Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
41
rated 0 times [  43] [ 2]  / answers: 1 / hits: 27665  / 12 Years ago, sun, march 11, 2012, 12:00:00

The script below is working fine with Firefox and Chrome but I cant seem to get it to work with ie, tried everything even lowered the security on my browser to see if was that blocking it, but i still cant get it to work.





function postData() {

var http = new XMLHttpRequest();

var url = /scripts/remove_fr.php;

var params = ;

http.open(GET, url, true);



//Send the proper header information along with the request

http.setRequestHeader(Content-type, application/x-www-form-urlencoded);

http.setRequestHeader(Content-length, params.length);

http.setRequestHeader(Connection, close);



http.onreadystatechange = function() { //Call a function when the state changes.

if(http.readyState == 4 && http.status == 200) {



}

}



http.send(params);



}



$(#qwerty).click(function () {

$('#qwerty').remove();

});



</script>

More From » jquery

 Answers
22

You're already using jQuery, so use jQuery's AJAX utility functions! Don't try to roll your own; the XMLHttpRequest API is ugly and annoying.



I'd like to provide sample code, but right now what you've got amounts to simply:



$.get(/scripts/remove_fr.php);


which isn't much of an example. ;)


[#86920] Friday, March 9, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
domeniccolti

Total Points: 276
Total Questions: 98
Total Answers: 93

Location: India
Member since Fri, May 13, 2022
2 Years ago
domeniccolti questions
Mon, Oct 18, 21, 00:00, 3 Years ago
Thu, Oct 14, 21, 00:00, 3 Years ago
Thu, Jul 15, 21, 00:00, 3 Years ago
Sat, Oct 24, 20, 00:00, 4 Years ago
Thu, Sep 3, 20, 00:00, 4 Years ago
;