pacozaa

appletLoadValidateIE11Only JS

Jul 9th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. function appletLoad()
  2. {
  3. var isIE11 = !!navigator.userAgent.match(/Trident.*rv[ :]*11\./)
  4. if (isIE11)
  5. {
  6. if (typeof document.myApplet != 'undefined')
  7. { //IE9 will come here only when it is loaded
  8. if (document.myApplet.isActive())
  9. {
  10. $("#smartCard").css("cursor", "default");
  11. $("#smartCardCtl").css("cursor", "default");
  12. $("#taxId").css("cursor", "default");
  13. $("#cardIdCtl").css("cursor", "default");
  14. $('#smartCard').button('reset');
  15. $("#smartCard").prop("disabled",false);
  16. $('#smartCardCtl').button('reset');
  17. $("#smartCardCtl").prop("disabled",false);
  18. $('#myModal').modal('hide');
  19. }
  20. else
  21. {
  22. $("#smartCard").css("cursor", "wait");
  23. $("#smartCardCtl").css("cursor", "wait");
  24. $("#taxId").css("cursor", "wait");
  25. $("#cardIdCtl").css("cursor", "wait");
  26. $('#smartCard').button('loading');
  27. $('#smartCardCtl').button('loading');
  28. $('#myModal').modal('show');
  29. setTimeout(appletLoad(), 100);
  30. }
  31. }
  32. else
  33. {
  34. $('#smartCard').button('loading');
  35. $('#smartCardCtl').button('loading');
  36. $('#myModal').modal('show');
  37. setTimeout(appletLoad(), 100);
  38. }
  39. }
  40. else
  41. {
  42. appletError('ไม่สามารถอ่านบัตร SmartCard ได้เนื่องจาก Web Browser ไม่รองรับ!');
  43. $('#smartCard').button('reset');
  44. $("#smartCard").prop("disabled",true);
  45. $('#smartCardCtl').button('reset');
  46. $("#smartCardCtl").prop("disabled",true);
  47. $('#myModal').modal('hide');
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment