iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old November 20th, 2008, 12:14 AM   #1
New Member
 

Join Date: Oct 2008
Location: Canberra Australia
Age: 28
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Hootinanny is on a distinguished road
Javascript issues with Firefox vs. IE6

Can anyone tell me why my javascript needs to be before the doctype to work in Firefox, but then needs to be after the doctype for IE6 or it breaks the page layout.


If anyone has a way of fixing this issue, I would really appreciate it as I am starting to tear out my hair!
Hootinanny is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 21st, 2008, 08:17 PM   #2
Most Reputable Member
 

Join Date: Feb 2008
Location: In My Own Little World
Age: 15
Posts: 1,346
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Rep Altering Power: 0 CloudedVision is on a distinguished road
Re: Javascript issues with Firefox vs. IE6

Huh? You shouldn't have javascript before the doctype.... the soonest should use javascript is in the head.
__________________
Theron Luhn
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 22nd, 2008, 07:10 AM   #3
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: Javascript issues with Firefox vs. IE6

CV is right - post your code if you're still having troubles.
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 3rd, 2008, 12:21 AM   #4
New Member
 

Join Date: Oct 2008
Location: Canberra Australia
Age: 28
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Hootinanny is on a distinguished road
Re: Javascript issues with Firefox vs. IE6

I don't want to put the code before the doctype, but it is the only place where the javascript will work in Firefox. I think the problem may be that there is already vbscript on the page - for a different issue.

Unfortunately I can't easily post the script due to privacy issues.
This is the javascript:
<script type="text/javascript">

var OpenDiv;
var OpenImg;

function Close(div, img)
{
if (div != null) div.style.display = "none";
if (img != null) img.src = "/_lib/images/bg_arrowRed.gif";
}

function Open(div, img)
{
if (OpenDiv == div)
{
// user has clicked on an already open div, so close it
Close(div, img);
OpenDiv = null;
OpenImg = null;

}
else
{
// user wants to open a div
div.style.display = "block";
img.src = "/_lib/images/bg_arrowRed_down.gif";
// close the open div
Close(OpenDiv, OpenImg);
// update the open vars
OpenDiv = div;
OpenImg = img;
}
}

</script>

Any ideas??
Hootinanny is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 3rd, 2008, 10:18 AM   #5
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: Javascript issues with Firefox vs. IE6

If you're using VBScript, then no, it won't work with FF.

VBScript is Microsoft-only (i.e. Internet Explorer) - the same goes for ActiveX.
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
firefox , ie6 , javascript , layout


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Background attachment issues w/Firefox linchpin311 HTML, XHTML and CSS 6 June 20th, 2008 09:17 AM
CSS Layout Issues (IE vs Firefox) Keith HTML, XHTML and CSS 5 February 11th, 2008 07:22 PM
Firefox Display Issues marytery Your Design and Layout 6 October 5th, 2007 05:24 PM
IE issues with my layout, works fine in Firefox :[ st3ady HTML, XHTML and CSS 6 August 18th, 2006 06:18 PM
FireFox Issues csa HTML, XHTML and CSS 3 August 8th, 2006 10:28 AM


Search Engine Optimization by vBSEO 3.2.0 RC8