Click to See Complete Forum and Search --> : opening new browser window from general image map


rasyekj
12-29-2003, 11:25 AM
I need to open a new browser window using javascript. I know how to open a new window, but not using a general image map in an array.

For reference, you can go to http://www.gosps.com. Highlight "commercial product" and you will see GolfGopher. I need the link to GolfGopher to open in a new window.

If you view the source code, you will see the link to GolfGopher set as:
url[7][1] = "http://www.golfgopher.com/B2B";

I tried changing it to:
url[7][1] = "javascript:window.open('http://www.golfgopher.com/B2B')";

This opens the page in a new browser window, but changes the body of the parent window to say "[object]".

If anyone could please help, I'd appreciate it.

Thanks.

stoodder
12-29-2003, 11:32 AM
try that again once without using the java script inside of it.. so liek make it like this:

onClick = "window.open('theURL');return true;"

or another though is you could make a function:


onClick="openWin('theURL');"

<script langauge="javascript">
<!--
function openWin(winurl) {
window.open(winurl);
}
-->
</script>


i dunno but give that a try once k.

rasyekj
12-29-2003, 11:42 AM
Thanks, but I couldn't get either option to work. I just kept getting object expected or url is not defined or return is outside of function errors. Any other suggestions?