Built-in functions of JavaScript scripting language - Eval, Escape and Unescape

zhaozj2021-02-16  163

Eval - a small JavaScript interpreter in the transmissive expression, a similar interpreter. Var myString = "2 5"; var mysum = adder; mystring

Document.write (MyString "=" mysum "."

Function adder (args) {elsum = evAl (args); RETURN ELSUM;} The output result is: "2 5 = 7"

Escape - Encourse string to format passed through HTTP

Unescape - Decoding strings Var myString = "I am na na na na na na na na na!"; var webfriednlystring = escape (mystring);

Document.write (WebFriendlyString "

"); Document.write (people); output results are as follows: I% 20AM% 20 Na% 20NA% 20NA% 20nA% 20nA% 20nA% 20nuH% 20nA% 20nA% 20nA% 21i am Iron Man- Na Na Na Na Na Na Na Na!

转载请注明原文地址:https://www.9cbs.com/read-8440.html

New Post(0)