optimise main link checking function to use native JavaScript instead of jQuery. One step closer to removing the jQuery dependency and additional overhead