首页 \ 问答 \ IE9说语法错误,但不是在哪里?(IE9 says Syntax Error but not where?)

IE9说语法错误,但不是在哪里?(IE9 says Syntax Error but not where?)

所以,我有一个大型项目,其中包含大量的javascript内容。

现在我用IE9进行了一些测试,并且在一个事件触发了AJAX操作时它会中止并告诉我

Syntax Error: Expected ')'

但就是这样。 它让我不知道从哪里开始寻找。

我正在使用Dojo处理我所做的大部分事情,在这一点上,我正在使用AJAX请求检索JSON数据。 但是我已经排除了JSON字符串中的错误,因为JSON通常不包含括号() ,对吧?

在请求完成之后还有一个console.log(data) ,但它也不会触发。 在此之前我没有看到任何花哨的括号,这可能会让IE失去理智。 但我可能仍然在寻找错误的地方,只是想在这里提供尽可能多的信息。

(顺便说一下:Firefox对一切都很好。没有错误或警告;一切运行都很好)

调试此原因或可能原因的最佳方法是什么?


So, I have a large project with a bunch of javascript stuff going on.

Now I did some testing with IE9 and on one event triggered AJAX-operation it aborts and tells me

Syntax Error: Expected ')'

but that's all it says. It leaves me without any clue about where to start looking.

I'm using Dojo for most of the things I do and at this particular point I'm retrieving JSON-data with the AJAX-request. But I've ruled out an error in the JSON-string, simply because JSON ususally does not contain brackets (), right?

There also is a console.log(data) right after the request should be completed, but it doesn't fire either. And I don't see any fancy bracketwork before that, that could make IE lose it's mind. But I might still be looking at the wrong spot, just trying to give as much info as possible here.

(btw: Firefox is fine with everything. No errors or warnings; everything runs just fine)

What's the best way to debug this or possible causes?


原文:https://stackoverflow.com/questions/13458387
更新时间:2023-06-08 13:06

最满意答案

如果你使用的是postgres,你可以使用它来减少所有的查询

select *, count(*) OVER() AS full_count from daily_txns where created_date <='2017-08-01' and created_date>='2017-07-01' and mid='0446721M0008690' order by created_date desc limit 10;

“count(*)OVER()as full_count”将'忽略'通过的限制,给你全部的可能元素


If you are using postgres you can use this to reduce everything to one single query

select *, count(*) OVER() AS full_count from daily_txns where created_date <='2017-08-01' and created_date>='2017-07-01' and mid='0446721M0008690' order by created_date desc limit 10;

the "count(*) OVER() AS full_count" will 'ignore' the limits passed giving you the full count of possible elements

相关问答

更多
  • 解 为了让jQuery DataTables搜索子行,您需要将显示在子行中的数据作为隐藏列添加到主表中。 例如,您可以使用extn选项为extn数据属性添加隐藏列,如下所示: JavaScript的: "columns": [ { "class": 'details-control', "orderable": false, "data": null, ...
  • 鉴于上面的注释链,我的建议是在错误响应中放入一个唯一的字符串,如: code: 401 然后,使用全局$.ajaxError来捕获错误并根据响应文本执行不同的操作: $( document ).ajaxError(function( event, jqxhr, settings, thrownError ) { if (typeof settings === "string" && settings.indexOf('401') > -1) { //you can probably ...
  • 如果你使用的是postgres,你可以使用它来减少所有的查询 select *, count(*) OVER() AS full_count from daily_txns where created_date <='2017-08-01' and created_date>='2017-07-01' and mid='0446721M0008690' order by created_date desc limit 10; “count(*)OVER()as full_count”将'忽略'通过的限制, ...
  • 问题是html中的第一行,你不需要包含服务器处理php文件,ajax调用正在收集json对象以供数据表使用 The issue is the first line in the html, you dont need to include the server processing php file, the ajax call is gathering the json object for datatables to use
  • 更新自定义单元格( DOC ): https : //jsfiddle.net/hdadLhmo/2/ $('table').DataTable({ data: [ {a: 'A1', b: 'B1'}, {a: 'A2', b: 'B2'} ], columns: [ {data: 'a', title: 'A'}, {data: 'b', title: 'B'} ] }); var dt = $('table').DataTable(); console.lo ...
  • 那么在尝试了很多东西之后,我想出了答案。 获取数据表功能的解决方案是调用$("#table_report").DataTable(); 在它被添加到主文档之后。 function getReport() { var xmlhttp = new XMLHttpRequest(); var startdate = document.forms["cat-sales"]["start-date"].value; var enddate = document.forms["cat-sales ...
  • 好的,这里有一个更接近你的要求。 如果员工不到40岁,那么就在最后一栏中放置按钮。再次,代码获取行的数据,然后显示员工的姓名。 注意我是如何在columnDefs中使用render的。 http://jsbin.com/gobonec/edit?js,output $(document).ready(function () { var table = $('#example').DataTable({ "data": dataStore.data, "columns": ...
  • 我能想到的一个想法是通过portlet的Look and Feel隐藏标题“Web内容显示”,然后使用Structures & Templates创建Web内容。 在Template您可以指定要在Web内容顶部显示的title ,您可以使用一些css-magic将其定位到用于显示的portlet-title位置。 我想这应该不难。
  • 用PHP "; ?> 在HTML中 in PHP
  • 您无法在显示功能中访问变量searchURL,请尝试以下操作: function display(searchURL){ //console.log(data); $(document).ready(function() { $('#example').DataTable( { ajax: { url:buildSearchURL(document.getElementById('foodLabel').value), ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)