我已经在母版页中编写了以下代码
<script type="text/javascript">
if (window.location.pathname.contains('Page1.aspx')) {
var js = document.createElement("script");
js.type = "text/javascript";
js.src = 'http://code.jquery.com/jquery-1.8.3.js';
}
if (window.location.pathname.contains('Page2.aspx')) {
var js = document.createElement("script");
js.type = "text/javascript";
js.src = 'http://code.jquery.com/jquery-1.9.1.js';
}
</script>
在asp.net应用程序中,我有三个页面page1、page2、page3,它们都继承了相同的主页。当我尝试访问page3时,它显示错误:"JavaScript运行时错误:对象不支持属性或方法'contains'"。