« Return to the blog entry
Hi Jake,
I don't think you need to edit the source code of YUI DataSource for altering the URL used for getting the data.
Now you need to use a url like the following:
getNames?OpenAgent&query=typed%20value&foo=foo
var oDS = new YAHOO.util.XHRDataSource("getNames?OpenAgent");
oDS.generateRequest = function(queryValue){
console.log(queryValue) //This will be the entire value typed by user.
return "&query=" + queryValue + "foo=foo";
}
The above code will do what you wanted without altering the source code of the framework.
Regards
JP
Hi Jake,
I don't think you need to edit the source code of YUI DataSource for altering the URL used for getting the data.
Now you need to use a url like the following:
getNames?OpenAgent&query=typed%20value&foo=foo
var oDS = new YAHOO.util.XHRDataSource("getNames?OpenAgent");
oDS.generateRequest = function(queryValue){
console.log(queryValue) //This will be the entire value typed by user.
return "&query=" + queryValue + "foo=foo";
}
The above code will do what you wanted without altering the source code of the framework.
Regards
JP