User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 423,546 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,929 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

JavaScript problem in FF

Join Date: Jul 2006
Location: Deptford, London
Posts: 954
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 48
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is online now Online
Posting Shark

Re: JavaScript problem in FF

  #4  
Jan 2nd, 2007
what happens if you try this code:

 function loadJSintoDIV(id, url, switchdiv) {
     obj = document.getElementById(id);
     if(obj.innerHTML == '' || !switchdiv) {
         oelem=document.createElement("script");
         oelem.src=url;
         oelem.type="text/javascript";
         oelem.defer=true;
         document.getElementsByTagName("head")[0].appendChild(oelem);
 
         obj.style.height = '';
         obj.style.visibility = 'visible';
     } else {
         obj.innerHTML = '';
         obj.style.height = '0px';
         obj.style.visibility = 'hidden';
     }
     alert('test');
 }

Notice the movement of the alert() line. This isn't an attempt to solve your problem, but let me know if it has the same effect as having the alert() line first, or if there is a difference
Last edited by MattEvans : Jan 2nd, 2007 at 5:11 am. Reason: ahhh having probs with codetags and pasted code
If it only works in Internet Explorer; it doesn't work.
Reply With Quote  
All times are GMT -4. The time now is 5:59 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC