Skip Navigation

[Resolved] Dynamically embedding javascript code for an externally sourced widget/iframe

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 3 voices.

Last updated by CaseyK4294 3 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1915279

Tell us what you are trying to do?
I am trying to use a snippet of Javascript code to display a widget from an external source on my site. When I first started working on this project, the code worked, but sometime over the past few weeks it stopped working. I tried working from a clean staging install of wordpress and toolset but still having the same issue. I also tried placing the code directly into the a code block,on a fresh page in the blocks editor and that doesn't work either. I have also tried using shortcode to call in the custom field instead of the raw code, but also get a blank result.

Is there any documentation that you are following?
Sharing this because it's how we originally set it up with help from Toolset. However, what has changed since then is that we have completely gotten rid of the Elementor template we were building on and opted to build with the Toolset content template instead: https://toolset.com/forums/topic/iframe-embed-code-integration-with-elementor/

What is the link to your site?
hidden link

Under the heading "Walking and Biking Score – any score over 50 is good​" (still working on the navigation so it's probably easier to just scroll to that spot). On the backend we have both a wysiwyg widget dynamically pulling the code from our custom field and a shortcode widget with the shortcode "[types field='walk-bike-score-widget' output='raw'][/types]". Both are returning a blank on the preview of the page.

#1915835

Hello and thank you for contacting the Toolset support.

I checked the previous ticket but I don't see any code that could create an Iframe, I see some code here https://toolset.com/forums/topic/iframe-embed-code-integration-with-elementor/#post-1784669
But that's only defining some variables, it does not include any code that will build the widget.

I would like to know where do you get the code? Is it from a 3rd party service? Can you share the whole snippet so I can check it?
Would you like to allow me temporary access to check it further?
Also

#1920319

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Jamal passed this ticket to me and I'll take care of this ticket.

To ensure the code you shared is not stripped out from the forum post - Can you please share the code provided by walkscore.com on another file sharing service and then I will try to use that code.

Or

I would like to confirm - is the code added to the field "Walk Score Widget" is correct?
=> hidden link

#1921323

Hi Minesh, thank you for your help.

Yes, I am confirming that the code added to the field "Walk Score Widget" is correct in the link you pasted above.

#1921755

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

It was a issue of protocol.

Your site is hosted with https and the widget link was using http:

<script type='text/javascript' src='<em><u>hidden link</u></em>;

I changed the walkscore widget link to https:

<script type='text/javascript' src='<em><u>hidden link</u></em>;

And I can see now its displayed at the bottom of the page. You can move it to your desired place.

#1922155

My issue is resolved now. Thank you!