js 易混淆定義

2021-09-13 01:38:09 字數 1484 閱讀 9300

一.阻止事件冒泡

ie ev.cancelbubble =true ,非ie ev.stoppropagation()

二.阻止預設事件

return false 或 ev.preventdefault()

三.函式宣告 與 函式表示式

function functionname(arg){} //函式宣告

var afunction = function(arg){} //函式表示式

四.new 操作符原理

var person = function(name)

person.prototype.sayhello = function()

var p1 = new person('hanmei');

p1.sayhello();

1. 建立乙個類的例項:建立乙個空物件obj,然後把這個空物件的__proto__設定為person.prototype(即建構函式的prototype);

2. 初始化例項:建構函式person被傳入引數並呼叫,關鍵字this被設定指向該例項obj;

3. 返回例項obj。

function new(f);  /*第一步*/

return function()

}

五.程式中捕獲異常的方法

trycatch(e)finally
六、ajax 原理

//傳送合適的請求頭

xhr.onreadystatechange =function()

}xhr.send("foo=bar&lorem=ipsum");

// xhr.send('string');

// xhr.send(new blob());

// xhr.send(new int8array());

// xhr.send();

// xhr.send(document);七. offsetwidth offsetheight和clientwidth clientheight的區別

offsetwidth,offsetheight (content +padding+border)

clientwidth,offsetheight(content+padding)

自定義控制項中易混淆方法

一大波自定義控制項 view.getscrollx 說明 它表示的是當前的螢幕x座標的最小值 移動的距離 向右滑動時移動的距離為正值,向左滑動時移動的距離為負值 它的起始點始終是最開始接觸螢幕滑動的座標點 只要手指沒有離開螢幕的話 它的值即為離開第一頁的最短距離 表示當前滑塊的x座標 view.sc...

mysql易混淆點

1 alter table 表名 change name names char 40 after 欄位名 改變位置放到字段之後 before 放到字段之前 2 查詢要攜帶索引字段,通常放在select之後第乙個 3 檢視檢視命令 show table status where comment vie...

js混淆還原工具 js混淆解密 還原混淆方法

方法一 方法二 混淆後的測試 eval function p,a,c,k,e,d if replace string e function c 1 while c if k c p p.replace new regexp b e c b g k c return p 1 0 6 2 4 8 3 2...