1
我在spotfire文本區域有一個小javascript。它按設計工作。我保存並關閉了點火。重新打開它根本不顯示。我的代碼如下。任何幫助,將不勝感激。Spotfire Javascript輸出消失
resource = [
"//cdn.rawgit.com/toorshia/justgage/master/raphael-2.1.4.min.js",
"//cdnjs.cloudflare.com/ajax/libs/justgage/1.2.8/justgage.js"
]
//add scripts to head
$.getScript(resource[0], function() {
$.getScript(resource[1], init)
})
var init = function() {
var g = new JustGage({
id: "gauge",
min: 0,
max: 100,
customSectors: [{
"lo": 0,
"hi": 89.999,
"color": "#f05050"
},
{
"lo": 90,
"hi": 92.999,
"color": "#DD7502"
},
{
"lo": 93,
"hi": 100,
"color": "#41c572"
}
],
levelColorsGradient: false
});
//refresh gauge when calcvalue changes
$(calcValue).on('DOMSubtreeModified', function() {
g.refresh($(this).text())
})
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<span id=calcValue><SpotfireControl id="3321e4c9003142ad83fdb753e6f66605" />
</span>
<DIV id=gauge></DIV>
例如jQuery的需求也 – epascarello
什麼'init'? – epascarello
@epascarello對不起,我試圖讓它工作,並將'init = function()'改爲'window.onload = function()' – kav77