简体   繁体   English

Google o3d和jQuery可以在同一页面中使用吗?

[英]can google o3d and jQuery be used in the same page?

I would like to use both of these library on the same page but they seem to conflict when they are loaded at the same time. 我想在同一页面上同时使用这两个库,但是当它们同时加载时它们似乎冲突。 Does anyone know of any examples where they are both used or what might help prevent conflicts? 有谁知道在任何地方都使用它们的示例,或者什么可以帮助防止冲突?

You are probably looking for the jQuery noconflict mode: 您可能正在寻找jQuery noconflict模式:

http://api.jquery.com/jQuery.noConflict/ http://api.jquery.com/jQuery.noConflict/

I believe this was due to the o3d code I had setting window.onload = init() function of my o3d code. 我相信这是由于我在o3d代码中设置window.onload = init()函数所导致的o3d代码。

commenting out that line and adding: 注释掉该行并添加:

jQuery(function() {

  init();

}

at the end solves the problem. 最后解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM