Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用jquery插入“回车键”_Javascript_Jquery - Fatal编程技术网

Javascript 使用jquery插入“回车键”

Javascript 使用jquery插入“回车键”,javascript,jquery,Javascript,Jquery,我有一个报价功能,当用户点击该文本的“报价”时,例如:这是我的文本,在我的文本区域将显示>这是我的文本。用户可以在文本下方添加文本。当前,在我引用后,然后单击textarea,我的光标位于新行,但当我添加textarea时,我的quote text和text enter位于一行 这是我的HTML <span style='float:left' id="topmod"></span><br/> <textarea class="text ui-widge

我有一个报价功能,当用户点击该文本的“报价”时,例如:这是我的文本,在我的文本区域将显示>这是我的文本。用户可以在文本下方添加文本。当前,在我引用后,然后单击textarea,我的光标位于新行,但当我添加textarea时,我的quote text和text enter位于一行

这是我的HTML

<span style='float:left' id="topmod"></span><br/>
<textarea class="text ui-widget-content ui-corner-all" name='modrepmsg' id='modrepmsg' cols='100' rows='8' tabindex='1004'></textarea><br/>
<br/>
<span id="modquote" style="float:left;text-decoration:underline;">QUOTE</span>
<input type="hidden" name="repmsg" id="repmsg" />
<span id="modadd" class="button_form" style="cursor:pointer;"><?php echo $lang['REQUEST_ADD_B']; ?></span>
这里是保存的jquery

    $( '#modadd')
  .click(function() {
    var repmsg = $('#modrepmsg').val();

    window.location = 'reply_msg.php?msg=' + repmsg;
});
在我的回复_mg.php中,我请求msg$msg=$_请求['msg']

请帮帮我。谢谢。

请将此托盘:

$('#textbox').keypress(function (e) {
   if (e.keyCode == 13) { // get Enter key
      // your code here
   }
});

你有吗?@emiligort没有,因为我对编程很陌生。在这种情况下,请尝试以下方法:$'body'。在'keypress','textbox',函数{/*code here*/};
$('#textbox').keypress(function (e) {
   if (e.keyCode == 13) { // get Enter key
      // your code here
   }
});