# כיצד לרענן ווידג'ט מסוים לאחר קבלת נתונים מ-ajax

**URL:** <https://meta.discourse.org/t/how-to-refresh-a-particular-widget-after-getting-data-from-ajax/189616>\
**Category:** Development\
**Created:** [7 במאי,‏ 2021,‏ 10:57am UTC](https://meta.discourse.org/t/how-to-refresh-a-particular-widget-after-getting-data-from-ajax/189616 "2021-05-07T10:57:47Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sachin\_kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sachin_kumar/32/212559_2.png) [@sachin\_kumar](https://meta.discourse.org/u/sachin_kumar)\
**Post date:** [7 במאי,‏ 2021,‏ 10:57am UTC](https://meta.discourse.org/t/how-to-refresh-a-particular-widget-after-getting-data-from-ajax/189616/1 "2021-05-07T10:57:47Z")

</div>

Hello I have been trying to implement a custom navigation bar for my discourse website and below is my code now

```
  $.ajax("/categories.json").then(
    (data) => {
      data.category_list.categories.map((val)=>{
            api.addNavigationBarItem({
            name: val.name,
            displayName: val.name,
            title: val.name,
            href: `/c/${val.slug}`,
            forceActive: (category, args, router) => {
                return router.currentURL === `/c/${val.slug}`;
                }
            })              
        })
        
    }
  );

```

Now I have to manually go to other link for it to show up the newly added nav items how can I reload the navigation bar after getting values from ajax  
Thank You

---

_[View the full topic](https://meta.discourse.org/t/how-to-refresh-a-particular-widget-after-getting-data-from-ajax/189616)._
