开发者

How to do partial page refresh and get new data's or values each time

开发者 https://www.devze.com 2023-04-01 14:46 出处:网络
How to do partial page refresh and get new data\'s or values each time? I have two tables .One table is 开发者_Go百科to select the products and other is to display it and while selecting the products

How to do partial page refresh and get new data's or values each time? I have two tables .One table is 开发者_Go百科to select the products and other is to display it and while selecting the products through a category .Each time it reloads and i lose the data's of previous category.So how to keep the second table without reloading until the user clicks on the submit button in the second table the table which is displaying ?How to achieve this!

How to do partial page refresh and get new data's or values each time


You can do this with ajax technology. You need write something like:

$('#button_id').click( function() {
   for (var i=0; i<numberRows; i++)
   {
     $('#id'+i).get('query.php?id='+i);
   }
});

where for example "id7" is an id tag in this table, which corresponds with 7-th row and desired column in this row.


try to set javascript ajax action on submit button (not on checkboxes)


You can either use an iFrame, or AJAX. For the iframe, which is the simplest, your form's target would be set to the iframe, thus reloading only that instead of the whole page.

0

精彩评论

暂无评论...
验证码 换一张
取 消