2021-05-30

Accessing a JS variable from a different

I need to access a js variable declared in one block of a html page into another block of the same html page just so I can stop a ajax call that is being made, but I don't know how can I access a variable that was declared into another block. I can't merge the two blocks, everything else is on the table.

        <script>
    $(function() {
      var term = new Terminal('#input-line .cmdline', '#container output');
      term.init();
      });
    </script>
  

   <script>
   term.ajaxHandler.abort();//but how can I access the variable term from the block above,this will be inside a button later
   </script>

Thanks in advance



from Recent Questions - Stack Overflow https://ift.tt/3yRp8Pk
https://ift.tt/eA8V8J

No comments:

Post a Comment