« Return to Thread: Idea for comments.php

Re: Idea for comments.php

by Robin Adrianse :: Rate this Message:

Reply to Author | View in Thread

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@...> 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@...
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

 « Return to Thread: Idea for comments.php