This topic is: resolved

Failed to load jquery-latest.min.js ??

  • sylviaQC
    Participant
    Post count: 7
    # 6 months, 4 weeks ago

    Hi, Tentered is super! but got this error message:
    jquery-latest.min.js:4 Failed to load … /api/tweet.php?count=1&exclude_replies=true: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
    If I don’t want to tweet, do I need jquery module to load?
    Thanks,
    s-qc

    sylviaQC
    Participant
    Post count: 7
    # 6 months, 4 weeks ago

    Found the answer online:
    http://ahmed.amayem.com/solution-to-chrome-cross-origin-requests-are-only-supported-for-protocol-schemes-http-data-chrome-chrome-extension-https-chrome-extension-resource/

    Solution to Chrome Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
    Solution to Chrome Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
    Posted on March 8, 2015 by Ahmed Amayem
    If you are running a page directly from Chrome (you just double clicked on an html file) and you’re javascript is trying to request some data you will hit an error that looks something like the following:

    Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
    You can see the error in the console of your browser. To view the console check How to Open/Activate Web Developer Tools on Chrome, Firefox and Safari Browsers

    The Reason
    You are not opening the page through a server, like Apache or nginx, so when the browser tries to obtain the resource it thinks it is from a separate domain, which is not allowed.

    The Solution
    Run a Server on your Machine
    Open your page through a web server like Apache, nginx, node etc.

    Use a Different Browser
    I did not find this error when directly opening the page using Firefox and Safari.

    Contributions
    Krill Fuchs‘s answer to this Stackoverflow Question

    AuthorAuthor
    Keymaster
    Post count: 26641
    # 6 months, 4 weeks ago

    Hi there

    Yes, this is the reason while accessing a local website files without using a local server. This error won’t come when website files are hosted on a hosting server.

    If you plan to not use the Twitter widget then you can disable it from your js folder => init.js file by commenting the below like
    TENTERED.TwitterWidget();

    Change to:

    //TENTERED.TwitterWidget();

    Thanks

    sylviaQC
    Participant
    Post count: 7
    # 6 months, 3 weeks ago

    Great!
    Thanks so much for your help!
    Regards,
    Sylvia

    AuthorAuthor
    Keymaster
    Post count: 26641
    # 6 months, 3 weeks ago

    Welcome 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Failed to load jquery-latest.min.js ??’ is closed to new replies.