|
| |||||||
![]() | Welcome to iWEBTOOL Talk, where you talk about
webmaster-related stuff.
1 Register
2 Browse the board
3 Discuss whatever may interest you! | |||||||||||||
![]() |
| | Thread Tools | Search this Thread | Display Modes |
| | #1 |
| Newcomer Join Date: May 2007
Posts: 2
![]() | 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 |
| |
|
| |||||||
| | #2 |
| Member Join Date: Apr 2007
Posts: 174
![]() | 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. |
| |
| | #3 |
| Newcomer Join Date: May 2007
Posts: 2
![]() | 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! |
| |
(Threads which have no activity for more than 30 days are automatically closed.) |
| Quick Reply | ||
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |