7
Day 17

Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

Embed Size (px)

Citation preview

Page 1: Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

Day 17

Page 2: Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

» Client side and Server side» Since PHP is Server side and can output anything

we want, we can output to JS.» With JS libraries, we can create flash like effects

that go beyond the client side.» Common uses:

• Transition Effects/feedback• In-place editing, form controls• Many more…

Page 3: Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

» jQuery» Prototype» MooTools» Yahoo YUI» EXT JS» DoJo Toolkit» MochiKit» Many many more..

Page 4: Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

» Write Less, Do More» “jQuery is a fast, concise, JavaScript Library that

simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages.”

» Easy to use, extensive documentation, plugin ability, well supported, small download.

Page 5: Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

» PHP and JS work together in two ways.• PHP output to JS• JS output to PHP through AJAX

» Once a page is sent to the client, JS can work, but can’t directly communicate with PHP on the server without AJAX.

» jQuery makes this process simple.

Page 6: Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

» PHP output to JS on server side.

<?phpecho ‘<script>

alert(“This is javascript.”);</script>’;

?>

» You can output JS the same way you output HTML, PHP makes no distinction.

Page 7: Day 17. » Client side and Server side » Since PHP is Server side and can output anything we want, we can output to JS. » With JS libraries, we can create

» Automatic Random Picture Rotator» Self Submitting Forms» Auto-save capabilities» Unique Username and Email checker for new user

account creation» Change CSS formatting on the fly» Edit in-place form data» Instant rating system