![]() |
Question about telling a script in which folder to look! Please help!
Hello,
I have this code: Code:
<script type="text/javascript">It works well, but I don't know what to modify in order for it to search the html file in another folder (deeper). For example, now it only searches the in the folder where the script is (which is in a html page), and I would like it to look for the document in a given folder let's say "transactions" which is down one level. What should I modify? Can you help please? Thanks |
Looks like this is where it's being set:
Code:
var filename = document.formlogin.trackingnr.value.toUpperCase() + ".html";Code:
var filename = "transactions/" + document.formlogin.trackingnr.value.toUpperCase() + ".html"; |
Multiple folders
Works perfect for one folder, what if i want to look in two separate folders:
var filename = "transactions/" + document.formlogin.trackingnr.value + ".html"; How to add another folder ? |
You mean look for it in two possible locations?
Only way to do that is to try the one location and, if not found, look in the other one. You could do that by looking at the http.status: If it was 404 (file not found) instead of 200, then you would have to tell your code to look in the other folder. Somewhat more complex code. Why would you not know what folder a file is in??? |
I have one folder "transaction" and another one called "stock"
The search works perfect for transaction and i want to add folder stock. The script must look in both folders. Is possible ? |
Its OK, if not fount in folder Transaction then look in the other one. how do i do that ?
|
Code:
function PasswordLogin(folder)Code:
PasswordLogin("transactions");you can make an additional progress monitor to throw the alert up if both fail: Code:
function doPageSearch(){Code:
elseCode:
else |
| All times are GMT +1. The time now is 02:04 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.