PDA

View Full Version : Can someone help me with my quotes


ecnarongi
02-05-2003, 11:22 PM
Here is my code

<html>
<head>
<script>
function wind(which)
{
window.open(which)
}

function runme()
{
document.write('<a href="#" onclick="wind(http://www.yahoo.com)">yahoo.com</a>')
}
</script>
</head>
<body onload="runme()">
</body>
</html>

I want to simply click on yahoo and get a pop-up window with yahoo.com in the browser. Thank you, all help is appreciated.

Borgtex
02-05-2003, 11:25 PM
use \'

document.write('<a href="#" onclick="wind(\'http://www.yahoo.com\')">yahoo.com</a>')

Justin Ba
02-05-2003, 11:26 PM
for some reason this forum adds a space inbetween java and script... probably for security reasons... remove the space in your code

<html>
<head>
<script>
function wind(which)
{
window.open(which)
}

function runme()
{
document.write('<a href="javascript:wind(http://www.yahoo.com)">yahoo.com</a>')
}
</script>
</head>
<body onload="runme()">
</body>
</html>

whammy
02-06-2003, 12:29 AM
function runme()
{
document.write('<a href="#" onclick="wind(\'http://www.yahoo.com\')">yahoo.com</a>')
}

P.S. That looks remarkably similar to what Borgtex posted. LOL. ;)

ecnarongi
02-06-2003, 01:22 AM
Thanks fellas :thumbsup: