Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
"Object required" errors in IE, but not in Firefox
Old 03-02-2007, 07:05 PM "Object required" errors in IE, but not in Firefox
Spin's Avatar
Super Talker

Posts: 113
Trades: 0
I have this website at http://betterfonts.com/ and keep getting javascript errors in IE. I can't understand why, and what's stranger is that they only appear in IE.

Anyone have any suggestions? Thanks a lot...
Spin is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-02-2007, 07:09 PM Re: "Object required" errors in IE, but not in Firefox
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
IE is evil, and trying to destroy your site. But don't think it's just you - Internet Explorer hates everyone.

Can you post the script that's breaking, here, so we can look at it?
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 03-02-2007, 08:17 PM Re: "Object required" errors in IE, but not in Firefox
Spin's Avatar
Super Talker

Posts: 113
Trades: 0
I think this is the function that seem to confuse IE...:

62 function resizeit() {
63 var myWidth = 0, myHeight = 0;
64 if( typeof( window.innerWidth ) == 'number' ) {
65 //Non-IE
66 myHeight = window.innerHeight;
67 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
68 //IE 6+ in 'standards compliant mode'
69 myHeight = document.documentElement.clientHeight;
70 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
71 //IE 4 compatible
72 myHeight = document.body.clientHeight;
73 }
74document.getElementById('fontlist2').style.heigh t = myHeight-180+'px';
75document.getElementById('content').style.height = myHeight-170+'px';
76document.getElementById('preview').style.height = myHeight-270+'px';
77document.getElementById('overlay').style.height = myHeight+'px';
78}

Last edited by Spin; 03-02-2007 at 08:20 PM.. Reason: there seems to be a space between h and t on line 74, but it's not there neither in the original code or when i try to edit
Spin is offline
Reply With Quote
View Public Profile
 
Old 03-02-2007, 10:01 PM Re: "Object required" errors in IE, but not in Firefox
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I'm seeing the error in FF too actually I think the problem is line 76

document.getElementById('preview').style.height = myHeight-270+'px';

I think you call the id 'prev' in the html so they're not matching.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 03-03-2007, 09:48 AM Re: "Object required" errors in IE, but not in Firefox
Spin's Avatar
Super Talker

Posts: 113
Trades: 0
There's both a DIV with id 'preview' and IMG with id 'prev' (which is hidden at all times), so I don't think that would be the problem.. Thank you for the reply though.


<div id="preview" name="preview">
<div style="visibility: hidden"><img src="png3/acharmingfont.png" id="prev" name="prev" onload="document.getElementById('loader').style.vi sibility = 'hidden';document.getElementById('preview').style. backgroundImage = 'url('+this.src+')'" width="0" height="0" style="visibility: hidden"></div>
Spin is offline
Reply With Quote
View Public Profile
 
Old 03-03-2007, 11:31 AM Re: "Object required" errors in IE, but not in Firefox
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
As stupid as this sounds, I don't think the problem is in your Javascript itself.

If you code your images so that they all have an absolute path, it seems to get rid of the error. e.g. <img src=http://www.betterfonts.com/your image here...put the quotes in too, silly thing won't let me.)

I'm also not sure why you're calling the resizeit function so often. Why not just call it on body load and resize?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-04-2007, 11:13 AM Re: "Object required" errors in IE, but not in Firefox
Spin's Avatar
Super Talker

Posts: 113
Trades: 0
The problem was the resizeit calls. I removed some of them and everything seems to be fine. The reason for having them was that the page would fit the screen even when loading - i guess i can live without that.

Thanks guys
Spin is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 12:32 PM Re: "Object required" errors in IE, but not in Firefox
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Glad you got it all working Spin.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 03-04-2007, 12:48 PM Re: "Object required" errors in IE, but not in Firefox
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Likewise. Now don't let it happen again.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to "Object required" errors in IE, but not in Firefox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29783 seconds with 12 queries