本文介绍了当我在新的aspx页面中使用没有主页的Jquery复制我的aspx代码时,jquery停止工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 当我在新的aspx页面中使用没有Masterpage的Jquery复制我的aspx代码时jquery停止工作 虽然我已经清楚地添加了我的jquery文件和ajax的引用link < asp:内容 ID = Content1 ContentPlaceHolderID = head Runat = 服务器 > < link rel = 样式表 type = text / css href = Css / Master.css / > < script src = http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js type = text / j avascript > < / script > < 脚本 src = JS / jquery-1.6.2.min.js type = text / javascript > < / script > < script language = javascript 类型 = text / javascript > 当用户点击链接时,' 'onclick事件被触发了它的 - ID被传递给函数Reset(tabId) 我调试了它控件移动正常 以下tabId包含onclicked链接ID然后根据它适当的链接变得可见 虽然在没有MAsterpage的早期页面它工作正常 $(tabId).show(); 函数重置(tabId){ //调试器; $(#Dynamic_1)。hide(); $(#Dynamic_2)。hide(); $(#Dynamic_3)。hide(); $(#Dynamic_4)。hide(); $(#Dynamic_5)。hide(); $(#Dynamic_6)。hide(); tabId =#+ tabId; $(tabId).show(); $(tabId).css(background-color,#fafafa); $(tabId).css(font-weight,Bold); } $(凭证).ready(function(){重置(Dynamic_1); }); < / script > < / asp:Content > 解决方案 (tabId).show(); 功能重置(tabId){ //调试器; ( #Dynamic_1)隐藏(); ( #Dynamic_2)隐藏(); when i copied my aspx code with Jquery having no Masterpage in a new aspx page jquery stopped workingthough i have clearly add reference of my jquery file and ajax link<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <link rel="Stylesheet" type="text/css" href="Css/Master.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js" type="text/javascript"></script> <script src="JS/jquery-1.6.2.min.js" type="text/javascript"></script> <script language="javascript" type="text/javascript">when a User clicks on a link it''s onclick event fired and its --"ID" is passed to the function Reset(tabId)I have debugged it control moves properly below tabId contains onclicked link ID then according to it appropriate link became visible though in earlier page without MAsterpage it is working fine $(tabId).show();function Reset(tabId) { //debugger; $("#Dynamic_1").hide(); $("#Dynamic_2").hide(); $("#Dynamic_3").hide(); $("#Dynamic_4").hide(); $("#Dynamic_5").hide(); $("#Dynamic_6").hide(); tabId = "#" + tabId; $(tabId).show(); $(tabId).css("background-color", "#fafafa"); $(tabId).css("font-weight", "Bold"); } $(document).ready(function() { Reset("Dynamic_1"); }); </script></asp:Content> 解决方案 (tabId).show();function Reset(tabId) { //debugger;("#Dynamic_1").hide();("#Dynamic_2").hide(); 这篇关于当我在新的aspx页面中使用没有主页的Jquery复制我的aspx代码时,jquery停止工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-31 20:30