Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

nuJavaScriptCallback

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

nuJavaScriptCallback

Unread post by vario »

Is there any way I can wait for completion of nuRunPHPHidden so that code from nuJavaScriptCallback will be next to execute?

Neil.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuJavaScriptCallback

Unread post by kev1n »

If your code looks like this

Code: Select all

nuRunPHPHidden(...);

Other code here..

Change it to:

Code: Select all

nuRunPHPHidden(...);

function runOtherCode() {
   Other code here..
}


and in PHP, call runOtherCode();

Code: Select all

nuJavaScriptCallback(' runOtherCode(););
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: nuJavaScriptCallback

Unread post by vario »

OK thanks. One other thing...
If the code is part of an onchange event, and then the event handling is over before the PHP returns (given that the code is then just a call to nuRunPHPHidden() followed by a function definition) is the function invoked by the callback then undefined?
Obviously just for the sake of argument the function isn't defined globally!
I might give it a try but some of this just confuses me...
Post Reply