Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Using highlight.js to highlight js [SIMPLE VERSION] You can make it better-->
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Syntax Highlighting Example</title>
- <link rel="stylesheet"href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css">
- </head>
- <body>
- <pre> <!-- replace the code in the <code> tag to highlight this is the code im highlighting -->
- <code>
- const data = [2, 27];
- // replace your-endpoint with any your-endpoint
- fetch('/your-endpoint', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(data)
- })
- .then(response => {
- if (response.ok) {
- console.log('Array sent to the database successfully.');
- } else {
- console.error('Error:', response.status);
- }
- })
- .catch(error => {
- console.error('Error:', error);
- });
- </code>
- </pre>
- <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
- <script>
- hljs.highlightAll();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement