0x800a139e-JavaScript运行时错误:SyntaxError [英] 0x800a139e - JavaScript runtime error: SyntaxError

查看:970
本文介绍了0x800a139e-JavaScript运行时错误:SyntaxError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Windows 8的Visual Studio Express 2012的新手.

I'm new to Visual Studio Express 2012 for Windows 8.

我已经能够使用一个简单的应用程序正常工作,但是它会抛出相同的异常".

I have been able to get a simple app to work just fine, but it would throw the same "exceptions".

因此,要进行测试,我刚刚启动了一个全新的空白JavaScript项目,只需将jQuery代码链接到default.html中,然后运行调试器,仍然会抛出以下异常:

So to test, I just started a brand new blank JavaScript project, and just linked the jQuery code in default.html, and ran the debugger, and the following exceptions are still thrown :

Exception was thrown at line 1217, column 4 in ms-appx://xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/Scripts/jquery-2.1.1.js
0x800a139e - JavaScript runtime error: SyntaxError
Exception was thrown at line 1235, column 4 in ms-appx://xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx/Scripts/jquery-2.1.1.js
0x800a139e - JavaScript runtime error: SyntaxError

如何编辑jQuery代码或需要执行什么操作才能消除抛出的异常?

jQuery代码的第一个异常被抛出的部分:

The part of the jQuery code where the first exception is being thrown :

assert(function (div) {
    // Support: Windows 8 Native Apps
    // The type and name attributes are restricted during .innerHTML assignment
    var input = doc.createElement("input");
    input.setAttribute("type", "hidden");
    div.appendChild(input).setAttribute("name", "D");

    // Support: IE8
    // Enforce case-sensitivity of name attribute
    if (div.querySelectorAll("[name=d]").length) {
        rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
    }

    // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
    // IE8 throws error here and will not see later tests
    if (!div.querySelectorAll(":enabled").length) {
        rbuggyQSA.push(":enabled", ":disabled");
    }

    // Opera 10-11 does not throw on post-comma invalid pseudos
    div.querySelectorAll("*,:x"); // *********** THIS IS LINE 1217 ***********
    rbuggyQSA.push(",.*:");
});

jQuery代码中抛出第二个异常的部分:

The part of the jQuery code where the second exception is being thrown :

if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
    docElem.webkitMatchesSelector ||
    docElem.mozMatchesSelector ||
    docElem.oMatchesSelector ||
    docElem.msMatchesSelector) )) ) {

    assert(function( div ) {
        // Check to see if it's possible to do matchesSelector
        // on a disconnected node (IE 9)
        support.disconnectedMatch = matches.call( div, "div" );

        // This should fail with an exception
        // Gecko does not error, returns false instead
        matches.call( div, "[s!='']:x" ); // ***** THIS IS LINE 1235 *****
        rbuggyMatches.push( "!=", pseudos );
    });
}

TooLongDon'tRead-我尝试过的事情:

TooLongDon'tRead - Things I've tried :

据我了解,应该抛出异常,但是微软不会批准抛出任何错误/异常的应用……我很困惑,对此没有明确的答案( (很容易找到)),因为每个人都可能在Visual Studio中使用jquery遇到问题.我什至尝试使用jquery2.02,人们说并没有抛出这些异常,但是对我来说仍然如此.我尝试自己编辑jquery代码,但这导致了很多其他错误.

From what I understand, it's suppose to throw the exception, however microsoft won't approve an app that is throwing any errors/exceptions... I'm quite confused that there isn't a clear cut answer to this (that is easily found), since it is likely an issue everyone has that uses jquery with visual studio. I even tried using jquery2.02 which people said didn't throw these exceptions , but it still did for me. I tried editing the jquery code myself, but that caused a whole lot of other errors.

我还在nuget中尝试了Windows 8的jquery(大约2年没有更新过)……我猜应该是要解决这个问题,但实际上给了我更多运行时错误.

I also tried the jquery for windows 8 in nuget (that hasn't been updated in like 2 years)... that I guess was suppose to resolve this stuff, but it actually gave me even more runtime errors.

推荐答案

在使用IE11时,我遇到了与jQuery类似的问题.事实证明,尽管JQuery 2.1.1声称与IE11兼容,但我发现在某些情况下它不是并返回错误.尝试使用最新的JQuery 1.X构建.它具有与2.1.1完全相同的功能,但仍具有对2.1.1中删除的IE 7、8和9的兼容性检查.

I encountered a similar issue with jQuery when using IE11. It turns out that even though JQuery 2.1.1 claims to be IE11 compatible, I found that in some situations it's not and returns errors. Try using the most recent JQuery 1.X build. it has the exact same functionality as 2.1.1, but still has the compatibility checks for IE 7, 8 and 9 that were removed in 2.1.1.

这篇关于0x800a139e-JavaScript运行时错误:SyntaxError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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