Skip to content

Instantly share code, notes, and snippets.

@geeknam
Created January 13, 2011 15:17
Show Gist options
  • Save geeknam/778022 to your computer and use it in GitHub Desktop.
Save geeknam/778022 to your computer and use it in GitHub Desktop.
Chrome Extension to get RP pics
function showPic(){
$("#studentImage").hide().html(getPic()).fadeIn(2000);
$("#studentId").val("");
$("#fullname").val("");
}
function getPic(){
var idval = $("#studentId").val();
var nameval = $("#fullname").val();
url = '<img src="Directory of the schools site that pictures resides at' + idval + '-' + nameval + '.jpg" onerror="notFound()"/>';
return url;
}
function notFound(){
errorMsg = '<span class="error">Image not found. Invalid student ID or student name.</span>';
$("#studentImage").html(errorMsg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment