• Resolved asilverstone

    (@asilverstone)


    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?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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>

    Thread Starter asilverstone

    (@asilverstone)

    Not exactly. I have this:

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

    and script IS in /

    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.

    Thread Starter asilverstone

    (@asilverstone)

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

    <script src=”https://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

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

    Should be…
    <script type="text/javascript" src="https://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 "

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘HOWTO Questions: Javascript’ is closed to new replies.