版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026四川华丰科技股份有限公司招聘市场经理等岗位的94人备考题库及答案详解(考点梳理)
- 2026上海交通大学医学院招聘85人备考题库及1套完整答案详解
- 2026四川水发能源开发有限公司招聘4人备考题库附参考答案详解(考试直接用)
- 2026年甘肃炳灵寺文物保护研究所合同制工作人员招聘备考题库及答案详解(典优)
- 养老体系可持续发展-洞察与解读
- 2026四川广元市青川县博睿人力资源有限公司招聘工程项目管理人员2人备考题库含答案详解(基础题)
- 2026上半年贵州事业单位联考德江县招聘36人备考题库附答案详解(综合卷)
- 2026吉林省科维交通工程有限公司东南地区项目部劳务派遣人员招聘14人备考题库含答案详解(满分必刷)
- 2026新疆双河市新赛股份公司招聘1人备考题库带答案详解(精练)
- 2026广东广州白云区石门街中心幼儿园招聘4人备考题库及答案详解(网校专用)
- 上海市历年中考语文现代文之议论文阅读6篇(含答案)(2003-2022)
- 烟气脱硝装置安装单位工程质量验收表
- AQ 1046-2007 地勘时期煤层瓦斯含量测定方法(正式版)
- 软装配饰合同范本
- 苏教版三年级下册数学计算能手1000题带答案
- 新媒体艺术的发展历程及艺术特征
- 依法行医教学课件
- 《日语零基础学习》课件
- 讲课学生数学学习成就
- 西葫芦栽培技术要点
- 高中学生学籍表模板(范本)
评论
0/150
提交评论