<button onclick='requestWithoutAjax("https://ssl.bing.com/webmaster/api.svc/pox/SubmitUrl?apikey= 27aedaeb929d4345b55085ff90be6ccb", {"siteUrl":"https://www.washborodems.org","url":"https://www.washborodems.org/home","url":"https://www.washborodems.org/josephine-noone","url":"https://www.washborodems.org/sonia-ron","url":"https://www.washborodems.org/chris-bauknight","url":"https://www.washborodems.org/follow-us","url":"https://www.washborodems.org/about-us","url":"https://www.washborodems.org/privacy","url":"https://www.washborodems.org/terms"})'>Make post call</button>
JavaScript
/**
* Make a request without ajax and without refresh the page
* Invisible for the user
* @param url string
* @param params object
* @param method string get or post
**/
function requestWithoutAjax( url, params, method ){
params = params || {};
method = method || 'post';
// function to remove the iframe
var removeIframe = function( iframe ){
iframe.parentElement.removeChild(iframe);
};
// make a iframe...
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.onload = function(){
var iframeDoc = this.contentWindow.document;
// Make a invisible form
var form = iframeDoc.createElement('form');
form.method = method;
form.action = url;
iframeDoc.body.appendChild(form);
// pass the parameters
for( var name in params ){
var input = iframeDoc.createElement('input');
input.type = 'hidden';
input.name = name;
input.value = params[name];
form.appendChild(input);
}
form.submit();
// remove the iframe
setTimeout( function(){
removeIframe(iframe);
}, 500);
};
document.body.appendChild(iframe);
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.