0
我有一種情況,我需要將jqplot.pieRenderer.min.js
文件僅引用到特定的腳本塊。因爲如果它在頂部全局使用,則會爲其他腳本塊功能引發錯誤。我怎樣才能維護這個js文件到特定的腳本塊。如何僅將js文件引用到特定的腳本塊
我在下面試過。
<script src="jquery.jqplot.min.js" type="text/javascript"></script> // global js file
<script type="text/javascript" src="jqplot.pieRenderer.min.js"> //using specific js
$(document).ready(function() {
BindLocationStock();
BindStatusWiseStock();
});
<script type="text/javascript"> //using global js
$(document).ready(function() {
BindBarChart();
});
第一個腳本塊可以使用全局js文件和塊級js文件嗎?我想要這個場景。我怎樣才能做到這一點。請在這裏協助。
爲什麼是一個jQuery插件在其他內聯腳本中導致錯誤? – Eevee
注意:'
我認爲這是衝突問題。要麼你可以使用
jQuery.noConflict
或結束你的代碼是這樣的:來源
2013-10-28 05:04:06