Welcome Guest, Not a member yet? Register   Sign In
Ajax IE help
#1

[eluser]Total Shop UK[/eluser]
Code:
$config['base_url'] = "http://www.totalshopuk.com/";

Code:
ajax('<?php echo base_url(); ?>_ajax/basket_add', 'status', poststr, 'POST');

Code:
function ajax(page, box, parameters, method, loadmessage, call, callparas);

Code:
var page = page.replace("http://www.totalshopuk.com", ""); // Page = /_ajax/basket_add

Code:
xmlhttp.open("POST", url, true);

http://totalshopuk.com - works
http://www.totalshopuk.com - doesn't work

Just cannot work it out :-S

Edit: exploding the base_url()and removing http://www.totalshopuk.com did the job.

Code:
$url_array = explode('/',base_url());
$x = count($url_array);
$url = '';
for ($i=3; $i<$x; $i++) {
    $url.= '/'.$url_array[$i];
}
return $url;




Theme © iAndrew 2016 - Forum software by © MyBB