Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Only on Firefox "Loading failed for the <script> with source"

I want to integrate Marketo form with my existing website on yii framework. My code works on all the browsers except Firefox.

Excerpt from my code:

    $('#button').click(function () {
    var formData = {
        'Email': $('#UserInfo_email').val(),
        'FirstName': $('#UserInfo_first_name').val(),
        'LastName': $('#UserInfo_last_name').val(),
        };
    MktoForms2.loadForm('//app-ab23.marketo.com', mcId, formId, function (form) {
        var myForm = MktoForms2.allForms()[0];
        myForm.addHiddenFields(formData);
        myForm.onSuccess(function (values, followUpUrl) {
            return false;
        });
        myForm.submit();
    });
});

I get error on Firefox only with message

Loading failed for the <script> with source “http://app-ab23.marketo.com/index.php/form/getForm?munchkinId=1111&form=1111&url=http%3A%2F%2Fblox.dev%2Fwizard%2Fmap&callback=jQuery110207175825035737486_1503656391790&_=1503656391791”.

other browsers do the job correctly

note: munchkinId and formId are changed for posting here.

like image 662
Narek Tootikian Avatar asked Aug 25 '17 10:08

Narek Tootikian


People also ask

How do I fix JavaScript error in Firefox?

Start Firefox in Safe Mode to check if one of the extensions ("3-bar" menu button or Tools -> Add-ons -> Extensions) or if hardware acceleration is causing the problem.

How do I force JavaScript to reload Firefox?

You can use Ctrl + F5 to force Firefox to download the latest files. Just hold down the Control Key and press the F5 key (or click the refresh button). If you want Firefox to always download the latest files then you can change the doc frequency setting like this: type this into the address bar: about:config.


4 Answers

I just had the same issue on an application that is loading a script with a relative path.

It appeared the script was simply blocked by Adblock Plus.

Try to disable your ad/script blocker (Adblock, uBlock Origin, Privacy Badger…) or relocate the script such that it does not match your ad blocker's rules.

If you don't have such a plugin installed, try to reproduce the issue while running Firefox in safe mode.

  • If you cannot reproduce it in safe mode, it means your issue is linked to one of your plugins or settings.
  • Otherwise, it might be a different issue. Make sure you have the same error message as in the question. Also look at the network tab of the developer tools to check if your script is listed (reload the page first if needed).
like image 159
Didier L Avatar answered Oct 09 '22 20:10

Didier L


I've just had the same issue - for me Privacy Badger on Firefox was the issue - not adblocker. Posting for posterity

like image 26
Stuart Avatar answered Oct 09 '22 20:10

Stuart


I noticed that in Firefox this can happen when requests are aborted (switching page or quickly refreshing page), but it is hard to reproduce the error even if I try to.

Other possible reasons: cert related issues and this one talks about blockers (as other answers stated).

like image 9
Christophe Roussy Avatar answered Oct 09 '22 20:10

Christophe Roussy


Today I ran into the exact same problem while working on a progressive web app (PWA) page and deleting some cache and service worker data for that page from Firefox. The dev console reported that none of the 4 Javascript files on the page would load anymore. The problem persisted in Safe mode, so it was not an add-on issue. The same script files loaded fine from other web pages on the same website. No amount of clearing the Firefox cache or wiping web page data from Firefox would help, nor would rebooting the Windows 10 PC. Chrome all the time worked fine on the problem page. In the end I did a restore of the entire Firefox profile folder from a day-old backup, and the problem was immediately gone, so it was not a problem with my PWA app. Apparently something in Firefox got corrupted.

like image 5
seeingwithsound Avatar answered Oct 09 '22 18:10

seeingwithsound