版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、内容摘要:1. What is JavaScript?JavaScript is a platform-independent,event-driven, interpreted client-side scripting and 内容正文:1. What is JavaScript?JavaScript is a platform-independent,event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and
2、Sun Microsystems.2.How to read and write a file using javascript?I/O operations like reading or writing a file is not possible with client-side javascript.However , this can be done by coding a Java applet that reads files for the script. 3.How to detect the operating system on the client machine? I
3、n order to detect the operating system on the client machine, the navigator.appVersion string (property) should be used. 4.Where are cookies actually stored on the hard disk? This depends on the users browser and OS.In the case of Netscape with Windows OS,all the cookies are stored in a single file
4、called cookies.txtc:Program FilesNetscapeUsersusernamecookies.txtIn the case of IE,each cookie is stored in a separate file namely HYPERLINK mailto: .c:WindowsCookies5.What can javascript programs do? Generation of HTML pages on-the-fly without accessing the Web server. The user can be given control
5、 over the browser like User input validationSimple computations can be performed on the clients machineThe users browser, OS, screen size, etc. can be detected Date and Time Handling6.How to set a HTML documents background color? document.bgcolor property can be set to any appropriate color.7.What d
6、oes the Access is Denied IE error mean? The Access Denied error in any browser is due to the following reason.A javascript in one window or frame is tries to access another window or frame whose documents domain is different from the document containing the script.8.Is a javascript script faster tha
7、n an ASP script?Yes.Since javascript is a client-side script it does require the web servers help for its computation,so it is always faster than any server-side script like ASP,PHP,etc.9.Are Java and JavaScript the Same?No.java and javascript are two different languages.Java is a powerful object -
8、oriented programming language like C+,C whereas Javascript is a client-side scripting language with some limitations.10.How to embed javascript in a web page?javascript code can be embedded in a web page between tags11.How to access an external javascript file that is stored externally and not embed
9、ded?This can be achieved by using the following tag between head tags or between body tags.where abc.js is the external javscript file to be accessed.12.What is the difference between an alert box and a confirmation box?An alert box displays only one button which is the OK button whereas the Confirm
10、 box displays two buttons namely OK and cancel.13.What is a prompt box?A prompt box allows the user to enter input by providing a text box.14.How to hide javascript code from old browsers that dont run it?Ans.Use the below specified style of comments orUse the some html code tags and code the displa
11、y html statements between these and this will appear on the page if the browser does not support javascript15. How to comment javascript code?Ans.Use / for line comments and/*/ for block comments16.Name the numeric constants representing max,min valuesAns.Number.MAX_VALUENumber.MIN_VALUE17.What does
12、 javascript null mean?Ans.The null value is a unique value representing no value or no object.It implies no object,or null string,no valid boolean value,no number and no array object.18.What does undefined value mean in javascript?Ans.Undefined value means the variable used in the code doesnt exist
13、or is not assigned any value or the property doesnt exist.19.What is the difference between undefined value and null value?Ans.(i)Undefined value cannot be explicitly stated that is there is no keyword called undefined whereas null value has keyword called null(ii)typeof undefined variable or proper
14、ty returns undefined whereastypeof null value returns object20.What is variable typing in javascript?Ans.It is perfectly legal to assign a number to a variable and then assign a string to the same variable as followsexamplei = 10;i = string;This is called variable typing21.Does javascript have the c
15、oncept level scope?Ans.No.Javascript does not have block level scope,all the variables declared inside a function possess the same level of scope unlike c,c+,java.22. What are undefined and undeclared variables?Ans.Undeclared variables are those that are not declared in the program (do not exist at
16、all),trying to read their values gives runtime error.But if undeclared variables are assigned then implicit declaration is done .Undefined variables are those that are not assigned any value but are declared in the program.Trying to read such variables gives special value called undefined value.23.
17、What is = operator ?Ans.= is strict equality operator ,it returns true only when the two operands are having the same value without any type conversion.24.What does the delete operator do?Ans.The delete operator is used to delete all the variables and objects used in the program ,but it does not delete variables declared with var keyword.25.What does break and continue statements do?Ans.Continue statement continues the current loop (if label not specified) in a new iterat
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 小学教育活动策划方案(3篇)
- 矿业立井施工方案(3篇)
- 夜场6s管理制度(3篇)
- 特产特色活动策划方案(3篇)
- 改造超市施工方案(3篇)
- 2026年淄博临淄区事业单位公开招聘综合类岗位人员(21人)备考考试题库及答案解析
- 2026年杭州市拱墅区人民政府武林街道办事处公开招聘编外工作人员4人备考考试题库及答案解析
- 2026年芜湖市劳动保障人力资源有限公司人才储备考试参考试题及答案解析
- 2026福建龙岩新罗区岩山中心幼儿园教师招聘1人参考考试题库及答案解析
- 2026年福建宁德古田县消防救援大队政府专职消防员招聘10人备考考试题库及答案解析
- 2021海康威视DS-AT1000S超容量系列网络存储设备用户手册
- 水利水电工程单元工程施工质量验收标准第8部分:安全监测工程
- 【政治】2025年高考真题政治-海南卷(解析版-1)
- DB50∕T 1571-2024 智能网联汽车自动驾驶功能测试规范
- 低蛋白血症患者的护理讲课件
- 建设工程招投标培训课件
- T/ZGZS 0302-2023再生工业盐氯化钠
- 健康骨骼课件
- 水泵电机年度维修项目方案投标文件(技术方案)
- 2024-2025学年江西省南昌市高二上学期期末联考数学试卷(含答案)
- GB/T 6075.6-2024机械振动在非旋转部件上测量评价机器的振动第6部分:功率大于100 kW的往复式机器
评论
0/150
提交评论