Background GET requests without Javascript

November 10, 2012

This is a very simple and poor man's way to call a URL when you don't necessary care about the response data

In your markup create a hidden <iframe>

<iframe name='link_loader' style='display:none;'/>

Whenever you need to call a url simply point the target attribute of an anchor to the link_loader iframe

<a href='http://somesite.com/?action=ping' target='link_loader'>Ping</a>
<a href='http://somesite.com/?action=pong' target='link_loader'>Pong</a>

An advantage of such an approach is that unlike regular AJAX solutions, you can make GET requests across multiple domains