Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stefu

Dynamic HTML not working in Mozilla?

This topic is 5523 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What''s wrong here that it doesn''t work in Mozilla Firebird but works in Explorer (pops up alert messagebox)?
<div id="pText" onmouseover="mover()">
Testing..
</div>
        
<script type="text/javascript">
<!--            

function mover()        
{
  alert(pText.innerText);
}
--> 
</script>
Mozilla javascript console output:
Error: pText is not defined
Source File: http://blablabla
Line: 43
 

Share this post


Link to post
Share on other sites
Advertisement
You can''t select things like that... You have to do this:

document.getElementById("id").property

IE si jsut stupid and does not comply with the standard for that whereas mozilla does. BTW, I''m not one of those Mozilla is the best browser ever morons.

Share this post


Link to post
Share on other sites
No Pipo, it didn''t help.

Puzzler is right. My book was favoring IE and didn''t tell anything about how to do it correctly.
Yes, Mozilla (Firebird) is best browser imho too.

Share this post


Link to post
Share on other sites
I thought the innerText thing was IE only, but I guess that was a while ago so things may have changed...

______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________

Share this post


Link to post
Share on other sites
Oh dear!

And changing cursor with CSS requires:

.mystyle {
cursor: pointer; // for Mozilla
cursor: hand; // for IE
}

Why can''t they both just use the same, or both?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
just use ms internet explorer for gods sake and throw mozilla netscape whatever out the window, and you wont have any problems...

im not saying that I love microsoft, but hell I dont need to complain about alot of stuff if i do it their way..

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
also dont u have to:

alert(document.pText.innerText);

at least this worked 4 years ago

Share this post


Link to post
Share on other sites
Try


document.getElementByID("pText").innerHTML


-HQ

[edited by - HQ-SOFT on August 9, 2003 1:30:46 PM]

Share this post


Link to post
Share on other sites
innerText isn''t supported by Mozilla. Do as HQ-SOFT suggested. But change the "D" in getElementByID to lowercase.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!