Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Sunday, April 22, 2007

Debugging Javascript in Visual Studio

Last week our server crashed, and had us roaming the internet with no purpose for a couple of days. Maybe one day I will write about that a separate post. The outcome of this is that all Internet Explorer definitions were reset when i connected to the new server and domain.


Since then, i was unable to debug javascript in visual studio. It took me a while to verify that I'm trying to debug the correct script and that the calling procedure is working fine.

I made sure that IIS was configured to debug asp pages, as you can see in the following pictures.
Inside the IIS console open the web site properties.


On the "Virtual directory" tab click on "Configuration".

In the configuration dialog select the Debugging tab and check the two debugging flags.

The last thing to check was Internet Explorer Options. In order to debug Javascript inside Visual Studio one must uncheck the (default) options that disable javascript debugging both on Internet Explorer and on other browsers. this is the checkbox to uncheck:


Well, Now you can just break an any Javascript line, see all values inside the Visual Studio enviroment, and generally have fun while debugging your site :)
benny is freely debugging javascript...


Thursday, April 12, 2007

Flash object fails to call Javascript function

The most popular way to show video in web pages today is to play the video files inside flash players that are embedded inside the html page. Like everyone else we did it too and it works just fine.

A new feature that we added to our site is the ability to embed our flash player into any blog or site page, and for this purpose we also added a feature that sends information from the flash player to our server each time someone plays one of our videos somewhere out there. That way we can count how many views our videos get even outside the site.


When we added this view-counter feature we could not get it to work. The flash player did not reach the server page even though we wrote the calling code properly.


After looking at some professional blogs and sites we found out the problem: we use the name "5minPlayer" as our player tag name, and the Object tag that holds the flash player should not begin with a number...


There are other limitations to this object tag, and also many things you should know if you are going to use flash on your page, especially if you are implementing extensive interaction between flash and the html page. A great page on this issue can be found here.