Hey,
I've tried searching everywhere for this but haven't found anything that was able to help me. I am working on a tagboard type script that calls AJAX after the user posts to make the new post show up. The tagboard calls a PHP script which checks to make sure the user included a name, message, and the correct captcha, and then once the PHP script verifies that everything is correct, it calls javascript which clears the input boxes on the main page. The problem is this javascript called by the php never actually executes. Using firebug I see that the new script appears on the page, it just doesn't do anything.
Does anyone know how to make javascript execute after the call to AJAX?

Thanks

Recommended Answers

All 3 Replies

Inside the function reference (or the function that handle's the response). try to call your stated function passed by the PHP script.

function processReq() {
// Handling some renponse -->

// Assuming that all  reponses is handled and done

callmyFunctionPassedByThePHP();
}

If this will not work, then try to separate your stated function that doesn't involve any PHP call — and apply the provided code again.

Unfortunately that's not working. The code that the php script calls appears in the source of the page but refuses to be executed by any method. It is like the browser does not see it as javascript..
I am also unable to separate the javascript from the php because the specific code of javascript is dependent on what the outcome of the php script is.

Thanks

Try to make some recap's on the script generated by the php call. See if you missed something there.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.