JavaScript Objects Escape and toGMTString

Source: Internet
Author: User
Tags gmt time zone local time

Both are the global functions of JavaScript.

(Come on Wscschool)

Escape

The escape () function encodes the string so that it can be read on all computers.

Hints and Notes

tip: You can use Unescape () to decode an escape () encoded string.


toGMTString:

Definition and usage

The toGMTString () method converts a Date object to a string based on Greenwich mean GMT (GMT) and returns the result.

Grammar
Dateobject.togmtstring ()
return value

The string representation of the Dateobject. This date is converted from the local time zone to the GMT time zone before being converted to a string.

Example 1

In this example, we will convert today's date to a (based on GMT) string:

<script type= "Text/javascript" >var d = new Date () document.write (d.togmtstring ()) </script>

Output:

Thu, Oct 05:41:45 GMT

prompt () method:


Definition and usage

The prompt () method is used to display a dialog box that prompts the user for input.

Grammar
Prompt (Text,defaulttext)
Parameters Description
Text Optional. The plain text to display in the dialog box (instead of the HTML-formatted text).
DefaultText Optional. The default input text.
Description

Returns NULL if the user clicks the Cancel button of the prompt box. If the user clicks the Confirm button, the text that is currently displayed in the input field is returned.

It will block all user input to the browser until the user clicks the OK button or the Cancel button to close the dialog box. When prompt () is called, execution of the JavaScript code is paused, and the next statement is not executed until the user responds.

650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/A6/FF/wKioL1nfA1jx6ZLEAAGf3slQbCY663.png-wh_500x0-wm_ 3-wmp_4-s_1882269500.png "title=" image 1.png "alt=" Wkiol1nfa1jx6zleaagf3slqbcy663.png-wh_50 "/>


This article is from the "Jianbo" blog, make sure to keep this source http://jianboli.blog.51cto.com/12075002/1971692

JavaScript Objects Escape and toGMTString

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.