Forum Moderators: open

Message Too Old, No Replies

new html dcument

help with script

         

electricocean

1:53 am on Dec 11, 2004 (gmt 0)

10+ Year Member



I am trying to make a javascript file in which when the user clicks a link,a new window opens with new html and is not a file in the filemanger on my server. I have a code but it'd not working, any help, please?

my code:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">

function popupJoke(title, joke) {
var w = window.open('','sound','width=500,height=500,scrollbars=yes,resizable=yes');
var d = w.document;
d.write(
'<html><head><title>Dkicks Jokes</title></head><body bgcolor=#FFFFFF>' +
'Dkciks / Jokes / ' + title + '<p>
<p align="center"><font face="Courier" size="50">' + title + '</font><br><br>' + joke + '<br><br>
'<FONT SIZE="2" FACE="Verdana,Arial,Helvetica,sans-serif"><a HREF="javascript: self.close()">Close Window</a></font></p></body></html>');
d.close();
w.focus();
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<a href="javascript:popupJoke('dead', 'hee hee<br>hee hee<br>hee hee<br>hee hee<br>hee hee<br>')">the joke</a>
</body>
</html>

orion_rus

1:20 pm on Dec 11, 2004 (gmt 0)

10+ Year Member



You have some sintax errors there, right code will be following:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">

function popupJoke(title, joke) {
var w = window.open('',title,'width=500,height=500,scrollbars=yes,resizable=yes');
var d = w.document;
document.write("ya tut");
d.write('<html><head><title>Dkicks Jokes</title></head><body bgcolor=#FFFFFF>' +'Dkciks / Jokes / ' + title + '<p align="center"><font face="Courier" size="50">' + title + '</font><br><br>' + joke + '<br><FONT SIZE="2" FACE="Verdana,Arial,Helvetica,sans-serif"><a HREF="javascript: self.close()">Close Window</a></font></p></body></html>');
d.close();
w.focus();
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<a href="javascript:popupJoke('dead', 'hee hee<br>hee hee<br>hee hee<br>hee hee<br>hee hee<br>')">the joke</a>
</body>
</html>


Good luck next time

orion_rus

1:21 pm on Dec 11, 2004 (gmt 0)

10+ Year Member



document.write("ya tut") of cause needs to be out

electricocean

10:09 pm on Dec 11, 2004 (gmt 0)

10+ Year Member



whats hey tut?

orion_rus

7:51 am on Dec 12, 2004 (gmt 0)

10+ Year Member



it's a russian word means 'here') 'ya'='i'm');
good luck you)

electricocean

11:18 pm on Dec 12, 2004 (gmt 0)

10+ Year Member



you don't need that tho