# How to display output of script in dashboard

**URL:** <https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943>\
**Category:** Dashboard\
**Created:** [16 December 2024 18:19 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943 "2024-12-16T18:19:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xtrailrunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xtrailrunner/32/74959_2.png) [@xtrailrunner](https://discourse.nodered.org/u/xtrailrunner)\
**Post date:** [16 December 2024 18:19 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943/1 "2024-12-16T18:19:57Z")

</div>

Hello,  
I got a code snippet  
script src="[https://xxxx.yyyy.com/zzz](https://xxxx.yyyy.com/zzz)"\>\</script  
which produces a weather widget with a nice diagram.  
I would like to display this diagram in my dashboard.  
I have tried to use a function node but without success.  
Do you have a recommendation for an approach?  
Kind regards  
Juergen

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [16 December 2024 20:09 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943/2 "2024-12-16T20:09:12Z")

</div>

You should be able to include a script inside a template node, eg

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b81d2e3811afa9e247d9f69a79627028881b735.png)

---

<div class="post-metadata">

**Author:** ![xtrailrunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xtrailrunner/32/74959_2.png) [@xtrailrunner](https://discourse.nodered.org/u/xtrailrunner)\
**Post date:** [16 December 2024 21:37 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943/3 "2024-12-16T21:37:28Z")

</div>

Thank you!  
This seems to be an appropriate solution but the widget/diagram is not visible in the dashboard.  
Any ideas?

---

<div class="post-metadata">

**Author:** ![xx\_Nexus\_xx](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xx\_Nexus\_xx](https://discourse.nodered.org/u/xx_Nexus_xx)\
**Post date:** [17 December 2024 02:17 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943/4 "2024-12-17T02:17:03Z")

</div>

to show an external page you have to use iFrame

```auto
<template>
    <iframe :src="msg.payload" width="100%" height="200" frameborder="0"></iframe>
</template>

```

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [17 December 2024 06:42 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943/5 "2024-12-17T06:42:25Z")

</div>

It will be something in that direction.

However, there must be more to it than only including a script.  
You will need some html element to display whatever the script is outputting.

Care to share the link to the script /snippet ?

---

<div class="post-metadata">

**Author:** ![xtrailrunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xtrailrunner/32/74959_2.png) [@xtrailrunner](https://discourse.nodered.org/u/xtrailrunner)\
**Post date:** [17 December 2024 13:33 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943/7 "2024-12-17T13:33:12Z")

</div>

Here is the code snippet (brackets replaced by hash, https replaced by xxxxx):

```auto
<script src="https://wxblox.aerisapi.com/free/js/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImZ1bGwtd2lkZSIsImxvYyI6InB3c191d2ptMSIsIm1ldHJpYyI6dHJ1ZSwidGhlbWUiOiJsaWdodCIsImNvbG9ycyI6eyJiYXNlIjp7fSwiYWx0Ijp7fSwiYWNjZW50Ijp7fX0sImlhdCI6MTczMzE2ODYxMX0.TJLAWDaWIALL2bxdJkgD8x9M0C-V-CUqwn9rX19PaKY"></script>

```

Thanks and kind regards

[Moderator edit to add backticks to show how to post code correctly. Click pencil icon to see edit.]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [16 January 2025 13:33 UTC](https://discourse.nodered.org/t/how-to-display-output-of-script-in-dashboard/93943/8 "2025-01-16T13:33:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
