Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

javascript - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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).

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...