I'm new to the site and also to JavaScript. I started writing this little UserScript as a start. Basically what it does is, when you hover your mouse pointer over a thumbnail image, if enlarges that picture to a popup window.
I used Firebug and identified the right code block which contains the image URL.
<div id="profPhotos">
<a class="profPhotoLink" href="photo.php?pid=6054657&uid=1291148517">
<img width="163" height="130" src="http://th0.max.ipstatic.net/thumbs/163x130/0e/e9/604x402_1291148517_6054657.jpg">
</a>
<br>
</div>
And I wrote the below code to retrieve the URL to a variable.
var thumbURL = document.getElementById("profPhotos").getAttribute("src");
But when I run that piece of code in the Firebug console just to check it, it retrieves null
.
Am I doing something wrong here? Your kind help would be very much appreciated. :)