{"id":361,"date":"2012-06-24T22:20:51","date_gmt":"2012-06-24T16:50:51","guid":{"rendered":"http:\/\/ramkulkarni.com\/blog\/?p=361"},"modified":"2012-06-24T22:20:51","modified_gmt":"2012-06-24T16:50:51","slug":"creating-dynamic-popup-menus-with-jquery-mobile","status":"publish","type":"post","link":"http:\/\/ramkulkarni.com\/blog\/creating-dynamic-popup-menus-with-jquery-mobile\/","title":{"rendered":"Creating dynamic popup menus with JQuery Mobile"},"content":{"rendered":"<p>Creating popup menus in JQuery Mobile is not quite simple. I am talking about menu that you might want to display when user clicks on, for example, a list item or a button. Refer to JQuery Mobile documents for <a href=\" http:\/\/jquerymobile.com\/demos\/1.1.0-rc.1\/docs\/forms\/selects\/index.html\">select menus<\/a>\u00a0and <a href=\" http:\/\/jquerymobile.com\/demos\/1.1.0-rc.1\/docs\/forms\/selects\/custom.html\">custom menus<\/a>\u00a0. These menus are actually drop down lists and in all the cases, the menu has to be already visible.<\/p>\n<p>However this is not what I wanted in my mobile apps. I do not want menu to be visible initially, but want to display it when user clicks on a button on a list item. So I started investigating how this could be done. As it turned out, the menu that JQuery Mobile shows (when nativeMenu attribute is set to false), is different from the select tags that you create for the menu. JQM hides the menu that you create and creates a new (wrapper) menu using div and anchor tags. Option tags become anchor tags in the new menu. This is all fine, but the problem is that JQM does not have any direct APIs to access elements of the new menu. This makes it difficult to attach event handlers to menu options.<\/p>\n<p><!--more--><\/p>\n<p>But JQM follows certain patterns when creating the wrapper menu. As of the current version, which is 1.1, JQM does following &#8211;<\/p>\n<ol>\n<li>It creates an outer div with ui-selectmenu class<\/li>\n<li>Within the above div it creates ul element with id = id_of_the_select_element + &#8220;-menu&#8221;<\/li>\n<li>It creates li element for each menu option inside the above ul element<\/li>\n<li>Actual menu items are in anchor element inside the above li element<\/li>\n<\/ol>\n<p>All this is not documented by JQuery Mobile, so it might change in the future versions.<\/p>\n<p>So, having understood the above pattern, it was then easy to create a menu and attach event handler. Here is a simple example, which displays a menu when a button is clicked &#8211;<\/p>\n<p>First a screen shot &#8211;<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/138.197.85.232\/blog\/wp-content\/uploads\/2012\/06\/menu_screen_shot.jpg\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"362\" data-permalink=\"http:\/\/ramkulkarni.com\/blog\/creating-dynamic-popup-menus-with-jquery-mobile\/menu_screen_shot\/\" data-orig-file=\"https:\/\/i0.wp.com\/ramkulkarni.com\/blog\/wp-content\/uploads\/2012\/06\/menu_screen_shot.jpg?fit=451%2C235\" data-orig-size=\"451,235\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"menu_screen_shot\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ramkulkarni.com\/blog\/wp-content\/uploads\/2012\/06\/menu_screen_shot.jpg?fit=300%2C156\" data-large-file=\"https:\/\/i0.wp.com\/ramkulkarni.com\/blog\/wp-content\/uploads\/2012\/06\/menu_screen_shot.jpg?fit=451%2C235\" class=\"alignnone size-medium wp-image-362\" title=\"menu_screen_shot\" src=\"https:\/\/i0.wp.com\/138.197.85.232\/blog\/wp-content\/uploads\/2012\/06\/menu_screen_shot-300x156.jpg?resize=300%2C156\" alt=\"\" width=\"300\" height=\"156\" srcset=\"https:\/\/i0.wp.com\/ramkulkarni.com\/blog\/wp-content\/uploads\/2012\/06\/menu_screen_shot.jpg?resize=300%2C156 300w, https:\/\/i0.wp.com\/ramkulkarni.com\/blog\/wp-content\/uploads\/2012\/06\/menu_screen_shot.jpg?w=451 451w\" sizes=\"(max-width: 300px) 100vw, 300px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<pre style=\"color: #000000; background: #ffffff;\"><span style=\"color: #7f0055;\">&lt;!DOCTYPE html&gt;<\/span>\n<span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">html<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n    <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">head<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n        <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">link<\/span> type=<span style=\"color: #2a00ff;\">\"text\/css\"<\/span> href=<span style=\"color: #2a00ff;\">\"jquery.mobile-1.2.0.css\"<\/span> rel=<span style=\"color: #2a00ff;\">\"stylesheet\"<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n\n        <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">script type=\"text\/javascript\" src=\"jquery-1.8.2.js\"<\/span><span style=\"color: #7f0055;\">&gt;<\/span><span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">script<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n        <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">script type=\"text\/javascript\" src=\"jquery.mobile-1.2.0.js\"<\/span><span style=\"color: #7f0055;\">&gt;<\/span><span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">script<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n\n        <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">script type=\"text\/javascript\"<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n            $(document).bind(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">pageinit<\/span><span style=\"color: #2a00ff;\">\"<\/span>, onPageInit);\n\n            <span style=\"color: #3f7f59;\">\/\/variable to store menu instance<\/span>\n            newMenu = <span style=\"color: #7f0055; font-weight: bold;\">null<\/span>;\n\n            <span style=\"color: #7f0055; font-weight: bold;\">function<\/span> onPageInit()\n            {\n                <span style=\"color: #3f7f59;\">\/\/create menu. First option in the third argument is menu title<\/span>\n                createMenu(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">dynamicMenu1<\/span><span style=\"color: #2a00ff;\">\"<\/span>,<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">contentDiv<\/span><span style=\"color: #2a00ff;\">\"<\/span>,<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">Menus,menu1,menu2,menu3<\/span><span style=\"color: #2a00ff;\">\"<\/span>,menuHandler);\n\n                $(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">#btn1<\/span><span style=\"color: #2a00ff;\">\"<\/span>).click(<span style=\"color: #7f0055; font-weight: bold;\">function<\/span>(){\n                    showMenu(newMenu);\n                });\n            }\n\n            <span style=\"color: #7f0055; font-weight: bold;\">function<\/span> createMenu(menuId, parentId, options, menuHandler)\n            {\n                <span style=\"color: #3f7f59;\">\/\/create a containing div<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> div = $(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">&lt;div id='<\/span><span style=\"color: #2a00ff;\">\"<\/span> + menuId + <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">div'&gt;&lt;\/div&gt;<\/span><span style=\"color: #2a00ff;\">\"<\/span>).appendTo(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">#<\/span><span style=\"color: #2a00ff;\">\"<\/span>+parentId).hide();\n\n                <span style=\"color: #3f7f59;\">\/\/create select tag<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> menuElm = $(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">&lt;select id='<\/span><span style=\"color: #2a00ff;\">\"<\/span> + menuId + <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">' data-inline='true' data-native-menu='false'&gt;&lt;\/select&gt;<\/span><span style=\"color: #2a00ff;\">\"<\/span>).appendTo(div);\n\n                <span style=\"color: #3f7f59;\">\/\/add options<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> optionsArray = options.<span style=\"color: #7f0055; font-weight: bold;\">split<\/span>(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">,<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                <span style=\"color: #7f0055; font-weight: bold;\">for<\/span> (<span style=\"color: #7f0055; font-weight: bold;\">var<\/span> i = 0; i &lt; optionsArray.length; i++)\n                    $(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">&lt;option&gt;<\/span><span style=\"color: #2a00ff;\">\"<\/span> + optionsArray[i] + <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">&lt;\/option&gt;<\/span><span style=\"color: #2a00ff;\">\"<\/span>).appendTo(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">#<\/span><span style=\"color: #2a00ff;\">\"<\/span>+menuId);\n\n                <span style=\"color: #3f7f59;\">\/\/convert to JQueryMobile menu<\/span>\n                $(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">#<\/span><span style=\"color: #2a00ff;\">\"<\/span> + menuId).selectmenu();\n\n                <span style=\"color: #3f7f59;\">\/\/find custom menu that JQM creates<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> menus = $(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">.ui-selectmenu<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                <span style=\"color: #7f0055; font-weight: bold;\">for<\/span> (<span style=\"color: #7f0055; font-weight: bold;\">var<\/span> i = 0; i &lt; menus.length; i++)\n                {\n                    <span style=\"color: #3f7f59;\">\/\/if ($(menus[i]).children(\"ul:#\" + menuId + \"-menu\").length &gt; 0)<\/span>\n                    <span style=\"color: #7f0055; font-weight: bold;\">if<\/span> ($(menus[i]).children(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">ul<\/span><span style=\"color: #2a00ff;\">\"<\/span>).filter(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">#<\/span><span style=\"color: #2a00ff;\">\"<\/span> + menuId + <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">-menu<\/span><span style=\"color: #2a00ff;\">\"<\/span>).length &gt; 0)\n                    {\n                        newMenu = $(menus[i]);\n                        <span style=\"color: #7f0055; font-weight: bold;\">break<\/span>;\n                    }\n                }\n\n                <span style=\"color: #3f7f59;\">\/\/Hack for JQM 1.2 - check if parent of select menu is ui-popup-container<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> menuContainer = $(menus).parent(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">.ui-popup-container<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                <span style=\"color: #7f0055; font-weight: bold;\">if<\/span> (menuContainer.length &gt; 0)\n                {\n                    <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> pageElm = menuContainer.parent(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">div[data-role='page']<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                    <span style=\"color: #7f0055; font-weight: bold;\">if<\/span> (pageElm.length &gt; 0)\n                    {\n                        menus.detach();\n                        menuContainer.remove();\n                        pageElm.append(menus);\n                        menus.css(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">width<\/span><span style=\"color: #2a00ff;\">\"<\/span>, <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">80%<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                        menus.css(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">max-width<\/span><span style=\"color: #2a00ff;\">\"<\/span>, <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">350px<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                    }\n                }\n\n                <span style=\"color: #7f0055; font-weight: bold;\">if<\/span> (newMenu == <span style=\"color: #7f0055; font-weight: bold;\">null<\/span>)\n                {\n                    alert(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">Error creating menu<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                    <span style=\"color: #7f0055; font-weight: bold;\">return<\/span>;\n                }\n\n                <span style=\"color: #3f7f59;\">\/\/Associate click handler with menu items, i.e. anchor tags<\/span>\n                $(newMenu).find(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">.ui-selectmenu-list li a<\/span><span style=\"color: #2a00ff;\">\"<\/span>).click(menuHandler);\n\n                <span style=\"color: #3f7f59;\">\/\/Add Close option<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> menuHeader = $(newMenu).find(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">.ui-header<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> closeLinkId = menuId + <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">_close_id<\/span><span style=\"color: #2a00ff;\">\"<\/span>;\n                menuHeader.prepend(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">&lt;span style='position:relative;float:left'&gt;<\/span><span style=\"color: #2a00ff;\">\"<\/span> +\n                    <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">&lt;a href='#' id='<\/span><span style=\"color: #2a00ff;\">\"<\/span> + closeLinkId + <span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">'&gt;X&lt;\/href&gt;&lt;\/span&gt;<\/span><span style=\"color: #2a00ff;\">\"<\/span>);\n                $(<span style=\"color: #2a00ff;\">\"<\/span><span style=\"color: #2a00ff;\">#<\/span><span style=\"color: #2a00ff;\">\"<\/span> + closeLinkId).click(<span style=\"color: #7f0055; font-weight: bold;\">function<\/span>(e){\n                    newMenu.hide();\n                });\n\n                <span style=\"color: #7f0055; font-weight: bold;\">return<\/span> newMenu.hide();\n            }\n\n            <span style=\"color: #7f0055; font-weight: bold;\">function<\/span> showMenu(menu)\n            {\n                <span style=\"color: #7f0055; font-weight: bold;\">if<\/span> (menu == <span style=\"color: #7f0055; font-weight: bold;\">null<\/span>)\n                    <span style=\"color: #7f0055; font-weight: bold;\">return<\/span>;\n\n                <span style=\"color: #3f7f59;\">\/\/show menu at center of the window<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> left = ($(window).width() - $(menu).width()) \/ 2;\n                <span style=\"color: #3f7f59;\">\/\/consider vertical scrolling when calculating top<\/span>\n                <span style=\"color: #7f0055; font-weight: bold;\">var<\/span> top = (($(window).height() - $(menu).height()) \/ 2) + $(window).scrollTop();\n                $(menu).css({\n                    left: left,\n                    top: top\n                });\n\n                $(menu).show();\n            }\n\n            <span style=\"color: #3f7f59;\">\/\/Callback handler when menu item is clicked<\/span>\n            <span style=\"color: #7f0055; font-weight: bold;\">function<\/span> menuHandler(event)\n            {\n                <span style=\"color: #7f0055; font-weight: bold;\">if<\/span> (newMenu != <span style=\"color: #7f0055; font-weight: bold;\">null<\/span>)\n                    $(newMenu).hide();\n\n                alert(event.srcElement.text);\n            }\n        <span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">script<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n\n    <span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">head<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n\n    <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">body<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n        <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">div<\/span> data-role=<span style=\"color: #2a00ff;\">\"page\"<\/span> <span style=\"color: #7f0055;\">&gt;<\/span>\n            <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">div<\/span> data-role=<span style=\"color: #2a00ff;\">\"content\"<\/span> id=<span style=\"color: #2a00ff;\">\"contentDiv\"<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n                <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">a<\/span> href=<span style=\"color: #2a00ff;\">\"\"<\/span> data-role=<span style=\"color: #2a00ff;\">\"button\"<\/span> data-inline=<span style=\"color: #2a00ff;\">\"true\"<\/span> id=<span style=\"color: #2a00ff;\">\"btn1\"<\/span><span style=\"color: #7f0055;\">&gt;<\/span>Show Menu<span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">a<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n            <span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">div<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n            <span style=\"color: #7f0055;\">&lt;<\/span><span style=\"color: #7f0055; font-weight: bold;\">span<\/span> style=<span style=\"color: #2a00ff;\">'<\/span><span style=\"color: #7f0055; font-weight: bold;\">position<\/span>:relative;<span style=\"color: #7f0055; font-weight: bold;\">float<\/span>:left<span style=\"color: #2a00ff;\">'<\/span><span style=\"color: #7f0055;\">&gt;<\/span><span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">span<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n        <span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">div<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n\n    <span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">body<\/span><span style=\"color: #7f0055;\">&gt;<\/span>\n<span style=\"color: #7f0055;\">&lt;\/<\/span><span style=\"color: #7f0055; font-weight: bold;\">html<\/span><span style=\"color: #7f0055;\">&gt;<\/span><\/pre>\n<p>&#8211; Ram Kulkarni<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating popup menus in JQuery Mobile is not quite simple. I am talking about menu that you might want to display when user clicks on, for example, a list item or a button. Refer to JQuery Mobile documents for select menus\u00a0and custom menus\u00a0. These menus are actually drop down lists and in all the cases, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/ramkulkarni.com\/blog\/creating-dynamic-popup-menus-with-jquery-mobile\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Creating dynamic popup menus with JQuery Mobile&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[30,1],"tags":[37,31],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2g9O8-5P","jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/posts\/361"}],"collection":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/comments?post=361"}],"version-history":[{"count":0,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/posts\/361\/revisions"}],"wp:attachment":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/media?parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/categories?post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/tags?post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}