I guess I found a quick solution after been looking for some examples.
1.Create a new .js file (it could be created with Sublime Text or any other text editor).
In your file you can add all functions as you were working in any other kind of project.
in the function you want to call the Remoting function you need to change the way you call the remoting method from visualforce with this format:
yournamespace.yourapexcontroller.themethod(function(result,event){
//here all your actions after validate event.status and use the results
});
- Upload your file as static resource
- invoke your script with
Here an example of how my js file looks like:
and how the visualforce looks like:
and here some console.log();
Finally I minimized the javascript code and all still worked.
Hope it helps.