need help with JavaScript syntax

Hi all,

The script below, embedded in html page, is causing me some grief. While there is no syntax error message generated, it does say the value passed in by 'filename' is undefined. So, if the value of filename is "myfile.html", it complains about "myfile.html" not being defined.

My guess is that I made a mistake in the syntax of the JavaScript below:

document.write("")

Any ideas for correcting my error?

Thanks.

Toady.

Comments

  • : Hi all,
    :
    : The script below, embedded in html page, is causing me some grief. While there is no syntax error message generated, it does say the value passed in by 'filename' is undefined. So, if the value of filename is "myfile.html", it complains about "myfile.html" not being defined.
    :
    : My guess is that I made a mistake in the syntax of the JavaScript below:
    :
    : document.write("")
    :
    : Any ideas for correcting my error?
    :
    : Thanks.
    :
    : Toady.
    :

    Hi! There're a couple of things that might be the problem... I'm not sure, but i believe that the onClick event should be quoted.. at least i do it that way always... like this: onClick="launchNow(" + filename + ")">";
    Then, for robustness i do it like this: document.filename... Though, it isn't explicit if filename is a variable from the script or the document or posted by the form... Either way, you should always be able to identify it that way. If none of this work, then you'll have to be a little more especific... ;)
    Be well...


    MacLeod
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion