开发者

jquery ui version issues

开发者 https://www.devze.com 2023-01-20 06:38 出处:网络
I\'m using 2 different modules in JQuery that each use the UI library. One module uses version 1.8.5 and the other uses 1.7.2.

I'm using 2 different modules in JQuery that each use the UI library. One module uses version 1.8.5 and the other uses 1.7.2.

The problem I'm having is that one of the two modules stops working when I attempt to load both UI libraries. I'm brand new to JQ so I'm not sure what to do about this.

EDIT: Can someone ple开发者_Python百科ase tell me what I need to do with this? Do I need to choose one plugin over the other? How does one resolve this?

I'm using jquery datepicker and jquery.editinplace.js


You cannot use two jQuery UI libraties out of the box.

You need to rewrite older plugin to make it work with newer jQuery-UI ir modify one of jQuery-UI versions.


Well, it is possible, but it's a bit of a hack. I'd recommend finding an in place editor that works with newer versions of jQuery. I'm assuming you are using this edit in place plugin, there is already a bug filed that mentions it does not work with jQuery 1.4.x

You could get around this by using noConflict

<!-- Newest jquery version -->
<script src="jQuery1.4.2.js"></script>
<script>
    var $jq14 = jQuery.noConflict(true);
</script>

<script src="jQuery1.3.2.js"></script>

Then use $("#edit").editInPlace( etc ) for your edit in place stuff and the $jq14() operator for the newer jQuery stuff. Note that it's important to load the older version last and to let it have the $() operator.

Mostly stolen from this previous StackOverflow question, which you should read. The answer describes it better than me.

0

精彩评论

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