Creating a Custom "Survey Offline" WebProd Page

Creating a Custom "Survey Offline" WebProd Page

Summary This article describes how to utilize Javascript to create a customized "Survey Offline/Unavailable" screen in WebProd
Applies to askiaweb
Written for Scriptwriters and Survey Authors
Keywords webprod; offline; script

Download example script here

Utilizing a combination of Javascript and HTML, it is possible to create a customized page that WebProd will redirect a respondent to in the case of a "103 Survey Offline" Error.

This is useful in the situation of invitation links having been sent to respondents, who may attempt to access them well after your survey has finished field.

Please Note: If your survey is offline, but still taking an active WebProd slot, the default "Offline" Final Page dictated in Askia Design WILL override this code.


Placing this functionality into WebProd is relatively simple. Using the script provided, it can then be pasted into the "General Error Page" dialogue in the WebProd Configuration window:


The Javascript template will be used like this:


<div>Error: ??WEBPROD_ERROR??.</div>
<script src=""></script>
    var foundin = $("div:contains(\"(cause 103)\")").length > 0;
    foundin = foundin || $("div:contains(\"Error 1003\")").length > 0;
    var bodyText = $("div").text();
    var quote = unescape("%27");
    var taskName = bodyText.substring(bodyText.indexOf(quote)+1,bodyText.lastIndexOf(quote));
    var redirectURL = "/AskiaEndPage/" + "EndPage.htm";
    if (foundin) {
    function checkIfRemoteFileExists(url) {
            error: function()
                // do nothing; file does not exist
            success: function()
                window.location.href = url;


The code's functionality relies on looking for the "Cause 103" Default Error text to appear. Depending on this, the script will utilize an AJAX call to redirect the respondent to a pre-determined HTML page located on the Survey's respective Web machine by replacing the URL.

In this case, the HTML file was located under: 



The code provided can also be altered by a survey programmer with a working knowledge of HTML/Javascript to further customize the function to suit the client's needs. 

Have more questions? Submit a request