SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2002
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to change the src of a javascript tag

    how do u change the src of a javascript tag (by using a javascript method that is)

    cause i need to upload info from a text file to a <div>

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    erm i'm not sure whether you mean this

    PHP Code:

      
    if (your_condition)
      {
        
    loc='js1.js';
      }
      else
      {
        
    loc='js2.js';
      }

      
    document.write('<script type="text/javascript" src="' loc '"></' 'script>'); 


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
  •