I have done the Autosuggest Control and it works fine on my first try.
Now I wanted to do it on a second page and there it works wrong.
On my second page it shall request different data than on the first page and I want to use the same
js-file.
So I extend the creation of SuggestionProvider:
function SuggestionProvider(requestMethod) {
this.http = zXmlHttp.createRequest();
this.requestMethod = requestMethod;
}
and I use the instance variable "requestMethod" later in SuggestionProvider.prototype.requestSuggestions():
var oData = {
requesting: this.requestMethod,
text: oAutoSuggestControl.userText,
limit: 5
};
Now the effect in Firefox is that on my second page I get the same suggestions as on the first page.
Although I make these calls in window.onload():
Page1:
var oOptions = new AutoSuggestControl(document.getElementById("item_m odel"), new SuggestionProvider("productModel"));
Page2:
var oOptions = new AutoSuggestControl(document.getElementById("option "), new SuggestionProvider("options"));
In IE I get the right suggstions. Is there only one instance of XMLHTTPRequest ?
Manfred Ursprung