bigfoot icon indicating copy to clipboard operation
bigfoot copied to clipboard

Will not work inside jQuery Ajax Window

Open kacinash opened this issue 10 years ago • 5 comments

I attempted to implement the footnotes on a page that is typically viewed as a popup jQuery ajax window, but it does not work. If I view the actual page, it works fine. Is there any work around to get it to function inside the ajax window?

kacinash avatar Oct 16 '15 19:10 kacinash

What do you mean by an Ajax window? You will probably have to re-call $.bigfoot whenever new content is added that contains footnotes, regardless of how it is added (Ajax, manual DOM additions, etc).

lemonmade avatar Oct 20 '15 15:10 lemonmade

You can see an example of the window here: just click on "Fort No 1" and the window will pop up. When I was styling the footnotes there with bigfoot, the java did not work--there was just floating text there. But if I went to the actual page that the ajax window is pulling the text from, bigfoot would work just fine. So something about the window and bigfoot was conflicting.

kacinash avatar Oct 20 '15 15:10 kacinash

After the content is retrieved and the modal is added, do you run $.bigfoot() again? It's hard to tell what that part of the JavaScript is doing.

lemonmade avatar Oct 20 '15 15:10 lemonmade

I'm not sure what you mean by that. I have

<script type="text/javascript" src="./resources/bigfoot/bigfoot.js"></script>
<script type="text/javascript">
$.bigfoot();
...

in the footer of the page, but my guess is that it the window is not loading it for some reason.

kacinash avatar Oct 20 '15 15:10 kacinash

This is likely a problem with whatever is loading the content via AJAX not running the scripts of the retrieved page when adding it to the DOM. If whatever does the AJAX provides a callback for when the content is added, you could manually call $.bigfoot().

lemonmade avatar Oct 20 '15 16:10 lemonmade