views:

372

answers:

2

Hi, 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

A: 

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

Pratt
+1  A: 

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") %>
SLaks