Search

'timer'에 해당되는 글 1건

  1. 2016.04.14 Activex Event use in JavaScript

Activex Event use in JavaScript

Programming/JAVA,JSP 2016. 4. 14. 11:26 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

If you want to use Activex Event in JavaScript 



You commonly use JavaScript Event listener


1.  

<script type="text/javascript" for="ActiveXControl" event="LogOn()"></script>


2.   

var ctrl = document.getElementById("ActiveXControl");

ctrl.attachEvent('LogOn', ActiveXControl_LogOn);


function ActiveXControl_LogOn() {

        

}


3.   

var ctrl = document.getElementById("ActiveXControl");

ctrl.addEventListener('LogOn', ActiveXControl_LogOn, false);



function ActiveXControl_LogOn() {

        

}



This way can't use correctly alert method. you can see alert only in debug mode.


I think this situation is have a thread problem.



I suggest other way to use eventhandling


By use timer, This problem can be solved.



// make eventArray 

var eventArray = [];


// if event occured, when you add information to eventArray

eventArray.push(information);


// make Timer

setInterval(function () {

if (eventArray.length > 0) {

var information= eventArray.pop();

alert("information: " + information);

}

}, 100);



This method can be use alert method







'Programming > JAVA,JSP' 카테고리의 다른 글

Get client IP, Location, Address using just JavaScript?  (0) 2016.04.26
Web Browser 점유율 통계  (0) 2016.04.18
JDBC Realm  (1) 2016.03.09
ImageFrameTest  (0) 2016.02.05
Java 채팅 프로그램  (0) 2016.02.04