SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mac IE and javascript

    what is up with Mac IE 5.1???

    I run a layer popup menu on IE on windows and it runs just fine, but on my mac, it gives me object errors.
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be helpful if you tell us what the Error is.

    anyway do you have a script that can detect and identify object in DOM for Cross Browsers and Cross platform?

    Here is the code that will identify any object as long as the object you are trying to interact with has an ID value assigned.
    Code:
    var isDHTML=false;
    var isLayers=false;
    var isAll=false;
    var isID=false;
    
    
    if (document.getElementById){
    	isID = true; isDHTML = true;
    	}
    	else {
    		if (document.layers) {
    			isLayers = true;
    			isDHTML = true;
    		}
    		else {
    			if (document.all) {
    				isAll = true;
    				isDHTML = true;
    			}
    	}
    }
    
    function findDOMObj(ObjectID){
    	if (isID) { return (document.getElementById(ObjectID));}
    	else {
    		if (isAll){ return (document.all[objectId]);}
    		else {
    			if (isLayers) { return  (document.layers[ObjectID]);}
    		}
    	}
    }
    use findDOMObj(ObjectID) to find any object in the DOM, the ObjectID is ID that you want to interect with.
    Azizur Rahman
    Web Application Developer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •