I want to draw an chart with Highchart. Before the chart is drawn, I collect the series, the user wants to see via jQuery Shopping Cart.
I save every dropped item in array choice.
The data is from php-file output.php . It prints out an JSON-Array for the chart-builder-method.
Everything works with Google Chrome browser. But not with Firefox
It generates the url-output output.php?string=undefined
//Global var
choice = new Array();
//Shopping Cart
$(function () {
$("#catalog").accordion();
$("#catalog li").draggable({
appendTo: "body",
helper: "clone"
});
$("#cart ol").droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
accept: ":not(.ui-sortable-helper)",
drop: function (event, ui) {
choice.push((this));
$(this).find(".placeholder").remove();
$("<li></li>").text(ui.draggable.text()).appendTo(this);
}
}).sortable({
items: "li:not(.placeholder)",
sort: function () {
$(this).removeClass("ui-state-default");
}
});
});
// For individually tab - Draw chart after the container is put into the site
function drawChart() {
//output.php -> there the chart gets the data
var url = 'output.php?string=' + choice[0].innerText;
//later in the code ...
$.getJSON(url,
function(data) {
What could be the problem?