Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yui connection problem

Status
Not open for further replies.

dexeloper

Programmer
Oct 26, 2004
162
GB
Any Yui experts there?
I'm just trying to return a string of data via an ASP page.
My relevant code is:

function sbmSch() {
var sUrl = "searchGet.asp?find=" + document.main.find.value;
var rtnString = 'aaa';
var callback = {success:handleSuccess, failure:handleFailure, argument:rtnString};
var div = document.getElementById('results');
var handleSuccess = function(o){if(o.responseText !== undefined){div.innerHTML = "aaa";}}
var handleFailure = function(o){if(o.responseText !== undefined){div.innerHTML = "bbb";}}
var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
}

The page searchGet.asp is executing but then nothing.
Ahy suggestions?
 
it's possibly a scoping issue... div is defined as being local to the "sbmSch" function, but I think the context of the callback function may be further afield...

Try moving your "div" declaration to be global (i.e. outside of sbmSch).

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dan
It was scoping but not the div. The other functions had to be defined outside the submitting function.
Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top