Click to See Complete Forum and Search --> : Syntax Problem?


Troy Spiral
07-02-2003, 06:00 PM
Hello,

This code:







<script language="JavaScript">
<!--
if (parent.frames.length)
parent.location.href= self.location;
// -->


if ( self.location == "http://pub86.ezboard.com/btroyspiral" ) {

document.write(' <center>');
document.write(' <img border="0" src="http://www.troyspiral.com/dgheadwreck.jpg"height="60">');



}

{
document.write(' </center>');
document.write(' <br></br>');
document.write(' 4th of July DGN Picnic Info<a href='http://pub86.ezboard.com/ftroyspiralfrm13.showMessage?topicID=293.topic'>Here</a>
')
}





</script>






Should, display a banner at the top of the website:

http://DetroitGothic.net


and then below that, have a line of text that says:

4th of July DGN Picnic Info HERE <-- with the "here" being clickable link.



But what happens is, nothing. No banner, no text, no link.. nothing. If i take the second "text and link" element out, the banner shows up just fine (the way it is on the site right now)

Could someone tell me what im doing wrong?

Thanks in advance.

pyro
07-02-2003, 06:19 PM
You didn't unescape your inner single quotation marks. Try either this:

document.write(' 4th of July DGN Picnic Info<a href=\'http://pub86.ezboard.com/ftroyspiralfrm13.showMessage?topicID=293.topic\'>Here</a>');

or:

document.write(' 4th of July DGN Picnic Info<a href="http://pub86.ezboard.com/ftroyspiralfrm13.showMessage?topicID=293.topic">Here</a>');

Troy Spiral
07-02-2003, 07:09 PM
hi ,

thanks for the input.

Sadly, i did put the line, exactly as your first example shows (if you look closely in the code posted above the "closing" quotation" is there its just on the next line down)

But i manually went and cut and pasted both of your suggestions just to try it, and i get the same effect.


The banner, after adding the "text and link" section (the one that says about the picnic) the banner disaapears, and nothing is displayed at all on top of the page.

Still in the same boat. Its very frustrating because it seems like a simple thing to get to work :(


Any addtional help would be greatly appreciated.

Troy Spiral
07-03-2003, 03:57 AM
help help! -makes sad face- :p

Charles
07-03-2003, 04:59 AM
The board has slightly altered pyro's post which you can see by hitting the quote button under the post.

document.write(' 4th of July DGN Picnic Info<a href=\\'http://pub86.ezboard.com/ftroyspiralfrm13.showMessage?topicID=293.topic\\'>Here</a>');