I have a link to an image an I would like to save it as an image.
For example the link is http://graph.facebook.com/sarfraz.anees/picture. How do I save this into an image variable in javascript so I can use it to do:
document.write("<img src=\"" + pic + "\" class=\"avatar\">")
also would be very useful if someone can guide me on how to resize this image to a 50×50.
Here’s my latest code
UPDATE:
<body id="suggestions" class="default verified ">
<div id="fb-root"></div>
<script type="text/javascript">
FB.init({appId: '1355709392349404', status: true, cookie: true, xfbml: true});
FB.getLoginStatus(function(response) {
if (response.session) {
pic = "http://graph.facebook.com/" + response.session.uid + "/picture";
} else {
window.location = "index.php"
}
});
</script>
<div class="clearfix" id="wrap">
<div id="nav">
<div class="center clearfix">
<h5>
<a href="/main.php">Favor</a>
</h5>
<ul class="icons menu clearfix">
<li>
<a title="You" href="/me">
<script type="text/javascript">
document.write("<img src=\"" + pic + "\" class=\"avatar\">");
</script>
</a>
</li>
Issue is that I can’t get the pic that is on the other script
What’s wrong with just:
or…
?? And it’s already a 50×50 image…