Jump to content

get web root


jwk811

Recommended Posts

nevermind it doesnt even work when i put the full url in.

 

its an ajax thing

 

xmlhttp.open("GET","lib/getMessage.php",true);

 

that works for only the front page. but if i go to a different folder it wont work because the url changes.

 

if i put

xmlhttp.open("GET","http://www.domain.com/lib/getMessage.php",true);

that doesnt work tho!

 

why??? i know this is more ajax/js now but please help

Link to comment
Share on other sites

Your problem could be that you're accessing the web page without the www. and the AJAX request includes the www In that case you should either force www or no www or do something like this:

 

xmlhttp.open("GET","http://" + location.host + "/lib/getMessage.php",true);

Link to comment
Share on other sites

Your problem could be that you're accessing the web page without the www. and the AJAX request includes the www In that case you should either force www or no www or do something like this:

 

xmlhttp.open("GET","http://" + location.host + "/lib/getMessage.php",true);

 

tytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytyty

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.