Login   Register  
PHP Classes
elePHPant
Icontem

File: public_html/index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Omar Yepez  >  jQuery4PHP  >  public_html/index.php  >  Download  
File: public_html/index.php
Role: Example script
Content type: text/plain
Description: Demo page
Class: jQuery4PHP
Generate JavaScript to use the jQuery library
Author: By
Last change:
Date: 2010-09-06 21:50
Size: 2,131 bytes
 

Contents

Class file image Download
<?php 
ini_set
('display_errors'1); 
error_reporting(E_ALL E_STRICT);
include_once(
'../lib/YepSua/Labs/RIA/jQuery4PHP/YsJQueryAutoloader.php');
YsJQueryAutoloader::register(); ?>
<html>
<head>
  <title>jQuery4PHP</title>
  <script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<h3>Welcome to jQuery4PHP</h3>See the <a href="http://jquery4php.sourceforge.net">jQuery4PHP API<a>
<h4>Event demo:</h4>
<input type="button" id="btnClick" value="Click me" />
  <?php
  
echo
  
YsJQuery::newInstance()
    ->
onClick()
    ->
in('#btnClick')
    ->
execute(
      
'alert("Hello World")'
    
)
  
?>
<br/>
<br/>
<b>Code:</b>
<?php 
highlight_string
(
(
"
<?php
YsJQuery::newInstance()
 ->onClick() 
 ->in('#btnClick')
 ->execute(
  'alert(''Hello World'')'
 )
?>"
)
);
?>
<hr/>
<h4>Ajax demo:</h4>
<input type="button" id="btnAjax" value="Click me" /><br>
<input type="text" id="txtMsg" value="Write a message" />
<?php
echo
YsJQuery::newInstance()
  ->
onClick()
  ->
in('#btnAjax')
  ->
execute(
    
YsJQuery::load(
      
'sample-ajax.php',
      array(
'msg' => YsJQuery::val()->in('#txtMsg'))
    )
    ->
in('#divRendered')
  );
?>
<br>
Result: <div id="divRendered"></div>

<br/>
<br/>
<b>Code:</b>
<?php 
highlight_string
(
(
"
<?php
echo
YsJQuery::newInstance()
  ->onClick()
  ->in('#btnAjax')
  ->execute(
    YsJQuery::load(
      'sample-ajax.php',
      array('msg' => YsJQuery::val()->in('#txtMsg'))
    )
    ->in('#divRendered')
  );
?>
"
)
);
?>
<hr/>
<h4>Effects demo:</h4>
<input type="button" id="btnEffect" value="Click me" /></br></br>
<div id="divEffect" style="height:60px;width:60px;background-color:blue;}" align="center">
  Test
</div>
<?php
echo
YsJQuery::newInstance()
  ->
onClick()
  ->
in('#btnEffect')
  ->
execute(
    
YsJQuery::slideToggle()->in('#divEffect')
  );
?>
<br/>
<br/>
<b>Code:</b>
<?php 
highlight_string
(
(
"
<?php
echo
YsJQuery::newInstance()
  ->onClick()
  ->in('#btnEffect')
  ->execute(
    YsJQuery::slideToggle()->in('#divEffect')
  );
?>"
)
);
?>
</body>
</html>