毕业设计(文)外文资料翻译
题 目: Beginning JavaScript with DOM Scripting and Ajax
深入浅出JavaScript
学 院: 信息工程学院 系 计算机
专 业: 计算机科学技术
班 级:
学 号:
姓 名:
指导教师:
起讫日期:
外文资料翻译译文
深入浅出JavaScript
11 JavaScript产生原
Web发展初期HTML公理接口(GUI)HTML定义部分文文档户代理(通常网页浏览器)显示标签
间文字会成段落段落中标签
定义页面标题注意数开始标签会相应<开头结束标签
HTML缺点状态固定变果想改变东西者户输入数需服务器提出返请求动态技术(ColdFusionASPASPNETPHPJSP)表单者参数中信息发送服务器然通服务器完成计算测试数库查找等技术相关联应程序服务器会产生HTML文档显示结果然处理结果HTML文档形式返回浏览器供户查
样做问题时网页变化整程需重复执行遍(重新加载网页)样会显较笨重缓慢没网络新媒介承诺美现已普遍拥快速特网连接显示页面然意味着重新加载时常失败缓慢程(遇Error 404没?)
需更加灵活东西——允许Web开发员快速户予反馈服务器重新加载页面改变HTML想象表单字段中产生错误需重新加载果够重新服务器加载页面快速获取错误提示岂更方便实?正JavaScript武
信息(表单计算验证信息)需服务器JavaScript访问者电脑户代理(通常浏览器)执行做客户端代码(clientside code)样减少服务器交互成网站运行更快
12 JavaScript什
JavaScript前身LiveScript网景公司名字改成JavaScriptJava火爆名字常会令感迷惑JavaJavaScript语法较相间没必然联系
JavaJavaScriptCar(汽车)Carpet(毯)
——UsenetJavaScript讨组
网景公司1996年创造JavaScript语言包含Netscape Navigator(NN)20浏览器中解释器读取执行添加html页面JavaScript代码种语言稳步发展壮越越普现数浏览器支持
意味着JavaScript网页中现代浏览器解释浏览器实现JavaScript方式核心JavaScript语言样JavaScript户关闭掉公司机构安全角度考虑求户样做稍(贯穿书)会进步讨
关JavaScript特点旦学会浏览器编程中应领域中微软服务器JavaScript做服务器端网页编程(ASP)PDF文件现JavaScript甚Windows务理JavaScript动运行许应程序DreamweaverPhotoshopJavaScript编写脚操作系统许插件苹果公司Dashboard者LinuxWindows台Konfabulator甚允许JavaScript编写帮助程序
许公司提供网页中JavaScript象方法组成API(应编程接口)Google Maps中种需行代码网站中提供缩放滚动图
更特点JavaScript高级编程语言服务器端编程更容易开发需JavaC++样编译需PerlPHPRuby语言样运行服务器需命令行执行编写执行调试应JavaScript脚需文编辑器浏览器两者操作系统提供然工具更加方便Mozilla VenkmanMicrosoft Script Debuggerkjscmd样JavaScript调试器
13 JavaScript问题价值
正章开始提JavaScript年里已成Web开发完整部分常错误结果落名声导致结果原某严重影响户JavaScript特效移动页面元素弹出窗口种情况第次印象会深刻快变成错情况甚变成没更许类似效果DHTML时代(相见第3章)
术语户代理(user agent)含义缺乏理解样问题通常户代理指浏览器微软IENetscapeMozilla(Moz)Firefox(Fx)OperaSafari浏览器web唯户代理户代理包括:
• 辅助技术帮助户克服缺陷——语音合成软件者盲文显示器
• 纯文代理例Lynx
• 支持Web应程序
• 游戏控制台
• 手机
• 数字助理(PDA)
• 交互式电视机顶盒
• 搜索引擎索引程序
•
类户代理(没更新旧户代理)技术手段JavaScript非常危险
访问者体验应JavaScript增强许会出安全考虑关闭JavaScriptJavaScript做事做坏事果操作系统(没补丁windows)语序通JavaScript某台计算机安装病毒木马者读取户信息发送外服务器
■注解 没办法知道访问者什工具计算机功者永远知道访问者验力网络方面——参然样会JavaScript程序员带意外果
数情况想种服务器端代方案测试户代理否支持需功果支持服务器会代方案
脚语言独立性网站法律方面求英国数字歧视法美国法律508条款世界区法律中定义意味着果开发站点没JavaScript者JavaScript增强需户户代理低效运行情况具定力客户控告歧视
然JavaScript邪恶没优秀工具帮助滑流畅网站浪户花费更少时间
外文资料原文
出Beginning JavaScript with DOM Scripting and Ajax200636
作者:Christian Heilmann
Beginning JavaScript with DOM Scripting and Ajax
The Why of JavaScript
In the beginning of the Web there was HTML and the Common Gateway Interface (CGI) HTML defines the parts of a text document and instructs the user agent (usually the web browser) how to show it—for example text surrounded by the tags
HTML缺点状态固定变果想改变东西者户输入数需服务器提出返请求动态技术(ColdFusionASPASPNETPHPJSP)表单者参数中信息发送服务器然通服务器完成计算测试数库查找等技术相关联应程序服务器会产生HTML文档显示结果然处理结果HTML文档形式返回浏览器供户查
样做问题时网页变化整程需重复执行遍(重新加载网页)样会显较笨重缓慢没网络新媒介承诺美现已普遍拥快速特网连接显示页面然意味着重新加载时常失败缓慢程(遇Error 404没?)
需更加灵活东西——允许Web开发员快速户予反馈服务器重新加载页面改变HTML想象表单字段中产生错误需重新加载果够重新服务器加载页面快速获取错误提示岂更方便实?正JavaScript武
信息(表单计算验证信息)需服务器JavaScript访问者电脑户代理(通常浏览器)执行做客户端代码(clientside code)样减少服务器交互成网站运行更快
12 JavaScript什
JavaScript前身LiveScript网景公司名字改成JavaScriptJava火爆名字常会令感迷惑JavaJavaScript语法较相间没必然联系
JavaJavaScriptCar(汽车)Carpet(毯)
——UsenetJavaScript讨组
网景公司1996年创造JavaScript语言包含Netscape Navigator(NN)20浏览器中解释器读取执行添加html页面JavaScript代码种语言稳步发展壮越越普现数浏览器支持
意味着JavaScript网页中现代浏览器解释浏览器实现JavaScript方式核心JavaScript语言样JavaScript户关闭掉公司机构安全角度考虑求户样做稍(贯穿书)会进步讨
关JavaScript特点旦学会浏览器编程中应领域中微软服务器JavaScript做服务器端网页编程(ASP)PDF文件现JavaScript甚Windows务理JavaScript动运行许应程序DreamweaverPhotoshopJavaScript编写脚操作系统许插件苹果公司Dashboard者LinuxWindows台Konfabulator甚允许JavaScript编写帮助程序
许公司提供网页中JavaScript象方法组成API(应编程接口)Google Maps中种需行代码网站中提供缩放滚动图
更特点JavaScript高级编程语言服务器端编程更容易开发需JavaC++样编译需PerlPHPRuby语言样运行服务器需命令行执行编写执行调试应JavaScript脚需文编辑器浏览器两者操作系统提供然工具更加方便Mozilla VenkmanMicrosoft Script Debuggerkjscmd样JavaScript调试器
13 JavaScript问题价值
正章开始提JavaScript年里已成Web开发完整部分常错误结果落名声导致结果原某严重影响户JavaScript特效移动页面元素弹出窗口种情况第次印象会深刻快变成错情况甚变成没更许类似效果DHTML时代(相见第3章)
术语户代理(user agent)含义缺乏理解样问题通常户代理指浏览器微软IENetscapeMozilla(Moz)Firefox(Fx)OperaSafari浏览器web唯户代理户代理包括:
• 辅助技术帮助户克服缺陷——语音合成软件者盲文显示器
• 纯文代理例Lynx
• 支持Web应程序
• 游戏控制台
• 手机
• 数字助理(PDA)
• 交互式电视机顶盒
• 搜索引擎索引程序
•
类户代理(没更新旧户代理)技术手段JavaScript非常危险
访问者体验应JavaScript增强许会出安全考虑关闭JavaScriptJavaScript做事做坏事果操作系统(没补丁windows)语序通JavaScript某台计算机安装病毒木马者读取户信息发送外服务器
■注解 没办法知道访问者什工具计算机功者永远知道访问者验力网络方面——参然样会JavaScript程序员带意外果
数情况想种服务器端代方案测试户代理否支持需功果支持服务器会代方案
脚语言独立性网站法律方面求英国数字歧视法美国法律508条款世界区法律中定义意味着果开发站点没JavaScript者JavaScript增强需户户代理低效运行情况具定力客户控告歧视
然JavaScript邪恶没优秀工具帮助滑流畅网站浪户花费更少时间
外文资料原文
出Beginning JavaScript with DOM Scripting and Ajax200636
作者:Christian Heilmann
Beginning JavaScript with DOM Scripting and Ajax
The Why of JavaScript
In the beginning of the Web there was HTML and the Common Gateway Interface (CGI) HTML defines the parts of a text document and instructs the user agent (usually the web browser) how to show it—for example text surrounded by the tags
becomes a paragraph Within that paragraph you may have
tags that define the main page heading Notice that for most opening tags there is a corresponding closing tag that begins with <
HTML has one disadvantage—it has a fixed state If you want to change something or use data the visitor entered you need to make a roundtrip to a server Using a dynamic technology (such as ColdFusion ASP ASPNET PHP or JSP) you send the information from forms or from parameters to a server which then performs calculatingtestingdatabase lookups etc The application server associated with these technologies then writes an HTML document to show the results and the resulting HTML document is returned to the browser for viewing The problem with that is it means every time there is a change the entire process must be repeated (and the page reloaded) This is cumbersome slow and not as impressive as the new media Internet promised us to be It is true that at least the Western world has the benefit of fast Internet connections these days but displaying a page still means a reload which could be a slow process that frequently fails (ever get an Error 404)
We need something slicker—something that allows web developers to give immediate feedback to the user and change HTML without reloading the page from the server Just imagine a form that needs to be reloaded every time there’s an error in one of its fields—isn’t it handier when something flags the errors immediately without needing to reload the page from the web server This is one example of what JavaScript can do for you
Some information such as calculations and verifying the information on a form may not need to come from the server JavaScript is executed by the user agent (normally a browser) on the visitor’s computer We call this clientside code This could result in fewer trips to the
server and fasterrunning web sites
What Is JavaScript
JavaScript started life as LiveScript but Netscape changed the name—possibly because of the excitement being generated by Java—to JavaScript The name is confusing though as there is no real connection between Java and JavaScript—although some of the syntax looks similar
Java is to JavaScript what Car is to Carpet
——From a JavaScript discussion group on Usenet
Netscape created the JavaScript language in 1996 and included it in their Netscape Navigator (NN) 20 browser via an interpreter that read and executed the JavaScript added to html pages The language has steadily grown in popularity since then and is now supported by the most popular browsers
The good news is that this means JavaScript can be used in web pages for all major modern browsers The notquitesogood news is that there are differences in the way the different browsers implement JavaScript although the core JavaScript language is much the same However JavaScript can be turned off by the user—and many companies and other institutions require their users to do so for security reasons We will discuss this further
shortly as well as throughout this book
The great thing about JavaScript is that once you’ve learned how to use it for browser programming you can move on to use it in other areas Microsoft’s server—IIS—uses JavaScript to program serverside web pages (ASP) PDF files now use JavaScript and even Windows administration tasks can be automated with JavaScript code A lot of applications such as Dreamweaver and Photoshop are scriptable with JavaScript Operating system addons like
the Apple Dashboard or Konfabulator on Linux and Windows even allow you to write small
helper applications in JavaScript
Lately a lot of large companies also offer application programming interfaces (APIs) that feature JavaScript objects and methods you can use in your own pages—Google Maps being one of them You can offer a zoomable and scrollable map in your web site with just a few lines of code
Even better is the fact that JavaScript is a lot easier to develop than higher programming languages or serverside scripting languages It does not need any compilation like Java or C++ or to be run on a server or command line like Perl PHP or Ruby all you need to write execute debug and apply JavaScript is a text editor and a browser—both of which are supplied with any operating system There are of course tools that make it a lot easier for you examples being JavaScript debuggers like Mozilla Venkman Microsoft Script Debugger or kjscmd
Problems and Merits of JavaScript
As I mentioned at the outset of this chapter JavaScript has been an integral part of web development over the last few years but it has also been used wrongly As a result it has gotten a bad reputation The reason for this is gratuitous JavaScript effects like moving page elements and popup windows which might have been impressive the first time you saw them but soon turned out to be just a nice to have and in some cases even a nice to not have any longer A lot of this comes from the days of DHTML (more on this in Chapter 3)
The term user agent and the lack of understanding what a user agent is can also be a problem Normally the user agent is a browser like Microsoft Internet Explorer (MSIE) Netscape Mozilla (Moz) Firefox (Fx) Opera or Safari However browsers are not the only user agents on the Web Others include
• Assistive technology that helps users to overcome the limitations of a disability—like texttospeech software or Braille displays
• Textonly agents like Lynx
• Webenabled applications
• Game consoles
• Mobilecell phones
• PDAs
• Interactive TV settop boxes
• Search engines and other indexing programs
• And many more
This large variety of user agents of different technical finesse (and old user agents that don’t get updated) is also a great danger for JavaScript
Not all visitors to your web site will experience the JavaScript enhancements you applied
to it A lot of them will also have JavaScript turned off—for security reasons JavaScript can be used for good and for evil If the operating system—like unpatched Windows—allows you to you can install viruses or Trojan Horses on a computer via JavaScript or read out user information and send it to another server
■Note There is no way of knowing what the visitor uses or what his computer is capable of Furthermore you never know what the visitor’s experience and ability is like This is one of the beautiful aspects of the Web—everyone can participate However this can introduce a lot of unexpected consequences for the JavaScript programmer
In many cases you might want to have a serverside backup plan It would test to see whether the user agent supports the functionality desired and if it doesn’t the server takes over
Independence of scripting languages is a legal requirement for web sites defined in the Digital Discrimination Act for the UK section 508 in the US law and many more localized legal requirements throughout the world This means that if the site you developed cannot be used without JavaScript or your JavaScript enhancements are expecting a certain ability of the users or their user agent without a fallback your client could be sued for discrimination
However JavaScript is not evil or useless and it is a great tool to help your visitor to surf web sites that are a lot slicker and less timeconsuming
文档香网(httpswwwxiangdangnet)户传
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档
HTML has one disadvantage—it has a fixed state If you want to change something or use data the visitor entered you need to make a roundtrip to a server Using a dynamic technology (such as ColdFusion ASP ASPNET PHP or JSP) you send the information from forms or from parameters to a server which then performs calculatingtestingdatabase lookups etc The application server associated with these technologies then writes an HTML document to show the results and the resulting HTML document is returned to the browser for viewing The problem with that is it means every time there is a change the entire process must be repeated (and the page reloaded) This is cumbersome slow and not as impressive as the new media Internet promised us to be It is true that at least the Western world has the benefit of fast Internet connections these days but displaying a page still means a reload which could be a slow process that frequently fails (ever get an Error 404)
We need something slicker—something that allows web developers to give immediate feedback to the user and change HTML without reloading the page from the server Just imagine a form that needs to be reloaded every time there’s an error in one of its fields—isn’t it handier when something flags the errors immediately without needing to reload the page from the web server This is one example of what JavaScript can do for you
Some information such as calculations and verifying the information on a form may not need to come from the server JavaScript is executed by the user agent (normally a browser) on the visitor’s computer We call this clientside code This could result in fewer trips to the
server and fasterrunning web sites
What Is JavaScript
JavaScript started life as LiveScript but Netscape changed the name—possibly because of the excitement being generated by Java—to JavaScript The name is confusing though as there is no real connection between Java and JavaScript—although some of the syntax looks similar
Java is to JavaScript what Car is to Carpet
——From a JavaScript discussion group on Usenet
Netscape created the JavaScript language in 1996 and included it in their Netscape Navigator (NN) 20 browser via an interpreter that read and executed the JavaScript added to html pages The language has steadily grown in popularity since then and is now supported by the most popular browsers
The good news is that this means JavaScript can be used in web pages for all major modern browsers The notquitesogood news is that there are differences in the way the different browsers implement JavaScript although the core JavaScript language is much the same However JavaScript can be turned off by the user—and many companies and other institutions require their users to do so for security reasons We will discuss this further
shortly as well as throughout this book
The great thing about JavaScript is that once you’ve learned how to use it for browser programming you can move on to use it in other areas Microsoft’s server—IIS—uses JavaScript to program serverside web pages (ASP) PDF files now use JavaScript and even Windows administration tasks can be automated with JavaScript code A lot of applications such as Dreamweaver and Photoshop are scriptable with JavaScript Operating system addons like
the Apple Dashboard or Konfabulator on Linux and Windows even allow you to write small
helper applications in JavaScript
Lately a lot of large companies also offer application programming interfaces (APIs) that feature JavaScript objects and methods you can use in your own pages—Google Maps being one of them You can offer a zoomable and scrollable map in your web site with just a few lines of code
Even better is the fact that JavaScript is a lot easier to develop than higher programming languages or serverside scripting languages It does not need any compilation like Java or C++ or to be run on a server or command line like Perl PHP or Ruby all you need to write execute debug and apply JavaScript is a text editor and a browser—both of which are supplied with any operating system There are of course tools that make it a lot easier for you examples being JavaScript debuggers like Mozilla Venkman Microsoft Script Debugger or kjscmd
Problems and Merits of JavaScript
As I mentioned at the outset of this chapter JavaScript has been an integral part of web development over the last few years but it has also been used wrongly As a result it has gotten a bad reputation The reason for this is gratuitous JavaScript effects like moving page elements and popup windows which might have been impressive the first time you saw them but soon turned out to be just a nice to have and in some cases even a nice to not have any longer A lot of this comes from the days of DHTML (more on this in Chapter 3)
The term user agent and the lack of understanding what a user agent is can also be a problem Normally the user agent is a browser like Microsoft Internet Explorer (MSIE) Netscape Mozilla (Moz) Firefox (Fx) Opera or Safari However browsers are not the only user agents on the Web Others include
• Assistive technology that helps users to overcome the limitations of a disability—like texttospeech software or Braille displays
• Textonly agents like Lynx
• Webenabled applications
• Game consoles
• Mobilecell phones
• PDAs
• Interactive TV settop boxes
• Search engines and other indexing programs
• And many more
This large variety of user agents of different technical finesse (and old user agents that don’t get updated) is also a great danger for JavaScript
Not all visitors to your web site will experience the JavaScript enhancements you applied
to it A lot of them will also have JavaScript turned off—for security reasons JavaScript can be used for good and for evil If the operating system—like unpatched Windows—allows you to you can install viruses or Trojan Horses on a computer via JavaScript or read out user information and send it to another server
■Note There is no way of knowing what the visitor uses or what his computer is capable of Furthermore you never know what the visitor’s experience and ability is like This is one of the beautiful aspects of the Web—everyone can participate However this can introduce a lot of unexpected consequences for the JavaScript programmer
In many cases you might want to have a serverside backup plan It would test to see whether the user agent supports the functionality desired and if it doesn’t the server takes over
Independence of scripting languages is a legal requirement for web sites defined in the Digital Discrimination Act for the UK section 508 in the US law and many more localized legal requirements throughout the world This means that if the site you developed cannot be used without JavaScript or your JavaScript enhancements are expecting a certain ability of the users or their user agent without a fallback your client could be sued for discrimination
However JavaScript is not evil or useless and it is a great tool to help your visitor to surf web sites that are a lot slicker and less timeconsuming
文档香网(httpswwwxiangdangnet)户传
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档