Forums

HOWTO Questions: Javascript (6 posts)

  1. asilverstone
    Member
    Posted 5 months ago #

    So, I got this .js that I know is good.
    I put it on the server.
    I called it from a page.

    That didnt do "it".

    What am I doing wrong?

  2. asechrest
    Member
    Posted 5 months ago #

    Did you add the path to the javascript file in the head?

    <script type="text/javascript" src="'.get_option(siteurl).'/wp-content/plugins/author_exposed/javascript/skripta.js"></script>

  3. asilverstone
    Member
    Posted 5 months ago #

    Not exactly. I have this:

    <script src="http://www.arielsilverstone.com/twittermap.js type=mce-”text/javascript”"></script>

    and script IS in /

  4. asechrest
    Member
    Posted 5 months ago #

    Is your javascript file actually in your server root as the filepath you gave suggests?

    Your post is cut off so I don't know your javascript file location. You've got additional errors in the script tag you listed, including a failure to close your src= double quotation mark, a doubling of your end quotation marks, and an incorrect type= designation.

  5. asilverstone
    Member
    Posted 5 months ago #

    Yes, the file is in root. I did close those. The line is this:

    <script src="http://www.arielsilverstone.com/twittermap.js type=mce-”text/javascript”"></script>

    closing double quotes, and closing script. My type will be corrected - I wonder what entered the "mce-" part

  6. t31os_
    Member
    Posted 5 months ago #

    Your call is still incorrect...
    <script src="http://www.arielsilverstone.com/twittermap.js type=mce-”text/javascript”"></script>

    Should be...
    <script type="text/javascript" src="http://www.arielsilverstone.com/twittermap.js"></script>

    NOTE: I moved the type and src around, but honestly which comes first doesn't matter, importantly you just need to ensure the correct use of quotes..

    If it's in the root, then this **might** work..
    <script type="text/javascript" src="/twittermap.js"></script>

    If you have a path problem, when viewing the page, check "View Source" and note the URL that's been printed into the SRC part of the call to the JS.. as in this bit.. src=" whatever_appears_here "

Reply

You must log in to post.

About this Topic