ui icon indicating copy to clipboard operation
ui copied to clipboard

Missing AJAX HTML type in v6

Open jurajkapsz opened this issue 6 months ago • 1 comments

It seems v6 dropped support for loading HTML from external pages ie AJAX, which was available in v5. imho this is a breaking change, also my site with previously v5 stopped working in this manner.

What is the recommended approach to load external HTML in Fancybox v6?

I'm wondering, if I would resemble this feature in a way, eg convert loaded external HTML to inline HTML for v6, how could I work with a loading screen within v6 layer (ie until the external HTML gets loaded).

I know there is the other option of using an iframe, but this wouldn't have the desired outcome in my use case.

Thanks.

jurajkapsz avatar Jun 19 '25 09:06 jurajkapsz

I resolved this atm by loading external HTML via regular JS Web API (fetch) and assigning it to the new html option . I also do it upfront, so no loading screen is needed.

Works quite alright. Don't know if this is the intended way of replacing the former AJAX option, otherwise I can close this issue.

jurajkapsz avatar Jun 27 '25 09:06 jurajkapsz

The latest update adds Ajax support, see https://fancyapps.com/fancybox/guides/html/#ajax

fancyapps avatar Jul 14 '25 10:07 fancyapps

Thanks very much! I haven't tested it yet, as my current project benefits in the end from the new html option with the mentioned own JS fetch of external HTML as I do additional HTML transformations on the retrieved markup.

But I will sure report if I should run into any issues with using this feature.

jurajkapsz avatar Jul 14 '25 20:07 jurajkapsz