skip to Main Content

Calling .js file from HTML using AJAX – Jquery ajax

this js is at index.html between "<script type="text/javascript">" function callanular() { peticion_http = new XMLHttpRequest(); peticion_http.onreadystatechange = showContent; peticion_http.open('GET', 'anular.js', true); peticion_http.send(null); function showContent() { if(peticion_http.readyState == 4) { if(peticion_http.status == 200) { document.getElementById("notice").innerHTML=peticion_http.responseText; } else document.getElementById("notice").innerHTML="ERROR "+peticion_http.status; } }…

VIEW QUESTION

Uncaught TypeError: on null – Jquery ajax

I am using ajax for getting tabular format in my page. The problem is it was working, currently I encounter this problem My code $.each(res,function(index,row){ console.log(row.bookable); //{id: 2, slug: "dire_international_queen", organization_id: 1, roomtype_id: 5, no_bed: "2", …} console.log(row.bookable.slug); // it show…

VIEW QUESTION

Redis – Variable scope inside loop with async call

I'm making an async call (https://github.com/socketio/socket.io-redis#redisadapterclientsroomsarray-fnfunction) with socket.io inside of a loop. elements.forEach((element) => { const foo = { id: element.id, name: element.name, }; // async code io.in(element.id).clients((err, clients) => { foo.clients = clients; }); }); Since this loop will…

VIEW QUESTION
Back To Top
Search