hi all,do anyone know how to append user input to url using nokia rss reader example?
below are my code,can anyone tell me if there any part tat i do wrongly..thanks!
Code://///////////////////////////////////////////////////////////////////////////// // The FeedUpdateBroker class implements a simple RSS fetcher and parser. // Constructor. function FeedUpdateBroker() { this.httpReq = null; this.callback = null; } // Fetches a feed from the specified URL and calls the callback when the feed // has been fetched and parsed, or if the process results in an error. FeedUpdateBroker.prototype.fetchFeed = function(feedURL,name,callback) { // remember callback this.callback = callback; // create new XML HTTP request this.httpReq = new XMLHttpRequest(); // set callback var self = this; this.httpReq.onreadystatechange = function() { self.readyStateChanged(); }; // append the current time after the URL to bypass caches var fullURL = feedURL; var Name = name; alert(Name); if (fullURL.indexOf("?") == -1) { fullURL += "?"; } else { fullURL += "&"; } fullURL += "nocache=" + Name ; // Enable Universal Browser Read if (netscape.security.PrivilegeManager.enablePrivilege) netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); // 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) {} // handle the response and call the registered callback this.callback.call(this, this.handleResponse(responseStatus, this.httpReq.responseText)); } } // Handles a completed response. FeedUpdateBroker.prototype.handleResponse = function(responseStatus, xmlDoc) { if (responseStatus == 200) { alert(xmlDoc); var myArray2 = xmlDoc.split("|"); var item = []; for (var i = 1; i < myArray2.length; i++) { var array3 = (myArray2[i].toString()).split("~/"); item.push({ invitedby: array3[0], date: array3[1], time: array3[2], event:array3[3], location: array3[4], message: array3[5], participate: array3[6], }); } return { status: "ok", item:item }; } else { // update failed return { status: "error" }; } }

Reply With Quote


