Answers for "image preview from url"

0

image preview for website

<head>
 <meta property="og:image" content="https://raw.githubusercontent.com/nitria/Euroaion-Time-Sieges/main/EuroAionSieges.jpg" />
 <meta property="og:type" content="website" />
 <meta property="og:url" content="https://nitria.github.io/Euroaion-Time-Sieges/"/>
 <meta property="og:title" content="EuroAion Sieges" />
 <meta property="og:description" content="EuroAion Sieges Hours of all Fortress"/>
 </head>
<!--At the minimum, you should use images that are 600 x 315 pixels to display link page posts with larger images. Images can be up to 8MB in size.-->
Posted by: Guest on January-08-2021
0

image preview

// <input type="file" accept="image/*" id="img-input">
// <img id="preview"/>
function readURL(input) {
      if (input.files && input.files[0]) {
          var reader = new FileReader();
          reader.onload = function(e) {
          $('#preview').attr('src', e.target.result);
          }
          reader.readAsDataURL(input.files[0]);
      } else {
          $('#preview').attr('src', '');
      }
    }

  $("#img-input").change(function() {
    readURL(this);
  });
Posted by: Guest on February-10-2022

Browse Popular Code Answers by Language