gpt4 book ai didi

javascript - 0x800a138f - JavaScript 运行时错误 : The value of the property '$' is null or undefined, 不是函数对象

转载 作者:搜寻专家 更新时间:2023-10-31 08:31:32 24 4
gpt4 key购买 nike

当我启动我的项目并加载我的页面时,出现以下错误:

0x800a138f - JavaScript runtime error: The value of the property '$' is null or undefined, not a Function object.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPage.aspx.cs" Inherits="WebsiteTest.TestPage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Web Service Test</title>
<script src="http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#tbDetails').hide();
$('#btnClick').click(function () {
alert('test');
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" id="btnClick" value="Get Data" />
<table id="tbDetails">
<thead style="background-color: #DC5807; color: White; font-weight: bold">
<tr style="border: solid 1px #000000">
<td>Description</td>
<td>Comments</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
</form>
</body>
</html>

我假设,这与 JQuery 没有被包含有关,尽管它应该被包含。

知道问题出在哪里吗?

谢谢。

更新:

使用时有效

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

将继续研究它为什么不能与 MS 一起使用!它肯定在那里,因为我可以下载它!

更新

我解决了两个问题:

  1. 我在本地主机上使用 https,我应该使用 jquery 的 https。更改它消除了我原来的错误,但它给了我一些我仍在研究的其他错误。

  2. 我的代码运行良好(自从我打开此线程以来运行得更好),因为现在我还在调用 REST 网络服务并处理返回的数据,没有出现任何错误,但这仅适用于 Chrome 和 Firefox! IE11到底是怎么回事

最佳答案

从 src 中删除协议(protocol),然后浏览器将使用您的页面使用的任何内容。这是一个例子

<script src="//ajax.microsoft.com/ajax/jQuery/jquery-2.1.1.js" type="text/javascript"></script>

关于javascript - 0x800a138f - JavaScript 运行时错误 : The value of the property '$' is null or undefined, 不是函数对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23785705/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com