Ex DOM Storageãããããã¨å®å¿ãã¦Web Storage使ãã¾ãããªWebã¢ããªãä½ãã¨è½ã¨ãç©´ã«åµã件
Ex DOM Storageã使ã£ã¦ãã¦åµã£ãã
é ããããããªãããã ã£ãããªãã¨ãã¨ããããã®è§£æ±ºã¯ã§ããã®ã§ã
ãã®ä»¶ã«ã¤ãã¦è©±ãããã
Ex DOM Storage
IE6,7ã§Web Storageã使ããããã«ããã©ã¤ãã©ãªã
userData behaviorã¨htcã使ã£ã¦å®è£
ããã¦ããã
è½ã¨ãç©´
ãã¡ãã®ãªãªã¼ã¹åç¥ã¨ã³ããªã§è¨åããã¦ãããã®ã®ä»ã«ãã
userData behaviorã«ã¯Web Storageã®æ©è½ãåç¾ã§ããªãå¶éãããäºãåãã£ãã
Ex DOM Storage をリリースしました - Yet Another Hackadelic
å¥ãã£ã¬ã¯ããªã¨ãã¼ã¿ãå ±æåºæ¥ãªã
userData behaviorã¯åããã£ã¬ã¯ããªå ã§ãªãã¨ãã¼ã¿ãå ±æåºæ¥ãªãã
a UserData store is available only in the same directory and with the same protocol used to persist the store.
http://msdn.microsoft.com/en-us/library/ms531424(VS.85).aspx
Web Storageã®æ©è½ãã¢ç¨ã«1åHTMLãç¨æãã¦ããã¨ãããã®ãªãä½ãåé¡ãªãã
ããããä¾ãã°Railsã®scaffoldã§ä½ãããindexã¨newã¯pathã
"/hoge"ã¨"/hoge/new"ã¨ãããµãã«ãªã£ã¦ãããããããã®éã§ãã¼ã¿ãå
±æåºæ¥ãªãã
("/hoge/ã¨"/hoge/new"ãªãå
±æåºæ¥ã")
ãã¡ã¤ã³æ¯ã®ãã¼ã¿å®¹éä¸éããã
ããå½ããåã®äºã«æããã ãããã
å¥ãã£ã¬ã¯ããªã¨ãã¼ã¿ãå
±æåºæ¥ãªãäºã¨åãããã¨
æãããäºãèµ·ããã
ä¾ãã°"/hoge/:id/edit"ã¨ãã£ãåçã«ä½ããã"ãã£ã¬ã¯ããªãç°ãªã"URLã®ãã¼ã¸ä¸ã§
localStorageã使ããæã
æ¶ãå¿ããã»æ¶ãæããçãã¦å°ããã¤å®¹éã使ã£ã¦ããã¨ããã
使ã£ã容éã®åè¨ããã¡ã¤ã³æ¯ã®ãã¼ã¿å®¹éä¸éã«éãã¦ãã¾ãã°ã
å
¨ã容éã使ã£ã¦ããªãã¾ã£ãããªãã£ã¬ã¯ããªä¸ã§ãã£ã¦ãã
localStorageã«ãã¼ã¿ãå
¥ããäºãã§ããªããªã£ã¦ãã¾ãã
åçã«ä½ãããç¡æ°ã®ãã£ã¬ã¯ããªã®ä¸ã«å®¹éãé£ã£ã¦ããã®ãæ£ãã°ã£ã¦ãããã
ååããã®ã¯é常ã«å°é£ã§ããã
ãã¾ãã«ãæ®ã容é以ä¸ã®ãã¼ã¿ãå
¥ãããã¨ããã¨catchã§ããªãã¨ã©ã¼ã«ãªããã
ãã¡ã¤ã³æ¯ã®æ®ã容éã¯åç
§ä¸è½ã§ããã£ãããªãã¨ãã®ä¸ãªãã
å¥ãã£ã¬ã¯ããªã¨ãã¼ã¿ãå ±æåºæ¥ãªã件ã®å¯¾ç
ä»ã®ã¨ãã極ååããã£ã¬ã¯ããªå
ã§å®çµãããããã«ãããããªãã
ç°¡åãªãã®ã ã¨"/hoge"ã¨"/hoge/new"ã§ã¯ãªã"/hoge/ã¨"/hoge/new"ã«ããã¨ãã
"/hoge"ã§localStorageãæ¶ãã¦ã"/hoge/:id/edit"ã«é·ç§»ããå ´åçã¯ã
"/hoge"ã§cookieã§ãã©ã°ãç«ã¦ã¦ãé·ç§»å
ã®"/hoge/:id/edit"ã§localStorageãæ¶ãçã®å¯¾å¿ãããã
ã©ããã¦ããã£ã¬ã¯ããªãã¾ããã§ä½ãããããå ´åã¯ã
Ex DOM Storageãèªã¿è¾¼ãã å¾localStorageã«ä½ããããJavaScriptãå®è¡ããHTMLã
è¿ãã ãã®actionãå®è£
ãã¦ããããiframeã§èªã¿è¾¼ãäºã§ã
å¥ãã£ã¬ã¯ããªä¸ã®localStorageãæä½ããçã¨ããäºããã£ãã
ãããã®å¯¾å¿ã¯å
¨ã¦ã¢ãããã¯ãªãã®ã ããæå¾ã®ä¾ãçºå±ãããã°ã
ãã£ã¬ã¯ããªãã¾ããã§ãã¼ã¿å
±æåºæ¥ãªã件ã¯å®å
¨ã«è§£æ±ºããã®ã§ã¯ãªããã¨æãã
ç¹å®ãã£ã¬ã¯ããªä¸ã«Ex DOM Storageãèªã¿è¾¼ãã§ä½¿ç¨å¯è½ã«ããã ãã®htmlãé
ç½®ãã
å®éã«ä½¿ããã¼ã¸ã§ã¯ãã®htmlãiframeã§èªã¿è¾¼ã¿ããçµç±ã§ãã¼ã¿ãå
±æããã
ã¨ããäºã«ãªãã¨æãã
expiresã§ãã¡ã¤ã³æ¯ã®ãã¼ã¿å®¹é溢ããé²ã
ã¾ããã®ä»¶ã«é¢ãã¦sessionStorageã®ä½¿ç¨ã¯è§£æ±ºçã«ãªããªãã
ã©ãããcookieã§ãã©ã°ãç«ã¦ã¦åæåæã«ãã©ã°ãç«ã£ã¦ãªãã£ããsessionStorageã空ã«ãã
ã¨ãã£ãæãã®å®è£
ãªã®ã§ãäºåº¦ã¨èªã¿è¾¼ã¾ããªããã£ã¬ã¯ããªã«ã´ããæºã¾ã£ã¦ãããååãããªãã
ããã§ãexdomstorage.htcã®ä¸ã®exdomstorage_impl.jsã®é¨åã«æãå
¥ãã
element.save()ã®åã«expiresãè¨å®ããããã«ããã
expiresãç¸å½çãå¼·ããå ·ä½çã«ã¯ãããªæãã
- æéåãã«ãªãã¨userData behaviorã«ã¢ã¯ã»ã¹åºæ¥ãªããªãâlocalStorageã®èªã¿æ¸ããã§ããªããªã
- æéåãã«ãªã£ãå¾IEãåèµ·åããã¨ã¢ã¯ã»ã¹åºæ¥ãããã«ãªã£ã¦ãã
- IEèµ·åä¸ã«æéåãã«ãªã£ã¦ã容éã¯è§£æ¾ãããªã
åºæ¬çã«ã¦ã¼ã¶ã®è©²å½ãã£ã¬ã¯ããªä¸ã§ã®æä½ä¸ã«æéåãã«ãªãã¨å°ãã®ã§ã
é·ãã«è¨å®ããã®ãããã¨æãã
æ¶ãã®ã«å¤±æããã¾ã¾é·æéæ¾ç½®ããããã®ãèªåã§ååããããããªæãã
ææ³ã¨ã
ããããããã¦ãã¦ãæºããªãã¨æãã
å¤ã§å
¬éããWebã¢ããªã§ä½¿ãã®ã¯ã¡ãã£ã¨ã¾ã å³ããã®ã§ã¯ãªãããªãã¨ããæ°ãããã