"open a website without really opening" on Javascript

atm I am trying to make an Brute Force password cracker for testing. I decided to use Javascript and I have an idea how to make the password generating thing.
The test page I try to enter uses the GET method, so I can easily enter the generated password in the URL. And the break condition would be something like comparing the URL with the password inserted and the actual URL after submitting it.
But my problem is I have no clue how to check the URL without open the actual website, because this option would slower the hole brute force process so much down that it would be as fast as entering the password myself. So how could I check if the URL is redirecting you to another URL without actual opening it?

Source: stackoverflow-javascript