dongshun1884 2016-01-02 14:05
浏览 49

javascript触发jquery html()ajax插入

I am inserting the following javascript function into my page using the jQuery command html(data_in_here). How do I make it run the javascript code?

        echo 'window.onload = function(){';
            echo 'var ctx = document.getElementById("canvas").getContext("2d");';
            echo 'window.myLine = new Chart(ctx).Line(lineChartData, {';
                echo 'responsive: true,';
                echo 'maintainAspectRatio: false';
            echo '});';
        echo '}';

I assume it's not running because it is using window.onload?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求一下解题思路,完全不懂
    • ¥15 tensorflow
    • ¥15 densenet网络结构中,特征以cat方式复用后是怎么进行误差回传的
    • ¥15 STM32G471芯片spi设置了8位,总是发送16位
    • ¥15 R语言并行计算beta-NTI中tree文件的类型
    • ¥15 如何解读marsbar导出的ROI数据?
    • ¥20 求友友协助弄一下基于STC89C52单片机的声光控制灯原理图
    • ¥15 arduino双向交通灯设计
    • ¥15 有没有会粒子群算法的大能(○゜ε^○)求带不会出收敛图😭
    • ¥15 Matlab读取根元素出错