Click to See Complete Forum and Search --> : [RESOLVED] Problem with putting an embedded object in my JS.


th1666
07-10-2008, 12:17 AM
Hello.

I'm using Javascript to replace a div with certain content when selected from a menu on the side of the page, so whatever I click will show a certain video in the div.

The problem is, when I'm specifying what I want to put in the div, the quotes from the embed code end the line.

This is what I have:
videoArray[18] = "<h1>Before I Forget</h1><p>EMBEDDED VIDEO CODE</p>";

So the quotation marks in the video code stop the valuing of the array short.

Is there anyway I could stop the quotes from doing that? Could I have it get the embed code from somewhere else?

th1666
07-10-2008, 05:12 AM
Never mind I found out how to fix it.

You have to put a backslash (\) before each quote, to tell the javascript it's part of the value.

SOLVED