sazzie Posted January 19, 2007 Share Posted January 19, 2007 I have 2 javascripts. Script1.js is in a directory which is parent to another directory containing a php script and script2.js.Can someone please tell me how to redirect my php script to use the first javascript in the parent directory.So if I have the following declaration in a php script: [code]<script language="JavaScript" src="script2.js"> </script>[/code]How can I get the php script to utilize a 'script1.js' which is in the parent directory?thanks :) Link to comment https://forums.phpfreaks.com/topic/34872-redirecting-javascript-s/ Share on other sites More sharing options...
micah1701 Posted January 19, 2007 Share Posted January 19, 2007 'um maybe I don't get the question?it sounds like you just need to change[code]<script language="JavaScript" src="script2.js"> </script>[/code] to[code]<script language="JavaScript" src="script1.js"> </script>[/code]this would run script1.js instead of script2.jswhat am I missing?when you talk about a "parent" directory, you may need to change how the script looks for the source. update the path like:src="/parentdirectory/subdirectory/script1.js"or justsrc="../script1.js"depending on your file structure.on another note[quote]get the php script to utilize a 'script1.js'[/quote]PHP can't utilize javascript because PHP is run server-side and, after being processed on your webserver, is sent to the end user who's browsers renders the server code and then applies the javascript (which only runs client-side). Link to comment https://forums.phpfreaks.com/topic/34872-redirecting-javascript-s/#findComment-164519 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.