【笔试】凯捷html5试卷

1,what the standard DOCTYPE of HTML5?(3“)

 <!DOCTYPE html5>

2,What the different between sessionStorage and  LocalStorage?(3”)

html5中的Web Storage包括了两种存储方式:sessionStorage和localStorage。

A,sessionStorage用于本地存储一个会话(session)中的数据,这些数据只有在同一个会话中的页面才能访问并且当会话结束后数据也随之销毁。因此sessionStorage不是一种持久化的本地存储,仅仅是会话级别的存储。

localStorage用于持久化的本地存储,除非主动删除数据,否则数据是永远不会过期的。

B,web storage和cookie的区别

Web Storage的概念和cookie相似,区别是它是为了更大容量存储设计的。Cookie的大小是受限的,并且每次你请求一个新的页面的时候Cookie都会被发送过去,这样无形中浪费了带宽,另外cookie还需要指定作用域,不可以跨域调用。

除此之外,Web Storage拥有setItem,getItem,removeItem,clear等方法,不像cookie需要前端开发者自己封装setCookie,getCookie。

但是Cookie也是不可以或缺的:Cookie的作用是与服务器进行交互,作为HTTP规范的一部分而存在 ,而Web Storage仅仅是为了在本地“存储”数据而生(来自@otakustay 的纠正)

3,which pareamters should be passed to the openDatabase method when create a datebase in html5 development?(3”)

var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024); 参考: http://www.tutorialspoint.com/html5/html5_web_sql.htm

4,what is the extension name of HTML5 Application Cache file?(3“)

    manifest

此题涉及:离线存储:

Application cache gives an application three advantages: (离线存储的优点)

  1. Offline browsing - users can use the application when they're offline
  2. Speed - cached resources load faster
  3. Reduced server load - the browser will only download updated/changed resources from the server

 

5, In development of cloudEvent, in order to retrieve data from webservice, we use a standard Object for http request, write the name of this Object.

httpRequest?

6,write a simple line code to check wherther a Browser support localstorage feature or not.(3“)

if(typeof(localStorage)!=="undefined")
  {
   console.log(" localStorage support!");
  }
else
  {
 console.log(" not support!");
  }

7, Gave a simple example for storing a variable to the localstorage:  (3”)

sessionStorage.setItem("key", "value");  localStorage.setItem("site", "js8.in");  
参见:http://www.cnblogs.com/xhuangtao/p/3338838.html

8,How to include a javascript file to our html page?(3)

1) add  script=""  in label ,eg:<div script="..." >

2) add <script> .... </script> in html file

3) add file of  aaa.js and add :<script type="text/javascript" src="aaa.js"></script>

 

9, We have a import property in JqueryMobile, just set the values of this property to page/button/collapsible-set, we can get a page/button/collapsible-set... Can you tell me this important property in JqueryMobile(3)?

jQuery.mobile.activePage  参考网页:http://jquerymobile.com/demos/1.2.1/docs/buttons/buttons-inline.html

 

10,write the fullname of the HTML.(3“)

      Hyper Text Markup Language

 

11,  Write the different between localStorage and webSQL?(10”)

1)     localStorage  is faster than webSQL.

2)    webSQL can store more date.

3)     localStorage  support more browser.

4)    webSQL  can manger the data better(searching, sorting, and so on)than localStorage .

5)    localStorage API (setitem, getitem)  is more easy to use than webSQL(select, insect, update...need to know SQL knowage) .

     参考网页:http://www.petefreitag.com/item/780.cfm   实际效果测试:http://jsperf.com/localstorage-vs-objects/20

 

12, write down the strong points and weak point of  HTML5。(10) HTML5优缺点

  参考网页:http://www.blog.qarea.com/news/html5-strong-and-weak-points/

               http://wenku.baidu.com/view/aac71f5b77232f60ddcca1bc.html

优点:

* 改善视频字幕  

* 改善快速寻优(fast seeking)  

* 更好的forms属性,包括input、autocomplete等

* 拼写检查

* 更好的图像可访问性  

* 更强大的、用于嵌入文档的iframes 

* native video support (原声的视频支持 – bye,flash)
* geolocation (地址信息的获取) 
* offline access support (不在线的支持,支持local storage) 
* semantics with tags that makes SEO friendly (flash content is not indexable – SEO能理解的 tags来帮助搜索引擎的加索引)

缺点:

* 浏览器支持不够

* 完整统一的标准尚未形成

    

13,Describe your understanding of Hybrid Application(10")

A hybrid application (hybrid app) is one that combines elements of both native and Web applications. Native applications are developed for a specific platform and installed on a computing device. Web applications are generalized for multiple platforms and not installed locally but made available over the Internet through a browser. Hybrid apps are often mentioned in the context of mobile computing.

 

Hybrid application features:

  • Can function whether or not the device is connected. 
  • Integration with a device’s file system.  
  • Integration  with Web-based services. 
  • An embedded browser to improve access to dynamic online content.

Most applications could be considered hybrid apps. Web apps, such as online banking services, typically store some content locally; locally stored native apps, such as Microsoft Word, also interface to the Internet.

14. Write the different between html4 & html5.(20")

1. HTML5 标准还在制定中
首先要注意的是,HTML5虽然现在很火,但是HTML5标准还在制定中,标准仍在改变。HTML4已经10多年了,不会有任何改变了。

2. 简化的语法
HTML5简化了很多细微的语法,例如doctype的声明,你只需要写<!doctype html>就行了。HTML5与HTML4、XHTML1兼容,但是与SGML不兼容。

3. <canvas>标签替代Flash
Flash给很多Web开发者带来了麻烦,要在网页上播放Flash需要一堆代码和插件。<canvas>标签使得开发者只要使用一个标签就 能和用户产生UI交互。虽然目前<canvas>标签还不能实现Flash的所有功能,但是很快<canvas>就会让 Flash看起来老土,哈哈!

4. 新增 <header> 和 <footer> 标签
HTML5设计的一个原则是更好的体现网站的语义性,所以增加了<header>和<footer>这样的标签,用来明确表示网页的结构。

5. 新增 <section> 和 <article> 标签
与<header>, <footer>类似,<section>和<article>也有利于清晰化网页的结构,更有利于SEO。

6. 新增 <menu> 和 <figure> 标签
<menu>可以被用于创建传统的菜单,也可以用于工具栏和上下文菜单。<figure>标签使得网页文字和图片的排版更专业。

7. 新增 <audio> 和 <video> 标签
这两个标签可能是HTML5里面最有用的两个标签了。顾名思义,这两个标签是用来播放音频和视频的。

8. 全新的表单
HTML5对 <form> 和 <forminput> 标签进行了大量修改,添加了很多新的属性,也修改了很多属性。

9. 删除 <b> 和 <font> 标签
这个改进我还无法理解。我不认为删除这两个标签对代码的改进有很大的帮助。官方的解释是应该用CSS来替代这两个标签。但我还是觉得对于简单的文本,这两个标签还是很方便的。

10. 删除 <frame>, <center>, <big> 标签
我已经记不得上次是什么时候使用这些标签了。

15. Write diffrent between Post & Get method.(20")

参考网页:http://blog.csdn.net/gideal_wang/article/details/4316691

概括:GET一般用于获取/查询 资源信息,而POST一般用于更新 资源信息

1、 get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。

2、 对于get方式,服务器端用Request.QueryString获取变量的值,对于post方式,服务器端用Request.Form获取提交的数据。两种方式的参数都可以用Request来获得。

3、get传送的数据量较小,不能大于2KB。post传送的数据量较大,一般被默认为不受限制。但理论上,因服务器的不同而异.

4、get安全性非常低,post安全性较高。

5、Get限制Form表单的数据集的值必须为ASCII字符;而Post支持整个ISO10646字符集。默认是用ISO-8859-1编码 

6、Get是Form的默认方法。

7、Get请求有如下特性:它会将数据添加到URL中,通过这种方式传递到服务器,通常利用一个问号?代表URL地址的结尾与数据参数的开端,后面的参数每一个数据参数以“名称=值”的形式出现,参数与参数之间利用一个连接符&来区分。 

8、Post请求有如下特性:数据是放在HTTP主体中的,其组织方式不只一种,有&连接方式,也有分割符方式,可隐藏参数,传递大批数据,比较方便。

 注:7,8两点可不写,看情况。

posted @ 2013-09-25 16:39  ybingbing_1213  Views(541)  Comments(0)    收藏  举报