Open In App

HTML <script> referrerpolicy Attribute

The HTML <script> referrerpolicy Attribute is used to specify the reference information that will be sent to the server when fetching the script. 

Syntax:



<script referrerpolicy="no-referrer|no-referrer-when-downgrade|
        origin|origin-when-cross-origin|same-origin|
        strict-origin-when-cross-origin|unsafe-url">

Attribute Values: 

Example: Below code illustrates the use of referrerpolicy attribute in <script> element. 






<!DOCTYPE html>
<html>
 
<head>
    <title>HTML script referrerpolicy Attribute</title>
</head>
 
<body style="text-align: center">
    <h1>GeeksForGeeks</h1>
 
    <h2>HTML script referrerpolicy Attribute</h2>
 
    <br />
    <button>Submit</button>
 
    <script id="myGeeks" type="text/javascript"
        src="my_script.js" referrerpolicy="no-referrer">
    </script>
</body>
 
</html>

 Output: 

Supported Browsers: 

 

Article Tags :