Results 1 to 5 of 5

Thread: Problem with JavaScript

  1. #1
    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

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    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. #3
    Join Date
    Oct 2005
    Posts
    2,393

    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. #4
    Join Date
    May 2008
    Posts
    2,389

    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. #5
    Join Date
    Feb 2008
    Posts
    1,852

    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;
    }
    );

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,383,508.55141 seconds with 16 queries