SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External Javascript

    Hi,

    I have a javascript which is a onmouseover help tool that I need help inserting into my site, javahelp.js and picture I would need to be able to edit it. Any help would be greatly appreaciated.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,620
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    You'd normally link to an external script inside the <head> of your page or just before the closing </body> tag. I think you need to go into a lot more detail about what you need help with here, as it's not clear. Are you having trouble with using the script itself?

  3. #3
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have the .js script with a icon that I'd like on my site to give users information when they hover over it. I just like to know the code to do so.

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ix3 View Post
    I have the .js script with a icon that I'd like on my site to give users information when they hover over it. I just like to know the code to do so.
    The HTML tag for that is:

    HTML Code:
    <script src="path/to/file.js"></script>
    Place it at the end of the body, just before the </body> tag.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What if there is no body tag? It's a .tpl file, with this code given how would I be able to edit the text for each help box?

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    All web pages have a body tag. If it is not explicitly entered then the browser will add it.

    The very last two tags in any web page are </body></html> so if those are not there (and are going to be added by the browser) then simply attach the JavaScript at the very bottom of the content.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tested this on a normal page of the site and still will not work (nothing shows up) here's the last code of the page. All the files from the script are javahelp.js, javahelp.css and helpicon.png

    </div>
    <!-- Site Wrapper Ends -->
    <script src="javahelp.js"></script>
    </body>
    </html>

  8. #8
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,527
    Mentioned
    84 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by ix3 View Post
    I tested this on a normal page of the site and still will not work (nothing shows up) here's the last code of the page. All the files from the script are javahelp.js, javahelp.css and helpicon.png
    Where did you get that javahelp.js script from?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  9. #9
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,620
    Mentioned
    413 Post(s)
    Tagged
    7 Thread(s)
    If your source says src="javahelp.js", also make sure that the javahelp.js is in the same directory/folder as the page on which the link appears.
    Last edited by ralph.m; Dec 15, 2012 at 18:12.

  10. #10
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Where did you get that javahelp.js script from?

    I bought it.

  11. #11
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think this script is meant to work the way I want it to, I'm not even sure how I would be able to edit it all was given is <script src=""></script> and I had plan to set this up with every field I have. Thanks for the help I might try to get my money back.


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
  •