samedi 25 juin 2016

Is it possible to load content of page without Refreshing the whole page

Actually i want to refresh my content of a page without Refreshing the whole page through JavaScript or j Query ....... and i did my whole project into ( Php or javaScript) so i face such type of problem

Note : i want to refresh my page content when user do some action here is the screenshot of the page i want to load these dynamic boxes without loading the whole page

Here is my Code:

//On Button click, the below will be execute:

  $('body').on('click', '#click', loadDoc); 

and the LoadDoc functio:

   function loadDoc() { 

                                //alert('heruybvifr');
                var _this = $(this); 
                var order_id= $(this).parents('.modal').find('.order-id').text(); 

                $.get('myPHP.php',{order_id: order_id},function(){ 
             _this.hide();

                }) 
                }

Now myPHP.php :

  <?php
 include("connection.php");
 $limit = intval($_GET['order_id']);

echo $valuek;
    $query="UPDATE orders
SET status ='cooking'
 WHERE id = $limit";
if (mysqli_query($connection,$query)) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . mysqli_error($connection);
 }


  ?> 

Aucun commentaire:

Enregistrer un commentaire