# how to load a div section html

**URL:** <https://forum.djangoproject.com/t/how-to-load-a-div-section-html/16573>\
**Category:** Templates & Frontend\
**Created:** [October 20, 2022, 8:49pm UTC](https://forum.djangoproject.com/t/how-to-load-a-div-section-html/16573 "2022-10-20T20:49:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kingman29](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kingman29/32/8853_2.png) [@kingman29](https://forum.djangoproject.com/u/kingman29)\
**Post date:** [October 20, 2022, 8:49pm UTC](https://forum.djangoproject.com/t/how-to-load-a-div-section-html/16573/1 "2022-10-20T20:49:02Z")

</div>

Hello  
is that any tutorial how to load a template html into another html file in div section  
without refresh all the main page ? please

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [October 20, 2022, 9:48pm UTC](https://forum.djangoproject.com/t/how-to-load-a-div-section-html/16573/2 "2022-10-20T21:48:16Z")

</div>

You need to use _something_ that is built on AJAX. Whether it’s using [JavaScript](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) directly, [jQuery](https://api.jquery.com/jquery.ajax/), or [HTMX](https://htmx.org/) - it’s up to you.  
(Note: I’ve become a **big** fan of HTMX)

In any of these cases, you’ll be writing a view that will return that html fragment.

But it’s not possible to do this directly in Django without assistance from the browser.

---

<div class="post-metadata">

**Author:** ![kingman29](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kingman29/32/8853_2.png) [@kingman29](https://forum.djangoproject.com/u/kingman29)\
**Post date:** [November 3, 2022, 9:05am UTC](https://forum.djangoproject.com/t/how-to-load-a-div-section-html/16573/3 "2022-11-03T09:05:40Z")

</div>

Hello  
Thank you very much  
I’m wondering what do you mean without assitance from the browser ?  
thnk you

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 3, 2022, 12:51pm UTC](https://forum.djangoproject.com/t/how-to-load-a-div-section-html/16573/4 "2022-11-03T12:51:54Z")

</div>

It requires JavaScript to do this. You can’t do it from the server.

---

<div class="post-metadata">

**Author:** ![kingman29](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kingman29/32/8853_2.png) [@kingman29](https://forum.djangoproject.com/u/kingman29)\
**Post date:** [November 3, 2022, 2:01pm UTC](https://forum.djangoproject.com/t/how-to-load-a-div-section-html/16573/5 "2022-11-03T14:01:34Z")

</div>

thank you very for you answers
