版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2026学年带教学楼插画设计
- 2025-2026学年北京娃衣教学设计
- 2025-2026学年教学楼无障碍标识设计
- 2025-2026学年包身工教学设计图片
- 水务提升改造项目专项债可行性研究报告
- 市政工程移动式监控巡检技术方案
- 流行性感冒高热患者护理查房
- 胃十二指肠溃疡护理查房
- 环保免烧砖生产项目质量管控方案
- 2026年全国初级银行从业资格之初级个人理财考试黑金提分题(详细参考解析)
- 《孟子》精读学习通超星期末考试答案章节答案2024年
- 《建筑业企业资质等级标准》(建建200182号)-20210829233
- 2024全国中考语文试题分类汇编:非连续文本
- MOOC 乒乓球入门与提高-北京体育大学 中国大学慕课答案
- 《光伏发电工程可行性研究报告编制规程》(NB/T32043-201)中文版
- 排土场安全培训课件
- 第十七章-阿法芙·I·梅勒斯的转变理论
- 贴身管家服务流程
- 储气罐安全使用培训
- 家庭保洁课件
- 区域政策课件
评论
0/150
提交评论