Return to iWEBTOOL

Go Back   iWEBTOOL Talk > The Web and your Website > Programming > HTML > JavaScript
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
Welcome to iWEBTOOL Talk, where you talk about webmaster-related stuff.
 
Discuss topics which interest you.
With over thousands of threads (topics), we're sure you'll find something that'll interest you.
Ask for help whenever you need it.
We have thousands of members who are available to help you if you need it.
It's absolutely FREE!

 1  Register           2  Browse the board           3  Discuss whatever may interest you!
 


Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 05-03-2007, 09:06 AM   #1
markor2d2
Newcomer
 
markor2d2's Avatar
 
Join Date: May 2007
Posts: 2
markor2d2 is on a distinguished road
Default Getting properties of another file?

Hi, I have a question.
I want in one HTML page(first.html) to display some properties, for example date of last modification or file size of another file(second.html)

With document.lastModified and document.fileSize I can get properties of current-first.html file...but can I do that for second.html?
Maybe by giving path/filename of that second file...?
Lets say both files are in the same directory.

I have found some code that works for iframe, displaying properties of its content window. But I would like some general way of getting those other file properties, not just with iframes and their contents. Anyway, here's the mentioned code-original, i tried to change it to work my way, but getting null value when copying script to a <td> of a table:

<html>
<head>
<title>Last Modified</title>
<script type="text/javascript">
function getLastMod(){
var myFrm = document.getElementById('myIframe');
var lastModif = new Date(myFrm.contentWindow.document.lastModified);
document.getElementById('LastModified').innerHTML = "Prices correct as at: " +
lastModif.toLocaleString();
}
</script>
</head>

<body>
<span id="LastModified"></span>

<iframe id="myIframe" onload=getLastMod() src="prices.html" style="display:none;">
</iframe>

</body>
</html>

Thanx in advance.
Marko
markor2d2 is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
SEO Checklist
Get yourself better ranking with
our "Do-it-Yourself" SEO Checklist.
Click Here
Old 05-05-2007, 02:55 PM   #2
dessign
Member
 
dessign's Avatar
 
Join Date: Apr 2007
Posts: 174
dessign is on a distinguished road
Default Re: Getting properties of another file?

Why don't you use PHP instead of JavaScript? PHP is more accurate than JavaScript and those functions don't work on some browsers.

If you really want to make this using JavaScript, you have to run those functions (document.lastModified, document.fileSize) on second.html (which will be loaded in to the iframe) and than pass the recorded info from the second.html to first.html using innerHTML.

I would have made the script for you, but I'm really busy right now.

Good luck!
__________________
Link Exchange Directory - Join a growing link exchange network of professional websites!
Link Exchange Forum - Resources and information regarding link exchange.
dessign is offline  
Old 05-08-2007, 04:09 PM   #3
markor2d2
Newcomer
 
markor2d2's Avatar
 
Join Date: May 2007
Posts: 2
markor2d2 is on a distinguished road
Default Re: Getting properties of another file?

Hi dessign, the above code does exactly the thing you said, it can read only the properties for the loaded frame, with the innerHTML...I haven't found the general way(no frames) to read properties of any of my directory/subdirectory files using only javascript..not using php here. I'm not sure its even possible.

Thanks for your time!
markor2d2 is offline  
 
This is an Ad Revenue Sharing forum Place your advert here
Webmaster Tools Webmaster Tools Click Here
Closed Thread

(Threads which have no activity for more than 30 days are automatically closed.)



Quick Reply
Message:

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help.I get .php backup file roksolana PHP 6 04-04-2007 11:29 AM
Expload Upload - Free file hosting + File SHARING Website hemanthjava Websites for Sale 0 02-25-2007 08:09 AM
Free File Hosting + File Sharing Website hemanthjava Websites for Sale 0 02-25-2007 08:08 AM
Free File Host PWRseth Other Goods 0 11-27-2006 09:26 PM
free to post your real estate properties ! www.PinoyBroker.com Advertise your website 1 10-12-2006 05:18 AM


All times are GMT. The time now is 01:48 AM.


Powered by vBulletin v3.6.7 © 2008, Jelsoft Enterprises Ltd. SEO by vBSEO © 2006, Crawlability, Inc.