Ajax page Effects mimic the Yii framework written by yourself

Source: Internet
Author: User
Tags yii

  This article mainly introduces its own Ajax page-flipping effect, imitating the YII framework, the need for friends can refer to the following

  Code as follows: <! DOCTYPE html>  <html>  <head>  <title>ajax pagination </title>  <script src= "Http://code.jquery.com/jquery-1.11.0.min.js" ></script>  <script>  function Loadxmldoc ($ URL)   {  var xmlhttp;  if (window. XMLHttpRequest)   {//code for ie7+, Firefox, Chrome, Opera, safari  xmlhttp=new XMLHttpRequest ();  else  {//code for IE6, ie5  xmlhttp=new activexobject ("Microsoft.XMLHTTP"); }  Xmlhttp.onreadystatechange=function ()   {  if (xmlhttp.readystate==4 && xmlhttp.status==200)   {  var $data = $ (' <div> ' + xmlhttp.responsetext + ' </div> '); //Alert ($ ("#updateId", $data). HTML () ); //document.getElementById ("Mydiv") .innerhtml=xmlhttp.responsetext;  $ ("#updateId"). ReplaceWith ($ (" #updateId ", $data)); } }  xmlhttp.open (" Get ", $url, True);  xmlhttp.send (); }  </ script>  </head>      <body>      <table id= "UpdateID" >  <tr><td& gt;id</td><td> title </td><td> Time </td></tr>  <?php if (isset ($_get[' P ')) &&$_get[' p '] = = 2):?>  <tr><td>2</td><td>222</td><td>222</ td></tr>  <tr><td>2</td><td>222</td><td>222</td></tr >  <?php Else:?>  <tr><td>1</td><td>111</td><td>111</td ></tr>  <tr><td>1</td><td>111</td><td>111</td></tr >  <?php endif?>      </table>  <div><a href= "javascript:;" onclick= "Loadxmldoc (' p=1 ')" >1</a><a href= "javascript: onclick=" Loadxmldoc ('? p=2 ') ">2</a></div >  </body>  </html>   
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.