What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-24 19:55:02
how to send json in js with post
// Sending and receiving data in JSON format using POST method // var xhr = new XMLHttpRequest(); var url = "url"; xhr.open("POST", url, true); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onreadyst... Add solution -
Javascript 2022-01-30 10:20:39
xhr post
var url = "https://example.com/"; var xhr = new XMLHttpRequest(); xhr.open("POST", url); xhr.setRequestHeader("Content-Type", "application/json"); xhr.onreadystatechange = function () { if (xhr.readyState === ... Add solution -
Javascript 2021-11-10 03:43:09
pure javascript post request
var xhr = new XMLHttpRequest(); // we defined the xhr xhr.onreadystatechange = function () { if (this.readyState != 4) return; if (this.status == 200) { var data = JSON.parse(this.responseText); // we get the returned data }... Add solution -
Javascript 2021-11-08 11:53:16
get authorization header javascript in my page
<!DOCTYPE html> <html> <head> </head> <body> <button onclick="tryit();">PDF</button> <script> function tryit() { var win = window.open('_blank'); downloadFile('/pdf', function(b... Add solution -
Javascript 2021-10-24 08:03:10
js check if image url exists
// create an XHR object const xhr = new XMLHttpRequest(); // listen for `onload` event xhr.onload = () => { if (xhr.status == 200) { console.log('Image exists.'); } else { console.log('Image does not exist.'); } }; // crea... Add solution -
C++ 2021-10-20 18:01:14
nodemcu web server slider
// Import required libraries #include <ESP8266WiFi.h> #include <ESPAsyncTCP.h> #include <ESPAsyncWebServer.h> // Replace with your network credentials const char* ssid = "REPLACE_WITH_YOUR_SSID"; const char* password = "R... Add solution -
Javascript 2021-10-12 23:44:05
xhr post send
var xhr = new XMLHttpRequest(); xhr.open("POST", '/url', true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { // Call a function when the state changes. ... Add solution