ImageVerifierCode 换一换
你正在下载:

js工具.docx

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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

本文(js工具.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

js工具.docx

1、js工具 a=62; function encode() var code = document.getElementById(code).value; code = code.replace(/rn+/g, ); code = code.replace(/g, ); var tmp = code.match(/b(w+)b/g); tmp.sort(); var dict = ; var i, t = ; for(var i=0; itmp.length; i+) if(tmpi != t) dict.push(t = tmpi); var len = dict.length; var ch

2、; for(i=0; ilen; i+) ch = num(i); code = code.replace(new RegExp(b+dicti+b,g), ch); if(ch = dicti) dicti = ; document.getElementById(code).value = eval(function(p,a,c,k,e,d)e=function(c)return(c35?String.fromCharCode(c+29):c.toString(36);if(!.replace(/,String)while(c-)de(c)=kc|e(c);k=function(e)retu

3、rn de;e=function()returnw+;c=1;while(c-)if(kc)p=p.replace(new RegExp(b+e(c)+b,g),kc);return p( + +code+,+a+,+len+,+ dict.join(|)+.split(|),0,); function num(c) return(c35?String.fromCharCode(c+29):c.toString(36); function run() eval(document.getElementById(code).value); function decode() var code =

4、document.getElementById(code).value; code = code.replace(/eval/, ); document.getElementById(code).value = eval(code); function do_js_beautify() document.getElementById(beautify).disabled = true; js_source = document.getElementById(code).value.replace(/s+/, ); tabsize = document.getElementById(tabsiz

5、e).value; tabchar = ; if (tabsize = 1) tabchar = t; if (js_source & js_source.charAt(0) = ) document.getElementById(code).value = style_html(js_source, tabsize, tabchar, 80); else document.getElementById(code).value = js_beautify(js_source, tabsize, tabchar); document.getElementById(beautify).disabl

6、ed = false; return false; function pack_js(base64) var input = document.getElementById(code).value; var packer = new Packer; if (base64) var output = packer.pack(input, 1, 0); else var output = packer.pack(input, 0, 0); document.getElementById(code).value = output; function Empty() document.getEleme

7、ntById(code).value = ; document.getElementById(code).select(); function GetFocus() document.getElementById(code).focus(); function js_beautify(js_source_text, indent_size, indent_character, indent_level) var input, output, token_text, last_type, last_text, last_word, current_mode, modes, indent_stri

8、ng; var whitespace, wordchar, punct, parser_pos, line_starters, in_case; var prefix, token_type, do_block_just_closed, var_line, var_line_tainted; function trim_output() while (output.length & (outputoutput.length - 1 = | outputoutput.length - 1 = indent_string) output.pop(); function print_newline(

9、ignore_repeated) ignore_repeated = typeof ignore_repeated = undefined ? true: ignore_repeated; trim_output(); if (!output.length) return; / no newline on start of file if (outputoutput.length - 1 != n | !ignore_repeated) output.push(n); for (var i = 0; i indent_level; i+) output.push(indent_string);

10、 function print_space() var last_output = output.length ? outputoutput.length - 1 : ; if (last_output != & last_output != n & last_output != indent_string) / prevent occassional duplicate space output.push( ); function print_token() output.push(token_text); function indent() indent_level+; function

11、unindent() if (indent_level) indent_level-; function remove_indent() if (output.length & outputoutput.length - 1 = indent_string) output.pop(); function set_mode(mode) modes.push(current_mode); current_mode = mode; function restore_mode() do_block_just_closed = current_mode = DO_BLOCK; current_mode

12、= modes.pop(); function in_array(what, arr) for (var i = 0; i = input.length) return , TK_EOF; c = input.charAt(parser_pos); parser_pos += 1; if (c = n) n_newlines += 1; while (in_array(c, whitespace); if (n_newlines 1) for (var i = 0; i 2; i+) print_newline(i = 0); var wanted_newline = (n_newlines

13、= 1); if (in_array(c, wordchar) if (parser_pos input.length) while (in_array(input.charAt(parser_pos), wordchar) c += input.charAt(parser_pos); parser_pos += 1; if (parser_pos = input.length) break; / small and surprisingly unugly hack for 1E-10 representation if (parser_pos != input.length & c.matc

14、h(/0-9+Ee$/) & input.charAt(parser_pos) = -) parser_pos += 1; var t = get_next_token(parser_pos); c += - + t0; return c, TK_WORD; if (c = in) / hack for in operator return c, TK_OPERATOR; return c, TK_WORD; if (c = ( | c = ) return c, TK_START_EXPR; if (c = ) | c = ) return c, TK_END_EXPR; if (c = )

15、 return c, TK_START_BLOCK; if (c = ) return c, TK_END_BLOCK; if (c = ;) return c, TK_END_COMMAND; if (c = /) var comment = ; / peek for comment /* . */ if (input.charAt(parser_pos) = *) parser_pos += 1; if (parser_pos input.length) while (! (input.charAt(parser_pos) = * & input.charAt(parser_pos + 1

16、) & input.charAt(parser_pos + 1) = /) & parser_pos = input.length) break; parser_pos += 2; return /* + comment + */, TK_BLOCK_COMMENT; / peek for comment / . if (input.charAt(parser_pos) = /) comment = c; while (input.charAt(parser_pos) != x0d & input.charAt(parser_pos) != x0a) comment += input.char

17、At(parser_pos); parser_pos += 1; if (parser_pos = input.length) break; parser_pos += 1; if (wanted_newline) print_newline(); return comment, TK_COMMENT; if (c = | / string c = | / string (c = / & (last_type = TK_WORD & last_text = return) | (last_type = TK_START_EXPR | last_type = TK_END_BLOCK | las

18、t_type = TK_OPERATOR | last_type = TK_EOF | last_type = TK_END_COMMAND) / regexp var sep = c; var esc = false; c = ; if (parser_pos = input.length) break; parser_pos += 1; if (last_type = TK_END_COMMAND) print_newline(); return sep + c + sep, TK_STRING; if (in_array(c, punct) while (parser_pos = inp

19、ut.length) break; return c, TK_OPERATOR; return c, TK_UNKNOWN; /- indent_character = indent_character | ; indent_size = indent_size | 4; indent_string = ; while (indent_size-) indent_string += indent_character; input = js_source_text; last_word = ; / last TK_WORD passed last_type = TK_START_EXPR; /

20、last token type last_text = ; / last token text output = ; do_block_just_closed = false; var_line = false; var_line_tainted = false; whitespace = nrt .split(); wordchar = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$.split(); punct = + - * / % & + - = += -= *= /= %= = = != != = =

21、= = & &= | | ! ! , : ? = |=.split( ); / words which should always start on new line. line_starters = continue,try,throw,return,var,if,switch,case,default,for,while,break,function.split(,); / states showing if we are currently in expression (i.e. if case) - EXPRESSION, or in usual block (like, proced

22、ure), BLOCK. / some formatting depends on that. current_mode = BLOCK; modes = current_mode; indent_level = indent_level | 0; parser_pos = 0; / parser position in_case = false; / flag for parser that case/default has been processed, and next colon needs special attention while (true) var t = get_next

23、_token(parser_pos); token_text = t0; token_type = t1; if (token_type = TK_EOF) break; switch (token_type) case TK_START_EXPR: var_line = false; set_mode(EXPRESSION); if (last_type = TK_END_EXPR | last_type = TK_START_EXPR) / do nothing on ( and )( and and ( . else if (last_type != TK_WORD & last_typ

24、e != TK_OPERATOR) print_space(); else if (in_array(last_word, line_starters) & last_word != function) print_space(); print_token(); break; case TK_END_EXPR: print_token(); restore_mode(); break; case TK_START_BLOCK: if (last_word = do) set_mode(DO_BLOCK); else set_mode(BLOCK); if (last_type != TK_OP

25、ERATOR & last_type != TK_START_EXPR) if (last_type = TK_START_BLOCK) print_newline(); else print_space(); print_token(); indent(); break; case TK_END_BLOCK: if (last_type = TK_START_BLOCK) / nothing trim_output(); unindent(); else unindent(); print_newline(); print_token(); restore_mode(); break; case TK_WORD: if (do_block_just_c

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1