Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Ajax POST Method + Mozilla Firefox
Old 12-29-2008, 04:19 PM Ajax POST Method + Mozilla Firefox
Junior Talker

Posts: 2
Name: Israel
Trades: 0
ok, hello all.. it's my first time in this forum, i was looking for a webmasters forum and i found this in google~ so.. let me start !

a small question about Ajax / HttpRequest in mozilla
i have my httprequest script working on Internet Explorer, using POST method and other using GET Method

the GET httprequest works fine in Mozilla/IE
BUT, using the POST method in Mozilla doesn't work, it works fine using IE not mozilla firefox.
testing the script, and trying to find out why it doesn't work
i found that the problem was here:

Code:
var parameters = "aemail=" + escape(document.getElementById("aemail").value ) +
"&alogin=" + escape(document.getElementById("alogin").value ) +
"&apassword=" + escape(document.getElementById("apassword").value ) +
"&newPass=" + escape(document.getElementById("newPass").value ) +
"&confirmPass=" + escape(document.getElementById("confirmPass").value );
i dont know what the problem is, because that works fine using internet explorer

this is my complete script

Code:
var xmlHttp
function goPost(module,section,method)
{
xmlHttp = false;
xmlHttp=GetXmlHttpObject()
if (xmlHttp.overrideMimeType) { 
xmlHttp.overrideMimeType('text/xml; charset=utf-8'); 
} 
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="page.php"
url=url+"?section="+module
url=url+"&opt="+section
url=url+"&howto="+method
 
var parameters = "email=" + escape(document.getElementById("email").value) +
"&loginFLD=" + escape(document.getElementById("loginFLD").value) +
"&password=" + escape(document.getElementById("password").value) +
"&confpass=" + escape(document.getElementById("confpass").value) +
"&nick=" + escape(document.getElementById("nick").value);
 
xmlHttp.onreadystatechange=goToPost
xmlHttp.open("POST",url,true)
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.setRequestHeader("Content-length", parameters.length);
xmlHttp.setRequestHeader("Connection", "close");
xmlHttp.send(parameters)
}
function goToPost()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById("divresult").innerHTML=xmlHttp.responseText
}
}
 
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
i call this script on the <form tag wht the "action stuff

the problem is only in Mozilla Firefox looks like it doesn't take the values or something.

hope you can help me

thank you!
Akir is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-29-2008, 04:44 PM Re: Ajax POST Method + Mozilla Firefox
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Any error from the HTTP request or the script?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 12-29-2008, 05:48 PM Re: Ajax POST Method + Mozilla Firefox
Junior Talker

Posts: 2
Name: Israel
Trades: 0
ohw, i fixed it, it wasn't an error with the script
i was trying to call the values wht "name" tag, i just added the "id" tag too

thanks neways
Akir is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Ajax POST Method + Mozilla Firefox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.58328 seconds with 12 queries