Posts Tagged ‘script httphandlers’

Debugging javascript in ie7

May 5th, 2011

This is a dispersed article about caveats I found when forced to debug javascript in IE7.

Out of date web browser.  Out of date script engine.  Limping solution.

To fire up the debugger, enter

debugger;

as javasctipt on a row exceuting before where you want to start debugging.  One could probably divide by zero or something that makes IE throw up a dialogue asking if you want to debug or not.  and then answer yes…

There doesn’t seem to be any good official debugger for IE7, unless you have Visual studio installed.  Search the web and there is a NT4-compatible Microsoft Script Debugger; it is not very good.  There is one or more solutions but this is the only I have tried.

If you get a dialogue/error message

Request format is invalid: application/json; charset=utf-8

when working with jquery and ajax on an iis / dotnet solution, it might be due to missing lines in web.config.  The code below is for Dotnet3.5.  I don’t know what it looks like in 2.0 or 4.0.

<system.web>

<httpHandlers>
<remove path=”*.asmx” verb=”*” />
<add path=”*.asmx” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ validate=”false” verb=”*” />
<add path=”*_AppService.axd” type=”System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ validate=”false” verb=”*” />
<add path=”ScriptResource.axd” type=”System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″ validate=”false” verb=”GET,HEAD” />
</httpHandlers>
</system.web>