본문
방법1----------------------------------
function ccc(talk){
alert(talk);
}
function addEvent(object, event ,listener)
{
if (object.addEventListener){
object.addEventListener(event, listener, false);
} else if (object.attachEvent){
object.attachEvent('on' + event, listener);
}
}
addEvent(window,'load',new Function("ccc('가')"));
방법2----------------------------------
function addOnload(f) {
var nowonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = f;
}
else {
window.onload = function() {
if (nowonload) {
nowonload();
}
f();
}
}
}
addOnload(function() {
xxx();
});
댓글목록
등록된 댓글이 없습니다.