tyhoerr Posted February 22, 2010 Share Posted February 22, 2010 Here's what I'm trying to do: I need a div to pop-up below a list item with more information (that will basically describe the list item in detail). I also need the div code to be included on the same page- not called from a separate php file. I've cut out the bulky content and included the styles attached to the elements in the code below (instead of leaving the classes I'm using). <ul> <li><a href="javascript:document.getElementById('1').style.display='inline'">First List Item</a> <br /> <div id="1" style="display:none;"> Pop-up content. </div> </li> <li><a href="javascript:document.getElementById('2').style.display='inline'">Second List Item</a><br /> <div id="2" style="display:none;"> More Pop-up content. </div> </li> </ul> This works fantastic in Safari... but for some reason, not in firefox. (these are the only two I've tested). In Firefox, clicking the links opens a blank white page with the sinlge word inline. Any idea why this is happening and how to fix it? Or a more efficient way of accomplishing this task (without a mess of attached .js files), Thanks! Link to comment https://forums.phpfreaks.com/topic/192964-javascript-links-bringing-up-white-page/ Share on other sites More sharing options...
seventheyejosh Posted February 22, 2010 Share Posted February 22, 2010 Maybe the missing semicolon? <a href="javascript:blah ; " <- needs semicolon, it is probably being interpreted strangely. If not, are there any errors in the error console? Link to comment https://forums.phpfreaks.com/topic/192964-javascript-links-bringing-up-white-page/#findComment-1016248 Share on other sites More sharing options...
tyhoerr Posted February 22, 2010 Author Share Posted February 22, 2010 Woops, your right I forgot the semi-colon Didn't solve the problem though0 I got it working though- instead I used onclick, and just set the href="#" Thanks for the help! Link to comment https://forums.phpfreaks.com/topic/192964-javascript-links-bringing-up-white-page/#findComment-1016272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.