How to Use Event Handler Callbacks

 

In Qularoo, you can use JavaScript functions as event handler callbacks for response to a particular event. 


To do this, add the callback functions within your main Qualaroo JavaScript. 
 

In this article, you will learn how to use Event Handler Callbacks,

 

1. When the survey is displayed

2. When the survey is minimized

3. When the survey is closed

4. When displaying a screen

5. When a user replies to a question

6. When the Mobile Screener is ready

7. When there are no surveys to fire

 

 When the survey is displayed

 

Use the event:

 

<script type="text/javascript" charset="utf-8">
_kiq.push(['eventHandler', 'show', function(){     
    // Execute the following function when the survey has appeared
}]);
</script>

 

 When the Survey Is Minimized

 

Use the event:

 

<script type="text/javascript" charset="utf-8">
_kiq.push(['eventHandler', 'show', function(survey_id){  
    if(survey_id == 'XXXXX') {
      _kiq.push(['minimizeSurvey']);
    }
} }]);
</script>

 

to minimize a survey right after its ‘show’ event so that it appears in minimized form. 

 

 When the Survey Is Closed

 

Use the event:

 

<script type="text/javascript" charset="utf-8">
_kiq.push(['eventHandler', 'close', function(){     
    // Execute the following function when the survey has been closed
}]);
</script>

 

when a visitor submits the survey.

 

 When Displaying a Screen

 

Use the event:

 

_kiq.push(['eventHandler', 'nodeRendered', function(nudge_id, screen_id){ //.... }])

 

when displaying a screen.

 

 When a User Replies to a Question

 

Use the event:

 

_kiq.push(['eventHandler', 'submit', function(answers_array, nudge_id, screen_id){ //... }]) 

 

 

 When the Mobile Screener Is Ready

 

Use the event:

 

_kiq.push(['eventHandler', 'screenerReady', function(nudge_id, screen_id, screen_height){ //... }])

 

when the mobile screener is ready.

 

 When There Are No Surveys to Fire

 

Use the event:

 

_kiq.push(['eventHandler', 'noTargetMatch', function(){ ///... }])

 

when no surveys are set to fire. 

 

That is all about using the event handler callbacks in Qualaroo.

 

 

© 2005 - 2024 ProProfs
-
add chat to your website