Closed TuningGuide closed 8 years ago
Minor changes to TuningGuide's code:
return function(bibSrc, bibElemId, opts) {
...
var $bibSrc = null;
if(bibsrc.indexOf('/') === -1) {
$bibSrc = $(bibsrc);
}
if ($bibSrc && $bibSrc.length) { // we found an element, use its HTML as bibtex
new Bib2HTML($bibSrc.html(), $pubTable, options);
$bibSrc.hide();
} else { // otherwise we assume it is a URL
var callbackHandler = function(data) {
new Bib2HTML(data, $pubTable, options);
};
$.get(bibsrc, callbackHandler, "text");
}
Thanks guys! It was an issue with newer jQueries than the ancient version used by the example. Should be fixed in commit e8c1c2ac410d2fb4a5e6656779bf09fba9d51efc along with other jQuery issues.
I would change it to something like: