Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php header("Access-Control-Allow-Origin: *"); ?>
- <html>
- <head>
- <script>
- function success(response){
- document.getElementById("response").innerHTML = response;
- }
- window.onerror = function (message, url, line, column, error) {
- obj = {
- 'type':'error',
- 'message':message,
- 'line':line,
- 'column':column
- }
- obj.url = (url != '') ? url : window.location.href;
- obj.stack = (error != null) ? error.stack : null;
- postAjax("/jserrors/logger.php", obj);
- return true;
- };
- function postAjax(url, data) {
- var params = Object.keys(data).map(
- function(k){ return encodeURIComponent(k) + '=' + encodeURIComponent(data[k]) }
- ).join('&');
- var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
- xhr.open('POST', url, true);
- xhr.onreadystatechange = function() {
- if (xhr.readyState>3 && xhr.status==200) {}
- };
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
- xhr.send(params);
- return xhr;
- }
- </script>
- <script src="http://www.jbcse.com/script.php" crossorigin="anonymous" onerror="alert();"></script>
- </head>
- <body>
- <div id="response"></div>
- <script>
- function a(){
- b();
- }
- function b(){
- c();
- }
- function c(){
- derp();
- }
- a();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement