简体   繁体   中英

Javascript doesn't work after call a function

I'm using jqwidgets for windows popout and canvasJS for charts

$(document).ready(function () {
    $("#jqxwindow1 ").jqxWindow({ height:600, width: 1600, maxWidth: 1600, theme: 'fresh',autoOpen:false  });
});

This is the window and i make a chart which on click on label will call a java script function:

function onClick2(e) {
    //$('#test').load(document.URL +  ' #test');
    $(document).ready(function () { /// Wait till page is loaded
        $('#main'+e.dataSeries.testcase).load('index.php?proiect=' + '<?php echo $project; ?>', function () {
            /// can add another function here
        });

    }); //// End of Wait till page is loaded
}

When i click on label, my main div will got the results but after that my 'show/hide' window or click on chart doesn't work anymore.

Any suggestion ? Thanks!

Remove $document.ready inside onClick2() .

function onClick2(e) {
    //$('#test').load(document.URL +  ' #test');                       
    $('#main' + e.dataSeries.testcase).load('index.php?proiect=' + '<?php echo $project; ?>', function () {
    /// can add another function here
    });
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM