Microsoft JScript运行时错误:预期的对象 [英] Microsoft JScript runtime error: Object expected
本文介绍了Microsoft JScript运行时错误:预期的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default_aspx" %>
<!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">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jQuery/1.2.6/jQuery.min.js" language="javascript"> </script>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$("#<%=GridView1.ClientID%> tr").
filter(":odd").css("background-color", "grey");
});
</script>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
</html>
我收到错误Microsoft JScript运行时错误:对象预期
I get the error Microsoft JScript runtime error: Object expected
推荐答案
( document )。ready( function () {
(document).ready(function () {
( #< (%)= GridView1.ClientID%GT; tr)。
filter( :odd)。css( background-color, < span class =code-string> grey);
});
< / script >
< title > < / title >
< / head >
< span class =code-keyword>< body >
< 表格 id = form1 runat = server >
< div >
< asp:GridView ID = GridView1 runat = 服务器 >
< / asp:GridView >
< / div >
< / form >
< / body >
< / html >
("#<%=GridView1.ClientID%> tr"). filter(":odd").css("background-color", "grey"); }); </script> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:GridView ID="GridView1" runat="server"> </asp:GridView> </div> </form> </body> </html>
我收到错误Microsoft JScript运行时错误:预期的对象
I get the error Microsoft JScript runtime error: Object expected
替换以下行...
Replace the follwoing line...
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jQuery/1.2.6/jQuery.min.js" language="javascript"> </script>
with ...
with...
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" language="javascript"> </script>
Capital Q 正在创造这个问题。因此 URL
错了。
它应该是小 q 。
Capital Q was creating the problem. Hence the URL
was wrong.
It should be Small q.
这篇关于Microsoft JScript运行时错误:预期的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文