function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
madhumadhu 

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()"/>
<script>
     var func;
     window.onload = function() {
          func = function(){
               alert("Button clicked");
          }
     
</script>