473,847 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

3 New Member
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 2327
acoder
16,027 Recognized Expert Moderator MVP
Does the lightbox have an id of "lightbox4" ?
Feb 18 '08 #2
tcnjdeluca
3 New Member
Yes the lightbox has an id of "lightbox4" and a class of "leightbox"

Dan
Feb 18 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Do you have a test page link? Have you checked that it isn't something else conflicting with the script?
Feb 18 '08 #4
tcnjdeluca
3 New Member
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
28038
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 (simplified): class phpBB_Template { var $classname = "Template"; // Root template directory.
1
2009
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 Opera could display the pages without any the error Does any knows what's wrong?
5
3093
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 user's browser and assign a variable with different items if it's Internet Explorer. My code works with firefox, opera and others but not IE. <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled...
1
15991
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
15686
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') ? "none" : "block"; if (link.className == "")
7
4617
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 expected Code: 0
5
22124
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 know hardly anything when it comes to JavaScript, and I keep getting an error saying: "Error: Object required Line: 31 Char: 1 Code: 0"
3
2313
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 ....' Each 'undefined' represents a text node or element I have interted into the DOM. As far as I can see I have declared all variables and asigned values so I just can't see what is wrong. Unfortunately the error reporting in MSIE is very poor indeed....
53
4976
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.
0
9730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10707
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7056
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5719
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4119
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3164
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.