JS not executing
JS not executing
我有这个代码:
if ($has_freechat1 && $has_freechat2)
{
if (($has_freechat1['confirmed'] == 1) && ($has_freechat2['confirmed'] == 1))
{
$was_clicked = 0;
?>
<a href="freechatcontacts.php?id=<?php echo $id_to.$was_clicked; ?>" class="charcoal_link" style="line-height: 20px;" name="message" id="message" onClick="return send('<?php echo $was_clicked;?> return false;')">
<?php echo $uniqueCode1?><span class="pink_text"><?php echo $uniqueCode2?></span><?php echo $uniqueCode3?>
</a>
<?php
if ($was_clicked == 1)
{
?>
<tr>
<td><input name="password" type="textarea" rows="10" cols="20" value="<?php echo $aCleanPost['message']['value']?>" /></td>
</tr>
<tr>
<td><br /><input name="cmdSubmit" type="submit" value="Send" /><br/> </td>
</tr>
<?php
}
}
上面显示了一个uniquecode链接,当我点击它时,我希望显示一个html文本区域,这样用户就可以输入短消息。。onlcicksend()是一个JS函数,但它不执行它,所以我可以将$was_clicked设置为1
我怎样才能解决这个问题?请帮忙谢谢
编辑来自注释的sendMessage
函数:
<script type="text/JavaScript">
function send(val)
{
val = 1; //was clicked
return val;
}
</script>
您的代码语法似乎是错误的。
onClick="return send('<?php echo $was_clicked;?> return false;')">
尝试
onClick="javascript:send('<?php echo $was_clicked;?>'); return false;">
相关文章:
- jQuery is not loaded
- AngularJS JSON not arriving php
- $rootScope not working
- reactRedux is not defined
- jquery ajax success functions not executing
- rails jquery ajax request not executing
- Javascript not executing google chrome extensioin
- SoundCloud JS SDK get handler not executing
- Office 365 on iPad - SP.SOD.executeFunc not executing functi
- Webview javascript not executing
- Rails 3.2.2 not executing rjs
- setTimeout not executing
- jQuery .post() not executing
- DataTables Ajax not executing
- Cordova / Phonegap -- jquery not executing Javascript on <
- Angularjs $timeout not executing
- Delphi, EmbeddedWB/TWebbrowser - jQuery not executing
- JS not executing
- Jquery else not executing
- e.preventDefault not executing