[advanced search]
Results from the most recent live auction are here.
20 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 07-01-2008, 03:33 AM   · #1
Wuoshi
NamePros Member
 
Trader Rating: (2)
Join Date: Apr 2006
Posts: 146
NP$: 0.00 (Donate)
Wuoshi is on a distinguished road
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').innerHTML = '<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?


Please register or log-in into NamePros to hide ads
__________________
Looking for information about the different TLDs? | www.TLDSearcher.com will help you!
Wuoshi is online now   Reply With Quote
Old 07-01-2008, 09:13 AM   · #2
Bruce_KD
NamePros Member
 
Trader Rating: (1)
Join Date: Sep 2006
Posts: 76
NP$: 100.00 (Donate)
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   Reply With Quote
Old 07-01-2008, 11:13 AM   · #3
Wuoshi
NamePros Member
 
Trader Rating: (2)
Join Date: Apr 2006
Posts: 146
NP$: 0.00 (Donate)
Wuoshi is on a distinguished road
You dah man!! I should've thought about that!

Repped, thank you!
__________________
Looking for information about the different TLDs? | www.TLDSearcher.com will help you!
Wuoshi is online now   Reply With Quote
Old 07-02-2008, 10:17 AM   · #4
kceleb9
New Member
 
Trader Rating: (0)
Join Date: Jun 2008
Posts: 20
NP$: 0.00 (Donate)
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   Reply With Quote
Old 07-02-2008, 11:35 PM   · #5
Wuoshi
NamePros Member
 
Trader Rating: (2)
Join Date: Apr 2006
Posts: 146
NP$: 0.00 (Donate)
Wuoshi is on a distinguished road
Thanks, will look into it.
__________________
Looking for information about the different TLDs? | www.TLDSearcher.com will help you!
Wuoshi is online now   Reply With Quote
Old 07-04-2008, 11:29 AM   · #6
obvio
NamePros Regular
 
Trader Rating: (9)
Join Date: Mar 2006
Posts: 623
NP$: 237.00 (Donate)
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   Reply With Quote
Old 07-19-2008, 09:19 AM   · #7
edomainsuk
New Member
 
Trader Rating: (0)
Join Date: Jul 2008
Posts: 11
NP$: 0.00 (Donate)
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.

Hope it helps.
__________________
Buying and selling domains, established websites and marketing advices since 2004.
edomainsuk is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
NameChatter Grow your forum! NameChatter
Advertise your business at NamePros
All times are GMT -7. The time now is 09:20 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0