Good morning Guys, I do not know if I'll be clear, but I have a problem here. I need to set the URL path in my JavaScript.
define('URL', 'http://' . $_SERVER['HTTP_HOST'] . '/sistema/');
$html = str_replace('#URL#' ,URL ,$html);
I set this constant, and it works perfectly in HTML and PHP. But in Javascript it looks like it's a String, I've tried several ways, and I think it's easy to solve, but I'm having a lot of trouble. See the Javascript.
var url = '" . URL . "';
function criaAJAX() {
if (window.XMLHttpRequest)
{// Codigo para IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
} else
{// Codigo para IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
Thank you.