473,513 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can JavaScript list files at a domain that it is permitted to see?

16 New Member
I have a whole bunch of files called xxx_Page1.htm at a domain, where xxx is a type of animal. I have a script that iterates through a known list of animals setting MyVar for each one. The following line works just fine at bringing these files on to a web page inside MyDiv:

document.getElementById('MyDiv').innerHTML = "<iframe src='"+MyVar+"_Page1.htm'></iframe>";

However the the files at the server are being added to all the time. I can maintain the list of animals to make it work, but my question is can JavaScript return me a list of files it is allowed to see at a given domain?

e.g. can I get ./*_Page1.htm returned where * is a wildcard and ./ is the domain.

p.s. I'm not allowed to write any server side code in this case :(
Jul 22 '10 #1
4 2255
gits
5,390 Recognized Expert Moderator Expert
no ... javascript has no access to a filesystem ... you could make an ajax call to a serverside script (php or whatever) that returns you the list of available files ...
Jul 23 '10 #2
tur130
16 New Member
Can you help me understand this...

http://en.wikipedia.org/wiki/XMLHttpRequest

Follow the link for 'Head' to...

http://en.wikipedia.org/wiki/Hyperte...equest_methods

Look at the description of options, it says...

"OPTIONS
Returns the HTTP methods that the server supports for specified URL. This can be used to check the functionality of a web server by requesting '*' instead of a specific resource."

Assuming the server supports it - there appears to be a way - or am I reading this incorrectly ?
Jul 23 '10 #3
JKing
1,206 Recognized Expert Top Contributor
Options will return the methods a specified URL supports. This will return something like GET, HEAD, POST. Using the wildcard * instead of specifying a URL will return the methods the server supports instead of a specific URL. Also returning GET, HEAD, POST etc.
Jul 23 '10 #4
tur130
16 New Member
D'oh!

Thanks for answering.
Jul 23 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1656
by: Jason | last post by:
I have two applications that I wrote that use asp and javascript source files. Recently both of these applications starting acting strange on my test box. Image icons will randomly stop showing...
1
2497
by: cs | last post by:
foreach (string file in Directory.GetFiles( System.Environment.GetFolderPath (System.Environment.SpecialFolder.InternetCache)) ) { Console.WriteLine(file.ToString()); } I can only get the...
8
2370
by: RML | last post by:
hey guys, i am looking at this piece of code that lists numbers of files in a directory. i want to convert it so it lists the files in th directory that end with .doc. i cant seem to get it to...
1
9767
by: MAF | last post by:
How can I create a list of domain users and groups?
7
32865
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
9
1844
by: skijor | last post by:
I am converting a raw html webiste to use javascript. A lot of the html code is duplicated in many pages. Some of that code can be consolidated into javacript but I don't want to add the same...
1
2562
by: mmohanra | last post by:
I am trying to list files in a folder in a remote server. I am using Scripting.FileSystemObject. This seems to be really slow. After a long time the connection times out. Is there any other way to...
4
5920
by: jake | last post by:
Can someone please give me an example on how to call a wcf method that resides on a different domain from JavaScript (not from C#/asp.net)? All the examples that I have seen show how to call from...
8
19827
by: Yew12 | last post by:
Hi, The following code is supposed to stop a booking being made if falls between another bookings start and end date. Unfortunately I get the following error message PLS-00410: duplicate...
3
2605
by: froditus | last post by:
Hello everyone, is it possible to list files from directory other than in apache web directory? my web folder is placed on c:/ and i put my files in windows directory "d:/files/images/". I...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.