Jump to content

A href inside a A href? Javascript


thefreebielife

Recommended Posts

cant you just change the void statement for the url?

and you also need to close your image tag

 

<a href="http://www.phpfreaks.com" onmouseover="return overlib('<b>Description:</b> <?=$od; ?><br><b>Requirements:</b> <?=$oi;?>');" onmouseout="return nd();"><img src="<?=$oimage;?>" border="0" ></a><br>

Link to comment
Share on other sites

It's closed, i didn't paste the whole code.

 

What I mean is something like this:

 

<a href="javascript:void(0);" onmouseover="return overlib('<a href="phpfreaks.com">Show Me this Offer</a><br><b>Description:</b> <? echo "$od"; ?><br><b>Requirements:</b> <? echo "$oi"; ?>');" onmouseout="return nd();"><img src="<? echo "$oimage"; ?>" border="0"</a><br>

 

It doesn't work correctly if I put that in.

Link to comment
Share on other sites

ahh ok.....

what you either need to do is store the string in a variable or change the " to " like this ...

 

<script language="JavaScript" type="text/JavaScript">
function test(str){
document.getElementById("test").innerHTML = str;
}
var myStr = '<a href="test.htm">Link 1</a>';
</script>
<a href="javascript:void(0);" onmouseover="test(myStr)">test</a><br>

<a href="javascript:void(0);" onmouseover="test('<a href="test.htm">Link 2</a>')">test</a><br>

<div id="test"></div>

 

Theres a section of the HTML spec about this here ....

http://www.w3.org/TR/html4/appendix....html#h-B.3.2.1

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.