|
| | |||||||
| Internet Explorer Discuss IE7 or any other IE version. |
| | LinkBack | Thread Tools |
| |||
| source attribute of onstorage event in DOM storage is null Hi, I'm using DOM storage and the onstorage event. In msdn blog about IE8 it says that IE8 support the onstorage event which includes the ource to the window of the origin. I'm able to see e.url but e.source gives me null. http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx "Finally, we also included improved support of the updated onstorage HTML 5.0 event returned when the storage is changed. We now return the URI when the local storage is changed, so that handlers for pages can know who carried out the latest transaction in the storage space in addition to providing the source to the window of the origin." My test: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Panel</title> <script type="text/javascript"> var addStorageEvent = function() { document.attachEvent("onstorage", function (e) { alert('storage event'); alert(e.url); alert(e.source); }); } i=1; var setStorage = function() { i++; window.localStorage['test'] = i; } var getStorage = function() { var val = window.localStorage['test']; alert(val); } </script> </style> </head> <body> <h1>DOM STORAGE TEST</h1> <button onClick="addStorageEvent();">attach event</button> <button onClick="setStorage();">set stroage</button> <button onClick="getStorage();">get storage</button> </body> </html> Thanks ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/communities...plorer.general |
| |||
| Re: source attribute of onstorage event in DOM storage is null HTML 5 Doctype declaration - http://www.w3schools.com/tags/html5_doctype.asp I haven't tested your test case, but I assume that in order to use HTML 5 support in IE8, you have to tell the browser that you are using it. I see that you have made multiple posts to other NG's and MSDN forums. These are all user Communities, manned by volunteers and enthusiasts. MSFT moderate but rarely answer questions there. Your best bet is to post a comment on the IE blog on the thread - http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx MS maintain an issue tracking database for IE8 at connect.microsoft.com. You can view a list of outstanding 'issues' and wish lists, there. Regards. "benbro" <benbro@discussions.microsoft.com> wrote in message news:15E3FB40-F306-482A-ACAC-00B108E87C37@microsoft.com... > Hi, > > I'm using DOM storage and the onstorage event. > In msdn blog about IE8 it says that IE8 support the onstorage event which > includes the ource to the window of the origin. > I'm able to see e.url but e.source gives me null. > > http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx > "Finally, we also included improved support of the updated onstorage HTML > 5.0 event returned when the storage is changed. We now return the URI when > the local storage is changed, so that handlers for pages can know who > carried > out the latest transaction in the storage space in addition to providing > the > source to the window of the origin." > > My test: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > <title>Panel</title> > <script type="text/javascript"> > var addStorageEvent = function() { > document.attachEvent("onstorage", function (e) { > alert('storage event'); > alert(e.url); > alert(e.source); > }); > } > > i=1; > var setStorage = function() { > i++; > window.localStorage['test'] = i; > } > > var getStorage = function() { > var val = window.localStorage['test']; > alert(val); > } > </script> > > </style> > </head> > <body> > <h1>DOM STORAGE TEST</h1> > <button onClick="addStorageEvent();">attach event</button> > <button onClick="setStorage();">set stroage</button> > <button onClick="getStorage();">get storage</button> > </body> > </html> > > Thanks > > ---------------- > This post is a suggestion for Microsoft, and Microsoft responds to the > suggestions with the most votes. To vote for this suggestion, click the "I > Agree" button in the message pane. If you do not see the button, follow > this > link to open the suggestion in the Microsoft Web-based Newsreader and then > click "I Agree" in the message pane. > > http://www.microsoft.com/communities...plorer.general |
| |||
| Re: source attribute of onstorage event in DOM storage is null Here is your corrected example... please validate your markup first. Works as expected for me. <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Panel</title> <script type="text/javascript"> var addStorageEvent = function() { document.attachEvent("onstorage", function (e) { alert('storage event'); alert(e.url); alert(e.source); }); } i=1; var setStorage = function() { i++; window.localStorage['test'] = i; } var getStorage = function() { var val = window.localStorage['test']; alert(val); } </script> </head> <body> <h1>DOM STORAGE TEST</h1> <button onClick="addStorageEvent();">attach event</button> <button onClick="setStorage();">set stroage</button> <button onClick="getStorage();">get storage</button> </body> </html> "benbro" <benbro@discussions.microsoft.com> wrote in message news:15E3FB40-F306-482A-ACAC-00B108E87C37@microsoft.com... > Hi, > > I'm using DOM storage and the onstorage event. > In msdn blog about IE8 it says that IE8 support the onstorage event which > includes the ource to the window of the origin. > I'm able to see e.url but e.source gives me null. > > http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx > "Finally, we also included improved support of the updated onstorage HTML > 5.0 event returned when the storage is changed. We now return the URI when > the local storage is changed, so that handlers for pages can know who > carried > out the latest transaction in the storage space in addition to providing > the > source to the window of the origin." > > My test: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > <title>Panel</title> > <script type="text/javascript"> > var addStorageEvent = function() { > document.attachEvent("onstorage", function (e) { > alert('storage event'); > alert(e.url); > alert(e.source); > }); > } > > i=1; > var setStorage = function() { > i++; > window.localStorage['test'] = i; > } > > var getStorage = function() { > var val = window.localStorage['test']; > alert(val); > } > </script> > > </style> > </head> > <body> > <h1>DOM STORAGE TEST</h1> > <button onClick="addStorageEvent();">attach event</button> > <button onClick="setStorage();">set stroage</button> > <button onClick="getStorage();">get storage</button> > </body> > </html> > > Thanks > > ---------------- > This post is a suggestion for Microsoft, and Microsoft responds to the > suggestions with the most votes. To vote for this suggestion, click the "I > Agree" button in the message pane. If you do not see the button, follow > this > link to open the suggestion in the Microsoft Web-based Newsreader and then > click "I Agree" in the message pane. > > http://www.microsoft.com/communities...plorer.general |
| |||
| Re: source attribute of onstorage event in DOM storage is null @rob: I've changed the DOCTYPE as you suggested. I also changed the encoding to utf-8 so and now it validates without errors: <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> I'm still getting null for the e.source. When I click on the "attach event" button and then on the "set storage" button I'm getting: alert: 'storage event' alert: 'http://localhost/storage.html alert: null The third alert should be the source window object. I'm running the html page on IE8 using Apache web server on localhost on windows XP fully updated. Am I doing something wrong? Thanks. "rob^_^" wrote: > Here is your corrected example... please validate your markup first. Works > as expected for me. > > <!DOCTYPE HTML> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > <title>Panel</title> > <script type="text/javascript"> > var addStorageEvent = function() { > document.attachEvent("onstorage", function (e) { > alert('storage event'); > alert(e.url); > alert(e.source); > }); > } > > i=1; > var setStorage = function() { > i++; > window.localStorage['test'] = i; > } > > var getStorage = function() { > var val = window.localStorage['test']; > alert(val); > } > </script> > > </head> > <body> > <h1>DOM STORAGE TEST</h1> > <button onClick="addStorageEvent();">attach event</button> > <button onClick="setStorage();">set stroage</button> > <button onClick="getStorage();">get storage</button> > </body> > </html> > > > "benbro" <benbro@discussions.microsoft.com> wrote in message > news:15E3FB40-F306-482A-ACAC-00B108E87C37@microsoft.com... > > Hi, > > > > I'm using DOM storage and the onstorage event. > > In msdn blog about IE8 it says that IE8 support the onstorage event which > > includes the ource to the window of the origin. > > I'm able to see e.url but e.source gives me null. > > > > http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx > > "Finally, we also included improved support of the updated onstorage HTML > > 5.0 event returned when the storage is changed. We now return the URI when > > the local storage is changed, so that handlers for pages can know who > > carried > > out the latest transaction in the storage space in addition to providing > > the > > source to the window of the origin." > > > > My test: > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > > "http://www.w3.org/TR/html4/strict.dtd"> > > <html> > > <head> > > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > > <title>Panel</title> > > <script type="text/javascript"> > > var addStorageEvent = function() { > > document.attachEvent("onstorage", function (e) { > > alert('storage event'); > > alert(e.url); > > alert(e.source); > > }); > > } > > > > i=1; > > var setStorage = function() { > > i++; > > window.localStorage['test'] = i; > > } > > > > var getStorage = function() { > > var val = window.localStorage['test']; > > alert(val); > > } > > </script> > > > > </style> > > </head> > > <body> > > <h1>DOM STORAGE TEST</h1> > > <button onClick="addStorageEvent();">attach event</button> > > <button onClick="setStorage();">set stroage</button> > > <button onClick="getStorage();">get storage</button> > > </body> > > </html> > > > > Thanks > > > > ---------------- > > This post is a suggestion for Microsoft, and Microsoft responds to the > > suggestions with the most votes. To vote for this suggestion, click the "I > > Agree" button in the message pane. If you do not see the button, follow > > this > > link to open the suggestion in the Microsoft Web-based Newsreader and then > > click "I Agree" in the message pane. > > > > http://www.microsoft.com/communities...plorer.general > |
| |||
| Re: source attribute of onstorage event in DOM storage is null Hi, e.source is not listed in the MSDN specifications for the onstorage event argument properties. http://msdn.microsoft.com/en-us/libr...59(VS.85).aspx Available Properties clientX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. clientY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. url Sets or retrieves the fully qualified URL of the document that fired the event. screenX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the user's screen. screenY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen. type Sets or retrieves the event name from the event object. The original IEBlog post was made in the Beta era. As I said it is best to post back on the IEBlog thread if you want to take it further. We are not MSFT here, just volunteers, although I did learn a lot from the exercise. Regards. "benbro" <benbro@discussions.microsoft.com> wrote in message news:F44DD49C-E53B-45F6-B887-0E506791B5EB@microsoft.com... > @rob: > > I've changed the DOCTYPE as you suggested. > I also changed the encoding to utf-8 so and now it validates without > errors: > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> > > I'm still getting null for the e.source. > > When I click on the "attach event" button and then on the "set storage" > button > I'm getting: > alert: 'storage event' > alert: 'http://localhost/storage.html > alert: null > > The third alert should be the source window object. > I'm running the html page on IE8 using Apache web server on localhost > on windows XP fully updated. > > Am I doing something wrong? > > Thanks. > > > > "rob^_^" wrote: > >> Here is your corrected example... please validate your markup first. >> Works >> as expected for me. >> >> <!DOCTYPE HTML> >> <html> >> <head> >> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> >> <title>Panel</title> >> <script type="text/javascript"> >> var addStorageEvent = function() { >> document.attachEvent("onstorage", function (e) { >> alert('storage event'); >> alert(e.url); >> alert(e.source); >> }); >> } >> >> i=1; >> var setStorage = function() { >> i++; >> window.localStorage['test'] = i; >> } >> >> var getStorage = function() { >> var val = window.localStorage['test']; >> alert(val); >> } >> </script> >> >> </head> >> <body> >> <h1>DOM STORAGE TEST</h1> >> <button onClick="addStorageEvent();">attach event</button> >> <button onClick="setStorage();">set stroage</button> >> <button onClick="getStorage();">get storage</button> >> </body> >> </html> >> >> >> "benbro" <benbro@discussions.microsoft.com> wrote in message >> news:15E3FB40-F306-482A-ACAC-00B108E87C37@microsoft.com... >> > Hi, >> > >> > I'm using DOM storage and the onstorage event. >> > In msdn blog about IE8 it says that IE8 support the onstorage event >> > which >> > includes the ource to the window of the origin. >> > I'm able to see e.url but e.source gives me null. >> > >> > http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx >> > "Finally, we also included improved support of the updated onstorage >> > HTML >> > 5.0 event returned when the storage is changed. We now return the URI >> > when >> > the local storage is changed, so that handlers for pages can know who >> > carried >> > out the latest transaction in the storage space in addition to >> > providing >> > the >> > source to the window of the origin." >> > >> > My test: >> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" >> > "http://www.w3.org/TR/html4/strict.dtd"> >> > <html> >> > <head> >> > <meta http-equiv="Content-Type" content="text/html; >> > charset=iso-8859-1"> >> > <title>Panel</title> >> > <script type="text/javascript"> >> > var addStorageEvent = function() { >> > document.attachEvent("onstorage", function (e) { >> > alert('storage event'); >> > alert(e.url); >> > alert(e.source); >> > }); >> > } >> > >> > i=1; >> > var setStorage = function() { >> > i++; >> > window.localStorage['test'] = i; >> > } >> > >> > var getStorage = function() { >> > var val = window.localStorage['test']; >> > alert(val); >> > } >> > </script> >> > >> > </style> >> > </head> >> > <body> >> > <h1>DOM STORAGE TEST</h1> >> > <button onClick="addStorageEvent();">attach event</button> >> > <button onClick="setStorage();">set stroage</button> >> > <button onClick="getStorage();">get storage</button> >> > </body> >> > </html> >> > >> > Thanks >> > >> > ---------------- >> > This post is a suggestion for Microsoft, and Microsoft responds to the >> > suggestions with the most votes. To vote for this suggestion, click the >> > "I >> > Agree" button in the message pane. If you do not see the button, follow >> > this >> > link to open the suggestion in the Microsoft Web-based Newsreader and >> > then >> > click "I Agree" in the message pane. >> > >> > http://www.microsoft.com/communities...plorer.general >> > |
| |||
| Re: source attribute of onstorage event in DOM storage is null The comments to: http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx are disabled. I don't know where to post bug reports. Thanks "rob^_^" wrote: > Hi, > > e.source is not listed in the MSDN specifications for the onstorage event > argument properties. > > http://msdn.microsoft.com/en-us/libr...59(VS.85).aspx > > Available Properties > > clientX Sets or retrieves the x-coordinate of the mouse pointer's position > relative to the client area of the window, excluding window decorations and > scroll bars. > clientY Sets or retrieves the y-coordinate of the mouse pointer's position > relative to the client area of the window, excluding window decorations and > scroll bars. > url Sets or retrieves the fully qualified URL of the document that fired the > event. > screenX Sets or retrieves the x-coordinate of the mouse pointer's position > relative to the user's screen. > screenY Sets or retrieves the y-coordinate of the mouse pointer's position > relative to the user's screen. > type Sets or retrieves the event name from the event object. > > > The original IEBlog post was made in the Beta era. As I said it is best to > post back on the IEBlog thread if you want to take it further. We are not > MSFT here, just volunteers, although I did learn a lot from the exercise. > > Regards. > > "benbro" <benbro@discussions.microsoft.com> wrote in message > news:F44DD49C-E53B-45F6-B887-0E506791B5EB@microsoft.com... > > @rob: > > > > I've changed the DOCTYPE as you suggested. > > I also changed the encoding to utf-8 so and now it validates without > > errors: > > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> > > > > I'm still getting null for the e.source. > > > > When I click on the "attach event" button and then on the "set storage" > > button > > I'm getting: > > alert: 'storage event' > > alert: 'http://localhost/storage.html > > alert: null > > > > The third alert should be the source window object. > > I'm running the html page on IE8 using Apache web server on localhost > > on windows XP fully updated. > > > > Am I doing something wrong? > > > > Thanks. > > > > > > > > "rob^_^" wrote: > > > >> Here is your corrected example... please validate your markup first. > >> Works > >> as expected for me. > >> > >> <!DOCTYPE HTML> > >> <html> > >> <head> > >> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > >> <title>Panel</title> > >> <script type="text/javascript"> > >> var addStorageEvent = function() { > >> document.attachEvent("onstorage", function (e) { > >> alert('storage event'); > >> alert(e.url); > >> alert(e.source); > >> }); > >> } > >> > >> i=1; > >> var setStorage = function() { > >> i++; > >> window.localStorage['test'] = i; > >> } > >> > >> var getStorage = function() { > >> var val = window.localStorage['test']; > >> alert(val); > >> } > >> </script> > >> > >> </head> > >> <body> > >> <h1>DOM STORAGE TEST</h1> > >> <button onClick="addStorageEvent();">attach event</button> > >> <button onClick="setStorage();">set stroage</button> > >> <button onClick="getStorage();">get storage</button> > >> </body> > >> </html> > >> > >> > >> "benbro" <benbro@discussions.microsoft.com> wrote in message > >> news:15E3FB40-F306-482A-ACAC-00B108E87C37@microsoft.com... > >> > Hi, > >> > > >> > I'm using DOM storage and the onstorage event. > >> > In msdn blog about IE8 it says that IE8 support the onstorage event > >> > which > >> > includes the ource to the window of the origin. > >> > I'm able to see e.url but e.source gives me null. > >> > > >> > http://blogs.msdn.com/ie/archive/200...e8-beta-2.aspx > >> > "Finally, we also included improved support of the updated onstorage > >> > HTML > >> > 5.0 event returned when the storage is changed. We now return the URI > >> > when > >> > the local storage is changed, so that handlers for pages can know who > >> > carried > >> > out the latest transaction in the storage space in addition to > >> > providing > >> > the > >> > source to the window of the origin." > >> > > >> > My test: > >> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > >> > "http://www.w3.org/TR/html4/strict.dtd"> > >> > <html> > >> > <head> > >> > <meta http-equiv="Content-Type" content="text/html; > >> > charset=iso-8859-1"> > >> > <title>Panel</title> > >> > <script type="text/javascript"> > >> > var addStorageEvent = function() { > >> > document.attachEvent("onstorage", function (e) { > >> > alert('storage event'); > >> > alert(e.url); > >> > alert(e.source); > >> > }); > >> > } > >> > > >> > i=1; > >> > var setStorage = function() { > >> > i++; > >> > window.localStorage['test'] = i; > >> > } > >> > > >> > var getStorage = function() { > >> > var val = window.localStorage['test']; > >> > alert(val); > >> > } > >> > </script> > >> > > >> > </style> > >> > </head> > >> > <body> > >> > <h1>DOM STORAGE TEST</h1> > >> > <button onClick="addStorageEvent();">attach event</button> > >> > <button onClick="setStorage();">set stroage</button> > >> > <button onClick="getStorage();">get storage</button> > >> > </body> > >> > </html> > >> > > >> > Thanks > >> > > >> > ---------------- > >> > This post is a suggestion for Microsoft, and Microsoft responds to the > >> > suggestions with the most votes. To vote for this suggestion, click the > >> > "I > >> > Agree" button in the message pane. If you do not see the button, follow > >> > this > >> > link to open the suggestion in the Microsoft Web-based Newsreader and > >> > then > >> > click "I Agree" in the message pane. > >> > > >> > http://www.microsoft.com/communities...plorer.general > >> > > |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 'null" is null or not an object | torpedo21 | Internet Explorer | 1 | 12-19-2007 10:10 AM |
| "Error: 'null' is null or not an object" when trying to view video | cse | Internet Explorer | 2 | 12-18-2007 09:40 AM |
| Event Source: DCOM | David F. Sage | Windows XP | 0 | 07-25-2007 11:50 PM |
| Urgent: Storage Card Mount and UnMount Event WM 5.0 | Krish | Pocket PC General | 1 | 04-18-2007 01:15 PM |
| Event ID: 333 - Event Source:Application Popup | SF | Windows XP | 0 | 01-04-2007 03:31 AM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |