B2G/gecko/content/html/content/test/forms/save_restore_radio_groups.sjs
/**
 * This SJS is going to send the same page the two first times it will be called
 * and another page the two following times. After that, the response will have
 * no content.
 * The use case is to have two iframes using this SJS and both being reloaded
 * once.
 */
This SJS is going to send the same page the two first times it will be called
and another page the two following times. After that, the response will have
no content.
The use case is to have two iframes using this SJS and both being reloaded
once.
This SJS is going to send the same page the two first times it will be called and another page the two following times . After that the response will have no content . The use case is to have two iframes using this SJS and both being reloaded once .
function handleRequest(request, response)
{
  var counter = +getState("counter"); 
  response.setStatusLine(request.httpVersion, 200, "Ok");
  response.setHeader("Content-Type", "text/html");
  response.setHeader("Cache-Control", "no-cache");
  switch (counter) {
    case 0:
    case 1:
      response.write(pages[0]);
      break;
    case 2:
    case 3:
      response.write(pages[1]);
      break;
  }
  setState("counter", "" + ++counter);
}
function handleRequest ( request , response ) { var counter = + getState ( "counter" ) ; response . setStatusLine ( request . httpVersion , 200 , "Ok" ) ; response . setHeader ( "Content-Type" , "text/html" ) ; response . setHeader ( "Cache-Control" , "no-cache" ) ; switch ( counter ) { case 0 : case 1 : response . write ( pages [ 0 ] ) ; break ; case 2 : case 3 : response . write ( pages [ 1 ] ) ; break ; } setState ( "counter" , "" + ++ counter ) ; }
This SJS is going to send the same page the two first times it will be called
 and another page the two following times.
This SJS is going to send the same page the two first times it will be called and another page the two following times .
// convert to number; +"" === 0