ok, So Im very new to this whole AJAX kind of thinking, and I might be trying to do something that's either harder than it needs to be, or theres an easier way that I havent fount yet...
I'm trying to make a generic javascript function to call php functions....
Please excuse my psudo code, but I just want to get the picture if this kind of thing might work... or if I should be focusing elsewhere... any ideas?
PHP
// php Page of Functions
function doSomething1() { }
function doSomething2($variable) { //update database with $variable }
...
MoreFunctions() { }
...
javascript
function getxmlhttp()
{
...
return xmlHttp;
}
function call_php_function(phpPageOfFunctions, funcName(withphpvariables))
{
xmlhttp = getxmlhttp();
xmlhttp.open(... "phpPageOfFunctions" ...);
CallTheGivenFunctionFromPage(funcName);
}
Html
<input type="button" onClick="call_php_function(phpfunctions.php,doSomething2(75));">
Has anyone implemented this kind of method?
Is there something else I should be searching for to get some insight?
any thoughts?
Thanks