开发者

JavaScript Error line 1 <ANYJAVASCRIPFILE.JS> SyntaxError: Parse error IN Iphone mobile safari

开发者 https://www.devze.com 2022-12-24 02:20 出处:网络
I keep getting this error when I run my web app 开发者_运维知识库(asp.net mvc) in the mobile safari (ITouch)

I keep getting this error when I run my web app 开发者_运维知识库(asp.net mvc) in the mobile safari (ITouch)

JavaScript Error line 1 SyntaxError: Parse error

JavaScript Error line 1 SyntaxError: Parse error

I have no problem running this in any other browser (including safari). I suspect this is something to do with mobile safari handling javascript files. I am using MicrosoftMvcAjax.js and Jquery.

The above error is totally useless to me and I couldn't figure out where to debug or start. Any help would be appreciated.

Thanks


The URL is resolved by the client, which doesn't know about the application.

To get a relative path for the client, you can write

<%= ResolveClientUrl("~/Scripts/MicrosoftAjax.js") %>


Turns out the src attribute for the Javascript is the problem. For some reason is taking me to the domain root instead of the application root. So instead of looking for http://localhost/application/scripts , the page is looking under http://scripts...Don't know why? The Parser error is simply file not found error. Thanks everyone

0

精彩评论

暂无评论...
验证码 换一张
取 消