Jump to content

jquery conflicts with babylon


dsman
 Share

Recommended Posts

If I use jquery.min.js I get following error. I have tried referencing jquery in a page before the babylon.js is referenced and after it. Gives same error. 

 

b.prepare is not a function   (at line # 9 babylon.2.0.js)

 

 

Link to comment
Share on other sites

Hi, 

 

Earlier I remember having jquery file included in the html page where my babylon scene is hosted. At that time I didn't see error. But at specific day it started appearning. And that day, since jquery wasn't useful for me, I just commented its reference. Then it went away. 

 

But now since I require it, I tried adding jquery reference again. And it gives following error in console. I tried placing jquery reference both before babylon.js reference and after babylon.js reference. Gives error in both case. 

b.prepare is not a function   (at line # 9 babylon.2.0.js)

I am refering following js files in HTML page. 

<!--<script src="scripts/jquery.min.js"></script>-->  <script src="scripts/babylon.2.0.js"></script><script src="scripts/hand-1.3.8.js"></script><script src="scripts/cannon.js"></script>  <script src="scripts/math.js"></script>  <!-- http://mathjs.org/ --><script src="scripts/utility.js"></script>  <!-- my own code . Code in this file uses jquery code --><script src="scripts/geoutil.js"></script>   <!-- my own code --><script src="scripts/model.js"></script>     <!-- my own code -->
Link to comment
Share on other sites

Resolved. Code in my utility.js file was causing the problem. 

 

But strangely the error in console was showin in babylon.js file and it seemed no way relevant to my code in utility.js 

 

I commented all functions one by one in utility.js and found a function which if was causing a problem. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...