×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    I am not able get response using "this.httpReq.responseText".

    Hi

    I am using Aptana 1.2 for making nokia s60 widget application.

    I am not able to get response of "http://wap.delmy.com/goto.php?t=259737&link=~1&ref=wapdaycom" link using following code.

    Code:
    HTML
    ----
    <body onload="init()">
        	<div id="finalcont">
    	</div>
    </body>
    
    JavaScript
    ----------
    
    FeedUpdateBroker.prototype.fetchFeed = function(feedURL, callback) {
        // remember callback
        this.callback = callback;
        
        // create new XML HTTP request
        this.httpReq = new Ajax();
        
        // set callback
        var self = this;
        this.httpReq.onreadystatechange = function() { self.readyStateChanged(); };
    
        // append the current time after the URL to bypass caches
         // here feedURL = http://wap.delmy.com/goto.php?t=259737&link=~1&ref=wapdaycom
        var fullURL = feedURL;
        
        // initiate the request
        this.httpReq.open("GET", fullURL, true);
        this.httpReq.send(null);
    }
    
    // Callback for ready-state change events in the XML HTTP request.
    FeedUpdateBroker.prototype.readyStateChanged = function() {
        // complete request?
        if (this.httpReq.readyState == 4) {
            // attempt to get response status
            var responseStatus = null;
            try {
                responseStatus = this.httpReq.status;
            } catch (noStatusException) {}
            
    	this.callback.call(this,  this.handleHTMLResponse(responseStatus, this.httpReq.responseText));
        }
    }
    
    // Handles a completed response.
    FeedUpdateBroker.prototype.handleHTMLResponse = function(responseStatus, xmlDoc) {
        if (responseStatus == 200 && xmlDoc != null) {
    	var finalcont = document.getElementById("finalcont");
    	finalcont.innerHTML = "OK: <br/>" + this.httpReq.responseText;
            // update was completed successfully
            return { status: "ok" }; //, lastModified: lastModified, items: items };
        } else {
    	var finalcont = document.getElementById("finalcont");
    	finalcont.innerHTML = "error: <br/>" + this.httpReq.responseText;
            // update failed
            return { status: "error" };
        }
    }
    Tell me please where I am going mistake, Please help me to solve this problem.

    Regards,
    SymbianTH

  2. #2
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Unhappy Re: I am not able get response using "this.httpReq.responseText".

    Hi

    Please somebody help me to solve this problem. please , please

    Regards,
    SymbianTH

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    13

    Re: I am not able get response using "this.httpReq.responseText".

    I may be struggling with something similar.

    Please provide us some more information, e.g. the final values of httpReq.status, httpReq.statusText and httpReq.readyState. Does the value of httpReq.responseText equal to ""? Are you running your code on Aptana, mobile device or browser?

  4. #4
    Registered User
    Join Date
    Nov 2009
    Posts
    11

    Re: I am not able get response using "this.httpReq.responseText".

    Maybe it's a crssdomain issue.

    I got the same problem.

    To do cross domain requests, I use : http://coderepos.org/share/browser/l...ScriptRequest/

Similar Threads

  1. Handling asynch USSD response from operator
    By espenwe in forum Symbian Networking & Messaging (Closed)
    Replies: 9
    Last Post: 2009-02-05, 08:46
  2. Problem retreiving custom HTTP response header
    By hmeet2 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-01-03, 09:35
  3. Nokia 30 response format
    By richard_h_t in forum Nokia M2M
    Replies: 0
    Last Post: 2005-07-06, 08:23
  4. 'Response Unknown' when downloading midlet
    By Weevil in forum Mobile Java General
    Replies: 3
    Last Post: 2004-05-30, 17:01
  5. nokia 7210 modem via IR doesn't work !
    By oussamaaiadi in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-03-06, 10:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×