Susan Shemin wrote:
I want to use javascript onclick to call a php function. This code works, but puts a "done, with errors" in the status line in the file when loaded, which I do not want. (I've done some error testing and isolation, and found the onclick is what is causing the "errors" message.) Any ideas -- or other ways to do it? onclick="<?php here_it_is(); ?>"; Also, I tried onclick=""; to make sure that it's the "embedded" php code that's the culprit, thinking that maybe javascript is reading the php code as nothing inside the quotes.
Javascript is client side and PHP is server side. Javascript's 'onclick' can only call a function within Javascript's namespace, not a function living on the server. You may find this easier done with a library like xAjax which wraps PHP functions for Javascript calls using XML.
_______________________________________________ New York PHP Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk NYPHPCon 2006 Presentations Online http://www.nyphpcon.com Show Your Participation in New York PHP http://www.nyphp.org/show_participation.php