Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Learn More

XMLHttpRequest with "post" does not work (parameters are not passed to called routine); same code works in Chrome and IE.

  • 2 απαντήσεις
  • 6 έχουν αυτό το πρόβλημα
  • 15 προβολές
  • Τελευταία απάντηση από Hasan

more options

Here is my code:

function evalCtr(Ctr)
{
var xxxhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xxxhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xxxhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xxxhttp.onreadystatechange=function()
  {
  if (xxxhttp.readyState==4 && xxxhttp.status==200)
    {
    alert(xxxhttp.responseText);
    }
  }
var params = "oper=XXX&Center=YYY";
xxxhttp.open("post","c_ctr.cfm",true);
xxxhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xxxhttp.setRequestHeader("Content-length", params.length)
xxxhttp.setRequestHeader("Connection", "close");

xxxhttp.send(params);
}
Here is my code:<br /> <br /> <pre><nowiki>function evalCtr(Ctr) { var xxxhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xxxhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xxxhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xxxhttp.onreadystatechange=function() { if (xxxhttp.readyState==4 && xxxhttp.status==200) { alert(xxxhttp.responseText);   } } var params = "oper=XXX&Center=YYY"; xxxhttp.open("post","c_ctr.cfm",true); xxxhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xxxhttp.setRequestHeader("Content-length", params.length) xxxhttp.setRequestHeader("Connection", "close"); xxxhttp.send(params); }</nowiki></pre>

Τροποποιήθηκε στις από το χρήστη cor-el

Όλες οι απαντήσεις (2)

more options

A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.

See http://forums.mozillazine.org/viewforum.php?f=25

more options

Troubleshooting extensions and themes

Check and tell if its working.