Thursday, July 26, 2007

Dune Toilet Buggy The Game

Manipulation of client-side javascript events

Normally the dynamic behavior of a web page is the default, calculated directly in the terms of the page. So the html file in the browser that comes a series of objects that respond to various events, performing methods and changing property.
An example:

\u0026lt;div style="height: 39px; border-style:solid;" onclick="javascript:prova();">
div click on the page defined
\u0026lt;/ div>

Sometimes, however, that the conduct of the page should change depending on the page. So javascript events to be generated during the life of the page are not defined directly on the server side but are set "dynamically" in the browser.

In practice you can write an HTML object with no associated events
eg

\u0026lt;div id="divNoEvent" style="height: 39px;border-style:solid;">
div clicks without a defined
runtime \u0026lt;/ div>

and add a bit of code.

\u0026lt;script type="text/javascript">
function test ()

{alert ('you clicked');}

var o = document.getElementById ('divNoEvent');
o. onclick = new Function ('test ()');
\u0026lt;/ script> The call

o.onclick = new Function (' test ()'); will hook the call to the function test () at runtime.

0 comments:

Post a Comment