Category : ajax

I don’t know much about the web and Ajax, I read the Sunshine project, This code gives PIN from the user and check it , If PIN was correct get accsess. This is Script in pin.html file : <script> document.querySelector("#form").addEventListener("submit", (e) => { e.preventDefault(); let pin = document.querySelector("#pin-input").value; document.querySelector("#status").innerHTML = ""; let b = JSON.stringify({ ..

Read more

We’ve created one EXE file using the CPP language and create one API like http://localhost:5800/get-id/. when I open in browser return me the perfect output. When I used fetch in HTML > script page, then getting No "Access-Control-Allow-Origin" header is present on the requested resource. Code1: fetch("http://localhost:5800/get-id/", {method: ‘GET’).then(function(response) { console.log(response.text()); }).catch(function(error) { console.log(‘Request failed’, ..

Read more