hey guys,
im making a website in dreamweaver. i need a pop up button, that when u press it, it pops up with the lyrics of a song
also (i dont want it to open a window, just pop up screen thing)
ok, i know its easy to just embed this in my html, but i need to do this in an external .js file.
so, what i have is lyrics.js, and in lyrics.js i have:
function popup() {
alert (”all the lyrics of the song”)
}
then in my html, under the i have
and then where i want it (under ) i have
now wheni save everything and load it, and click the button, nothing comes up!
is it coz the lyrics are too long and have charactors like /”() in them? how come its not working?
thanks
If yopu don’t already have it, get a copy of Firefox and install the “Web Developer Toolbar”, which shows you exactly what problems arise in your JavaScript (both errors and warnings).
Make sure to escape all single quotes in the string in JavaScript with a backslash:
var lyrics = ‘It\’s an escape character’;
Same goes for backslashes - to make a \ appear, type \\ in a string.
powered by Yahoo Answers
