+ Start a Discussion

oncomplete in javascript

what is oncomplete in java script????
Ajay K DubediAjay K Dubedi
There is no oncomplete event in Javascript.
If you have a javascript method and you want call it ,then we use oncomplete with apex command button shown below.
Oncomplete event comes with the apex comand button as shown below:-

 I added the function to the oncomplete event initially, and change the body of the function at runtime.
<apex:commandButton id="btn" value="save" oncomplete="function()"/>
     var func;
     window.onload = function() {
          func = function(){
               alert("Button clicked");