SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast Wouter's Avatar
    Join Date
    Jan 2002
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to exexute external script file inside script brackets???

    problem :

    <script language="JavaScript">

    if(condition)
    {
    <script src="xxx.js"></script> // incorrect line
    src='xxx.js'; // is not executed
    }
    </script>

    How to code this correctly ???

    Thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    northern Maine
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    if (condition)
        document.write('<script' + ' src="bla.js"><' + '/script>');
    Jason - Contact Me
    Supermoderator @ CodingForums


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •