Welcome to Motorhomefacts, we are a thriving motorhome community (Largest in Europe). Why Not JOIN NOW and get instant access to more of the website. It costs nothing to join and only takes a few minutes. We have 200,000 different people visiting our site monthly and this amount of motorhomers in one place guarantees a fast response to any questions you may have. We also have unique facilities not found elsewhere such as our Online Logbook, stopover tracker, Motorhome directory with Ebay type feedback and the largest repository of motorhome campsites reviews found anywhere
I'm afraid it isn't good news; i've had a quick look around at java scripts and how they are trying to implement the functionality you're after, and i'm afraid that, as i first thought, they are all fundamentally flawed.
As your web pages are html the simplest solution is for you to manually add the modified date (i.e. type the date on the web page as static text), if then at some point you change the web page; also change the text that states when it was modified, does this make sense? alternatively you can keep looking for a script that will write the last modified date for you but i don't think you'll find one that works properly and consistently. the third option, which i think is probably unfeasible, is to learn a server side programming language so that the actual real last modified date can dynamically be added to the web page at the server, as opposed to adding it at the client which is what you are trying to do.
<slightly technical bit>
The problem is;
when you open a web browser and go to a web page, your browser makes a connection to the web server hosting that page and then sends a 'request' object to the server, the request includes the page you want to see along with a few other bits of information, called request headers, such as what browser you are using, your ip address etc. the server processes the request and returns a 'response' object, this includes the html that is interpreted and rendered on screen by your browser along with response headers, additional information which includes the 'last-modified' field (theoretical date that the page you have requested was modified), remember your computer, browser and any script running on your computer does not have access to the web page on the server, it only has access to what the server sends it in the response object.
the server on the other hand does have direct access to the underlying files and can access the modified date, the way you can right click on a file on your computer, select the properties of the file, and see the date the file was last modified.
so the issues; the server may well not populate the last-modified response header field with the date you expect, it may not populate it at all, a lot depends on the server being used and its configuration. also, in your scenario the modified date is simply the date the html file was modified, however most websites are far more complex, there is static html, dynamic html, database driven content and many others, and determining when the response content was last modified becomes a lot more complicated.
once your browser starts rendering the response on your screen it's referred to as a document, any java script that has been included with the response can be run, however they run on your machine and can only interact with the document and the browser, therefore scripts stating things like 'document.lastmodified' are getting the last-modified information from either what was sent in the responses last-modified field, or what you browser thinks is the last modified date, which would be determined from the last modified field or most likely be the time that the browser loaded the document if the field is not populated.
<end of slightly technical bit>
Hence as i said initially; i can't really see how client side scripts could accurately give you this functionality, as they don't actually have access to the information. it should be done on the server but as you say some providers don't support dynamic content such as ASP or PHP, and if they do you would have to pay to use it, as well as learn the programming languages.
sorry i can't provide the ideal solution (and for waffling)
Lee
p.s. the ASP code you have won't work because your host can't/won't enable it on the server, even then your website would need modifying to be compatible.
wow! Lee. That answer is fantastic. Unfortunatly its as I suspected, even If I got code or learnt asp etc my web host wont accept it. I did think the best way for me was to manually put text in each time.
So Im afraid thats it. But Thankyou so much for the info I enjoyed the techy bit to.
regards Ramos
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All times are GMT + 1 Hour Page 2 of 2Goto page Previous1, 2