473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

java script error Expected ')'

One of our programmers is having an issue with a Javascript error and asked me to research it for him. Here's the code:

Expand|Select|Wrap|Line Numbers
  1. function dataRequest(action,dataValue,eID) {
  2.   if (ajaxRequest.readyState!=0) return;
  3.   if(dataValue=="") return;
  4.   if(dataValue=='') dataValue='0';
  5.   url = "https://207.42.229.4/cgi-bin/D3CGIServer/processAjax/~/" + action + "/" + dataValue + "/" + eID;
  6.   ajaxRequest.open("POST", url, true);
  7.   ajaxRequest.onreadystatechange = updateCS;
  8.   ajaxRequest.send(null);
  9. }
  10. function updateCS() {
  11.   if(ajaxRequest.readyState == 4 && ajaxRequest.status == 200) {
  12.     var resp = eval( '(' + ajaxRequest.responseText + ')' );
  13.     if(resp.errors!=""){
  14.        alert(resp.errors)
  15.     }
  16.     if(resp.response!=""){
  17.        eID=resp.element
  18.        if(eID!=""){
  19.           okayToSelect=resp.focus
  20.           document.getElementById(eID).value=resp.response;
  21.           if(okayToSelect=='YES'){
  22.              document.getElementById(eID).select();
  23.           }
  24.        }
  25.     }
  26.     ajaxRequest=CreateRequest();
  27.   }
  28. }
The error occurs at line 12
var resp = eval( '(' + ajaxRequest.responseText + ')' );
Mar 31 '10 #1
2 1997
Dormilich
8,658 Expert Mod 8TB
what is ajaxRequest.responseText?
Mar 31 '10 #2
That's what his program on the server side returns.
I think we may have found the issue. I did some research on how to handle ajax responses and instead of:
'(' + ajaxRequest.responseText + ')'
I think it should be
("+ajax.request.responseText+")

He's going to try that. Hopefully it's that simple.

Oh and he said that ajaxRequest.responseText is what his program on the server side returns. It returns the response in "Jason" format. Then resp.element is dob1.

I'm no programmer and am just conveying what he has told me. All greek to me to be honest. Don't shoot the messenger. :-)
Mar 31 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: dbabin | last post by:
I have a java script function enableServerList() {document.getElementById("ddlServers").disabled=false } function disableServerList() {document.getElementById("ddlServers").disabled=true } ...
9
by: Mickey Segal | last post by:
The long-simmering Eolas patent dispute: http://www.microsoft.com/presspass/press/2003/oct03/10-06EOLASPR.mspx has led to an optional Microsoft Update: http://support.microsoft.com/kb/912945/en-us...
1
by: zvia.awasker | last post by:
Hi, I am not familur with java script i am at beginning and I have wrote a java script that open word document but I didn't success to run a macro that exist in the Word document. var...
3
by: rajarya | last post by:
Hi, I m designing a HTML page(index.html),here i have 2 frames,by defult both frames have index1.html and index2.html as their source . in first frame(index.html) ,i have some redio buttons,and a...
1
by: JOJO123 | last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE. I see u guys all say, this is a...
3
by: squish54 | last post by:
Hi folks - I am mastering a website and there was some pre-existing Java content that I'd like to keep. The problem is that there is an error in the code somewhere and I am more of a networking guy...
0
by: TraceyAnnison | last post by:
I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis. We have a Java project built with the Spring framework, in order to...
3
by: siddhu085 | last post by:
hi! i'm new to java script. i'm doing a web page, where i can increment the value of a text field by pressing a button. Each time i press the button, the value in the text field should be...
1
by: mshroom12 | last post by:
Hello to all. I am having difficulty trying to do this Java project using Eclipse. The following is what I have to do. Election Day It's almost election day and the election officials need a...
4
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.