未捕获的语法错误:意外标记<;jQuery.load()
我被难住了。我有一个用服务器端Javascript编写的处理页面,它用我们系统中的一些数据构建了一个HTML表 我通过jQuery.load()函数调用页面。调用正常,返回数据,但发生了一些事情,抛出下面的错误副本。这还会停止在.load()之后进行的任何调用 你可以在这里看到这一页未捕获的语法错误:意外标记<;jQuery.load(),jquery,ajax,Jquery,Ajax,我被难住了。我有一个用服务器端Javascript编写的处理页面,它用我们系统中的一些数据构建了一个HTML表 我通过jQuery.load()函数调用页面。调用正常,返回数据,但发生了一些事情,抛出下面的错误副本。这还会停止在.load()之后进行的任何调用 你可以在这里看到这一页 http://pages.email.tofw.com/page.aspx?QS=38dfbe491fab00eadb06a33c6c7834943533ebb484a35c6efcab45c78cd9df38#
http://pages.email.tofw.com/page.aspx?QS=38dfbe491fab00eadb06a33c6c7834943533ebb484a35c6efcab45c78cd9df38#
I have tried .load(), .post(), .ajax()...
需要注意的是,我注意到,当我提醒响应时,我们的后端系统似乎在放置一些对其他js文件的引用。看下面,我觉得没问题
我还应该提到,
这在所有浏览器中都会发生
响应只是HTML(+那些js行)
格式很好
chrome在jQuery的第564行报告了这个错误,jQuery是一个名为noop的函数
任何直升机都很受欢迎,我不能再花一整天的时间独自去解决这个问题
提前谢谢
JS添加到我们系统的响应中
<script type="text/javascript" src="http://pages.email.tofw.com/Script/HttpRequest.js"> </script>
<script type="text/javascript" src="http://pages.email.tofw.com/Script/pageTracking.js"> </script>
<script type="text/javascript">
absoluteBaseUrl = "http://pages.email.tofw.com/";
SaveAnalyticData(7000926, 'd7ba6684-ae81-48dd-bac7-969595eb9846', '92401e11-8737-4d03-a458-be89ca0cbecf');
</script>
绝对BaseURL=”http://pages.email.tofw.com/";
保存分析数据(7000926,'d7ba6684-ae81-48dd-bac7-9695EB9846','92401e11-8737-4d03-a458-be89ca0cbecf');
Chrome报告的错误
Uncaught SyntaxError: Unexpected token < jquery-1.8.3.js:564
(anonymous function) jquery-1.8.3.js:564
jQuery.extend.globalEval jquery-1.8.3.js:565
jQuery.ajaxSetup.converters.text script jquery-1.8.3.js:8258
ajaxConvert jquery-1.8.3.js:8143
done jquery-1.8.3.js:7779
callback jquery-1.8.3.js:8518
send jquery-1.8.3.js:8524
jQuery.extend.ajax jquery-1.8.3.js:7986
(anonymous function) jquery-1.8.3.js:6007
jQuery.extend.each jquery-1.8.3.js:611
jQuery.fn.extend.domManip jquery-1.8.3.js:6004
jQuery.fn.extend.append jquery-1.8.3.js:5777
(anonymous function) jquery-1.8.3.js:5904
jQuery.extend.access jquery-1.8.3.js:814
jQuery.fn.extend.html jquery-1.8.3.js:5868
(anonymous function) jquery-1.8.3.js:7474
fire jquery-1.8.3.js:974
self.fireWith jquery-1.8.3.js:1084
done jquery-1.8.3.js:7803
callback
uncaughtsyntaxerror:意外标记
问题似乎就在这里
<script type="text/javascript"
src="http://pages.email.tofw.com/Script/pageTracking.js"
</script>
看起来您在第二个脚本标记中缺少了一个。
<script type="text/javascript"
src="http://pages.email.tofw.com/Script/pageTracking.js" > </script>
Missing this ---- ^
错过这个--^
谢谢您或您的意见,但我发现了问题所在。事实证明,其中一个引用的js文件抛出了一个错误,该错误显示了一个包含完整html文档的错误页面。因此,我的响应包含html标记,我想这会打乱jQuery
我是如何修复的:将我的预期结果包装在一个具有已知名称的div中,然后使用load函数传递该div,只给我该div的内容
工作非常完美。不确定这是否是您的确切代码,但您缺少了第二个脚本声明pageTracking.js
<script type="text/javascript"
src="http://pages.email.tofw.com/Script/pageTracking.js" > </script>
Missing this ---- ^