Security alert. Cross Site Request Forgery. More info here, fixed release available. [25] (what's this?)
Security alert. Information Leakage and Privilege Escalation. More info here, fixed release available. [24] (what's this?)
New release available: 2009-12-25 "Lemming". upgrade now! [23] (what's this?)
New release candidate available: 2009-12-02 "Mulled Wine". upgrade now! [22] (what's this?)
Security alert. Local file inclusion bug. More info here, fixed release available. [18] (what's this?)
New release available: 2009-02-14. upgrade now! [17] (what's this?)
New release candidate available: 2009-01-30 (RC2). upgrade now! [16] (what's this?)
 

using Javscript on a webpage

Javascript's primary reason to exist was to allow website developers to execute behaviors based on user input, like clicking.

Events are bound to objects using handlers like “onclick()”, “onhover()”, etc. and are typically embedded on the page, or in an external .js file

Following will cause an alert when clicked, and prevent returning so you don't actually follow the link:

click me

The code:

<a href="#" onclick="alert('thanks for the click'); return false;">click me</a>

More complex logic can be achieved in similar fashion:

  • hide/show the table of contents
  • flash an informative message
  • animate something
  • make AJAX requests to get more data

It's advisible to look into using a Javascript library like jQuery or Prototype when things start getting hairy! Save yourself some typing.

Next: Installing Greasemonkey (and other useful extensions)

howto/using_javascript_on_a_web_page.txt · Last modified: 2009/01/26 22:34 by 68.161.228.208
 
 
2007-2008 by the artzilla.org crew tobi-x and jdubs and gleuch