[wp-hackers] Idea for comments.php

Robin Adrianse shorty114 at shorty114.net
Tue Oct 3 04:35:03 GMT 2006


It's actually not supposed to be good practice to include JS in the HTML
tags.

This is why libraries such as Prototype, which Owen mentioned above, exist.
Using events and DOM insertion, you can put the attributes in, with a script
that was included in the <head>.

On 10/2/06, Roland Haeder <webmaster at mxchange.org> wrote:
>
> On Tuesday, 3. October 2006 01:15, Owen Winkler wrote:
> > Dumping javascript into the page to run as it's downloaded might not be
> > the best idea, especially since I've provided an example of how to do it
> > well, but here you go:
> >
> >
> > add_action('comment_form', 'my_php_function', 1);
> >
> > function my_php_function($postid) {
> >       echo "Post ID: {$postid}";
> > }
> >
> >
> > This hook is already in the default theme's template code.  See
> > comments.php.
> I mean a hook inside the <form> tag itself like:
>
> <form <?php do_action('comment_form_tag', $post->ID); ?> action=".......>
>
> So everyone can choose to add onSubmit and/or onReset to it or not. :-)
>
> Roland
>
> --
> (GNU) PGP ID: 0x8C8859B9
>
> Weblog:
> http://blog.mxchange.org
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list