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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yui POST connection with Firefox

Status
Not open for further replies.

dexeloper

Programmer
Oct 26, 2004
162
GB
A Yui question.
I'm struggling to make a POST (as opposed to a GET) connection in Firefox. I think it's a known issue and there must be a workaround but I can't find it. The Yui forum I find a mess.
Anyone know? Thanks for any help.
 
Hi,

Here is a section of code I use:

Code:
    var message=document.getElementById('message').value;
	message = encodeURIComponent(message);
	document.getElementById('message').value = "";
	document.getElementById('message').focus();
    var url="bottom_execute.pl";
    var params = "Message="+message+"&Random="+Math.random();
    [blue]xhr.open("POST",url,true);
    xhr.setRequestHeader("Content-type", "application/x-[URL unfurl="true"]www-form-urlencoded");[/URL]
	xhr.setRequestHeader("Content-length", params.length);
	xhr.setRequestHeader("Connection", "close");[/blue]
	xhr.onreadystatechange = function() {
		if(xhr.readyState == 4 && xhr.status == 200) {
			document.getElementById("DisplayA").innerHTML=xhr.responseText;
		}
	}
    xhr.send(params);

Possibly post the code you have tried if you are still having problems.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top