douxie1692 2013-07-17 08:09
浏览 40

JavaScript-var在Firefox下未定义,但在Chrome中未定义

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作