I’m currently writing this jquery and for some reason (I don’t know why) it works on the normal domain, but on the parked domain it doesn’t.
Normal domain – http://www.thefinishedbox.com
Parked domain – http://www.tfbox.com
If you scroll down to the colony news and hit the click me link you’ll see it will retrieve data via jquery ajax on the Normal domain, but on the parked domain it wont.
Here is the jQuery code I have so far (its pretty standard):
$(function() {
$.ajaxSetup({
cache: false
});
var ajax_load = "Load me plz";
// load() functions
var loadUrl = "http://thefinishedbox.com/wp-content/themes/tfbox-beta/test.php";
$('.overlay').css({
opacity: '0'
});
$('.toggle').click(function() {
$('.overlay').css({
display: 'block'
}).animate({
opacity: '1'
}, 300);
$(".overlay .content").html(ajax_load).load(loadUrl);
return false;
});
$('.close').click(function() {
$('.overlay').animate({
opacity: '0'
}, 300);
$('.overlay').queue(function() {
$(this).css({
display: 'none'
});
$(this).dequeue();
});
return false;
});
I’m a complete noob when it comes to ajax so any help would be massivly appreciated.
Because you can’t do Ajax requests on another domain, unless you have set permissions accordingly. It’s called “Cross-Domain Ajax”.
If you absolutly need to make it work, you can modify your code a bit:
Or use a workaround (not recommended) : http://www.usejquery.com/posts/9/the-jquery-cross-domain-ajax-guide