<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Get the header of the current page</title> </head> <body > <script type="application/javascript"> <!-- var x = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); x.open("GET",window.location.href, false); x.send(); console.log (x.getAllResponseHeaders ()); --> </script> </body> </html>