我在IE9收到以下錯誤jQuery的追加額外#到DOM對象
SCRIPT5022:語法錯誤,無法識別的表達:## chart1 jQuery的2.0.3.min.js,第4行字符14519
我不確定爲什麼給出下面顯示的代碼。我顯然不會將它添加到HTML字符串,並且只有當我在jqplot調用中引用它時纔有1。那麼爲什麼它會發現這個錯誤?
function createGraph() {
var HTMLstring = '<!DOCTYPE html>\n';
HTMLstring += '<HTML>\n';
HTMLstring += '<HEAD>\n';
HTMLstring += '<TITLE> Frequency Graph</TITLE>\n';
HTMLstring += '<!--[if lt IE 9]><script src="js/excanvas.js"></script><![endif]-->\n';
HTMLstring += '<script class="include" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>\n';
HTMLstring += '</HEAD>\n';
HTMLstring += '<BODY>\n';
HTMLstring += '<div><span>Moused Over: </span><span id="infomouseover">Nothing</span></div>\n';
HTMLstring += '<div><span>Clicked: </span><span id="infoclicked">Nothing</span></div>\n';
HTMLstring += '<div id="chart1" style="margin-top:20px; margin-left:20px; width:300px; height:300px;"></div>\n';
HTMLstring += '</BODY>\n';
HTMLstring += '</HTML>';
newwindow = window.open();
newdocument = newwindow.document;
newdocument.write(HTMLstring);
$(document).ready(function() {
freqchart = $.jqplot('#chart1', [
[
[2, 1],
[4, 2],
[6, 3],
[3, 4]
],
[
[5, 1],
[1, 2],
[3, 3],
[4, 4]
],
[
[4, 1],
[7, 2],
[1, 3],
[2, 4]
]
], {
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
pointLabels: {
show: true,
location: 'e',
edgeTolerance: -15
},
shadowAngle: 135,
rendererOptions: {
barDirection: 'horizontal'
}
},
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer
}
}
});
$('#chart1').bind('jqplotDataHighlight',
function (ev, seriesIndex, pointIndex, data) {
$('#infomouseover').html('series: ' + seriesIndex + ', point: ' + pointIndex + ', data: ' + data + ', pageX: ' + ev.pageX + ', pageY: ' + ev.pageY);
}
);
$('#chart1').bind('jqplotDataClick',
function (ev, seriesIndex, pointIndex, data) {
$('#infoclicked').html('series: ' + seriesIndex + ', point: ' + pointIndex + ', data: ' + data + ', pageX: ' + ev.pageX + ', pageY: ' + ev.pageY);
}
);
$('#chart1').bind('jqplotDataUnhighlight',
function (ev) {
$('#infomouseover').html('Nothing');
}
);
});
}