codeigniter
This page isn’t working Chrome detected unusual code on this page and blocked it to protect your personal information. ERR_BLOCKED_BY_XSS_AUDITOR
This page isn't working
Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers, and credit cards).
ERR_BLOCKED_BY_XSS_AUDITOR

This page isn’t working – ERR_BLOCKED_BY_XSS_AUDITOR
Mainly,
This error message is occurs when we are trying to post a content with HTML tags or Scripts Tags or Like When Google Chrome believes a “cross-site scripting” attack is happening. These attacks happen when a browser is tricked into rendering HTML or JavaScript that is not meant to be a part of the website being displayed.
Then Chrome Generates This ERROR ”
ERR_BLOCKED_BY_XSS_AUDITOR “
For PHP and All Other PHP Frameworks: Add this below line before post
header('X-XSS-Protection:0');
Print the Div Contents in Php or Javascript
The JavaScript is below..
<script type="text/javascript">
var base_url="<?php echo $this->request->webroot; ?>";
function printDivContents(divID="xshr_print_section") {
//Get the HTML of div
var divElements = document.getElementById(divID).innerHTML;
Popup(divElements);
}
function Popup(data) {
var mywindow = window.open('', 'new div', 'height=400,width=600');
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('<link rel="stylesheet" href="'+base_url+'"css/print.css" type="text/css" />');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.print();
return true;
}
</script>
The HTML file is like-
<div id="xshr_print_section">
<!-- here the printing Contents -->
-
-
-
</div>
How to Update the Current Browser URL
# UPDATE THE CURRENT URL IN BROWSER::
<script> ChangeUrl = function(page, url) { if (typeof (history.pushState) != "undefined") { var obj = { Page: page, Url: url }; history.pushState(obj, obj.Page, obj.Url); $('.breadcrumb-get-a-pro').attr('href', url); } else { alert("Browser does not support HTML5."); } } </script>
Meta Tags for Search Engine Optimization
Meta Tags for Search Engine Optimization
# Meta Tags used for seo::
<meta name="description" content="Stackofcodes is a blog for Learners, Developers, designers. "/> <meta name="robots" content="noimageindex,noarchive,nosnippet"/> <link rel="canonical" href="//www.stackofcodes.in/" /> <meta property="og:locale" content="en_US" /> <meta property="og:type" content="article" /> <meta property="og:title" content="Pricing | Kissmetrics" /> <meta property="og:description" content="Get, keep and grow more customers with Kissmetrics Customer Engagement Automation platform. Built for eCommerce marketers and product teams." /> <meta property="og:url" content="https://www.stackofcodes.in/" /> <meta property="og:site_name" content="Kissmetrics" /> <meta property="og:image" content="" /> <meta property="og:image:secure_url" content="" /> <meta property="og:image" content="" /> <meta property="og:image:secure_url" content="" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:description" content="Stackofcodes is a blog for Learners, Developers, designers." /> <meta name="twitter:title" content="Stackofcodes" /> <meta name="twitter:image" content="" />