Getting a javascript Expected_';"

Attempting to create a Cisco IP phone service. Following exact guidelines of one that does work;
Have logging enabled.

I get a 500 server error on the phone; very generic.
On the log, I get this -

(cs-uri-query field of the log)
ctype=out|4|800a03ec|Expected_';'

Can someone please tell me where I'm going wrong?
Code is attached.
thanks - Cindy

<%@ Language=JavaScript %>
<% 
var serverIP = Request.ServerVariables("LOCAL_ADDR");
var SERVICE_DIR="CiscoIPServices";

function MainMenu()
{	Response.Write("<CiscoIPPhoneMenu><Title>IP Time Clock</Title><Prompt>Choose a selection:</Prompt>\r\n");
	Response.Write("<MenuItem>\r\n");
	Response.Write("<Name>Clock In</Name>\r\n");
	Response.Write("<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/menu.asp?option=in</URL>\r\n");
	Response.Write("</MenuItem>\r\n");

	Response.Write("<MenuItem>\r\n");
	Response.Write("<Name>Clock Out</Name>\r\n");
	Response.Write("<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/menu.asp?option=out</URL>\r\n");
	Response.Write("</MenuItem>\r\n");
	Response.Write("</CiscoIPPhoneMenu>\r\n");
	return;
}

function Menu()
{	Response.Write("<CiscoIPPhoneMenu>\r\n");
	Response.Write("<Prompt>Select an option</Prompt>\r\n");

	//Clock In
	Response.Write("<MenuItem>\r\n");
	Response.Write("<Name>Clock In</Name>\r\n");
	Response.Write("<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/input.asp?ctype=in</URL>\r\n");
	Response.Write("</MenuItem>\r\n");

	//Clock Out
	Response.Write("<MenuItem>\r\n");
	Response.Write("<Name>Clock Out</Name>\r\n");
	Response.Write("<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/input.asp?ctype=out</URL>\r\n");
	Response.Write("</MenuItem>\r\n");

	Response.Write("</CiscoIPPhoneMenu>\r\n");
}

	var opt=Request.QueryString("option");
	Response.ContentType = "text/xml";
	Response.Buffer = true;
	Menu();

	Response.Flush();
%>

Open in new window

LVL 9
jrfaustVP of ITAsked:
Who is Participating?
 
jrfaustConnect With a Mentor VP of ITAuthor Commented:
The error was coming from the input.asp page - elseif is 2 words in javascript.
Thanks for taking a look. much appreciated.
0
 
Michel PlungjanIT ExpertCommented:
I would return concatenated strings instead of response writing them in your functions.

However there is nothing I can see should give you this issue
<%@ Language=JavaScript %>
<% 
var serverIP = Request.ServerVariables("LOCAL_ADDR"+
var SERVICE_DIR="CiscoIPServices";

function MainMenu() { 
  return "<CiscoIPPhoneMenu><Title>IP Time Clock</Title><Prompt>Choose a selection:</Prompt>\r\n"+
  "<MenuItem>\r\n"+
  "<Name>Clock In</Name>\r\n"+
  "<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/menu.asp?option=in</URL>\r\n"+
  "</MenuItem>\r\n"+

  "<MenuItem>\r\n"+
  "<Name>Clock Out</Name>\r\n"+
  "<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/menu.asp?option=out</URL>\r\n"+
  "</MenuItem>\r\n"+
  "</CiscoIPPhoneMenu>\r\n";

}

function Menu()
{  
  return "<CiscoIPPhoneMenu>\r\n"+
  "<Prompt>Select an option</Prompt>\r\n"+

  //Clock In
  "<MenuItem>\r\n"+
  "<Name>Clock In</Name>\r\n"+
  "<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/input.asp?ctype=in</URL>\r\n"+
  "</MenuItem>\r\n"+

  //Clock Out
  "<MenuItem>\r\n"+
  "<Name>Clock Out</Name>\r\n"+
  "<URL>http://" + serverIP + "/" + SERVICE_DIR + "/timeclock/input.asp?ctype=out</URL>\r\n"+
  "</MenuItem>\r\n"+

  "</CiscoIPPhoneMenu>\r\n";
}

  var opt=Request.QueryString("option");
  Response.ContentType = "text/xml";
  Response.Buffer = true;
  Response.write(Menu());

  Response.Flush();
%>

Open in new window

0
 
SStoryCommented:
I can't see anything wrong with your functions or the XML that they output.
However, I do not know the API for the Cisco IP phone. To me it seems the error is coming from there.
Or is it from input.asp?
I can't see that code so I don't know why it is complaining.
Ctype is a system function name in dotnet so the parameter naming choice might not be the best possible.
0
 
jrfaustVP of ITAuthor Commented:
Solution was on page not given to experts to review.
0
 
SStoryCommented:
Again, couldn't see that code.  Yes that sort of thing can get you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.