aeroswat Posted April 20, 2010 Share Posted April 20, 2010 I need a way of getting the upper folder in javascript. In PHP/HTML all I have to do is this... require_once('../src/file.php'); but this doesn't work in javascript for me. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted April 20, 2010 Share Posted April 20, 2010 What are you trying to do in JavaScript? Quote Link to comment Share on other sites More sharing options...
aeroswat Posted April 20, 2010 Author Share Posted April 20, 2010 What are you trying to do in JavaScript? This is my code <script type="text/javascript" src="../src/jquery-1.2.1.pack.js"></script> The file its being called from is public_html/edits/form.php The jquery file is stored in public_html/src/jquery-1.2.1.pack.js Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted April 20, 2010 Share Posted April 20, 2010 You got the path wrong. It's ../../src/jquery-1.2.1.pack.js Quote Link to comment Share on other sites More sharing options...
aeroswat Posted April 20, 2010 Author Share Posted April 20, 2010 You got the path wrong. It's ../../src/jquery-1.2.1.pack.js if i'm in public_html/edits/ I need to do two ..'s to get to public_html? Quote Link to comment Share on other sites More sharing options...
Alex Posted April 20, 2010 Share Posted April 20, 2010 Yes, ../ goes up one directory. Quote Link to comment Share on other sites More sharing options...
aeroswat Posted April 20, 2010 Author Share Posted April 20, 2010 Yes, ../ goes up one directory. The one ../ was right I figured out what was wrong. I hadn't changed the javascript file to recognize the new folder structure yet so it was the javascript file that was erring before the code got a chance to run Thanks for the help 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.