|
| |||||||||
| Tags: javascript, problem, programming language, response, return, xmlhttp |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Problem with JavaScript
I am having a small query regarding java script programming language. I am working on javascript programming language and i got stuck while returningxmlhttp response. I have no idea as how to declare this Please provide some suggestion regarding this |
|
#2
| ||||
| ||||
| Re: Problem with JavaScript
XMLHttpResponse protected XMLHttpResponse(NativeObject options) Creates a new instance of XMLHttpResponse. Parameters: options - map of response options defined in a javascript object |
|
#3
| ||||
| ||||
| Re: Problem with JavaScript
DataSet=function(){ //DataSet properties this.fields=new Array();//list of fields in DataSet row this.fieldsl=function(){ return this.fields.length; } this.onResponseGetf = function(){ var fieldList=new Array(); if(Ajax.CheckReadyState(Ajax.request)){ var response = Ajax.request.responseXML; var _response= response.getElementsByTagName('fields'); if(_response.length == 0){ document.getElementById('AjaxMessage').innerHTML = 'Missing field list.<br/>Try refreshing the page or you may have an error in the table name.'; } else { var _fields= response.getElementsByTagName('field'); for(var i=0; i<_fields.length; i++){ fieldList.push(response.getElementsByTagName('field')[i].firstChild.data); (response.getElementsByTagName('field')[i].firstChild.data); } alert(fieldList.valueOf()); } } } } function createDataset(_f){ _newSet= new DataSet(); _newSet.URL+="&table="+_newSet._form.name; alert(_newSet.fieldsl()); Ajax.Request(_newSet.URL+'&method=getf', _newSet.onResponseGetf,false)); alert(_newSet.fieldsl()); return _newSet; } |
|
#4
| ||||
| ||||
| Re: Problem with JavaScript
try { if (a === "") err += "some error"; if (b==="") err += "some error"; if (c==="") { err += "some error"; } else { // use an xmlhttp request to compare a condition // that must be evaluated from the server. the response // is true or false. } } catch{} finally{ if (err ==="") //submit the form else //let the user know about the errors. } |
|
#5
| ||||
| ||||
| Re: Problem with JavaScript
function ajaxfunc(filePath, action) { httpReq = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('MSXML2.XMLHTTP'); httpReq.open('GET', filePath, true); httpReq.send(null); httpReq.onreadystatechange = function() { if (httpReq.readyState == 4) { action(httpReq); } }; } ajaxfunc('json.html', function(httpReq) { document.body.innerHTML = httpReq.responseText; } ); |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Problem with JavaScript" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem when calling a Javascript function | Truster | Software Development | 5 | 22-07-2010 12:37 AM |
| Youtube Javascript problem | Darthmouth | Technology & Internet | 5 | 30-03-2010 08:41 PM |
| Javascript Adobe problem | cornto | Windows Software | 3 | 31-10-2009 03:03 PM |
| Problem to detect the javascript opener. | garfield1 | Software Development | 3 | 29-06-2009 11:58 PM |
| Problem with Javascript and Activex Controls ? | Anathakrishnan | Technology & Internet | 5 | 18-02-2009 01:36 PM |