jQuery无法使用母版页的内容 [英] jQuery is not working with content of master page
本文介绍了jQuery无法使用母版页的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好..
我有母版页和内容页...
我想使用jQuery进行验证...但是它不起作用...
这是我在内容页面中的代码...
hello..
i have master page and content page...
i want to do validation using jQuery...but its not working...
here is my code in content page...
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
$(document).ready(function ()
{
alert("hiiii");
$("#txtemailID").blur(function ()
{
alert("hi");
var EmailText = $("#txtemailID").val();
if ($.trim(EmailText).length == 0)
{
document.getElementById('LblEmail').innerHTML='please enter email !';
return false;
}
if (validateEmail(EmailText))
{
document.getElementById('LblEmail').innerHTML='valid Email address !';
return true;
}
else
{
document.getElementById('LblEmail').innerHTML='invalid Email address !';
return false;
}
});
});
function validateEmail(sEmail)
{
var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (filter.test(sEmail))
{
return true;
}
else
{
return false;
}
}
</script>
</asp:Content>
推荐答案
(document).ready(function() { alert(" );
(document).ready(function () { alert("hiiii");
(" ).blur(function() { alert(" ); var EmailText =
("#txtemailID").blur(function () { alert("hi"); var EmailText =
(" ).val(); 如果(
("#txtemailID").val(); if (
这篇关于jQuery无法使用母版页的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文