# Ajax fetched JSON data,can't view on console

**URL:** <https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148>\
**Category:** Developing Nodes\
**Created:** [14 April 2021 09:35 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148 "2021-04-14T09:35:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarthak7034](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sarthak7034/32/40258_2.png) [@sarthak7034](https://discourse.nodered.org/u/sarthak7034)\
**Post date:** [14 April 2021 09:35 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/1 "2021-04-14T09:35:24Z")

</div>

I am fetching data using $.ajax which comes in JSON format. But I can't view them on nodeRED nor on my console.  
I am using url link from swagger to test.

```
            $.ajax({
                type:'GET',
                url:'http://localhost:8080/service/00000000-bc18-ac67-0238-57551bada1f2/definition',
                success: function (params) {
                    // console.log(params)
                }
            })
```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 April 2021 10:42 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/2 "2021-04-14T10:42:51Z")

</div>

Is that running in the browser or the node-red server? If in the browser then it should appear in the browser developer console (I think).

---

<div class="post-metadata">

**Author:** ![sarthak7034](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sarthak7034/32/40258_2.png) [@sarthak7034](https://discourse.nodered.org/u/sarthak7034)\
**Post date:** [14 April 2021 14:36 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/3 "2021-04-14T14:36:17Z")

</div>

it's in the node red server. Is there something like .html that would show me in the node?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 April 2021 14:58 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/4 "2021-04-14T14:58:23Z")

</div>

Can you show us where you have put that code please.

---

<div class="post-metadata">

**Author:** ![sarthak7034](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sarthak7034/32/40258_2.png) [@sarthak7034](https://discourse.nodered.org/u/sarthak7034)\
**Post date:** [14 April 2021 15:01 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/5 "2021-04-14T15:01:08Z")

</div>

I would like to see the result somewhere of what I am fetching...

oneditprepare: function(){  
$.ajax({  
type:'GET',  
url:'[http://localhost:8080/service/00000000-bc18-ac67-0238-57551bada1f2/definition](http://localhost:8080/service/00000000-bc18-ac67-0238-57551bada1f2/definition)',  
success: function (params) {  
// console.log(params)  
}  
})  
}

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 April 2021 15:07 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/6 "2021-04-14T15:07:03Z")

</div>

You did not say this was in a custom node, and you have not asked in the Creating Nodes category. I will have to let someone else answer as I don't know how to do what you want.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 April 2021 15:07 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/7 "2021-04-14T15:07:53Z")

</div>

I have moved it to the correct category for you.

---

<div class="post-metadata">

**Author:** ![sarthak7034](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sarthak7034/32/40258_2.png) [@sarthak7034](https://discourse.nodered.org/u/sarthak7034)\
**Post date:** [14 April 2021 15:08 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/8 "2021-04-14T15:08:06Z")

</div>

@Colin Oh! My bad. Thank you so much 😃

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [14 April 2021 18:36 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/9 "2021-04-14T18:36:12Z")

</div>

> [@sarthak7034](#):
>
> But I can't view them on nodeRED nor on my console

`oneditprepare` runs client side and only when you open the custom nodes property dialog.

Have you checked in browser console?

Does that Ajax even work/return something? A simple test is to open the browsers devtools console and paste it in.

Also check for activity in the network tab of devtools.

---

<div class="post-metadata">

**Author:** ![sarthak7034](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sarthak7034/32/40258_2.png) [@sarthak7034](https://discourse.nodered.org/u/sarthak7034)\
**Post date:** [15 April 2021 14:10 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/10 "2021-04-15T14:10:04Z")

</div>

It seems I am getting results in my console. Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 June 2021 14:11 UTC](https://discourse.nodered.org/t/ajax-fetched-json-data-cant-view-on-console/44148/11 "2021-06-14T14:11:00Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
