Apply for Zend Framework Certification Training

Jquery




<script type="text/javascript">
     $(function() {
         $(".delete").click(function(){
                 var element = $(this);
                 var del_id = element.attr("id");
                 var info = 'id=' + del_id;
                 if(confirm("Are you sure you want to delete this?"))
                 {
                      $.ajax({
                           type: "POST",
                           url: "delete.php",
                           data: info,
                           success: function(){
                           }
                        });
                       $(this).parents(".show")
                       .animate({ backgroundColor: "#003" }, "slow")
                        .animate({ opacity: "hide" }, "slow");
                   }
                    return false;
           });
});
</script>
<style type="text/css">
  .show{
             height: 50px;
             width: 200px;
             background-color: yellow;
             border-radius: 5px;
    }
  .name{
            height: 50px;
            width: 100px;
            background-color: red;
            border-radius: 5px;
            float: left;
   }
  .action{
            height: 50px;
            width: 100px;
            background-color: red;
            border-radius: 5px;
             float: left;
    }
 
</style>
<div class="container">
< ?php
           mysql_connect("localhost","root","");
           mysql_select_db("jquery");
           $result = mysql_query('SELECT * FROM country');
            while($row = mysql_fetch_array($result))
           {
                  $id1=$row['country_id'];
                  $name=$row['country_name'];
 ? >
 <div class="show">
      <span class="name"><?php echo $name;  ?></span>
      <span class="action"><a href="#" id="<?php echo $id1; ?>" class="delete" title="Delete">X</a></span>
</div>
< ?php
}
? > 
</div>                                    

< Post Entry Redirect in jquery >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top