简体   繁体   中英

How to check table weather is has been filled or not?

I have one html page which gets generated as a result of clicking of search button on the page. Which fetches the records from mySQL and populate the table but after that it has one plot which uses the search parameter as input and plot the graph using highcharts.

Structure of page:

<html>
<head>
<script>
    <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
    <script>
    $(document).ready(function(){
      $("#plotgenerator").click(function(e){
        $.ajax();
    });
    </script>

</script>
</head>
<body>
       <input type=TEXT value="" name="text">
       <input type=SUBMIT value="search" name="search">
       <table></table>
       <input type=SUBMIT value="Submit" name="plotgenerator">  /*click button and fetch records using Ajax and generate a plot here.*/
     <div id ="someplot"></div>
</body>
</html>

Once table gets populatated button plotgenerator should be clicked and plot should be generate here. How to check the table has already been filled and completed?

Your code checks the table before the search. Your $(document).ready runs in the moment the user opens the page. If you use ' $(document).on it may checks the table after the search, when the results are there.

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