Web Analytics Made Easy -
StatCounter How do I call this popup from a .js file?? - CodingForum

Announcement

Collapse
No announcement yet.

How do I call this popup from a .js file??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I call this popup from a .js file??

    How do I call this popup from a .js file??

    Here is my popup code
    <script type="text/javascript" src="fad.js"></script>
    <link rel="stylesheet" type="text/css" href="fad.css" />

    </head>
    <body>
    <div id="fa">
    <div class="fa_close"><a href="#" onclick="hFa()"><img src="close1.jpg" /></a></div>
    <h1><i>THIS WEEK'S</i></h1>
    <img src="special.jpg" alt="special" />
    </div>

    From html I would call it using: <script type="text/javascript">sFa();</script>

    How do I activate this popup from a .js file

  • #2
    <script type="text/javascript" src="fad.js"></script>
    Everything in the file fad.js is included between the
    opening and closing script tags, so it's just the same
    as if it were actually typed there so, if you just
    put sFa() in the file it will run but, as written it will
    run before the page is loaded. This might not be
    what you want.You probably want it in an onload
    event handler ?

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎