Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Wednesday, January 14, 2009

Debugging Javascript

If you have Visual Studio 2008 you can debug javascript just like you debug C sharp cod.Just put a break point and run your project using the F5 key. But what if you don't have ??
All you have to do is add the debugger keyword on your javascript code where you want to debug.
When the code is executed IE will ask you if you want to debug and list the programs you have to debug the code. This technique also works with firefox+firebug.
To turn on javascript debuggin in IE you have to go in Tools->Internet Options and on the advanced tab uncheck the "Disable script debugging".
Be aware that this can cause the browser to show you errors in all sites ( and believe me there are a lot out there).

Monday, October 13, 2008

My fisrt experience with jQuery

I had to do a drag and drop interface for a web application , so I decided to give JQuery a try, since Microsoft is gong to distribute it with Visual Studio and I had a disapointment. There is a simple bug in the draggables function in IE ( works fine in Firefox) that if you have to scroll the page to see your draggable div , the clone div will not appear on the right place. You can see a proof here ..(scrool down the page too see three draggable divs ). Its a very simple code and it should just work...
I ended up using mootols . Using ExtJs was not an option because of the size of the library for something so simple.

kick it on DotNetKicks.com

Thursday, June 21, 2007

Unknown runtime error

This message is one of the worst error messages that a browser(IE) can give you.

There are a lot of theories to try to understand why this error happens.The truth is not even Microsoft knows why it happens (just look at the error message).

The only thing certain about this error is that it happens when you are manipulating the html of a div with javascript using the innerHTML method.

The workaround for this error is create another div, put the html inside it and append it to the original div.Here is some code:



originalDiv= document.getElementById('myDiv');

var t = document.createElement('div');

t.innerHTML =html;

originalDiv.appendChild(t);



I think the only message worse than this is "Catastrophic failure".. and you

what's the worst error message that you saw?





Powered by ScribeFire.