9 Replies Latest reply on Nov 3, 2015 9:55 AM by Karl Heinz Kremer

    Re-Tool JavaScript to work with PDF

    j92725037x

      I have copied a script from "Focus/blur methods and events | JavaScript Tutorial" that works in a web page, but I don't know how to make it work within a PDF. The function focuses on a web page that is already open:

       

      <script>
        var win = open('/','test')
      
        function getAttention(win) {
          win.focus()
          var i = 0
          var show = ['************', win.document.title]
      
          var focusTimer = setInterval(function() { 
            if (win.closed) {
              clearInterval(focusTimer)
              return
            }  
            win.document.title = show[i++ % 2]
          }, 1000)
      
          win.document.onmousemove = function() {
            clearInterval(focusTimer)
            win.document.title = show[1]
            win.document.onmousemove = null
          }
        }
      </script>
         
      <input type="button" onclick="getAttention(win)" value="getAttention(win)">
      

       

      Any help would be appreciated. Thank you!