# Call a javascript function to read querystring from URL

**URL:** <https://discuss.huggingface.co/t/call-a-javascript-function-to-read-querystring-from-url/36404>\
**Category:** 🔒 Gradio\
**Created:** [April 13, 2023, 5:24am UTC](https://discuss.huggingface.co/t/call-a-javascript-function-to-read-querystring-from-url/36404 "2023-04-13T05:24:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tariqzack](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@tariqzack](https://discuss.huggingface.co/u/tariqzack)\
**Post date:** [April 13, 2023, 5:24am UTC](https://discuss.huggingface.co/t/call-a-javascript-function-to-read-querystring-from-url/36404/1 "2023-04-13T05:24:38Z")

</div>

I have seen examples of calling javascript function to read query string in Blocks.load with input and output specified. What I would like is to call javascript function in Blocks.load without any UI (input and output) since I am using ChatBot. Can anybody please help?

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [April 13, 2023, 6:43am UTC](https://discuss.huggingface.co/t/call-a-javascript-function-to-read-querystring-from-url/36404/2 "2023-04-13T06:43:12Z")

</div>

hi @tariqzack ,

That’s possible, but you still need a dummy component to get the url param value,  
then you can read it from the chatbot component

here is an example  
just type `read query` to make the chatbot return the onload query param state.

> **[Gradio Chabot read query params - a Hugging Face Space by radames](https://huggingface.co/spaces/radames/gradio-chatbot-read-query-param?q=hello-from-query)**
>
> Discover amazing ML apps made by the community

---

<div class="post-metadata">

**Author:** ![tariqzack](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@tariqzack](https://discuss.huggingface.co/u/tariqzack)\
**Post date:** [April 16, 2023, 6:49am UTC](https://discuss.huggingface.co/t/call-a-javascript-function-to-read-querystring-from-url/36404/3 "2023-04-16T06:49:03Z")

</div>

Thanks for the solution…@radames
