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
    Oct 2011
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Embedded external .js file into HREF tag in html

    Hi,
    I have a external file for example abc.js ,in this abc.js file no functions ,it contains some scripting,i want to call the scripting file though html

    I use the code
    <script type="text/javascript src="abc.js"></script>
    in the header file

    but i want it in a href tag

    any clues really helpful.
    thankyou all.

  • #2
    New Coder
    Join Date
    Oct 2010
    Posts
    52
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I'm a noob, so forgive me if I'm misunderstanding your question.

    I don't think you can have a tag inside another tag. If you're asking how you can call a script that isn't stored in the same directory as the file calling it, then you just need the absolute or relative path.

    Code:
    <script type="text/javascript" src="resource\test.js"></script>
    <script type="text/javascript" src="http://www.test.com/resource/test.js"></script>
    Something like that, although I might have my slashes the wrong direction.


  •  

    Posting Permissions

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