当用户控件添加到页面中时,jquery无法正常工作 [英] jquery in page doesnt work when user control added in it
本文介绍了当用户控件添加到页面中时,jquery无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在页面和用户控件中使用了jquery.但是当我在页面中添加用户控件时,在没有用户控件的情况下运行良好的页面jQuery变得无响应,用户控件的jQuery可以正常工作.
我认为它可能是refernece src地址错误.
需要帮助
以下是代码:
Hi ,
I have used jquery in page and in user control. but when i add user control in page the jquery of page which was running fine without user control become unresponsive ,the jquery of user control works.
I thinks its might be refernece src address error.
need help
Following is the code :
<asp:Content ID="Content1" ContentPlaceHolderID="pagehead" Runat="Server">
<title runat ="server" id="pgTitle" />
<meta name="keywords" id="pgKeyword" runat ="server" content="" />
<meta name="description" content="" id="pgDescription" runat="server" />
<script src="<%= ResolveClientUrl("~/scripts/jquery-1.6.2.min.js") %>" type="text/javascript"></script><pre lang="Javascript">
<script src="<%= ResolveClientUrl("~/scripts/jquery-ui-1.8.17.custom.min.js") %>" type="text/javascript"></script>
<link href="<%= ResolveClientUrl("~/styles/jquery-ui-1.8.17.custom.css") %>" rel="stylesheet" type="text/css" />
<script src="../../scripts/jquery.jqzoom-core-pack.js" type="text/javascript"></script>
<link rel="stylesheet" href="../../styles/jquery.jqzoom.css" type="text/css"/>
<script type="text/javascript">
$(document).ready(function () {
$(''.jqzoom'').jqzoom({
zoomType: ''standard'',
lens: true,
preloadImages: false,
alwaysOn: false,
zoomWidth: 200,
zoomHeight: 200,
xOffset: 90,
yOffset: 30,
position: ''right''
});
//$(''.jqzoom'').jqzoom();
$(''#tabs'').tabs();
// Dialog
$(''#ReplyDialog'').dialog({
autoOpen: false,
modal: true,
show: "slide",
width: 600,
buttons: {
"Send Mail": function () {
var dataToSend = { MethodName: ''SendReply'', Reply: document.getElementById(''<%= txtReply.ClientID %>'').value };
//var id = $.readQS(''productId'');
var options =
{
url: ''<%=ResolveUrl(string.Format("~/classifieds/details/electricDetails.aspx?productId={0}", Request.QueryString["productId"])) %>'',
data: dataToSend,
dataType: ''JSON'',
type: ''POST'',
success: function () { $(this).dialog("close"); }
};
$.ajax(options);
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
// Dialog Link
$(''#ReplyDialog_link'').click(function () {
$(''#ReplyDialog'').dialog(''open'');
return false;
});
//hover states on the static widgets
$(''#ReplyDialog_link, ul#icons li'').hover(
function () { $(this).addClass(''ui-state-hover''); },
function () { $(this).removeClass(''ui-state-hover''); }
);
});
</script>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<script type ="text/javascript" language ="javascript"> !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } } (document, "script", "twitter-wjs");</script>
<script type="text/javascript">
(function () {
var po = document.createElement(''script''); po.type = ''text/javascript''; po.async = true;
po.src = ''https://apis.google.com/js/plusone.js'';
var s = document.getElementsByTagName(''script'')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<title >
</title>
以下是用户控制的代码:
following is the code of user control :
<script src="<%= ResolveClientUrl("~/scripts/jquery-1.6.2.min.js") %>" type="text/javascript"></script>
<script src="<%= ResolveClientUrl("~/scripts/jquery-ui-1.8.17.custom.min.js") %>" type="text/javascript"></script>
<link href="<%= ResolveClientUrl("~/styles/jquery-ui-1.8.17.custom.css") %>" rel="stylesheet" type="text/css" />
<script type ="text/javascript" >
$(document).ready(function () {
$('#categorydialog').dialog({
autoOpen: false,
modal: true,
width: 600,
show: "slide",
buttons: {
"Accepted": function () {
$(this).dialog("close");
}
}
});
$('#categorydialog_link').click(function () {
$('#categorydialog').dialog('open');
return false;
});
});
</script>
谢谢
Thanks
推荐答案
(document).ready(function(){
(document).ready(function () {
(''.jqzoom'').jqzoom( { zoomType:标准", 镜头:是的, preloadImages:否, alwaysOn:错误, zoomWidth:200, zoomHeight:200, xOffset:90, yOffset:30, 位置:正确" }); //
(''.jqzoom'').jqzoom({ zoomType: ''standard'', lens: true, preloadImages: false, alwaysOn: false, zoomWidth: 200, zoomHeight: 200, xOffset: 90, yOffset: 30, position: ''right'' }); //
(''.jqzoom'').jqzoom();
(''.jqzoom'').jqzoom();
这篇关于当用户控件添加到页面中时,jquery无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文