下面是我的.aspx页面的内容,"jquery-ui-1.7.1.custom.min.js"与.aspx文件位于同一位置.当我通过调试运行网站时,我得到以下错误.我知道我在这里非常遗憾.任何线索?
错误: -
Microsoft JScript runtime error: Object expected
Run Code Online (Sandbox Code Playgroud)
当我没有调试运行时,我收到以下javascript错误: -
Line: 10
Error: 'jQuery' is undefined
Run Code Online (Sandbox Code Playgroud)
ASPX页面内容: -
<%@ 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>
Run Code Online (Sandbox Code Playgroud)
fre*_*rik 12
jQuery UI没有包含基础jQuery.您需要在UI-js之前导入它.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
..fredrik