linuxfreakphp Posted December 14, 2013 Share Posted December 14, 2013 (edited) i have a problem with the path. i even tried put the js and the php in the folder,but the js don't find the php. the js is working but it is isn't find the php page and i don't know why. i check with <?php echo '<script language="JavaScript">alert("1");</script>'; ?> with the address in the browser: 'http://127.0.0.1/folder/private/php/index.php' and the php page is fine. 127.0.0.1 folder index.html - html file private - folder php index.php - ajax js file js index.js - ajax js file the path i have gave to the js file: './../php/index.php' (work in other models of ajax i have) 'http://127.0.0.1/folder/private/php/index.php' is working fine if i'm insert it to the browser. i even tried when i put the files (js and php) in the same folder as html, but it is n't working in this model. 127.0.0.1 folder index.html - html file index.php - ajax js file index.js - ajax js file the path i have gave to the js file: 'index.php' what is the problem? Edited December 14, 2013 by linuxfreakphp Quote Link to comment Share on other sites More sharing options...
scootstah Posted December 16, 2013 Share Posted December 16, 2013 Give it the full absolute path, not a relative path. Quote Link to comment Share on other sites More sharing options...
Solution linuxfreakphp Posted December 22, 2013 Author Solution Share Posted December 22, 2013 Give it the full absolute path, not a relative path. hey, i found what was my problem in this model. the path i gave was from the javascript to the php, but the reference to the php need be to the html file and not to the js file. once i set the path in the external js file so the path will be from the html to the php and not the js file the problem solve. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.