ver1iframe =
"\n" +
"
\n" +
"Update iframe\n" +
"\n" +
"\n" +
"First version of updating iframe.\n" +
"\n" +
"\n";
ver2iframe =
"\n" +
"\n" +
"Update iframe\n" +
"\n" +
"\n" +
"Second version of updating iframe.\n" +
"\n" +
"\n";
function handleRequest(request, response)
{
var match = request.queryString.match(/^state=(.*)$/);
if (match)
{
response.setStatusLine(request.httpVersion, 204, "No content");
setState("offline.updatingIframe", match[1]);
}
if (request.queryString == "")
{
response.setStatusLine(request.httpVersion, 200, "Ok");
response.setHeader("Content-Type", "text/html");
response.setHeader("Cache-Control", "no-cache");
switch (getState("offline.updatingIframe"))
{
case "": // The default value
response.write(ver1iframe);
break;
case "second":
response.write(ver2iframe);
break;
}
}
}