Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrei Caminschi  >  jQuery Helper  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: jQuery Helper
Generate Javascript to call jQuery library
Author: By
Last change:
Date: 4 years ago
Size: 464 bytes
 

Contents

Class file image Download
<?php

  
include 'jquery.php';
  
$jQuery = new jQuery();

  
#
  ## change the html of an element
  
echo $jQuery("'#id_here'")->html('new content');
  
# output : $('#id_here').html('new content');

  #
  ## use the ajax
  
echo $jQuery()->ajax(array(
    
'url'=>"'some_url'",
    
'type'=>"'POST'",
    
'data'=>array(
      
'username'=>"'zzerachiel'"
    
);
  ));
  
# output : $.ajax({url:'some_url',type:'POST',data:{username:'zzerachiel'});

?>