seany123 Posted November 11, 2011 Share Posted November 11, 2011 i have this code: function register() { hideshow('loading',1); error(0); $.ajax({ type: "POST", url: "http://www.domain.com/submit.php", data: $('#regForm').serialize(), dataType: "json", success: function(msg){ if(parseInt(msg.status)==1) { window.location=msg.txt; } else if(parseInt(msg.status)==0) { error(1,msg.txt); } hideshow('loading',0); } }); } and it works perfectly well, but only when the url on my website is eg: www.domain.com it DOESNT work if my domain is domain.com Quote Link to comment https://forums.phpfreaks.com/topic/250959-will-only-execute-when-the-url-in-browser-has-www/ Share on other sites More sharing options...
requinix Posted November 11, 2011 Share Posted November 11, 2011 It's the Same Origin Policy: the hostnames have to match exactly. Just use "/submit.php" for the URL. Quote Link to comment https://forums.phpfreaks.com/topic/250959-will-only-execute-when-the-url-in-browser-has-www/#findComment-1287478 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.