Highcharts不能使用jQuery 1.8,任何解决方法?

编程入门 行业动态 更新时间:2024-10-25 15:30:40
本文介绍了Highcharts不能使用jQuery 1.8,任何解决方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个场景,我需要使用jquery 1.8,但是我面临着高图的两个问题,图线不可见,缩放功能也无法正常工作。我已经下载了最新的hightcharts js,即2.3.3版本,有没有解决这个问题的方法?

解决方案

您可以使用 jQuery.noConflict()

要按照特定顺序订购jQuery脚本标签,那么您首先包含的标签将在此后使用 $ 引用,后一个可以使用 jQuery 或者你也可以给出一个你想要的名字,比如 jq172 。由于内部使用 jQuery 的内部高分辨率图表,您希望以后可以使用高图表。

< script type =text / javascriptsrc =code.jquery/jquery-1.8.0.js>< / script> < script type =text / javascriptsrc =code.jquery/jquery-1.7.2.js>< / script> < script type =text / javascript> window.jq172 = $。noConflict(); < / script>

您现在可以使用 $ 来调节1.8 .0特性和 jQuery 或 jq172 使用1.7.2

console.log($:+ $()。jquery); console.log(jQuery:+ jQuery()。jquery); console.log(window.jq172:+ jq172()。jquery);

打印到控制台

$:1.8.0 jQuery:1.7.2 window.jq172:1.7.2

jQuery版本冲突| Highchart& Highstock @ jsFiddle

I have a scenario where I need to use jquery 1.8, but I facing facing 2 problems with highcharts, the graph line is not visible and zoom functionality is also not working properly. I have downloaded the latest hightcharts js, ie, version 2.3.3, is there any work around for this?

解决方案

You can use jQuery.noConflict()

You need to order your jQuery script tags in a particular order, the one you include first will henceforth be referred using $ and the latter one can be referred using jQuery or you could also give a name that you want like jq172. Since highcharts internally using jQuery you want to the highchart friendly version later.

<script type="text/javascript" src="code.jquery/jquery-1.8.0.js" ></script> <script type="text/javascript" src="code.jquery/jquery-1.7.2.js" ></script> <script type="text/javascript"> window.jq172=$.noConflict(); </script>

You can now use $ to leverage 1.8.0 features and jQuery or jq172 to use 1.7.2

console.log("$: " + $().jquery); console.log("jQuery: " + jQuery().jquery); console.log("window.jq172: " + jq172().jquery);

prints to console

$: 1.8.0 jQuery: 1.7.2 window.jq172: 1.7.2

jQuery version conflict | Highchart & Highstock @ jsFiddle

更多推荐

Highcharts不能使用jQuery 1.8,任何解决方法?

本文发布于:2023-05-28 12:28:04,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:词库加载错误:Could not find file &#039;D:\淘小白 高铁采集器win10\Configuration\Dict_Sto

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!