Opening links in nodebb widget
-
@phenomlab the convo we started on nodebb forum, I thought to continue it here.
Still having the issue of links not loading often in widgets
Have you been able to take a look? -
A more efficient way of including this would be to not over complicate it and leverage a standard
iframe
(providing the CSP headers of the remote site permit this) like below<iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe>
This works first time every time on your site as intended.
-
@phenomlab the convo we started on nodebb forum, I thought to continue it here.
Still having the issue of links not loading often in widgets
Have you been able to take a look?@Panda not yet, will do so later. For continuity, can you provide the code here that you want to use?
-
@Panda not yet, will do so later. For continuity, can you provide the code here that you want to use?
@phenomlab yes, its just a quiz.
<script src="https://www.classmarker.com/public/js/embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5" data-quiz="gag66aea7922f0a5" data-width="700" data-height="800" ></script>
The fact this is so problematic makes me wonder if something should be built into the widget code in nodebb to sort whatever the timing issue is, that causes loading to fail
-
@phenomlab yes, its just a quiz.
<script src="https://www.classmarker.com/public/js/embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5" data-quiz="gag66aea7922f0a5" data-width="700" data-height="800" ></script>
The fact this is so problematic makes me wonder if something should be built into the widget code in nodebb to sort whatever the timing issue is, that causes loading to fail
@Panda I’ll test this and revert. Will get back to you later.
-
@phenomlab yes, its just a quiz.
<script src="https://www.classmarker.com/public/js/embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5" data-quiz="gag66aea7922f0a5" data-width="700" data-height="800" ></script>
The fact this is so problematic makes me wonder if something should be built into the widget code in nodebb to sort whatever the timing issue is, that causes loading to fail
@Panda It’s not caused by NodeBB, but the way you are calling the URL - see the error message below reported in the console
embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:7 Uncaught TypeError: Failed to construct 'URL': Invalid URL at __createIframe (embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:7:80) at load (embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:3:100) at embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:1:1 -
A more efficient way of including this would be to not over complicate it and leverage a standard
iframe
(providing the CSP headers of the remote site permit this) like below<iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe>
This works first time every time on your site as intended.
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (ether email, or push notification). You'll also be able to save bookmarks, use reactions, and upvote to show your appreciation to other community members.
With your input, this post could be even better 💗
RegisterLog in