POST到jsFiddle以错误的顺序显示外部资源

时间:2017-01-30 01:32:57

标签: jsfiddle

使用form of this fiddle我成功填充了新jsFiddle窗口的HTML,JavaScript和外部资源through a POST API call

<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=&quot;chart_div&quot;></div>' /><br />
    <input type='text' name='js' value='$(function() { $.jqplot(&apos;chart_div&apos;, [[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>

我应该得到is this:一个不错的JavaScript图表。

但是,外部资源并不总是以相同的顺序填充,并且图表可能不会显示。

这是一个已知的错误吗?任何解决方法或修复?

稍后编辑:由jsFiddle开发人员在GitHub上确认:这是一个错误。它将不会被修复,而他们正在开发一个具有重要设计变化的新版本。

1 个答案:

答案 0 :(得分:1)

解决方法:将所有外部资源作为链接/脚本HTML标记传递。

一天后,在查看他们的JS代码之后:每个资源都是通过异步AJAX调用添加的,因此有些调用可能会比其他调用更快地返回。