[Phpwm] [OT]event trigger

Keith Pope keith.pope at allpay.net
Thu Mar 15 08:11:09 GMT 2007


Hey Guys,

I would suggest using something like mootools, I use this framework for lots
of stuff and its well worth a look. It helps a lot with things like events
and is very lightweight ( plus using mod_deflate makes it even smaller! ),
it also has a very cool build selection on the download page so you can
select only the parts you really want.

I found trying to do reliable events cross-browser sucks and using something
like mootools makes life much easier!


Keith Pope
Web Developer

-----Original Message-----
From: phpwm-bounces at mailman.lug.org.uk
[mailto:phpwm-bounces at mailman.lug.org.uk] On Behalf Of Phil Beynon
Sent: 15 March 2007 01:49
To: West Midlands PHP User Group
Subject: RE: [Phpwm] [OT]event trigger

> Yeah as david said, really nowerdays we're (as in web developers as a 
> whole) are (or should be) trying to keep javascript out of html pages. 
> What you then do is install the hooks using the javascript. As a rule 
> of thumb this is done in "window.onload".

Agreed, which in most cases, as I just said in a previous email, it is. In
fact looking through it that little script is just about the only bit now
which is inline. I might see if I can shove that to the top later, not sure
in its current form if its going to work outside the form tags without
modification, dunno, will play and see.

Hehe - I've got a definite feeling that when I say I'm writing a CMS that
people might have a few prejudged misconceptions as to exactly what its
going to be :-)

Phil


>
>
> An example might be:
>
> ### init.js ###
> window.onload = init();
>
> function init() {
>     document.getElementById('foo').onmouseove = barr();
>     // etc.
> }
>
>
> function foo() {
>     // function body...
> }
>
> ### end ###
>
> ### index.php ###
> <html>
>     <head>
>         <script type='javascript' src='init.js'></script>
>     </head>
>     <body>
>         <!-- Page Content -->
>     </body>
> </html>
>
> ### end ###
>
> Although if you were to do it properly I believe you should try
> addEventListner() or something first. But that's just good practise.
>
> Hope this helps,
> from Paul
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/phpwm
>


_______________________________________________
Phpwm mailing list
Phpwm at mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/phpwm


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

allpay.net Limited, Fortis et Fides, Whitestone Business Park, Whitestone, Hereford, HR1 3SE. Telephone: 0870 243 3434, Fax: 0870 243 6041. Website: www.allpay.net Email: enquiries at allpay.net
**********************************************************************




More information about the Phpwm mailing list