473,383 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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

Expand|Select|Wrap|Line Numbers
  1.     initialize: function(ctrl) {
  2.     if(ctrl) {
  3.         this.content = ctrl.rel;
  4.         Event.observe(ctrl, 'click', this.activate.bindAsEventListener(this), false);
  5.         ctrl.onclick = function(){return false;};
  6.     }
  7. },
  8.  
  9.     initCallable: function(rel) {
  10.     this.content = rel;
  11. },
  12.     displayLightbox: function(display){
  13.         $('overlay').style.display = display;
  14.         $(this.content).style.display = display;
  15.         if(display != 'none') this.actions();        
  16.     },
IE is reporting the error on the following line
Expand|Select|Wrap|Line Numbers
  1.     $(this.content).style.display = display;
(line 14 in the above code.)

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

Expand|Select|Wrap|Line Numbers
  1.  lb = new lightbox();
  2. lb.initCallable('lightbox4');
  3. lb.activate(); 
Any Suggestions. I thank you all in advance.

Dan
Feb 17 '08 #1
4 2297
acoder
16,027 Expert Mod 8TB
Does the lightbox have an id of "lightbox4"?
Feb 18 '08 #2
Yes the lightbox has an id of "lightbox4" and a class of "leightbox"

Dan
Feb 18 '08 #3
acoder
16,027 Expert Mod 8TB
Do you have a test page link? Have you checked that it isn't something else conflicting with the script?
Feb 18 '08 #4
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
Feb 28 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: André Somers | last post by:
Hi, I'm having a problem that I have a hard time understanding. I am getting a "Fatal error: Call to a member function on a non-object" on a constructor of a class, that looks like this...
1
by: Lam | last post by:
the internet explorer always give me some error " Object Required : Request Code . 0" " on some ASP pages I try so look it up on the code, but I couldn't find anything wrong FireFox and ...
5
by: fred | last post by:
I don't know if I'm doing this correctly. I have a little programming experience in python, c++ and some others but this is my first time with javascript. I'm trying have my website detect the...
1
by: lkrubner | last post by:
Look at this page: http://www.lauradenyes.com/test3.html It contains this function: <script type="text/javascript"> function changeBackgroundImageZ (imageToChangeTo) {
4
by: dubing | last post by:
Hi, Our webpage uses the following JavaScript code. function toggleSubmenu(divId, link) { var div = document.getElementById(divId); div.style.display = (div.style.display == 'block') ?...
7
by: Shanimal | last post by:
Hello- I'm running a php front end app on mysql. When viewing the page with Firefox, no error. When viewing with IE6, always get the following error: Line: 210 Char: 3 Error: Object...
5
by: DaFallus | last post by:
I'm trying to write a somewhat simple page with dependent drop-down boxes. Unfortunately the entire page is written through PL/SQL so that makes it even more difficult for me to trouble shoot. I...
3
by: Brian A | last post by:
I have written some Javascript that works perfectly in Firefox - no errors reported. The dreaded MSIE 6 produces nothing but a long line of 'undefinedundefinedundefinedundefinedundefined ....'...
53
by: Aaron Gray | last post by:
Due to M$'s stupidity in not making DOMElements first class citizens the following will not work :- function isElement( o) { return o instanceof Element } It works for FF, Opera and Safari.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.