Hi there marain,
As James has pointed out, it appears that you have an escaping
apostrophes problem.
Try it like this...
PHP Code:
<?php
$here = 'codetest';
if ( $here !== 'quotations' ) {
echo '<body class="'. $here .'">';
}
else {
echo '<body class="quotations" onbeforeunload="alert(\'Thanks for visiting. Sorry you couldn\'t stay longer. We hope you return soon. And tell your friends!\')">';
}
?>
From the little I know about javascript, I think that you are going to
have the biggest problem with
onbeforeunload implementation.
And it certainly should not be in the body tag. If it has any possible
chance of working it will need to be coded in the script element.
coothead
Bookmarks