【发布时间】:2013-02-22 08:50:38
【问题描述】:
我有一个大型的 asp.net 2.0 应用程序。在当前页面中,我有一个
<head id="head1" runat="server"> 带有一些元信息,原始开发人员在<body> 标记中编写了所有 Javascript 函数。现在我想实现
$(document).ready(function load()
// My code
});
当我在我的 head/body 标签中包含 jquery-1.8.3.js 时,其他 javascript 函数无法正常工作。我能做些什么来解决这个问题?
<head id="Head1" runat="server">`
<script language="javascript" type="text/javascript" src="JScript/jquery-1.8.3.js"/>`
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<title>HMS</title>
<link href="Css/MyStyleSheet.css" rel="stylesheet" type="text/css" />
</head>
身体
<body>
<script language="javascript" type="text/javascript" src="JScript/MediReckonerJscript.js">
</script>
//some javascript functions here that are not firing since i added jquery reference in the head section. if that is removed this function works well.
我在正文中的脚本使用了 jQuery 库。
<script type="text/javascript" language="javascript">
//This is my script in the <body> tag.
jQuery.noConflict();
$(document).ready(function load() {
var iFrame = $('#PageFrame');
iFrame.bind('load', function() { //binds the event
alert('iFrame Reloaded');
});
});
</script>
【问题讨论】:
-
首先,您必须提供更多信息。你得到什么错误?我看到你在
load()之后忘记了{,但也许这只是一个错字。 -
您的页面中包含多少个 jquery 库?
-
而且您的页面是否包含 UpdatePanel 或 ajax 调用
-
我需要更多上下文来理解问题,哪些功能不起作用?那些原始代码使用不同的jQery版本,那些原始代码定义了自己的
$-function .... -
@codebrain 请参考之前的链接stackoverflow.com/questions/301473/…
标签: javascript jquery asp.net html