Forum Moderators: open
well thing is this:
function displayJoke(jgenre, jtitle, jjoke, jrating, jbgcolor){
var w = window.open('',jtitle,'width=500,height=500,scrollbars=yes,resizable=yes');
var d = w.document;
d.write('<html><head><title>DKicks Jokes / Jokes / ' + jgenre + ' / ' + jtitle + '</title></head>
<body bgcolor="' + jbgcolor + '">' + 'DKicks Jokes / Jokes / ' + jgenre + ' / ' + jtitle + '<br>
<p align="center"><table><tr><td><font size="30">' + title + '</font></td>
<td>Current Rating: <img src="images/rate_star_' + jrating + '.jpg" />
<input type="button" value="Rate This Joke" onclick="location.href='rate_joke.php';"></td></tr></table></p>
<p align="center">' + jjoke + '</p><br></body></html>');
d.close();
w.focus();
}
I think it's messed up and I need to do something with it. If anyone can help me w/ that, it would be great
electricocean
For the rest it is a lot easier to find out where it is going wrong (and a lot easier to read) if you do the write's over several lines, see example below.
Do that bit by bit correcting mistakes as you go and eventually it should all work.
function displayJoke(jgenre, jtitle, jjoke, jrating, jbgcolor){
var w = window.open('',jtitle.value,'width=500,height=500,scrollbars=yes,resizable=yes');
var d = w.document;
d.write('<html><head><title>DKicks Jokes / Jokes / ' + jgenre + ' / ' + jtitle + '</title><body bgcolor="' + jbgcolor + '">');
d.write('DKicks Jokes / Jokes / ' + jgenre + ' / ' + jtitle + '<br>');
// rest of writes here
d.write('</body></html>');
}
function displayJoke(jgenre, jtitle, jjoke, jrating, jbgcolor){
var w = window.open('',jtitle.value,'width=500,height=500,scrollbars=yes,resizable=yes');
var d = w.document;
d.write('<html><head><title>DKicks Jokes / Jokes / ' + jgenre + ' / ' + jtitle + '</title><body bgcolor="' + jbgcolor + '">');
d.write('DKicks Jokes / Jokes / ' + jgenre + ' / ' + jtitle + '<br>');
d.write('<p align="center"><table><tr><td><font size="30">' + jtitle + '</font></td>');
d.write('<td>Current Rating: <img src="images/rate_star_' + jrating + '.jpg" /> <input type="button" value="Rate This Joke" onclick="location.href=\"http://dkicks.dk.funpic.org/index.php?pageid=2&style=rate&joke=' + jtitle + '\";"></td></tr></table></p>');
d.write('<p align="center">' + jjoke + '</p><br><a href="#" onclick=" self.close()">Close Window</a></p>');
d.write('</body></html>');
d.close();
w.focus();
}
The pop-up window reads everything except the BOLD lines.
When I look at the source code throu my site (not in dreamweaver but in safari) it shows all my code normally like I would expect but it doesn't work.
thanks
electricocean