JQuery-Microsoft JScript运行时错误:预期对象 [英] JQuery - Microsoft JScript runtime error: Object expected
本文介绍了JQuery-Microsoft JScript运行时错误:预期对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面是我的.aspx页面的内容,"jquery-ui-1.7.1.custom.min.js"与.aspx文件位于同一位置.当我运行网站进行调试时,出现以下错误.我知道我在这里很想念东西.有任何线索吗?
Below is the content of my .aspx page and the "jquery-ui-1.7.1.custom.min.js" is in the same location as the .aspx file. When I run the website with debugging, I get the below error. I know I am terribly missing something here. Any clue?
错误:-
Microsoft JScript runtime error: Object expected
在不调试的情况下运行时,出现以下javascript错误:-
When I run without debugging, I get the following javascript error:-
Line: 10
Error: 'jQuery' is undefined
ASPX页面内容:-
ASPX page content:-
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<script>$(function () { alert('hello') });</script>
</div>
</form>
</body>
</html>
推荐答案
jQuery UI并不包含基本的jQuery.您需要在UI-js之前导入它.
jQuery UI doesn't inlucde base jQuery. You need to import that before the UI-js.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
.. fredrik
..fredrik
这篇关于JQuery-Microsoft JScript运行时错误:预期对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文