OpenSource For You

AJAX and event-driven programmin­g

-

:LWh QCXEHG, yRX sHLzH DOO FRQWURO RYHU GHfiQLQJ hRw yRXU SDJH wLOO EHhDYH RQ GLIIHUHQW RFFDsLRQs. 'HfiQH DQ DFWLRQ RQ any control (individual HTML elements such as buttons, textboxes, divs, spans, text, images, etc) in nCubed (using PHP, of course) for events like a click, mouse hover, keypress, etc —in short, for all the events gavaScript can detect. Then write an event-handler for the action (in PHP, again) and let the rest be lost in oblivion—nCubed will take over. Remember that when you create an event and its handler, you have to specify the type of action it is. There are three at your disposal: nJavapcrip­tAction— vou write a function in a gavaScript fiOH, LQFOXGH WhDW LQ yRXU SDJH, DQG WHOO QCXEHG WhDW yRX want to execute the same at the occurrence of the event. vou are not even writing jnuery code. nCubed—at your service! nperverAct­ion— The page will reload itself with all the changes that you commanded in the event-handler function. There’s no need to worry about PlST data, creating a long rRL string or handling the GbT parameters. nAjaxActio­n— An AgAu call is sent to the server, the event-handler function is executed and the server sends back the changes. ves, AgAu can be activated by changing the action type! Forget about writing separate functions to test what works with AgAu and what doesn’t. And you do not need to create a new PHP page to handle a complicate­d TXHUy-sWULQJ; yRX MXsW QHHG WR wULWH IXQFWLRQs. ThH HYHQW-GULYHQ DUFhLWHFWX­UH RI QCXEHG Ls sR flHxLEOH that it requires another article for me to share all the details.

Newspapers in English

Newspapers from India