Avatar of Ruby_Mauve
Ruby_Mauve

asked on 

Javascript not working in IE7

I am using a Moodalbox that fires <onload>

It works perfectly in Safari and Firefox as well as IE6 but not IE7.  Here is the code that I am using:



I don't know much about java script...



<script type="text/javascript">
function go(){
	MOOdalBox.open("pop-up.html", "", "325 200");
}
</script>
 
<body  leftmargin="0" topmargin="0" onload="MM_preloadImages('images/nav-about-o.jpg','images/nav-players-o.jpg','images/nav-members-o.jpg','images/nav-contact-o.jpg','images/nav-professionals-o.jpg');go();" >

Open in new window

Web BrowsersAJAXJavaScript

Avatar of undefined
Last Comment
Computer101
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

I see TWO divs with ID="mb_overlay"

That would not work in IE (it would create a collection):
javascript:alert(document.all('mb_overlay').length)
<DIV id=mb_overlay style="FILTER: alpha(opacity=0); VISIBILITY: hidden; opacity: 0" _element_extended_="true" opacity="0"></DIV>
<DIV id=mb_center style="DISPLAY: none; MARGIN-LEFT: -125px; WIDTH: 250px; HEIGHT: 250px" _element_extended_="true">
<DIV id=mb_contents _element_extended_="true"></DIV></DIV>
<DIV id=mb_bottom style="DISPLAY: none" _element_extended_="true"><A id=mb_close_link href="#" _element_extended_="true"></A>
<DIV id=mb_caption _element_extended_="true"></DIV>
<DIV style="CLEAR: both" _element_extended_="true"></DIV></DIV>
 
<DIV id=mb_overlay style="FILTER: alpha(opacity=0); VISIBILITY: hidden; opacity: 0" _element_extended_="true" opacity="0"></DIV>
<DIV id=mb_center style="DISPLAY: none; MARGIN-LEFT: -125px; WIDTH: 250px; HEIGHT: 250px" _element_extended_="true">
<DIV id=mb_contents _element_extended_="true"></DIV></DIV>
<DIV id=mb_bottom style="DISPLAY: none" _element_extended_="true"><A id=mb_close_link href="#" _element_extended_="true"></A>
<DIV id=mb_caption _element_extended_="true"></DIV>
<DIV style="CLEAR: both" _element_extended_="true"></DIV></DIV>

Open in new window

Avatar of Ruby_Mauve
Ruby_Mauve

ASKER

Thank you so much for your response.  I can't figure out were in my code I'm calling up two of these divs.  Could you help me figure that out as well?
It is not your code as far as I can tell it is the moodalbox.

Such are the issues with these bloated seemingly easy to use tools.

I do not like to use them for the same reason. When something fails it is near impossible to fix without delwing deep into the often opaque code.

Perhaps you can ask the developer of the tool? I am sure there is a bug reporting page somewhere
Avatar of Ruby_Mauve
Ruby_Mauve

ASKER

mplungjan,

Thanks for your help. I went to the mootools forum and found that I can use a
window.addEvent('domready', go)

Seems like it is working. Why?  I don't know:)


It makes sure all document objects have loaded.
So the result of my investigation seems to not have been the cause of the problem

Feel free to accept your on solution and close the question
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo