I have all ready seen several questions similar to this, but none of the answers work for me. I am using a .php file type and the entire body of the webpage is inside tags I use ECHO commands to post the HTML coding. I have tried to simply close the echo and php tags, insert the javascript then open a new php tag with echo commands for the rest of the page, but when I do that the layout of the page gets screwed up somehow. Most javascript works inside my PHP tags if I make sure to put "\" in front of single quotes. but this javascript uses "\" at several points in the code so I think it picks up my backslashes and thinks they are part of the code. so simply adding it inside the tags doesn't work either!