<?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>
|