Results 1 to 3 of 3

Thread: [RESOLVED] Javascript: Link isn't working..?

  1. #1

    Thread Starter
    Addicted Member Vanasha's Avatar
    Join Date
    Jun 2007
    Location
    In a bin.>_>
    Posts
    152

    Resolved [RESOLVED] Javascript: Link isn't working..?

    I'm very new to Javascript. I've been trying to do this for some time now. And i've been hacking my brains out.

    HTML Code:
    <a href="javascript:var inputone = "http://www.freewebs.com/vanashajokes/FMA%20Vids.html" + "#E" + prompt("Which episode do you wish to watch?","1");window.location = inputone;">GoTo Episode</a>



    The link is there. But the actual link chops off most of the code.
    You can visit the website Here
    Warning: The website does lag quite a bit, it has 49 embed videos on it.
    Thank you, all.
    Quote Originally Posted by Vanasha
    Sorry, i'm slow.


  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Javascript: Link isn't working..?

    This is because in HTML " character is reserved for attributes. Use single quotes instead within the double quotes. You can't mix HTML and JavaScript, they must be kept separate of each other and thought of separately.

    Code:
    <a href="#" onclick="var inputone = 'http://www

  3. #3

    Thread Starter
    Addicted Member Vanasha's Avatar
    Join Date
    Jun 2007
    Location
    In a bin.>_>
    Posts
    152

    Re: Javascript: Link isn't working..?

    Thanks!
    Quote Originally Posted by Vanasha
    Sorry, i'm slow.


Posting Permissions

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



Click Here to Expand Forum to Full Width