| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| 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').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?
__________________ Organic beauty www.onlyorganic.no |
| |
| | #3 (permalink) |
| NamePros Member | You dah man!! I should've thought about that! Repped, thank you!
__________________ Organic beauty www.onlyorganic.no |
| |
| | #4 (permalink) |
| 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... |
| |
| | #5 (permalink) |
| NamePros Member | Thanks, will look into it.
__________________ Organic beauty www.onlyorganic.no |
| |
| | #6 (permalink) |
| NamePros Regular | 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 |
| |
| | #7 (permalink) |
| 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";
}
Hope it helps.
__________________ Buying and selling domains, established websites and marketing advices since 2004. |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |