3

I'm trying to load HTML content via javascript code (not via target in HTML) with Featherlight, but not really sure what I'm doing wrong.

Following code gives me no errors and it pops up a small empty Modal, and does not load the HTML in it:

$.featherlight($(), {
    contentFilters: 'html',
    html: 'support.html'
});

Would greatly appreciate help on this if anyone has a clue. Doesn't even have to be pure HTML, as long as the content is dynamically loaded somehow with featherlight from a second file.

urbz
  • 2,663
  • 1
  • 19
  • 29
Looren
  • 31
  • 4

2 Answers2

0

The html content filter is for html strings. The ajax content filter is probably what you are looking for.

Marc-André Lafortune
  • 78,216
  • 16
  • 166
  • 166
  • Thank you for your answer, Although I have tried using 'ajax' instead of 'html' in 'contentFilters' but it produces the same result. – Looren Jan 27 '17 at 08:17
0

This is the correct way:

$.featherlight($(), {
    contentFilters: 'ajax',
    ajax: 'file.ext .selector'
});