Javascript function on PHP page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Katja

    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_nam e,from){

    parent.sections .location = file_name;
    parent.flash.wh at_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
  • Alvaro G Vicario

    #2
    Re: Javascript function on PHP page

    *** Katja wrote/escribió (27 Feb 2004 03:58:02 -0800):[color=blue]
    > The javascript error is:
    > Unterminated string constant.[/color]

    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
    --

    Comment

    • Katja

      #3
      Re: Javascript function on PHP page

      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 <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> wrote in message news:<wmugyvr6x ivt$.qnf93lvjna 90$.dlg@40tude. net>...[color=blue]
      > *** Katja wrote/escribió (27 Feb 2004 03:58:02 -0800):[color=green]
      > > The javascript error is:
      > > Unterminated string constant.[/color]
      >
      > You haven't checked the generated HTML code? There's obviously a missing
      > quote somewhere in the result. View-> Page Source.
      >
      > --[/color]

      Comment

      Working...