ImageVerifierCode 换一换
格式:DOCX , 页数:13 ,大小:22.12KB ,
资源ID:470007      下载积分:10 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-470007.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(毕业论文外文翻译--使用JavaScript设计网页(适用于毕业论文外文翻译+中英文对照)Word格式.docx)为本站会员(wj)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

毕业论文外文翻译--使用JavaScript设计网页(适用于毕业论文外文翻译+中英文对照)Word格式.docx

1、ALERT BOXESTo pop up an alert box include the following line of code inside of script tags in the body of your HTML document. Please note that the processing of the page will stop until the viewer responds to the alert box.alert (Place the text to be displayed in the alert box between these quotes.n

2、)Other types of pre-made dialog boxes are available such as the prompt and confirm boxes. In order to take full advantage of the features of these dialog boxes you must write more JavaScript code which can use the values that are returned by the dialog boxes.The following statements will pop up a di

3、alog box that requires a yes or no answer (OK or Cancel). If the answer is OK then the variable named answer has a value of true and if the answer is Cancel then the variable named answer has a value of false. You can then use an if statement in the JavaScript code to respond appropriately.var answe

4、r = confirm (Are you sure you want to quit?)if (answer=true)(window.close()The following code will pop up a dialog box that asks the user to enter some sort of information. If the user clicks OK the information they entered is stored in the variable. The second set of quotation marks inside of the p

5、rompt statement make the contents of the text box blank when the dialog box is displayed.var response = prompt (What is your name?document.write (font size=7 color=red face=arialHello + response + ”)Notice that in the last two examples the window and document objects were used. Window refers to the

6、browser window and document refers to the page being displayed. The use of a dot after the name of the object allows actions to be performed on that object or properties of that object to be modified. In this next example, the navigator object is referenced in order to display the browser name and v

7、ersion.You are using + navigator.appName + version + navigator.appVersion +POP-UP WINDOWSAn additional browser window may be opened using a simple JavaScript. The open method contains three parts as in the following example: the name of the document or url of the web site to be displayed in the new

8、window, the name that may be used to refer to the browser window (requires more code than is shown here), and the properties of the new window. Please note that the properties are all listed in one set of quotation marks and are separated by commas.open (myfile.html”,mywin”, height=200, width=200, t

9、itlebar=falseThe following properties may be used to control the appearance of the new window:Tablel-l properties may be used to control the appearance of the new windowFeatureExampleDescriptionheightheight = 200determines the height of the new window in pixelswidthwidth=200determines the width of t

10、he new window in pixelstitlebartitlebar=falseremoves the title bar from the new windowlocationincludes the url / address text box in the new windowmenubarincludes a menu bar in the new windowresizeresize=offmakes the new window a fixed sizescrollbarsadds scrollbars to the new windowstatusincludes a

11、status bar for the new windowtoolbartoolbar=yesadds a toolbar for the new windowWRITING FUNCTIONSFunctions are small subprograms that are located within script tags between the head tags of an HTML document. Functions are executed when they are called by name from an event handler within the body of

12、 an HTML document.The basic structure of a function is as follows:function NameOfFunction()EVENT HANDLERSThe following example demonstrates the use of event handler onclick as well as the use of styles to control the appearance of buttons. Note that instead of using type=submit for the button the co

13、de simply says type=button. Copy and paste this entire set of code in to a new document and test it out.htmlheadtitleS amplestyle type=text/css#bigbutton (background-color : yellow; font-family : arial; color : blue;font-size :18px; height: 50px; border-width : 0.2cm; border-color : red/style/headbo

14、dyform name=myforminput type=button name=mybutton id=bigbutton value= CLICK ME!onclick=,window.location=,n/form/body/htmlChanging the code for the button to read onclick=myfunction( ) will result in exactly the same thing as the previous example if the following function is included in a script betw

15、een the head tags. Typically, you would write a function only if the event required more than one thing to happen.function myfunction()window.location = The following are some of the event handlers that exist in javascript:Table 1-2 event handlers that exist in javascriptonfocusonbluronselectonchang

16、eonsubmitonclickonmouseoveronmouseoutonloadonunloadonabortonerroronresetonkeypressonkeyuponmousedownonmousemoveonmouseuponmoveonresizePOP-UP MENUSPop-Up Menus can be quickly created by using the select tag as it was used in forms to create a drop down list. Set the value of each of the options in th

17、e select tag to the url of the new page to be displayed. Use the onchange event handler to set the location of the window to the selected value in the drop down list. For example, if the form is named myform, the select tag is named mychoices, and the value of each option is a url then the statement

18、 window.location = document.myform.mychoices.value will take you to the new page that was selected from the drop down list.By default only one item in a list is displayed by a select statement until the viewer clicks on the down arrow to expose the rest of the list. To display more that one item at

19、a time (and create a text box with a vertical scrollbar) include the size attribute in the select tag. For example, size=5 will display the first five items in the list and add a vertical scroll bar to the box if there are more than 5 items in the list.MOUSEOVERSA mouseover refers to the effect that

20、 occurs when the properties of an object are changed if the mouse is positioned over the top of the object and then again if the mouse is removed from the object. The quickest way to generate a mouseover is to use the onmouseover and onmouseout event handlers in a form of in-line style.Visit the sty

21、le section of the DHTML page of this web site to see an example of mouseovers used with text as an in-line style. Any style property that applies to a particular object can be changed as the result of a mouseover.Performing mouseovers with a graphic is not much different than with text. When the des

22、ired event occurs (onmouseover, onmouseout) change the source of the graphic as in the example that follows:img src=picl.jpg onmouseover=src=,pic2.jpgH, onmouseout=src=,picl.jpg,nSCROLLING TEXTSince the marquee tag is only supported by Internet Explorer it is a good idea to avoid it as much as possi

23、ble and use a JavaScript to generate scrolling text instead. With this JavaScript it is also quite easy to place the scrolling text on the status bar instead of in the document itself by using window.status as the destination for the message. The following function will generate a scrolling message

24、in a text box named mymessagebox which is part of a form named myform. The event handler onload must also be used in the body tag to call the function when the page loads.var message = This is a test. var position = 0function mymessage()document.myform.mymessagebox.value=message.substring(position,

25、message.length) +message.substring(O, position)position = position + 1if (position message.length)position = 0window.setTimeout(mymessage( )”,300)DATES AND TIMESDates and times are often displayed on web pages to indicate when a page was last updated, when a page was loaded, or to display a countdow

26、n to a particular event. Displaying the date and time of the last update is a good practice to get in to for all of your pages because frequent updates are one sign of a quality site. The date/time stamp lets the viewer know how recent the information is and therefore provides one indication of vali

27、dity. To display the date and time of the last update (the last time the document was saved) use the following one line inside of script tags:This page last updated ” + document.lastModified)To display the current time and date on a web page you must declare a variable of type Date ( var now = new Date). The variable can then be used to access various parts of the date and time including day of the week, month, day of the month, year, hours (in military time), minutes, and seconds. Assuming that now is the variable declared of type Date the fol

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2