by
0
4
157
0
Popular
Tagged
Specified
OpenSource
Created
Modified Jul 15, 2017

Published on:

Languagecsharp
Languagejavascript
LicenseMIT_X11
TechnologyAJAX

Prueba de Ajax

Prueba de Axaj en javascript nativo.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/2228872/Prueba-de-Ajax?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
function ajax() { var elements = document.getElementsByClassName("formVal"); var formData = new FormData(); for(var i=0; i<elements.length; i++) { formData.append(elements[i].name, elements[i].value); } var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4 && xmlHttp.status == 200) { alert(xmlHttp.responseText); } } xmlHttp.open("post", "prueba.php"); xmlHttp.send(formData); }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus