0

Hi,

I have the following piece of code.

<html>
<script language=javascript type='text/javascript'>
function Getlink(a, b)
{
    var targetURL="";
    switch(a)
    {
        case 'param1':       
            switch(b)
            {
                case 'param2':               
                    targetURL="http://www.google.com";                
                    break;
            }       
            break;
        default:
            break;
    }
    return targetURL;
}
</script>
<body>

<p>
  <!--<a href="javascript:Getlink('param1', 'param2')">Test google</a>-->
<a href="#" target="content" onClick="document.location.href=Getlink('param1', 'param2');">Test google</a> <a href="http://www.yahoo.com" target="content">Test yahoo</a> <a href="http://www.live.com" target="content">Test live </a></p>
<p>&nbsp;</p>
<table width="99%" height="246" border="0">
  <tr>
    <td><iframe name="content"></iframe>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>

When I click on Test yahoo and Test live I could able to display those sites in the iframe (content). But in case of test google, i wish to display in that iframe. But it always opens in new window. Could any one suggest me on this?

Edited by mike_2000_17: Fixed formatting

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by hielo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.