-
Javascript cookies
Hi all, I've been trying to set, get and delete js cookies for a while now, although they seem to set (from what I can tell) I can't seem to do what else I need with them. This is what I'm trying to do: Function1 - setCookie (sets a cookie called 'saveAndExit' - that's it, no expiry date) Function2 - useCookie (checks to see if a cookie called 'saveAndExit' exists and if it does alert("COOKIE WORKS") and then deletes the cookie If it doesn't exist alert("cookie does not exists") Could anyone assist with this? It's been driving me insane for days! Thanks.
-
Disable button WITHOUT using onClick
Hi all, I need to do the following: When a button is clicked, the button then disables (as well as running its normal function). Obviously I'm used to using this.disabled=true but in this instance I cannot access the onClick in the <input> tag because the page is hard coded by a third party application. So I'm trying to make a function which locates the button, notices if it's been clicked and disables it on click. Seems easy to me! However I cannot make it work! Here are the two variations I've tried (both call the function in the page onLoad): function disableButton() { document.getElementById('submit').onclick=document.getElementById('submit').disabled=true; } and.... function disableButton() { if(document.getElementById('submit').onclick=true) { document.getElementById('submit').disabled=true; } } Any ideas? Because this seems like it should be way easier than I'm finding it right now! Thanks
-
Need solution for popup issue
Arghhh now I've hit more problems! Is there a way to do this using js and cookies? Cheers
-
Countdown timer javascript with cookies
Hi there, I have a js countdown timer which counts down from 60 seconds to zero and when it hits zero it redirects the page. Only problem is that when the user refreshes the page the timer obviously reverts to 60 seconds. Does anyone have any code which would turn this into a cookie so that the location of the timer is stored each time the page is refreshed and then the timer continues from where it left off? My timer is using setTimeout. I've seen a couple of examples of this on various forums but none actually seem to work - my cookies are switched on. Also, I cannot use form, input or anything else like this due to the third party software we're using (long story!). Any help would be lovely. Thanks!
-
Having issues with page structure and links
You could also call the CSS and images by using the full path for example http://www.yoursite.com/images/ Surely that would be the simplest way? You could also use <base href="http://www.yoursite.com/" /> with the <head> section to generate a prefix on all URL's and then just put /images or /css or whatever before your link. (:
-
Passing parent properties to child window
Hey, In javascript I need to pass a variable or function or something from the parent window to the child window. There will be a URL in the parent that needs to be passed into the child so when you click on the link in the child window it pulls in the link from the parent's js. Like this (ignore my rubbish javascript as I'm just writing it to explain my point!)... Parent window var variableName="http://www.google.com" (send variable to child window) Child window (pick up variable from parent window and drop it into the link's URL) <a href="(variableName);">google</a> This might seem like a crazy way of doing things but it's totally neccasery in the project I'm working on for various reasons. Not sure if its a variable it needs but either way it needs to be in the js somewhere in the parent and the child needs to read it within the link. Everywhere I've looked on the internet shows how to do this with forms etc but I can't make it work for a URL. Thanks (:
-
Need solution for popup issue
Thanks for this. Couldn't actualy use it because our pages are generated through a third party application which is all ASP. However because these pages are only to be used locally within my relatively small company, I'm now running a small VB script on any machines which need it which searches for the browser window by title and location and then disables the close button. Not ideal but works (: Have a javascript question actually which I'll post in a new topic. Cheers.
-
Need solution for popup issue
Hey there. I have an issue which I can't seem to solve with a div or a popup (window.open). I'm sure there must be a workaround but I'm just not seeing it at the moment. My initial thought: is there a way to create a fixed div which, when the parent window is refreshed or reloaded, the div doesn't reload? I have a timer which needs to sit in a popup of some description. The page behind the popup will be reloaded but the timer in the popup continues to count down. I also need the user to not be able to close the popup, or, if they close the popup - the timer continues to count down. So, I realise that it's not possible to disable the close button on a browser window but is there another way around this? Thanks!