使用这种小提琴的形式,我成功地填充了一个新的jsFiddle窗口通过POST API调用的HTML、JavaScript和外部资源
<form name='form' action='http://jsfiddle.net/api/post/library/pure/' target="_blank" method='POST'>
<input type='text' name='title' value='some title' /><br />
<input type='text' name='description' value='some description' /><br />
<input type='text' name='html' value='<div id="chart_div"></div>' /><br />
<input type='text' name='js' value='$(function() { $.jqplot('chart_div', [[3,7,9,1,4]]); });' /><br />
<input type='text' name='resources' value='https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/themes/smoothness/jquery-ui.css,https://cdn.jsdelivr.net/excanvas/r3/excanvas.js,https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js,https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js,http://cdn.jsdelivr.net/jqplot/1.0.8/jquery.jqplot.min.css,http://cdn.jsdelivr.net/jqplot/1.0.8/jquery.jqplot.min.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.barRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.categoryAxisRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.dateAxisRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.logAxisRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.enhancedLegendRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.canvasAxisTickRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.canvasAxisLabelRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.canvasTextRenderer.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.canvasOverlay.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.pointLabels.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.highlighter.js,http://cdn.jsdelivr.net/jqplot/1.0.8/plugins/jqplot.cursor.js' /><br />
<input type='text' name='wrap' value='h' /><br />
<input type='text' name='dtd' value='html 5' /><br />
<input type="submit" value="Submit" /><br />
</form>我应该得到的是这个吗:一个很好的JavaScript图表。
但是,外部资源并不总是按相同的顺序填充,图表可能不会出现。
这是已知的窃听器吗?有解决办法或解决办法吗?
稍后编辑:jsFiddle的开发人员在GitHub上确认了:这是一个bug。它将不会被修复,而他们正在工作一个新的版本与重要的设计变化。
发布于 2017-01-30 15:54:49
解决方案:将所有外部资源作为链接/脚本HTML标记传递
一天后,在查看了他们的JS代码之后:每个资源都是通过异步AJAX调用添加的,因此有些调用可能会比其他调用更快地返回。
https://stackoverflow.com/questions/41927911
复制相似问题