0

I want to attach this script : http://findify-assets-2bveeb6u8ag.netdna-ssl.com/search/prod/beatmed.com.min.js with RequireJS, but It destroys other scripts from require.

My js config:

var config = {
    paths: {
        "findify": "//findify-assets-2bveeb6u8ag.netdna-ssl.com/search/prod/beatmed.com.min",
        "test": "////maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min"
    },
}
require.config(config);

In HTML:

<script type="text/javascript">
  require(['findify']);
</script>

I have problem with the findify script, the "test" loads without errors in console.

Console Errors:

enter image description here

enter image description here

This script loads also other files for example: beatmed.com.min.js

0

1 Answer 1

1

If you take a look at the findify script below, you can see that it overrides the requirejs implementation require and can therefore not find its exec function anymore. So findify is loaded correctly, but then requirejs is gone!

Findify-script excerpt

require = function a(b, c, d) {
    function e(g, h) {
        if (!c[g]) {
            if (!b[g]) {
                var i = "function" == typeof require && require;
                if (!h && i) return i(g, !0);
                if (f) return f(g, !0);
                var j = new Error("Cannot find module '" + g + "'");
                throw j.code = "MODULE_NOT_FOUND", j
            }
            var k = c[g] = {
                exports: {}
            };
            b[g][0].call(k.exports, function(a) {
                var c = b[g][1][a];
                return e(c ? c : a)
            }, k, k.exports, a, b, c, d)
        }
        return c[g].exports
    }
    for (var f = "function" == typeof require && require, g = 0; g < d.length; g++) e(d[g]);
    return e
}({..........
....
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, but now I still don't know what to do with this information. Have you go any idea?
That's another question. Don't know what findify is used for. But you can ask here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.