opengist icon indicating copy to clipboard operation
opengist copied to clipboard

I need to refresh the page to see my gist embed

Open twhite96 opened this issue 8 months ago • 4 comments

I am using Astro with AstroPaper theme and embedding my gist within this blog setup.

Not sure if you're using lazy loading behind the scenes but it isn't loading at all unless I refresh the page, which isn't ideal.

Image

twhite96 avatar May 18 '25 00:05 twhite96

Can you check what the console says ?

thomiceli avatar May 26 '25 15:05 thomiceli

Can you check what the console says ?

Seems you're loading the script with document.write and Chromium is throwing an error, I really don't know the exact error, but I know it is with the gist script.

document.write('<link rel="stylesheet" href="https://www.example.org/assets/embed-3b762c54.css">');
document.write("\u003cdiv class=\"opengist-embed\" id=\....)

Image

twhite96 avatar May 27 '25 03:05 twhite96

Seems you can't use document.write to load an async script. Do you need some help with this? My gig was mainly frontend so just let me know.

twhite96 avatar May 27 '25 03:05 twhite96

Yeah document.write is deprecated and has been for a very long time. See: Document: write() method - Web APIs | MDN

twhite96 avatar May 27 '25 03:05 twhite96