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
Rahul ChowdaryRahul Chowdary 

how can we call a javascript function beforea vf page navigating to next page

i have scenario that i need to call a javascript function after the action method execution complets . i have used oncomplete() also but the problem is my page is navigating to next page so the oncomplete() is not working.
Naveen Rahul 3Naveen Rahul 3
what code you have written in java script??
Rahul ChowdaryRahul Chowdary
Hi Naveen,

Thanks for your reply ...i am just calling console tool kit Api method called RefreshNavigationTab() ...

<apex:command button  id="button" onclick="callMe()" action="{Navigator!}">

<script>

function callMe(){

sforce.console.refreshNavigationTab();
}
</script>



the navigator method will leads us to next page ...i want  method should call first then java script method ..but onclick is calling first
Naveen Rahul 3Naveen Rahul 3
Why cant you try this,

<apex:command button  id="button" onclick="callMe()" action="{Navigator!}">

<script>
function acthere(){
//do some functionality here
return true;
}

function callMe(){

if(acthere()==true){
      sforce.console.refreshNavigationTab();
}

}
</script>