NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Javascript not working in IE

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-01-2008, 04:33 AM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Apr 2006
Posts: 254
Wuoshi is a jewel in the roughWuoshi is a jewel in the roughWuoshi is a jewel in the rough
 



Javascript not working in IE


Any reason to why the following code wont work when using IE?


<div id="fields3">Bla bla<input name='frakt' type='radio' class='rad' value='org' onclick="document.getElementById('levvy').innerHTM L = '<p>Bla bla</p> <br /> <p>Bla bla</p> <br /> <p>Bla bla</p>'" /></div>

<p class="checkout" id="levvy">Blabla</p>

It works in all other browsers. It also works in IE if I remove the html-tags. Any ideas or alternative solutions?
Wuoshi is offline  
Old 07-01-2008, 10:13 AM   #2 (permalink)
NamePros Member
Join Date: Sep 2006
Posts: 99
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
 



I would recommend making "levvy" a <div>, or some sort of other element to see if it works that way.
Putting a <p> inside of another <p> is probably too much for IE to handle.


Bruce
Bruce_KD is offline  
Old 07-01-2008, 12:13 PM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: Apr 2006
Posts: 254
Wuoshi is a jewel in the roughWuoshi is a jewel in the roughWuoshi is a jewel in the rough
 



You dah man!! I should've thought about that!

Repped, thank you!
Wuoshi is offline  
Old 07-02-2008, 11:17 AM   #4 (permalink)
New Member
Join Date: Jun 2008
Posts: 20
kceleb9 is an unknown quantity at this point
 



You can also try using outerHTML - though that can cause headaches in Firefox.

Honestly though - this form of DOM manipulation is fairly old school - you might want to try using something like jQuery - if you can take the slight overhead - it makes all of these things a snap - and handles the cross browser issues for you...
kceleb9 is offline  
Old 07-03-2008, 12:35 AM THREAD STARTER               #5 (permalink)
NamePros Regular
Join Date: Apr 2006
Posts: 254
Wuoshi is a jewel in the roughWuoshi is a jewel in the roughWuoshi is a jewel in the rough
 



Thanks, will look into it.
Wuoshi is offline  
Old 07-04-2008, 12:29 PM   #6 (permalink)
NamePros Regular
Join Date: Mar 2006
Posts: 623
obvio will become famous soon enoughobvio will become famous soon enough
 



I second that recommendation to look at jQuery. It makes manipulating html or css very simple and easy to read. It also separates the html from the javascript which makes things so much more readable.
__________________
Forum Posters
obvio is offline  
Old 07-19-2008, 10:19 AM   #7 (permalink)
New Member
Join Date: Jul 2008
Posts: 12
edomainsuk is an unknown quantity at this point
 



Just make it compatible by using innerHTML and outerHTML .. etc

example
Code:
if(navigator.appName.indexOf("Mozilla") == -1)
{
 document.getElementById('levvy').innerHTML = "Mozilla content";
} else {
 document.getElementById('levvy').outerHTML = "IE content";
 }
or instead of using div's and <p> with id's just use "document.write();" .. that way it won't be neither of those to outhandle.
????: NamePros.com http://www.namepros.com/programming/488017-javascript-not-working-in-ie.html

Hope it helps.
__________________
Buying and selling domains, established websites and marketing advices since 2004.
edomainsuk is offline  
Closed Thread


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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 04:50 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger