 |
Results from the most recent live auction are here.
20 members in the live chat room. Join Chat!
| |
07-01-2008, 03:33 AM
|
· #1 | | NamePros Member | 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?
__________________ Looking for information about the different TLDs? | www.TLDSearcher.com will help you! |
| |
07-01-2008, 09:13 AM
|
· #2 | | NamePros Member Join Date: Sep 2006
Posts: 76
NP$: 100.00 ( Donate)
| 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 |
| |
07-01-2008, 11:13 AM
|
· #3 | | NamePros Member | 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! |
| |
07-02-2008, 10:17 AM
|
· #4 | | New Member | 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... |
| |
07-02-2008, 11:35 PM
|
· #5 | | NamePros Member | Thanks, will look into it.
__________________ Looking for information about the different TLDs? | www.TLDSearcher.com will help you! |
| |
07-04-2008, 11:29 AM
|
· #6 | | NamePros Regular Join Date: Mar 2006
Posts: 623
NP$: 237.00 ( Donate)
| 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. |
| |
07-19-2008, 09:19 AM
|
· #7 | | New Member | 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.
|
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |