# Open web page using URL

**URL:** <https://discourse.nodered.org/t/open-web-page-using-url/1571>\
**Category:** Dashboard\
**Created:** [14 July 2018 18:03 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571 "2018-07-14T18:03:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boufahja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/boufahja/32/573_2.png) [@Boufahja](https://discourse.nodered.org/u/Boufahja)\
**Post date:** [14 July 2018 18:03 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/1 "2018-07-14T18:03:05Z")

</div>

Is there any node that allows me to open a web page using its URL adress ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 July 2018 20:36 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/2 "2018-07-14T20:36:30Z")

</div>

Not sure I know what you mean. The flow executes on the server not the browser. So where would this web page be seen? The http request node can go and get a web page which you can then parse.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [14 July 2018 22:14 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/3 "2018-07-14T22:14:59Z")

</div>

If you want the dashboard to link to another site use a ui-template node. Here is an example that will link to google.

```auto
[{"id":"71bd6044.791278","type":"ui_template","z":"27e6a447.75ae8c","group":"d8596899.c56458","name":"","order":0,"width":0,"height":0,"format":"<div>\n <a href=\"http://google.com\"><span>Google</span></a>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":580,"y":300,"wires":[[]]},{"id":"d8596899.c56458","type":"ui_group","z":"","name":"Default","tab":"ae47cffa.963c78","disp":true,"width":"6","collapse":false},{"id":"ae47cffa.963c78","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

```

---

<div class="post-metadata">

**Author:** ![Boufahja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/boufahja/32/573_2.png) [@Boufahja](https://discourse.nodered.org/u/Boufahja)\
**Post date:** [14 July 2018 22:39 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/4 "2018-07-14T22:39:57Z")

</div>

> [@zenofmud](#):
>
> ```auto
> [{"id":"71bd6044.791278","type":"ui_template","z":"27e6a447.75ae8c","group":"d8596899.c56458","name":"","order":0,"width":0,"height":0,"format":"<div>\n <a href=\"http://google.com\"><span>Google</span></a>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":580,"y":300,"wires":[[]]},{"id":"d8596899.c56458","type":"ui_group","z":"","name":"Default","tab":"ae47cffa.963c78","disp":true,"width":"6","collapse":false},{"id":"ae47cffa.963c78","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]
> 
> ```

yeah that's what i'm searching about , thank you a lot 🙂  
is there any other solution ? a node for example ?

---

<div class="post-metadata">

**Author:** ![Boufahja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/boufahja/32/573_2.png) [@Boufahja](https://discourse.nodered.org/u/Boufahja)\
**Post date:** [14 July 2018 22:41 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/5 "2018-07-14T22:41:38Z")

</div>

i want juste to make a link to a certain site

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [15 July 2018 06:28 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/6 "2018-07-15T06:28:34Z")

</div>

In the right panel of the dashboard editor you can add a link

---

<div class="post-metadata">

**Author:** ![Boufahja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/boufahja/32/573_2.png) [@Boufahja](https://discourse.nodered.org/u/Boufahja)\
**Post date:** [15 July 2018 09:23 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/7 "2018-07-15T09:23:56Z")

</div>

Good idea ! thank you 🙂

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [7 May 2019 12:40 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/9 "2019-05-07T12:40:56Z")

</div>

In case I want to open a web page with query parameters like "[www.google.com?x=1&y=2](http://www.google.com?x=1&y=2) the character & makes the above example non functioning due to error. How do I change (encode) the request so that I can add more parameters?

Actually my aim is to have a link to google maps api with lat and lon as parameters. The link would be in the node-red UI and when clicking a new page should open showing the map. Those location parameters will come from a gps IOT device installed on my boat.

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [7 May 2019 12:49 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/10 "2019-05-07T12:49:59Z")

</div>

it works for me

```auto
[{"id":"5f91d80d.9b428","type":"ui_template","z":"eaea399f.2dd2e8","group":"2007caa7.9dc636","name":"","order":0,"width":0,"height":0,"format":"<div>\n <a href=\"http://www.google.com?x=1&y=2\"><span>Google</span></a>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":370,"y":152,"wires":[[]]},{"id":"2007caa7.9dc636","type":"ui_group","z":"","name":"Default","tab":"ad0e1f68.c10fd","disp":true,"width":"6","collapse":false},{"id":"ad0e1f68.c10fd","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 May 2019 14:53 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/11 "2019-05-07T14:53:18Z")

</div>

As always I will add a plug for [https://flows.nodered.org/node/node-red-contrib-web-worldmap](https://flows.nodered.org/node/node-red-contrib-web-worldmap) 🙂 as we already have some boat friendly layers built in.

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 May 2019 05:28 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/12 "2019-05-08T05:28:54Z")

</div>

If I copy this from your post to my node-red without modifications, I got a red error mark on line 2 saying "Named entity expected. Got none". If I then add a space between & and y the error goes away, but obviously that is not an acceptable url.

Any hints?

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 May 2019 05:30 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/13 "2019-05-08T05:30:28Z")

</div>

Wow, I didn't know about this. Very interesting. Thanks!

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [8 May 2019 06:17 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/14 "2019-05-08T06:17:12Z")

</div>

What version of node-red-dashboard are you using?

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 May 2019 07:12 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/15 "2019-05-08T07:12:22Z")

</div>

It's v0.19.4

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [8 May 2019 07:18 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/16 "2019-05-08T07:18:37Z")

</div>

That’s hopefully the version of node-red not the dashboard.  
You can check the version of the dashboard in the menu under manage palette.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a16baf5be48725fa4bdfe3b31fdfd1ad3fbe0152.jpeg)

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 May 2019 07:43 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/17 "2019-05-08T07:43:42Z")

</div>

Oh, sorry, my bad :). It was 2.13.0 so I updated it to the latest. Still same error visible.  
But now I noticed that in case I deploy despite of this error mark, it works OK. Do not know if that is due to the latest version because I think I couldn't deploy earlier when this error was shown.

It would be interesting to know what is the reason in case you do not see the error mark, but I can live with this as it seems to do what I need now.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [8 May 2019 07:54 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/18 "2019-05-08T07:54:19Z")

</div>

If you can it's probably worth upgrading to v0.20.x as well... If you installed it yourself on a pi there's a simple upgrade script on the raspberry pi page in the docs

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [8 May 2019 12:16 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/19 "2019-05-08T12:16:04Z")

</div>

Thanks for the hint. I did that and running now with v0.20.5. Still the same status, but it works:

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

Now I need to figure out how do I pass the x and y in previous example as parameters coming from the gps via MQTT-node to this ui\_template 🙂

---

<div class="post-metadata">

**Author:** ![Chinchilla](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chinchilla/32/8860_2.png) [@Chinchilla](https://discourse.nodered.org/u/Chinchilla)\
**Post date:** [29 May 2019 23:36 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/20 "2019-05-29T23:36:32Z")

</div>

In valid HTML the `&` indicates the start of an entity reference. So although it's a valid character in a URL (as you type it on the location bar in your browser), it's not correct within an HTML document.

To be "correct" you should replace the `&` in the `href=` with `&amp;` which would result in:  
`<a href="http://www.google.com?x=1&amp;y=2">`  
Which will work correctly and remove the flagged error.

The error given is a real error, but what you have got there is such a common mistake that browsers have been coded to "do the right thing" in this situation.

Hope that helps, if a little late. 🙂

---

<div class="post-metadata">

**Author:** ![luotope](https://avatars.discourse-cdn.com/v4/letter/l/278dde/32.png) [@luotope](https://discourse.nodered.org/u/luotope)\
**Post date:** [30 May 2019 05:15 UTC](https://discourse.nodered.org/t/open-web-page-using-url/1571/21 "2019-05-30T05:15:58Z")

</div>

Thanks for the good explanation Chinchilla. It helped to understand the reason for the error.

[Next page](https://discourse.nodered.org/t/open-web-page-using-url/1571.md?page=2)
