0x800a138f - JavaScript运行时错误:属性'$'的值为null或undefined,而不是Function对象 [英] 0x800a138f - JavaScript runtime error: The value of the property '$' is null or undefined, not a Function object

查看:721
本文介绍了0x800a138f - JavaScript运行时错误:属性'$'的值为null或undefined,而不是Function对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When I start my project and it loads up my page, I get the following error:


0x800a138f - JavaScript运行时错误:属性'$'的值为null或未定义,而不是Function对象。

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有关,即使它应该被包含在内。

I'm assuming, it's got something to do with JQuery not being included even though it should be.

知道问题可能是什么?

谢谢。

更新:

使用时工作

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

将继续研究它为何不能与MS合作!它绝对存在,因为我可以下载它!

Will keep researching it as to why it won't work with the MS one! It is definitely there as I can download it!

更新

我想出2个问题:


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

  1. I was using https on my localhost and I should have used the https of jquery. Changing this got rid of my original error but it gave me some other error that I'm still researching.

我的代码完美无缺(自从我以后更多)我打开这个线程)就像现在我也在调用一个REST Web服务并操纵返回的数据而没有一个错误,但这只适用于Chrome和Firefox!到底是怎么回事IE11

My code works perfectly (and more since I've open this thread) as now I'm also calling a REST web service and manipulating the data returned without a single error but this only works in Chrome and Firefox! What the hell is up with IE11


推荐答案

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

Drop the protocol from the src and the browser will then use whatever your page uses. Here is an example

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

这篇关于0x800a138f - JavaScript运行时错误:属性'$'的值为null或undefined,而不是Function对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆