Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-03-2009
Member
 
Join Date: Jan 2009
Posts: 59
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
Reply With Quote
  #2  
Old 14-03-2009
Member
 
Join Date: May 2008
Posts: 2,293
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
Reply With Quote
  #3  
Old 14-03-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
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;
}
Reply With Quote
  #4  
Old 14-03-2009
Member
 
Join Date: May 2008
Posts: 2,383
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.
}
Reply With Quote
  #5  
Old 14-03-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
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;
}
);
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem with JavaScript"
Thread Thread Starter Forum Replies Last Post
Problem in Firefox javascript with BBC iPlayer Parvati Windows Software 3 18-08-2010 03:27 PM
Youtube Javascript problem Darthmouth Technology & Internet 5 30-03-2010 07:41 PM
Javascript Adobe problem cornto Windows Software 3 31-10-2009 02:03 PM
Problem with the parameters of JavaScript function Luis234 Software Development 4 16-03-2009 11:12 AM
Problem with Javascript and Activex Controls ? Anathakrishnan Technology & Internet 5 18-02-2009 01:36 PM


All times are GMT +5.5. The time now is 01:41 AM.