Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $.ajax({
- url: 'http://127.0.0.1/api/plugin/mysimpleapiplugin',
- type: 'GET',
- dataType: 'json',
- data: 'command:command3, data:data',
- success: function() { alert('hello!'); },
- error: function() { alert('boo!'); },
- beforeSend: setHeader
- });
- });
- function setHeader(xhr) {
- xhr.setRequestHeader('X-Api-Key', '65299B7128094CF787E1998F09DF0D88');
- xhr.setRequestHeader('Content-Type', 'application/json');
- }
- </script>
- </head>
- <body>
- <h1>Some Text</h1>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement