The src attribute needs to be a url. It won't execute javascript. What you can do though, after the FB api has loaded up, is to call get_profile_pic(), but only after you change it to the following:
function get_profile_pic(){
FB.api("/me/picture?type=square", function(response) {
$('.profile_pic').attr('src', response.data.url);
});
}
Note: this uses jQuery.. If you're not using jQuery, and don't know how to change the src of an image using plain javascript, (and aren't willing to use jQuery), then let me know, and I'll update my answer..
Let me know if this makes sense or if you have any questions :)
Plain Javascript
By placing the code inside window.fbAsyncInit after the FB.init, you can ensure that your code is executed after the facebook api is called. For instance, the following is a plain javascript implementation of the previous script:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : 'YOUR_APP_ID', // App ID from the app dashboard
channelUrl : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
// Additional initialization code such as adding Event Listeners goes here
FB.api("/me/picture?type=square", function(response) {
var profilePics = document.getElementsByClassName('profile_pics');
for (i=0; i<a.length; i++)
{
profilePics[i].src = response.data.url;
}
});
};
// Load the SDK asynchronously
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>