PHP Interferes With LastModified Function - Shows The Date A Page Was Last Modified
Oct 6, 2009
I have found a useful script at [URL] which shows the date a page was last modified. I have put it at [URL] where it works perfectly. But the same script with a PHP file extension as here [URL] only shows the current time. There is no PHP in the page, but somehow the PHP processor seems to be upsetting it.
I have been able to use javascript to place the last modified date in the bottom left corner of my document however I do not need the time with it. How do I use the substring() method on the lastModified property? Here is what it looks like.
<script type="text/javascript"> <!--Hide from old browsers var today = new Date() var dayofweek = today.toLocaleString() dayLocate = dayofweek.indexOf(",") weekDay = dayofweek.substring(0, dayLocate) newDay = dayofweek.substring() [Code]..
I use NETSCAPE established a catalog page in XML, which uses Javascript-DOM to add, remove and sort the products by their prices. But which Javascript function should I use in order to save the modified page into local hard disk? to sort products as well.
Apparently, ` new Date() ` reads it correctly, though problems can occur if the browser returns only two digits for the year. In particular, time zone, field order and separators may vary. It is also reliant on the server's clock having been correctly set at the time of upload. See the URL below.
The original page is visible for a very short moment, before the modifications done with the javascript are visible. This is logic to me, sinceI add my javascriptat the end of the page, as recomended. For the user it is a little confusing. Is there a way that the user sees only the page with the javascript modifications?
Basically, I want a page to load, and then every 5 seconds be able to check a file to see if it has been modified since the last time the page loaded. If it has refresh, if not then wait 5 more seconds. Is this possible using javascript?
I'm searching for a pre-made cookie script or a tutorial on making a simple session cookie. Just a cookie to make sure users are getting most current copies of HTML pages on my site.
Up till now I've just had messages on each page instructing them to refresh to make sure the have the latest version.
function wr(s) { //Just got tired of writing document.write, //so I created a shorthand version document.write(s); }
function lm() { //I know this can be shorter but the original script //tried to format the outputstring, wichh did not //work in Mozilla, so I commented a lot out //and this is what's left of it... var s = document.lastModified; return s; }
function lmstring() { var s = "This page was last modified at: "; s += lm(); s += "."; return s; }
This _should_ return the date and time the document was last modified (saved), however in Mozilla (1.4; Windows ME) it will return the actual current date and time (as if I'd used "new Date()"). In IE (5.50) it behaves as I expect.
What am I doing wrong (or is it a Mozilla bug?).
(The script is in an external .js file, if that should make any difference)
On this page, when you click one of the item titles, a pop up box appears. Depending on the size, the music player interferes with it (displays in front and blocks some content). Is there a way to make the music player appear behind the pop up?
I've been looking without success for a slide show program that will rotate web pages as opposed to just images. Am I best off just using a banner rotation script or is there something out there that is available for that purpose. The wish list is for a full page rotation ( the page uses SSI) possible fading of images in IE and being able to vary the time of each image. Asking alot?
Does anybody know how to load an IFrame in the background of the browser, without interfering with running JQuery animations?
I have this page that contains an IFrame. Using JQuery I set the src attribute to a certain url.
But my page is also showing an animating span continuously. (kind of progress-bar). When the IFrame is loading a large image of the external url, the browser stops temporarily, until the images is loaded, so my animation is stopped for an instant, and then continues.
I have the below function and I keep getting the error Lid is not defined.
<script type="text/javascript"> function loadTips(file,ID,File,id){ alert(file); alert(ID);
[Code]....
So my alert Lid comes up with txtHintLees, so it is working up until the alert. Which leads me to believe that maybe it doesn't like being wrapped in "", without "" though firebug halts the process. I tried wrapping it in {} e.g. {loadXMLDocRefresh(File,id)} but that wasn't liked either. I'll stop my list of things I tried that don't work now.
I have a javascript that displays couple of buttons, which are directional (e.g., click button it goes to a particular page). I need to have these buttons shows up multiple times in same page, each represent a different direction but buttons themself are from the same gif file. What's the most effecient way to do this?
I'm using Drip 0.5 to test for a memory leak in some code. After reducing the page down bit by bit to find the leak, I ended up with an empty page that still leaked!
It doesn't leak the same amount each page load - sometimes it's 8192, sometimes it's 16384, sometimes even reducing the memory load. But the overall trend is an upward movement. I let it run for 10 minutes and it leaked almost 10MB, so it's about 1MB/min.
This is not a serious leak, but it's making it harder to know if a leak is caused by the js code or this other thing going on.
Has anyone else run into this? Any ideas what the problem is? I've shut down all processes, removed all IE add-ons, etc, but no change.
but for some reason if the page is long the whole page scrolls up so the top of the calendar is at the top of the browser, which actually hides the box that the date will end up in.
can anyone see how I can alter the code so that the page does not scroll up, but have the calendar show just below the box that the date will go in and the page does not scroll?
here is the full code that I am using to test this out with. code...
About the jquery Validation plugin. I need to lock the submit button on some forms to prevent multiple submissions, but I don't want to permanently lock it, in case there's a validation problem that the user needs to resolve. I did come up with a way to temporarily lock it and change the text to "Saving, Please Wait..." for a few seconds, then revert it to an unlocked submit button.
The problem I'm having is that this conflicts somehow with the jquery validation plugin. Some fields that have error messages if the user attempts to submit the form with missing data. If I use the temporary locking submit button (which uses an animation to create a duration) then these error messages do not display.
Is it possible to test for a validation value in a separate function before running this lock function? If valid, lock, if not valid, don't lock, because it isn't possible to submit an invalid form anyway. I tried wrapping the locking submit function in a setTimeout, but that didn't have any effect at all in delaying it.
I have been on this for over an hours now, it is probably something simple and/or stupid, but why doesn't this script work? I have read forums til my eyes are crossed and can't see what I am doing wrong I am new to javascript, but not programming. The point here is to create a function that compares two strings and then shows or hides a div depending on the results of the comparison. I was trying to pass in the name of the two input text boxes containing the text and the name of the div to show or hide (so that it can be used in multiple scenariios.) Right now my error message is that document.getElementById(field1).value is not a function.
However, it is appearing ont the page in Firefox for a split second when the page loads. Is there a way to stop this? The site is on localhost at the moment but I can easily upload it if need be.
I am using jQuery and BlockUI to display a "Loading..." message to theuser while the page is loading.The problem is that the "Loading..." message seems to show up AFTERthe page has loaded, not during load. Shouldn't the document.readyfire sooner than that?What am I doing wrong?
I am using Fancybox plugin and works well but for an ajax call the first few calls the popup/modal appears at the bottom of the window but later corrects itself and then is centered.
Here is an example:
Example Link
Click on the 'Foliage', 'Base' or 'Trunk' boxes in the right side column.