gpt4 book ai didi

jquery-mobile - 按特定顺序包含 jqPlot 文件

转载 作者:行者123 更新时间:2023-12-04 05:37:26 29 4
gpt4 key购买 nike

jQPlot 是否必须包含在标题中的特定顺序?目前我正在使用 jQMobile,但由于某种原因我的 jqPlot BarRenderer.js 没有被识别......

<head>  
<!-- CSS -->
<link rel="stylesheet" href="./signup.css">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog.min.css" />

<!-- Modernizer -->
<script type="text/javascript" src="./modernizr.custom.56582.js"></script>
<!-- jquery -->
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>

<!-- simpleDiaglo2 -->
<script src="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog2.js"></script>
<script type="text/javascript" src="http://dev.jtsage.com/cdn/simpledialog/latest/jquery.mobile.simpledialog2.min.js"></script>
<!-- Bar Chart -->
<script class="include" language="javascript" type="text/javascript"
src="./jquery-jqPlot/jquery.jqplot.js"></script>
<script class="include" language="javascript" type="text/javascript" src="./jquery-jqPlot/plugins/jqplot.barRenderer.min.js"></script>

</head>

最佳答案

示例加载顺序可能是 jQuery、jqplot、主渲染器、轴渲染器,然后是点标签。顺序取决于项目依赖项。

您正在包括来自 CDN 的 JS,这很好。但是在您的示例中,您在 <head> 中包含了 JavaScript。页面的。您应该在 </body> 上方包含您的 JS标签,以加快页面加载时间。 CSS 应该包含在 <head> 中区。

新更新的官方 jqplot 示例页面“条形图”将此加载顺序显示为文档:

记录的订单:

<script type="text/javascript" src="../jquery.min.js"></script>
<script type="text/javascript" src="../jquery.jqplot.min.js"></script>
<script type="text/javascript" src="../jquery.jqplot.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.barRenderer.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.pieRenderer.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script type="text/javascript" src="../plugins/jqplot.pointLabels.min.js"></script>
<link rel="stylesheet" type="text/css" hrf="../jquery.jqplot.min.css" />

请注意,官方页面的实际来源和文档似乎都有错误 - jqplot 被加载两次。但是,它们在实际源中正确加载了标题中的 CSS - 该示例显示它在页脚中加载了不正确的 JS。这是示例页面中实际的 JS 加载顺序:

示例页面上的实际订单:
<!-- Don't touch this! -->
<script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shCore.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushJScript.min.js"></script>
<script type="text/javascript" src="syntaxhighlighter/scripts/shBrushXml.min.js"></script>
<!-- Additional plugins go here -->
<script class="include" type="text/javascript" src="../jquery.jqplot.min.js"></script>
<script class="include" type="text/javascript" src="../plugins/jqplot.barRenderer.min.js"></script>
<script class="include" type="text/javascript" src="../plugins/jqplot.pieRenderer.min.js"></script>
<script class="include" type="text/javascript" src="../plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script class="include" type="text/javascript" src="../plugins/jqplot.pointLabels.min.js"></script>
<!-- End additional plugins -->

引用文献: http://www.jqplot.com/deploy/dist/examples/barTest.html , http://developer.yahoo.com/performance/rules.html , 个人经验

关于jquery-mobile - 按特定顺序包含 jqPlot 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11747241/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com