Using a key to execute a javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cainnech
    New Member
    • Nov 2007
    • 132

    Using a key to execute a javascript

    Hi guys,

    I want to ask your ideas on something.

    I want to add something to my javascripts to prevent them from being executed. Just call it like a sort of license. So when someone executes a script of mine, the script first checks online if it can be executed. If not, then it won't run, else it will run.

    I could program the javascript to send check online and send a reply back. But that reply could be mimicked by the user by adapting the javascript, so that's not a very good solution.

    The scripts where I want to add this are not scripts that are used on websites, they are scripts that are being used in applications. So basically I want to provide a sort of license system for HTA's.

    Greets,
    Cainnech
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    the only things that you reliably could suppress are serverside calls ... like XMLHttpRequests or such ... by using a session and a session id that must match ... all clientside JavaScript-code could be modified by a user at any time ...

    kind regards

    Comment

    • Cainnech
      New Member
      • Nov 2007
      • 132

      #3
      I was also thinking of using something like XMLHttprequest but how do you have that interrupt a script?

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        only if the script would ask the server during its runtime ... but the script would need to react in a appropriate way ... you basicly cannot interrupt a script itself in a reliable way ... but you might create a trap ... when the request is 'false' then the script will not get the needed response to continue ... so it would stop at this point ...

        Comment

        Working...