# HTML File for the web viewer

**URL:** <https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679>\
**Category:** Questions about Thunkable X\
**Created:** [October 7, 2021, 8:00am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679 "2021-10-07T08:00:44Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 8:00am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/1 "2021-10-07T08:00:44Z")

</div>

hello every one  
I work on HTML File for my app  
i need to get value from URL ?  
as example [https://www.codeproject.com/5225378](https://www.codeproject.com/5225378)

how to get 5225378 from url and show it as text in the html ?

any one know how to do that in HTML File  
THANK YOU

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 8:13am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/2 "2021-10-07T08:13:27Z")

</div>

> [@bader\_mouti](#):
>
> [https://www.codeproject.com/5225378](https://www.codeproject.com/5225378)

Try this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/8/88b99fc42bd3ccfd1bab25e8de19d5d8dce2c3f7.png)

Result is

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/0/800e28d5988818358fdd13c3490a19f54cdaf265.png)

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 8:16am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/3 "2021-10-07T08:16:19Z")

</div>

thank you muneer not that what i mean

i need Html code to do that to use it in the web viewer

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 8:21am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/4 "2021-10-07T08:21:52Z")

</div>

Can you explain more?

Do you want to change the number part of the URL to another number?

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 8:36am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/5 "2021-10-07T08:36:16Z")

</div>

look this for example my URL [https://www.codeproject.com/5225378](https://www.codeproject.com/5225378)

how i can take the number after the slash **5225378** and displayed it as a Title in my HTML page

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 8:39am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/6 "2021-10-07T08:39:00Z")

</div>

> [@bader\_mouti](#):
>
> look this for example my URL [https://www.codeproject.com/5225378](https://www.codeproject.com/5225378)

When I click in the URL, I get this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/6/167f6bf4cb75267421f7f81be178fa39f69d57cf.jpeg)

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 9:16am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/7 "2021-10-07T09:16:50Z")

</div>

**look muneer this code you write it for me** 5 months ago  
this code will take the url after the “showURL” word and displayed it in the iframe  
what i need is the same but to displayed it as a text in the HTML page

sorry about my bad language i know it hard to you to understand me thank you

 ![Screen Shot 2021-10-07 at 12.12.15 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/0/501cd388b8fc5bcc817ae7f817746b4b70579352.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 9:49am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/8 "2021-10-07T09:49:24Z")

</div>

Try this. If you use it in your browser and add any parameter to it you will see it in the HTML page

```auto
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Example for Bader</title>
</head>
<body>
  <h4>Text will show here</h4>
  <p id='exampleMsg'></p>
  <script>
    const partURL = new URLSearchParams(window.location.search);
    console.log(partURL);
    document.getElementById('exampleMsg').innerHTML = partURL;
  </script>
</body>
</html>

```

See this result  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/c/1cfe1212d91b46a0a810fe7d064c135e2b43a88a.png)

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 9:58am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/9 "2021-10-07T09:58:21Z")

</div>

thank you muneer that exactly what u need

but can i add something to this code just to show parameter after word “SHOW”

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 10:02am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/10 "2021-10-07T10:02:13Z")

</div>

Yes of course.

Change the line

```auto
document.getElementById('exampleMsg').innerHTML = partURL;

```

To the following

```auto
document.getElementById('exampleMsg').innerHTML = partURL.get('test');

```

Now you will see whatever you type in the URL after **test=**.

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 10:09am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/11 "2021-10-07T10:09:08Z")

</div>

it work THANK YOU for this fast solution 🥰

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 10:35am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/12 "2021-10-07T10:35:20Z")

</div>

the last question please

is that possible to have tow (test) word in the url so i can get 2 value ?

like this - i try this put not work

 ![Screen Shot 2021-10-07 at 1.34.22 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/6/3603d41888a11c675afbc9cd3895547e101adbeb.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 10:42am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/13 "2021-10-07T10:42:12Z")

</div>

> [@bader\_mouti](#):
>
> is that possible to have tow (test) word in the url so i can get 2 value ?

Yes, you can

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 10:43am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/14 "2021-10-07T10:43:29Z")

</div>

what i should to do  
can you please tell me how ?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 11:01am UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/15 "2021-10-07T11:01:23Z")

</div>

See this code

```auto
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Example for Bader</title>
</head>
<body>
  <h4>Text will show here</h4>
  <p id='showMsg'></p>
  <script>
    const partURL = new URLSearchParams(window.location.search);
    let textToShow = '';
    if (partURL.has('test')){
      textToShow += partURL.get('test');
    }
    if (partURL.has('demo')){
      textToShow += '<br>' + partURL.get('demo');
    }
    if (textToShow.length > 0) {
      document.getElementById('showMsg').innerHTML = textToShow
    } else {
      document.getElementById('showMsg').innerHTML = 'no data';
    }
  </script>
</body>

```

Sample output

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/2/d2a2da105773c6857f325972ada4271aed792803.png)

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 1:03pm UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/16 "2021-10-07T13:03:51Z")

</div>

Thank you munir but that not what I mean

I need each ID alone to use each word alone

Not to show the massage in one ID  
THANK YOU

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 7, 2021, 1:15pm UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/17 "2021-10-07T13:15:53Z")

</div>

Use this one then

```auto
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Example for Bader</title>
</head>
<body>
  <h4>Text will show here</h4>
  <p id='showMsg1'></p>
  <p id='showMsg2'></p>
  <script>
    const partURL = new URLSearchParams(window.location.search);
      document.getElementById('showMsg1').innerHTML = partURL.get('test');
      document.getElementById('showMsg2').innerHTML = partURL.get('demo');
  </script>
</body>

```

---

<div class="post-metadata">

**Author:** ![bader\_mouti](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/bader_mouti/32/98887_2.png) [@bader\_mouti](https://community.thunkable.com/u/bader_mouti)\
**Post date:** [October 7, 2021, 1:19pm UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/18 "2021-10-07T13:19:55Z")

</div>

Thank you so much muneer  
Now it’s work 100% as I need 🙏

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:14pm UTC](https://community.thunkable.com/t/html-file-for-the-web-viewer/1548679/19 "2024-11-08T13:14:54Z")

</div>


