Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

onClick: share image on Facebook angular 9

<!DOCTYPE html>
<html>
  
<head>
    <style type="text/css" media="all">
        /* This CSS is optional */
        #share-button {
            padding: 10px;
            font-size: 24px;
        }
    </style>
</head> 
  
<body>
    <!-- The share button -->    
    <button id="share-button">Share</button>
      
    <!-- These line breaks are optional -->
    <br/>
    <br/>
    <br/>
  
    <!-- The anchor tag for the sharing link -->
    <a href="#"></a>
    <script type="text/javascript" charset="utf-8">
        // Make sure you write this code inside the 
        // script tag of your HTML file 
  
        // Storing the URL of the current webpage
        const URL = window.location.href.slice(7);
        // We used the slice method to remove 
        // the 'http://' from the prefix 
  
        // Displaying the current webpage link
        // on the browser window 
        const link = document.querySelector('a');
        link.textContent = URL;
        link.href = URL;
  
        // Displaying in the console
        console.log(URL);
    </script>    
</body>
    
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: random jwt secret key generator 
Javascript :: configuring styled component to support ssr and hydration 
Javascript :: correct code for the { "vars": "local" } 
Javascript :: Execercise for loop 
Javascript :: node fs get size 
Javascript :: react-native-wagmi-charts 
Javascript :: how to get the first element in an array in javascript 
Javascript :: jquery keypress div color change 
Javascript :: Remove special char 4m JS and Join 
Javascript :: how to access property from inside an array 
Javascript :: how to put condition on pagination material table 
Javascript :: react onwheel preventDefault 
Javascript :: autonumeric stimulus 
Javascript :: how to add github secrets in javascript 
Javascript :: javascript How can i do optional function 
Javascript :: add flag persmison to write file nodejs 
Javascript :: angularjs how to get a response from a post request 
Javascript :: Fire "data-ng-change" programatically or another way to change value of input on website using Angular JS 
Javascript :: Understanding higher order JavaScript functions 
Javascript :: Pass JSON array to function in React as props and then count items in area 
Javascript :: What is the best way to download mulitple images using jquery 
Javascript :: javascript get value outside function 
Javascript :: style dropdown react native picker 
Javascript :: Javascript array of array loop 
Javascript :: dfs javascript 
Javascript :: phaser reverse matrix columns 
Javascript :: puppeteer create folder 
Javascript :: kendo grid column template based on condition 
Javascript :: array operations = map, filter, find, reduce, some, every, indexOf 
Javascript :: add array and sort 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =