This gets a little crazy, I had to do something like this recently. It's too bad there are only two forms of quotation marks to use in JS, and that's no doubt the problem you're running into.
Here's the way I got around it.
When you have script elements within a tag that require a single quotation ( ' ), eliminate that tag, and store the information as a variable you can call with no quotes.
For instance, in the first link,
You're going to have to make 'Back Home' a variable (I'd call it something easily recognized like:
var backhome='Back Home' ) and then in the tag itself (in nav.js) it will become:
(that's assuming you also set up the variable blankstatus=' ' before also.)
Now you only have one kind of quotation mark in what you want to write, so you can use the standard document.write('whatever') tag without conflicting quotes.
So your nav.js file is going to look like this:
var blankstatus=' '
var backhome='Back Home'
var newstory='Here you will find a new Ghost story every month'
//and now apply your old codes, minus the scripted parts, in a document.write tag:
document.write() needs a pair of closing quotes for itself, so any quotes within those must either be single quotes or escaped quotes. You escape quotes by preceeding them with a /
I did it!!!!!!!!!!I got it to work!!!!!!!!
Heres what I ended up with:
var txtOver1 = "Back Home";
var txtOver2 = "Here you will find a new Ghost story every month";
var txtOver3 = "Here you will find a links to other ghost sites";
var txtOver4 = "Here you will find a weekly poll";
var txtOver5 = "Ghost attractions of America";
var txtOut = " ";
document.write('')
Vincent Puglia posted this at 14:39 — 6th July 2000.
Now, aren't you glad I didn't write it for you?
'Cause if I (or anyone else) did, you would have learned nothing and been back with a similiar problem at some future date. Now...you can code (some, maybe, but code nonetheless)
Congrats!
Vinny
Where the world once stood
the blades of grass cut me still
Well I would like to thank you for your help. I look forword to coming here in the future for help.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
james3mg posted this at 17:13 — 5th July 2000.
They have: 4 posts
Joined: Apr 2000
This gets a little crazy, I had to do something like this recently. It's too bad there are only two forms of quotation marks to use in JS, and that's no doubt the problem you're running into.
Here's the way I got around it.
When you have script elements within a tag that require a single quotation ( ' ), eliminate that tag, and store the information as a variable you can call with no quotes.
For instance, in the first link,
You're going to have to make 'Back Home' a variable (I'd call it something easily recognized like:
var backhome='Back Home' ) and then in the tag itself (in nav.js) it will become:
(that's assuming you also set up the variable blankstatus=' ' before also.)
Now you only have one kind of quotation mark in what you want to write, so you can use the standard document.write('whatever') tag without conflicting quotes.
So your nav.js file is going to look like this:
var blankstatus=' '
var backhome='Back Home'
var newstory='Here you will find a new Ghost story every month'
//and now apply your old codes, minus the scripted parts, in a document.write tag:
document.write('
')
And so on...
I hope this helped.
If you have further questions, e-mail me at [email protected]
Vincent Puglia posted this at 19:37 — 5th July 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
document.write("
Ghigman3 posted this at 22:58 — 5th July 2000.
They have: 6 posts
Joined: Feb 2000
I can't get any of the stuff either of you gave me.....
Could you make me somthing so I only need to fill in the blanks??
[Edited by Ghigman3 on 07-05-2000 at 07:01 PM]
Vincent Puglia posted this at 00:01 — 6th July 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
You mean like:
Danny Goodman's Javas___t Bi__e ?
or:
document.write() needs a pair of closing quotes for itself, so any quotes within those must either be single quotes or escaped quotes. You escape quotes by preceeding them with a /
var textVariable = "He said, 'something'.";
document.write(textVariable);
document.write("He said, 'something'.");
document.write("He said, /"something/".");
Or:
would you prefer I rewrite the code for you?
Vinny
[Edited by Vincent Puglia on 07-05-2000 at 08:06 PM]
Where the world once stood
the blades of grass cut me still
Ghigman3 posted this at 02:05 — 6th July 2000.
They have: 6 posts
Joined: Feb 2000
I was hoping you might redo the code for me since I'm not very good with javascript.
Ghigman3 posted this at 02:39 — 6th July 2000.
They have: 6 posts
Joined: Feb 2000
I did it!!!!!!!!!!I got it to work!!!!!!!!
Heres what I ended up with:
var txtOver1 = "Back Home";
var txtOver2 = "Here you will find a new Ghost story every month";
var txtOver3 = "Here you will find a links to other ghost sites";
var txtOver4 = "Here you will find a weekly poll";
var txtOver5 = "Ghost attractions of America";
var txtOut = " ";
document.write('')
Vincent Puglia posted this at 14:39 — 6th July 2000.
They have: 634 posts
Joined: Dec 1999
Hi,
Now, aren't you glad I didn't write it for you?
'Cause if I (or anyone else) did, you would have learned nothing and been back with a similiar problem at some future date. Now...you can code (some, maybe, but code nonetheless)
Congrats!
Vinny
Where the world once stood
the blades of grass cut me still
Ghigman3 posted this at 02:08 — 7th July 2000.
They have: 6 posts
Joined: Feb 2000
Well I would like to thank you for your help. I look forword to coming here in the future for help.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.