
[英]jquery lazy load and other Jquery / javascript functions don't work after append
[英]javascript functions doestnt work after using jquery
我正在使用此jquery对textarea进行拼写检查。 拼写检查工作正常,但在使用jquery进行拼写检查后,我的其他javascript函数却无法正常工作。 知道为什么吗?
<script type="text/javascript">
$Spelling.SpellCheckAsYouType('txt_comment1');
function showselected() {
var input1 = document.getElementById('txt_comment1');
var startPos = input1.selectionStart;
var endPos = input1.selectionEnd;
var doc = document.selection;
if (doc && doc.createRange().text.length != 0) {
alert(doc.createRange().text);
} else if (!doc && input1.value.substring(startPos, endPos).length != 0) {
document.getElementById('txt_addwords').value = input1.value.substring(startPos, endPos);
//alert(input1.value.substring(startPos, endPos))
}
}
</script>
<asp:Button
ID="cmd_submit_good"
runat="server"
Height="38px"
OnClientClick="showselected();"
onclick="cmd_submit_good_Click"
Text="Good Word"
Font-Bold="False"
Font-Names="Arial" Font-Size="X-Small"
Width="80px" />
http://forum.jquery.com/topic/calling-a-script-when-button-clicked ,我从此链接获得了答案。 jQuery转换了实际的文本框,这就是为什么在原始文本框上不执行javascript的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.