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

Sunday, May 24, 2009

FireFox Javascript document.all

In javascript to get the page's control id in user control used in that page, we used "document.all". But in firefox browser it is not supported. Instead of "document.all" use "document.getElementsByTagName("body")[0].getElementsByTagName("*")"

Example:
var objState = document.all.state; //for IE and other browsers

var objState = document.getElementsByTagName("body")[0].getElementsByTagName("*").state; // For all browsers including firefox

Here state is the control used in the page.