getButterfly
Resume

NAVIGATION

ATTRIBUTION

getButterfly
Dublin, Ireland

All Content Copyright ©2019
getButterfly

AJAX Request Using Vanilla JavaScript

This is how you create an AJAX request with optional GET parameters in vanilla JavaScript. Note that you need to be on the same domain for the AJAX call to work.

JavaScript

function recordAb(parameters) {
    var xhttp = new XMLHttpRequest();

    xhttp.open('GET', 'https://www.example.com/receiver.php', true);
    xhttp.send();
}

Usage

recordAb('?this=1&that=2');

Find more JavaScript tutorials, code snippets and samples here.

Do you want better SEO? More traffic? More conversions? More growth? We help companies exponentially grow their traffic and conversions, while outranking their competitors. With more than 10 years of experience, we’ve learned what is valuable to our clients.
SEO Dublin | SEO Malta

My Battle Tested Recommendations

Jetpack
Dreamhost
WordPress.com
CodeCanyon
SEMrush

Disclaimer: These recommendations contain affiliate links.


Privacy Policy