Re: Weird Javascript "test is not defined" error.

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

    Re: Weird Javascript "test is not defined" error.

    Sytse meinte:

    Please stop top-posting. Thanks.
    OK thanks.
    Is there a trick to overcome this issue?
    Easy: Don't use document.write( ) after loading a page.

    Why do you write at all? Apend anchor elements to the body in your
    create()-function.

    Something like

    var a = document.create Element("a");
    a.appendChild(d ocument.createT extNode("test") ;
    a.href = "...";
    a.onclick = test;
    document.body.a ppendChild(a);

    Gregor



    --
    http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://web.gregorkofler.com ::: meine JS-Spielwiese
    http://www.image2d.com ::: Bildagentur für den alpinen Raum
  • Sytse

    #2
    Re: Weird Javascript "test is not defined" error.

    >OK thanks.
    >Is there a trick to overcome this issue?
    >
    Easy: Don't use document.write( ) after loading a page.
    >
    Why do you write at all? Apend anchor elements to the body in your
    create()-function.
    >
    Something like
    >
    var a = document.create Element("a");
    a.appendChild(d ocument.createT extNode("test") ;
    a.href = "...";
    a.onclick = test;
    document.body.a ppendChild(a);
    >
    Gregor

    Great! Thanks.

    Guess I'll have to dig into javascript a bit more.

    Regards,

    Sytse.

    Comment

    Working...