...

View Full Version : The ajax part of this code does not work



Artyboy2011
01-25-2012, 12:31 PM
function dimensions(){
$('.resource-container').css("width",($(window).width() - 306) + 'px');
$('.resource-title').css("width",($(window).width() - 366) + 'px');
$('.resource-container').css("height",($(window).height() - 250) + 'px');
$('.resource-content ul').css("height",($(window).height() - 292) + 'px');
$('.resource-iframe').css("width",($(window).width() - 306) + 'px');
$('.resource-iframe').css("height",($(window).height() - 275) + 'px');
}
function resourcego(id){
$.ajax({
url: "http://glynit.co.cc/resource.php?id=" + id + "&item=list&part=name",
cache: false,
success: function(data){
name = data;
$.ajax({
url: "http://glynit.co.cc/resource.php?id=" + id + "&item=list&part=list",
cache: false,
success: function(data){
list = data;
$('.resource-toolbar').html('<div id="resource-title" class="resource-title">' + name + '</div>');
$('.resource-content').html('<div class="resource-list"><ul>' + list + '</ul></div>');
dimensions();
}
});
}
});
}
function viewresource(id,ref){
$.ajax({
url: "http://glynit.co.cc/resource.php?id=" + id + "&content=name",
cache: false,
success: function(data){
name = data;
$('.resource-toolbar').html('<div id="resource-back" class="resource-back" onclick="resourcego(' + ref + ');">Back</div><div id="resource-title" class="resource-title">' + name + '</div><div id="resource-print" class="resource-print">Print</div>');
$('.resource-content').html('<iframe id="resource-iframe" class="resource-iframe" src="http://glynit.co.cc/resource.php?id=' + id + '&content=content"></iframe>');
dimensions();
}
});
}
$(window).load(function() {dimensions();});
$(window).resize(function() {dimensions();});

The webiste is http://www.glynit.co.cc/
and the login is guest:guest
And the page is the resources page and it is the links on the left of that page that do not work.

Logic Ali
01-25-2012, 03:00 PM
You're not monitoring for failure. Your url must contain www. or it is classed as a cross-domain communication attempt. If you log-in without www you'll see that it works.
If it will work using a relative path, use it.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum