---
title: "NO ajax request is happening in jstree"  
description: "NO ajax request is happening in jstree"  
author: "Anonymous User"  
published: 2013-04-10  
updated: 2013-04-15  
canonical: https://www.mindstick.com/forum/750/no-ajax-request-is-happening-in-jstree  
category: "jquery"  
tags: ["jquery"]  
reading_time: 2 minutes  

---

# NO ajax request is happening in jstree

Hi Everyone!\
I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to get sub nodes (in my case sub [categories](https://answers.mindstick.com/qa/47601/what-are-the-categories-of-stations-for-provision-of-passenger-amenities-explain-them)) on clicking in the parent nodes (categories). But I can see no [ajax request](https://www.mindstick.com/forum/157891/what-is-the-role-of-the-jsonresult-class-in-mvc-how-can-it-use-to-return-data-to-an-ajax-request) is happening in my case. I have \
used the solution from this [website](https://www.mindstick.com/articles/13110/why-copywriting-is-crucial-for-new-website-build) - (http://www.miketyka.com/2012/10/lazy-loading-with-jstree-and-ajax/). Here is my jstree code below -\
/** * menu tree [generation](https://www.mindstick.com/blog/300788/why-is-heart-attack-increasing-in-the-younger-generation) */ $("#menu_tree").bind("open_node.jstree", [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) (e, data) { // this binding will collapse all nodes whenever user expands any single nodedata.rslt.obj.siblings().filter(".jstree-open").each(function () { data.inst.close_node(this);});}) .jstree({ "json_data": { "ajax": { "url": base_url + "draw/get_child" }}, "types": { // this will let user to expand or collapse node by clicking on the node title "types": { "default": { "select_node": function (e) { this.toggle_node(e); return false; } } }}, "core": { "html_titles": true, "load_open": true}, "plugins": ["themes", "json_data", "html_data", "types", "ui"], "themes": { "theme": "apple", "dots": true, "icons": true}});the html part is below -\
<div class="" id="menu_tree" style="width: 500px;z-index: 1; float: right;position: [relative](https://www.mindstick.com/interview/33881/overview-of-relative-absolute-fixed-and-sticky-positioning-in-css);"> <ul class="" style="position: [absolute](https://www.mindstick.com/interview/1159/what-is-absolute-and-sliding-expiration-in-dot-net);top: 0px;left: 0px;"> <?php if (!empty($parent_categories)) { foreach ($parent_categories as $parent_categories) { ?> <li id="cat<?php echo $parent_categories->objcat_id; ?>"> <a href="#" class=""><?php echo $parent_categories->category_name; ?></a>\
</li> <?php } } ?> </ul> </div>I am only loading parent nodes for the first time, all child nodes should load by user click on the parent nodes.\
if i use "html_data" rather than "json_data" then a request occurs and i can see a loading gif but then i get this error "Uncaught Error: NotFoundError: DOM [Exception](https://www.mindstick.com/articles/1824/objective-c-exception-handling) \
8", but if i use "json_data" then nothing just happens, no ajax request in the firebug.\
i can't understand what's wrong i am doing... Any solution please? \
[Thank you in advance](https://answers.mindstick.com/qa/40482/why-was-1968-a-year-of-tension-and-turmoil-list-10-events-1-being-the-best-and-10-the-worst-thank-you-in-advance)!

## Replies

### Reply by AVADHESH PATEL

Hi Goti!\
Replace existing code from below line of code as following\
"json_data" : { "ajax" : { "url" : function (node) {\
to\
"json_data" : { "ajax" : { cache:false, "url" : function (node) {


---

Original Source: https://www.mindstick.com/forum/750/no-ajax-request-is-happening-in-jstree

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
