Jump to content

javascript links bringing up white page


tyhoerr

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.