Skip to Content
0
Former Member
Jul 04, 2013 at 05:13 AM

Server side javascript error: Need help

18 Views

Hi All,

I am facing trouble when I am running the below server side javascript multiply program:"Func.xsjs".

I get the error as "An error occurred during the processing of your request.

Data might be lost". Please guide me where I am wrong . Thanks a lot for your time.

Func.xsjs

function performMultiply()

{

var body = '';

var num1 = $.request.getParameter('num1');

var num2 = $.request.getParameter('num2');

var answer;

answer = num1*num2;

body = answer.toString();

$.response.addBody(body);

$.response.setReturnCode($.net.http.OK);

}

var aCmd = $.getParameter('cmd');

switch(aCmd)

{

case "Multiply": performMultiply();

break;

default:

$.response.setReturnCode($.net.http.INTERNAL_SERVER_ERROR);

$.response.addBody("Invalid Choice" +aCmd);

}

Attachments

link broken.png (64.6 kB)