Quantcast
Channel: VBForums - jQuery
Viewing all articles
Browse latest Browse all 69

[RESOLVED] Setting cookie on remote host

$
0
0
I'm trying to connect two sites together, one that uses JavaScript and one that uses PHP. I want to pass a JavaScript variable to the PHP site, and figured the best way to do this would be to use jQuery.

I created a simple PHP page that creates a cookie with it's POST data. One the JavaScript side, I've inserted this code:

Code:

$.post('http://remotedomain/setcookie.php', {ProfileID: ProfileID}, function(){
  //successful ajax request
}).error(function(){
  alert('Error setting cookie');
});

I keep getting the error alert and I have no idea how to debug it. I tried:
Code:

.error(function(jqXHR, textStatus, errorThrown) {
  alert(textStatus + " | | + errorThrown);
});

But all that returns is "ERROR". Any thoughts/suggestions?

Viewing all articles
Browse latest Browse all 69

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>