So I need to make a webshop for a school project.I wrote the javascript for my shopping cart page.I made an object Artikel and an object ArtikelList which contains an array of Artikel objects. Then I save the ArtikelList object into a cookie.But when I try to read the data from the cookie again I can't get it to work.Let me know if you need more info/details.Links with the javascript: [JavaScript] artikelToevoegenAanWinkelkarretje.js - Pastebin.com[JavaScript] winkelkarretjeInlezen.js - Pastebin.com
I've looked on several websites and several threads here regarding writing and reading cookies with javascript, and I just can't seem to get it to work. All I want is a simple text box with 2 buttons: Save and Recall. Text entered into box is saved to a cookie when "Save" is pressed, and at a later date when "Recall" is pressed the saved text will show up in the box.
I am trying to teach myself a little bit about Windows 7 gadgets, which as you probably know are built upon Javascript and HTML. My gadget it extremely simple. It only really has two functions:
–Read/Write a user-inputted date.–Calculate the difference between today's date and the user-given date.The date is outputted from an HTML form in this format:
dateYear = YYYY dateMonth = MM dateDay = DD
How would I go about saving and retrieving this data into a javascript array?
I have been using document.cookie to write and read cookies. Unfortunately, when I open my page in Internet Explorer, I don't see what I wrote to my cookie while in Netscape Navigator. Similarly, my page that I opened in Netscape doesn't see what I wrote to the cookie while in IE.
Surely there must be away for IE and Netscape to read the same cookie information ??. Otherwise, what happens if a user just happens to be browsing my page in both browsers? They'll expect things to be there, and they won't be there because one browser doesn't see what was written in the other.
Any ideas on how to get Netscape to read cookies written by IE, and visa versa?
yourdrive E ~~local~~/ 1088 647360864 29848791 647360864 29848791 * maindrive C ~~local~~/ 1088 647360864 29848791 647360864 29848791 *
So they must be being set. I must have tried a dozen cookie reading routines and I can't read either of them back! Can anyone do it? I am sure it must be simple. But all I get is "false" all the time. Code:
I'm not to good at javascript. I know VB.net, but I have not learned javascript yet. I am working on a project to get a survey to pop up for new visitors on the index page of our site.
What I need to do: On load look for a cookie, if that cookie is not found run a script telling the site to pull up another page in lightview [URL] using its own "on load" command. If the cookie is there the site will not open this other page.
What I've done: I already found a way to do most of this, but I can only use a hyper link as a trigger for the site to load the other page in lightview.
Now, I am not talking about some kind of malicious coding, or spyware writing by any means, but I do need it to be able to read the cookies from a site other than my own. At least I think this is what is required. What I am trying to accomplish is this; I have a stats package setup on a different domain than my live website and I am using it to track the stats of the users on my site other than paying for stats service through some other company, and it seems to be working just as I need it to, only I would like for it to be able to do a little bit more. Right now, all it is capturing form the user is their IP address, browser information and host information on their ISP. But, I would like for it to be able do more. I would like for it to be able to retrieve certain cookies generated by a different site and show me the information in which the cookies hold... I am not talking about displaying passwords or any such thing like that, I just need certain information.
So. I've been working on this stylesheet switcher for a school project, and basicly there are 3 layouts, "Standaard", "Zwart-wit" and "Printversie". What I want is that when you select one on (for example) the homepage, I want the other pages to apply the same stylesheet. I've been trying to do that with cookies, but it doesn't even work on one page.
PHP Code: function setup() { var current_style = read_cookie();
To read a cookie: Code: <script language=javascript> <!-- var cook=document.cookie.split(";"); var pieces=cook[0].split("="); document.writeln("Your javascript cookie is called: " + pieces[0] + "<br>"); document.writeln("Its value is: " + pieces[1]);
Is there a way to use Javascript to read a txt file, take all the words in the txt file one by one, then create a cookie out of each of them? Ideally, I'm also looking to create a prompt which asks the user if they want to set the cookie each time.The purpose of this is that I'm looking to create some basic browser based games (with information stored in txt files), so it doesn't have to be a script which works online. Everything is just run offline. If it makes a difference, it can also be, say, a doc file rather than a txt.I understand the idea of using activeX & IE to read the txt file, and after looking through this forum, I have found a way to load the entire txt into a form. I have not been able to advance my idea beyond that however.I've used Javascript before many times for webpages, but it generally comes down to me copying and pasting code, then just changing a few keys words. What I'm quickly trying to say there is that I can use js, but I'm not that much of an expert.
I'm trying to create a simple checkout system that utilizes cookies to pass information from page to page. Currently, my entire script works fine except for the read cookie portion. I cannot figure out what is wrong with it. It has been validated and the syntax is fine; it just doesn't work. I use the function with the onload call on my html file such as:
Is there a way in Javascript or Jquery to return an array of all objects underneath a certain point, ie. the mouse position. Basically, I have a series of images which link to various web pages but I have a large semi transparent image positioned over the top of the other images. I want to find the href of the background image that the mouse pointer clicks over.
I have an existing page that dynamically creates data in a popup window. I am trying to change it to use an iFrame. Is the following code valid:
The iFrame is as follows <iframe src="theframe.html" name="theframe"></iframe> "theframe.html" is an existing file initially with instructions.
In a script I do thewindow=window.open("","theframe"); thewindow.document.open(); thewindow.document.write("Some Requested Data"); thewindow.document.close();
This is done multiple times depending on what the user requests each time. Sometimes this works and sometimes it doesn't. I'm probably doing someing very wrong but I don't know where to look for reference.
I'm not really opening a window so there must be another way to do it.
What is the best way to write to an iFrame or should I not even try? Code:
I'm struggling to find out why the iframe is not being populated with a selectbox containing the album names from an XML file. majority of the code is working fine and the "alert(s)" function works perfectly and displays exactly the html I would like it to but the bits in bold are not working and are not writing the html to the iframe.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html>
I'm using this to write html tag in me textarea. Now i'm wondering what code do i need to use so that text cursor stays in textarea after i click on the button so that i don't have to click back to textarea every time i press button. Code:
I have a function that generates the code I want from form input. Beneath the form I want to create a div tag and write out the results from the form input.
How would I go about doing this?
How would I go about passing the results from the function (e.g. function newCode() {.......(code)... var scroll = X } Then I want to write out X in a div tag?
I'm trying to write a Tic-Tac-Toe program in JavaScript. I have an array containing the state of the grid. For some reason when I update the "O" for the computer's move, it doesn't show this in the updated grid. I don't understand why.[URL].. I'm brand new to JavaScript, and sometimes I accidentally use syntax from C++ or PHP when writing, so it could be something as simple as that. I just can't figure it out.
I have an HTML page with 3 frames. Lets call them top middle and bottom.
On the top frame there is a button to run some java script! When it is run I want to put some text into the middle frame, but in to a text box on a form call "testform" textbox name is "TestText"
I know I need to address the frame name but what am I missing?
Parent.frames("middle").TextText.value = "here is the data"