简体   繁体   English

使用ajax调用动态加载表后,调用Javascript函数

[英]Calling the Javascript Function once the table is loaded dynamically using ajax call

I want to call a Javascript function once the table is done loading. 表加载完成后,我想调用Javascript函数。

I thought of using onload() function on table, but later I came to know that onload() doesnt work for table. 我想到在表上使用onload()函数,但是后来我才知道onload()对表不起作用。

As you are using ajax call to load the data in table, after that you can call the javascript function inside the success . 当您使用ajax调用将数据加载到表中时,此后您可以调用成功内的javascript函数。

 $.ajax(
    {
        type: "GET",
        url: "yoururl",
        data: "yourdata",

        success: function(tableData)
        {   
             // load the table using data
            //Call the function you want to call 
             myJavascriptFunction();
        }
    });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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