01.
<
script
type
=
"text/javascript"
>
02.
function preventPasswordSaved() {
03.
var fakePwd = document.getElementById('txtPwd').value;
04.
var fuckPwd = document.getElementById('hdfPwd').value;
05.
var swap = fuckPwd + fakePwd.substr(fakePwd.lastIndexOf('*') + 1);
06.
if (fakePwd.length <
fuckPwd.length
) {
07.
swap
=
fuckPwd
.substr(0, fakePwd.length);
08.
}
09.
document.getElementById('hdfPwd')
.value
=
swap
;
10.
document.getElementById('txtPwd')
.value
=
new
Array(1500).join('*').substr(0, swap.length);
11.
}
12.
13.
//JQuery AJAX
14.
function execAjax(url, data, type, successFunc, errorFunc) {
15.
return $.ajax({
16.
type: type, /*POST/GET*/
17.
url: url,
18.
data: data, /* Parameter jQuery("[attribute^='value']" )*/
19.
contentType: "application/json;
charset
=
utf
-8",
20.
dataType: "json",
21.
success: function (data) {
22.
if (data.hasOwnProperty("d")) {
23.
successFunc(data.d);
24.
} else {
25.
successFunc(data);
26.
}
27.
},
28.
error: function (a, b, c) {
29.
errorFunc(a, b, c);
30.
}
31.
});
32.
}
33.
34.
//MS AJAX
35.
function execMSAjax(wsName, wsMethodName, successFunc, errorFunc) {
36.
if (typeof wsNameSpace === 'undefined' || wsNameSpace === null) {// variable is undefined or null
37.
wsNameSpace
=
"หอย_ERP"
; //wsNameSpace Set value in Master Page
38.
}
39.
return eval(wsNameSpace + '.' + wsName + '.' + wsMethodName + '(' + successFunc + ', ' + errorFunc + ')');
40.
}
41.
</script>
42.
<
body
>
43.
<
form
id
=
"frmLogin"
name
=
"frmLogin"
>
44.
<
input
name
=
"txtPw"
id
=
"txtPwd"
type
=
"text"
onkeyup
=
"preventPasswordSaved();"
autocomplete
=
"off"
/>
45.
<
input
name
=
"hdfPwd"
id
=
"hdfPwd"
type
=
"hidden"
/>
46.
</
form
>
47.
</
body
>