470,833 Members | 1,939 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

Javascript function on PHP page

Hi all,

I have a very bizarre problem.

I have a button on a PHP page which I want to call a Javascript
function when it is pressed. This is the code I have:
echo "<td><a href='$a_row[link]'
onClick=\"call_flash('$a_row[link]','$a_row[to]','')\">$a_row[pageName]</a></td>\n";

This line doesn't give me an error but the actual javascript funtion
that is located at the top of the page does. I have used the exact
same function in all the other pages (html and php) and it works fine.
The javascript error is:
Unterminated string constant.

And this is the function:
function call_flash(file_name,frame_name,from){

parent.sections.location = file_name;
parent.flash.what_frame(frame_name,from);

}

It is inside <script> tags and there are other functions too. If I
remove this function it will work fine, but then obviously the
function call doesn't work.

Please help.

Thank you very much

Kat
Jul 17 '05 #1
2 1401
*** Katja wrote/escribió (27 Feb 2004 03:58:02 -0800):
The javascript error is:
Unterminated string constant.


You haven't checked the generated HTML code? There's obviously a missing
quote somewhere in the result. View-> Page Source.

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #2
Hi,

Thank you very much. I noticed that i have accidentally entered a line
feed in the database so the varaibles were going all over the place.

Thank you very much.

Kat

Alvaro G Vicario <al******************@telecomputeronline.com> wrote in message news:<wm*****************************@40tude.net>. ..
*** Katja wrote/escribió (27 Feb 2004 03:58:02 -0800):
The javascript error is:
Unterminated string constant.


You haven't checked the generated HTML code? There's obviously a missing
quote somewhere in the result. View-> Page Source.

--

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.