TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Run a command on a computer from a button on a web page using a Bookmark URL

    Scheduled Pinned Locked Moved Instructions
    1 Posts 1 Posters 2.9k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • RussR Online
      Russ
      last edited by Russ

      This page demonstrates the code in action:
      https://www.w3schools.com/code/tryit.asp?filename=FUUM39NOG124

      This is the code for your HTML page:

      <!DOCTYPE html>
      <html>
      <body>
      <h3>A demonstration of how to put a TRIGGERcmd bookmark button on a web page</h3>
      <p>Click to run Calculator on Russ's computer:</p>
      
      <button type="button" id="myBtn" onclick="myFunction()">Try it</button>
      
      <p id="demo"></p>
      <script>
      function myFunction() {
      
      	const request = async () => {
         	const response = await fetch(
                // You can replace this Bookmark URL with your own:
                'https://www.triggercmd.com/trigger/bookmark?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJib29rbWFya3VzZXJfaWQiOiI1OGJiM2E3N2YyZjgzMTUzMjI0NzM1YjYiLCJjb21wdXRlcl9pZCI6IjViNGI5OGE1YTBlMTNhMDAxYmVlZWQ5MiIsImNvbW1hbmRfaWQiOiI1YjRiOThhNmEwZTEzYTAwMWJlZWVkOTMiLCJleHBpcmVzSW5TZWNvbmRzIjoiIiwiaWF0IjoxNTM1ODI2NzUzfQ.Bm5q9_6DMcv3yH09yOtCu8i-NqIK8T9Inhn8NJc8kDM'
                , { method: 'POST'}
              );
              
              const body = await response.json();    
              console.log(body);
      	}
      
      	request();
      }
      
      </script>
      
      </body>
      </html>
      

      To get a Bookmark URL for your own command, just click the red Bookmark button next to your command, and copy the URL from your browser's address bar.

      Russell VanderMey

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post