开发者

Collision between the mootools and script.js being on the same page

I am developing a widget for a website which in a number of it's own javascripts has mootools. My widget uses script.js library to dynamically load javascripts. This is how it more or less looks like:

<div id="id-which-will-never-intersect-with-any-other"></div>
<script src="http://mydomain.com/config.js" type="text/javascript">

Inside the config.js I have the following: http://pastie.org/1704345

And as a chain the last line includes the file which has the directives for all includes required. But..

When included to the page with mootools that's what the console says:

Uncaught TypeError: Cannot read property 'every' of 开发者_StackOverflow社区undefined
(anonymous function)mootools.js:7
rconfig.js:6
rconfig.js:6

:(

This above mentioned 38 line is the file which hosts script.js itself.

I really don't want to provide our app inside the iframe as well as am quite happy with script.js for it's job. Could you please recommend the possible solution?

Here is the repo of the script.js: https://github.com/polvero/script.js

Thanks!


Question is resolved with switching to the other framework, lab.js: http://labjs.com/ They way dependencies are managed here is even more clear.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜