Object Required Error in IE // No Bug Reported in FireFox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tcnjdeluca
    New Member
    • Feb 2008
    • 3

    Object Required Error in IE // No Bug Reported in FireFox

    Hello I am sorry if this is a really novice question, but I am virtually clueless when it comes to Javascript. I have a page that is running the "leightbox" script. I have modified the script as per a suggestion on Quaint Tech so the lightbox will appear on the page load (when required). The script works great in FireFox and Safari. Clicking on a link will pull up the lightbox as it should in IE. However when I click the link that is supposed to refresh the page and pull up the lightbox on the page load I am receiving a "Object Required" error in IE. Here is the relevant code

    Code:
    	initialize: function(ctrl) {
        if(ctrl) {
            this.content = ctrl.rel;
            Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false);
            ctrl.onclick = function(){return false;};
        }
    },
    		
    	initCallable: function(rel) {
        this.content = rel;
    },
    	displayLightbox: function(display){
    		$('overlay').style.display = display;
    		$(this.content).style.display = display;
    		if(display != 'none') this.actions();		
    	},
    IE is reporting the error on the following line
    Code:
    	$(this.content).style.display = display;
    (line 14 in the above code.)

    I am calling the the following function to pull up the lightbox onload

    Code:
     lb = new lightbox();
    lb.initCallable('lightbox4');
    lb.activate();
    Any Suggestions. I thank you all in advance.

    Dan
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Does the lightbox have an id of "lightbox4" ?

    Comment

    • tcnjdeluca
      New Member
      • Feb 2008
      • 3

      #3
      Yes the lightbox has an id of "lightbox4" and a class of "leightbox"

      Dan

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Do you have a test page link? Have you checked that it isn't something else conflicting with the script?

        Comment

        • tcnjdeluca
          New Member
          • Feb 2008
          • 3

          #5
          Sorry for the delay in response, I thank you for taking the time to look at this. The page that is not working correctly was deep in a database driven password protected site, so I had to mock up something that would work without all the passwords and garbage.

          Here is the page that is not working http://www.classchatter.com/editdemo.php The question I have is about the Links section in the lower left hand part of the page. When you pull up the Lightbox to add/edit links there is an option within the lightbox to edit an existing link. When that button is pressed in firefox or safari the page automatically reloads the page and pulls up the lightbox again with the link data repopulating the form. In IE the page reloads but the lightbox does not come up as IE reports an "Object Required" error.

          I have also put both the external .js files in a zipp file for anyone who would care to download them and take a look. Here is the link http://www.classchatter.com/scripts/lightbox.zip If anyone would prefer those sripts via another method please let me know, I am not sure of the protocol here. Thank you for your help. This is for a educational website, and I apparently don't have enough javascript knowledge to get this working

          Dan

          Comment

          Working...