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 to the CF scene
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    simple javascript help

    <script>
    var image = getObjByID("jimage","jimage");
    image.src="./images/jscripton.jpg";
    </script>

    well it does not seem to do work the ID is correct and the path to set the image to.

    anyideas on whats wrong and how do I fix it?

  • #2
    Regular Coder
    Join Date
    Oct 2006
    Posts
    206
    Thanks
    1
    Thanked 0 Times in 0 Posts
    It would really help if you posted a link to your complete html file rather than just this script snippet. Anyways, try something more like this:

    Code:
    <script type="text/javascript>
    var image = document.getElementById('jimage');
    image.src='./images/jscripton.jpg';
    </script>
    1212jtraceur


  •  

    Posting Permissions

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