Detecting unAPI in dynamic content


I've been experimenting with Zotero and Evergreen. The "basic" Evergreen search interface works extremely well (content generated server-side with unAPI IDs), but the "dynamic" (default) Evergreen interface isn't recognized at all.

I've tweaked a local instance of Evergreen to add the unAPI ID when the page initially loads, rather than forcing you to click the "View MARC" button, but Zotero still doesn't recognize unAPI. My guess is that because Evergreen loads about 30 JavaScript files that do all the work of dynamically adding the content, and the unAPI ID isn't added until close to end of the run of JavaScript, Zotero parses just the static HTML and fails to find the unAPI ID. Here's a sample link:

Is it possible for Zotero to parse the DOM after the JS init() event has finished?
  • Just a follow up - as it turns out, even if I hard coded unAPI IDs in the dynamic output, Zotero still wasn't signalling that it recognized a resource. And that seems to be because the unAPI server link used in the dynamic content is a relative link from the root of the server, rather than an absolute link that includes the hostname. Once I included the hostname in the unAPI server link, Zotero was able to find the MODS representation for the hard coded link and provide a citation. Yay!

    So - the findings of the exercise are:

    1. Confirmation that Zotero doesn't parse the DOM after manipulation events have been triggered.

    2. Zotero requires an absolute link for the unAPI server.

    More info at if you're interested.
Sign In or Register to comment.