Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get img dimensions from remote url js

function getMeta(url, callback) {
    var img = new Image();
    img.src = url;
    img.onload = function() { callback(this.width, this.height); }
}
getMeta(
  "http://snook.ca/files/mootools_83_snookca.png",
  function(width, height) { alert(width + 'px ' + height + 'px') }
);
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to add a right click listener javascript 
Javascript :: moment format date dd/mm/yyyy 
Javascript :: jquery clear select 2 
Javascript :: disable click event jquery 
Javascript :: javascript get string between two characters 
Javascript :: get query from url react router dom v6 
Javascript :: get text inside element javascript 
Javascript :: jquery insert after 
Javascript :: jquery last character in string 
Javascript :: js random string 
Javascript :: add select option javascript 
Javascript :: remove last 3 characters from string javascript 
Javascript :: javascript change string at particular index 
Javascript :: how to connect frontend with solidity 
Javascript :: js proxy to array 
Javascript :: horizontal divider react native 
Javascript :: how to check if file upload is empty jquery 
Javascript :: javasctipt unix timestamp from date 
Javascript :: javascript change web page title 
Javascript :: get parameter from next.js route 
Javascript :: before in material ui style 
Javascript :: momentjs number of days between two dates 
Javascript :: codeigniter raw query 
Javascript :: get child element by class javascript 
Javascript :: javascript remove from array by index 
Javascript :: express check if object is empty 
Javascript :: js appendchild wait for callback 
Javascript :: submit form using ajax 
Javascript :: trigger click jquery 
Javascript :: javascript push item to beginning of array 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =