Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    70
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Using variable as URL

    I'm using a flash embeding, and usually for the source i put:
    src="flash.swf"
    but I want the source to depend on a javascript variable, so if i have
    Code:
    <script>
    var example="flash2.swf";
    </script>
    then how can I use that example variable as the source for the flash file?

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    do it the hard way using the DOM api createElement and appendChild

    or... do it the easy way and use document.write
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow


  •  

    Posting Permissions

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