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
dai tran 6dai tran 6 

How can javascript after action complete?

Visualforce page:
<apex:column > <apex:commandLink action="{!deleteItem}" reRender="frmList"  oncomplete="updateCarts();"> Remove</apex:commandLink></apex:column>
JAVASCRIPT:
<script>      
         function updateCarts(){  
            var listId = "{!ids}";
             alert(listId);
            
        } 
        </script>

Controller
public string ids { get; set;}
public CartsController()
  { 
   ids= 'ABCDEF';   
  }
  public void deleteItem()
  {
    ids='123456';
  }

Result : updateCarts had call before action and show alert : 'ABCDEF';

How can javascript after action complete?