Created
April 4, 2012 19:00
-
-
Save kirs/2304768 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ror_id(jObjOrString) { | |
var matchResult; | |
if ( isJQ(jObjOrString) ) { | |
var id = jObjOrString.data('ror_id'); | |
if ( ! isset(id) ) { | |
id = jObjOrString.attr('id'); | |
if ( isset(id) ) { | |
matchResult = id.match($.regexp.rorId); | |
id = matchResult ? matchResult[2] : ''; | |
jObjOrString.data('ror_id', id); | |
} else id = ''; | |
} | |
} else { | |
matchResult = jObjOrString.match($.regexp.rorId); | |
id = matchResult ? matchResult[2] : ''; | |
} | |
return id; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment