When user does any action on the application page, the parent window creates events that can be monitored using VK.addCallback(String name, Function value) function. The table below shows a list of such events.
onApplicationAdded—This event occurs when user adds the application to his/her page.
onSettingsChangedint settingsThis event occurs when user changes application settings. settings parameter of the object passed into callback function contains a bit mask of the set settings values. To learn more about settings parameter see account.getAppPermissions method description.
onBalanceChangedint balanceThis event occurs when user credits or debits application vote balance. balance parameter contains current balance of the user in hundredth of a vote. This parameter can be used only for output for the user. Balance reliability shall always be checked with secure.getAppBalance method.
onOrderCancel—This event occurs when user cancels the purchase.
onOrderSuccessint orderIdThis event occurs when purchase is completed successfully.
onOrderFailint errorCodeThis event occurs when purchase fails.
onProfilePhotoSave—This event occurs when user confirms saving of the photo in the window, called by showProfilePhotoBox function.
onWallPostSave—This event occurs when user confirms posting on the wall in the window, called by showWallPostBox function.
onWallPostCancel—This event occurs when user cancels posting on the wall.
onWindowResizedint width, int heightThis event occurs when window size was changed. width and height parameters contain new values of the application size in pixels.
onLocationChangedString locationThis event occurs when the hash value is changed after # symbol in the browser address bar. For example, it happens when Back and Forward buttons are used in the browser. This event always occurs when application is run.
onWindowBlur—This event occurs when application window is blurred. For example, when user opens the window with application settings.
onWindowFocus—This event occurs when application window is in focus. For example, when user closes the window with application settings.
onScrollTopint scrollTop, int windowHeightThis event occurs when scrollTop method is called. windowHeight parameter defines window height in the browser.
onScrollint scrollTop, int windowHeightThis event occurs when user scrolls the page. To subscribe to this event you need to call scrollSubscribe method. windowHeight parameter defines window height in the browser.
onToggleFlashbool showThis event occurs when a pop-up window is opened and you need to hide flash components in the application for which it is impossible to set wmode="opaque", for example show defines what action shall be done with components: hide or show.