반응형
블로그 이미지
개발자로서 현장에서 일하면서 새로 접하는 기술들이나 알게된 정보 등을 정리하기 위한 블로그입니다. 운 좋게 미국에서 큰 회사들의 프로젝트에서 컬설턴트로 일하고 있어서 새로운 기술들을 접할 기회가 많이 있습니다. 미국의 IT 프로젝트에서 사용되는 툴들에 대해 많은 분들과 정보를 공유하고 싶습니다.
솔웅

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

카테고리

HTML5 Storage 4 - Application Cache -

2012. 1. 11. 00:13 | Posted by 솔웅


반응형
Let's see.... just imagine... If you can open any web pages with out internet connection.. Wow.. You don't need 3G,4G, WiFi and Internet connection though. You don't need to spend your money for internet service. That's cool..

Unfortunately there is no way to access remote web pages with out internet connection but I have a good news that you can open any web pages what you've opened before without Internet Connection. That is Application Cache.

If you use WiFi with your mobile. just open web pages what you want to see then you can reopen the pages out of the WiFi range.

Yes, It's becoming increasingly important for web-based applications to be accessible offline. Yes, all browsers have caching mechanisms, but they're unreliable and don't always work as you might expect. HTML5 addresses some of the annoyances of being offline with the ApplicationCache interface.

Using the cache interface gives your application three advantages:

    Offline browsing - users can navigate your full site when they're offline
    Speed - cached resources are local, and therefore load faster.
    Reduced server load - the browser will only download resources from the server that have changed.

The Application Cache (or AppCache) allows a developer to specify which files the browser should cache and make available to offline users. Your app will load and work correctly, even if the user presses the refresh button while they're offline.

영어로 조금 길게 썼네요. HTML5에서 제공하는 Application Cache 기능은 오프라인 환경에서도 웹 페이지를 열어 볼 수 있도록 도와 줍니다.
물론 아무 페이지나 열어볼 수 있는 건 아니구요. 한번은 오픈해서 Application Cache에 저장이 된 웹 페이지에 한정 되겠죠.
이 기능은 Manifest file과 javaScript 인터페이스 두 부분에서 설정해 주시면 됩니다.

테스트하기가 조금 힘들긴 할텐데요.. 왜냐하면 HTML을 서버에 올려놓고 브라우저로 오픈하고, 인터넷이 안되는 환경에서 다시 열어보고 해야 되니까......

하여간 아래 제가 조금 수정한 HTML 파일 올립니다.
You can download below html file.


HTML5 Presentation

JS

Application Cache


cache.appcache:

Turn off your internet connection and refresh this page!


 as you can see above, you need include the manifest attribute on the document's html tag and javascript.
Click this if you want to know more details.

좀 더 자세한 사용법을 보시려면 여기를 클릭 하세요.


반응형

HTML5 Storage 3 - IndexedDB -

2012. 1. 10. 06:15 | Posted by 솔웅


반응형
Today's Topic is Indexed Database of HTML5.

Indexed DB 도 Web Storage 중 하나인데요. Key-value 조합으로 데이터를 관리 할 수 있도록 해 줍니다.

아래 파일을 다운 받아서 브라우저에서 테스트 해 보세요.
Download below file and open it with latest Google Chrome Browser.


Google Chrome 16.0.912.75 m  - Working well (O)
Internet Explorer 9.0.8.112        - Not Working (X)
Opera 11.60                            - Not Working (X)
Safari 5.1.2                             - Not Working (X)
FireFox 9.0.1                          - Not Working (X)

This is only working on my Google Chrome browser as above.
이 기능은 구글 크롬 브라우저에서만 동작이 제대로 됩니다.


HTML5 Presentation
JS

IndexedDB

1.  "create objectStore" ->2.  Input key and value -> 3.  click "set" -> 4. do 2 and 3  as many as you want -> 5. you can see new key and value -> 6. You can delete it -> 7. you can remove objectStore

먼저 objectStore 를 create 하고 키와 밸류를 넣은 다음 set 버튼을 누릅니다.
그러면 데이터가 브라우저에 저장이 됩니다.
데이터를 여러개 생성할 수 있습니다. 하지만 key 값은 중복 될 수 없습니다.
생성된 데이터 옆에 Delete 버튼을 누르면 데이터가 지워집니다.
remove objectStore 버튼을 누르면 전체 objectStore 가 delete 됩니다.

오직 구글 크롬 브라우저에서만 실행 되더라구요.
혹시 다른데서 실행 되시는 분은 알려 주세요.

It works on Google Chrome browser only.
Please let me know if it works on any other browser.

그럼....

Thanks
반응형

HTML5 Storage 2 - Web SQL DB -

2012. 1. 10. 04:05 | Posted by 솔웅


반응형
Hi! This is the second tutorial of HTML5.
I am going to show you Web SQL DB of HTML5.

오늘 볼 기능은 Web SQL DB 입니다.
예전엔 PHP, ASP, JSP 같은 서버 사이드 스크립트 언어로 디비서버에 연결해서 테이블에 자료를 저장하고 불러오고 수정하고 했었습니다.
물론 HTML5에서도 그 기능이 가능한데요.
거기에다가 브라우저 내에도 테이블을 만들어서 SQL 쿼리로 테이블을 만들고 저장하고 지우고 할 수 있습니다.
물론 이 Data 는  Client side 의 Browser 에 저장이 됩니다.
Client side 에서 이 Browser 를 껐다 켜도, 그리고 컴퓨터를 껐다 켜도 그 데이터는 브라우저내에 그대로 있습니다. (서버에 있는 것이 아닙니다.)

이 기능을 살펴 보겠습니다.

- This function is not working on this blog so download below source code file and open the file with your browser (Google Chrome,Opera or Safari)
이 기능은 이 블로그에서는 실행이 안 되네요.
아래 업로드한 파일 다운 받으셔서 여러분 브라우저에서 실행해 보세요. -


HTML5 Presentation
JS

Web SQL Database

See the generated database: Developer > Developer Tools > Storage

1. Click Create Table Button -> The table will be created
2. Type Anything in Text field and click new to do item button. (You can make data as many as you want)
3. You can delete the data. (click the line Delete)
4. You can drop the table (Click the drop table button)

1. 먼저 create Table Button을 click 하셔서 table을 생성합니다. (Table1Test 테이블이 생성될 겁니다.)
2. text field 에 원하는 글자를 넣고 new to do item 버튼을 누르세요. 그러면 생성된 테이블에 그 데이터가 들어갑니다. 여러분이 원하는 만큼 만드세요.
3. 만들어진 데이터는 밑에 보여지게 됩니다. 여기서 Delete 링크를 누르면 해당 데이터는 지워지게 됩니다.
4. Drop table 버튼을 누르면 이 테이블 전체가 지워지게 됩니다.

사용법은 위에 있고 전체 소스는 아래에 업로드 하겠습니다.
You can download the source code below.

Google Chrome 16.0.912.75 m  - Working well (O)
Internet Explorer 9.0.8.112        - Not Working (X)
Opera 11.60                            - Working Well (O)
Safari 5.1.2                             - Working Well (O)
FireFox 9.0.1                          - Not Working (X)

이 기능은 제가 가지고 있는 인터넷 익스플로어 하고 파이어폭스에서 작동하지 않네요.

Please let us know (Leave a comment) whether it is working on your browser (PC,Mobile) or not please.
여러분 브라우저에서 제대로 작동하는지 댓글에 달아 주시면 아주 고맙겠습니다.
모바일 브라우저에서의 동작 여부도요.

그럼...
thanks..


반응형