I found this plugin for converting xml to json which I need for my application at least temporarily until the server can get me JSON directly. The jQuery Plugin to convert xml to json works pretty good it seems but i've found a bug. I have a structure that looks like something this: <EventLog> <Events> <Event> <EventNumber>1</EventNumber> <Type>TimeChange</Type> <Result>0</Result> <BayData>25'-Long (Green ) PL_</BayData> <BayData>35'-Long (Orange) PL_</BayData> <BayData>25'-Long (Green ) PL_</BayData> </Event> <Event> <EventNumber>2</EventNumber> <Type>Update</Type> <Result>1</Result> <BayData>25'-Long (Green ) PL_</BayData> <BayData>35'-Long (Orange) PL_</BayData> <BayData>25'-Long (Green ) PL_</BayData> </Event> </Events> </EventLog> My problem is that although the xml to json conversion contains an array of events, there will only be 1 BayData node for each event even though there are 3 (thus, it should convert to an array). This is definitely a bug. I tried to figure out what code to change but so far no luck. I tried another xml2json tool (http://www.thomasfrank.se/ xml_to_json.html) and it didnt have this problem, however it converted tags to lowercase which I don't want because in the future the json i get from the server (if that ever gets implemented) will have tags beginning with uppercase (not my decision). I tried taking out the line which converted the tags to lowercase with the thomasfrank version and that broke the parser and I wasn't sure what to change there either. Any help would be greatly appreciated
I want to have my own custom event handler for tabsselect because I need more flexibility in the content displayed than just a basic ajax query or some static content. I basically want to be able to have my own callback function for each tab, the callback function determines what to do based on the tabs hash right now. I saw there was an example of selecting the currently added tab, but I only want to execute this function for the currently active (first) tab.. I tried triggering tabsselect on the selected tab with an onclick handler but that does nothing, i can't trigger tabsload either (it appears tabsload is not registered unless you are using ajax tabs), and even tabsshow won't trigger from the onclick handler.. How can I make the pre selected tab execute a callback function to get its contents?
I have multiple tab lists (2) different ul's with tab links under them, and I want the contents for each tab to be in a single content block. I only want the contents of one thing displayed at a time. Right now it is displaying 1 tab content from each tab list. Is there any way to get this to work? Example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="/js/third_party/jquery/ jquery.min.js"></script> <script type="text/javascript" src="/js/third_party/jquery/jquery- ui-custom.js"></script> <style type="text/css"> .ui-tabs .ui-tabs-hide { display: none; } </style> <script type="text/javascript"> $(document).ready( function() { $('#top, #side').tabs(); }); </script> </head> <body> <div id="wrapper"> <div id="top"> <ul id="tabs-top"> <li><a href="#tab-1">Tab 1</a></li> <li><a href="#tab-2">Tab 2</a></li> </ul> </div> <div id="side"> <ul id="tabs-side"> <li><a href="#tab-3">Tab 3</a></li> <li><a href="#tab-4">Tab 4</a></li> </ul> </div> <div id="tab-content" class="ui-tabs"> <div id="tab-1">Tab 1 Content</div> <div id="tab-2">Tab 2 Content</div> <div id="tab-3">Tab 3 Content</div> <div id="tab-4">Tab 4 Content</div> </div> </div> </body> </html>
What I want to do is have one tab content area, and within it will have divs for each tab anchor, but the links that open the tabs will be in two different sections of the page. One set is on the left, another set is at the top. This isn't my design but the designers. I want the content section to be the same though. The tabs script though will treat each ul list as a different set of tabs and it will show the content from each sets of tabs at the same time. I want it to only show one tab at a time instead of one from each set (which means 2 content areas are visible when i only want 1). Any ideas how to accomplish this. Below i have a full demo, just link to jquery and jquery ui and you can see what i mean. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>test tabs</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="/js/third_party/jquery/ jquery.min.js"></script> <!-- ui custom just has the core and tabs script in it --> <script type="text/javascript" src="/js/third_party/jquery/jquery- ui-custom.js"></script> <style type="text/css"> .ui-tabs .ui-tabs-hide { display: none; } </style> <script type="text/javascript"> $(document).ready( function() { $(function() { $("#top,#side").tabs(); }); }); </script> </head> <body> <div id="wrapper"> <div id="top"> <ul id="tabs-top"> <li><a href="#tab-1">Tab 1</a></li> <li><a href="#tab-2">Tab 2</a></li> </ul> </div> <div id="side"> <ul id="tabs-side"> <li><a href="#tab-3">Tab 3</a></li> <li><a href="#tab-4">Tab 4</a></li> </ul> </div> <div id="tab-content" class="ui-tabs"> <div id="tab-1">Tab 1 Content</div> <div id="tab-2">Tab 2 Content</div> <div id="tab-3">Tab 3 Content</div> <div id="tab-4">Tab 4 Content</div> </div> </div> </body> </html>