{"id":2908916,"date":"2012-07-20T17:16:44","date_gmt":"2012-07-20T17:16:44","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/plugin-multi-level-navigation-plugin-enqueuing-javascript\/"},"modified":"2016-08-20T13:55:59","modified_gmt":"2016-08-20T13:55:59","slug":"plugin-multi-level-navigation-plugin-enqueuing-javascript","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/plugin-multi-level-navigation-plugin-enqueuing-javascript\/","title":{"rendered":"[Plugin: Multi-level Navigation Plugin] Enqueuing JavaScript"},"content":{"rendered":"<p>This is a great plugin that I&#8217;ve been using for years.<\/p>\n<p>A couple of the scripts are not properly enqueued, which means that if you want to use a plugin such as <a href=\"https:\/\/wordpress.org\/extend\/plugins\/footer-javascript\/\">JavaScript to Footer<\/a> then jquery script gets put at the bottom and the jQuery settings for the pixopoint menu remain at the top and you get a JavaScript error that jQuery is not found.<\/p>\n<p>There&#8217;s probably good reasons why they&#8217;re not, but it would be useful if that could be.<\/p>\n<p>There are two problem files that I could find:<\/p>\n<ul>\n<li>core.php<\/li>\n<li>scripts\\superfish_settings.js.php<\/li>\n<\/ul>\n<p>The problem line in core.php is:<\/p>\n<p><code>&lt;!--[if lte IE 7]&gt;&lt;script type=&quot;text\/javascript&quot; src=&quot;&#039;.WP_PLUGIN_URL.&#039;\/multi-level-navigation-plugin\/scripts\/suckerfish_ie.js&quot;&gt;&lt;\/script&gt;&lt;![endif]--&gt;<\/code><\/p>\n<p>I guess the conditional comment is a problem for enqueuing the suckerfish script, but this post (http:\/\/kuttler.eu\/post\/wordpress-style-version-conditional-comments\/) seems to suggest its possible for enqueue_styles, so something similar might work for enqueue_scripts. I found that as a Resource link near the bottom of the WordPress <a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/wp_enqueue_style\">wp_enqueue_style function reference<\/a> page.<\/p>\n<p>Not sure why the scripts\\superfish_settings.js.php file can&#8217;t be linked to in a script src attribute rather than being pushed directly into the page. If that was done then it could be enqueued properly.<\/p>\n<p>https:\/\/wordpress.org\/extend\/plugins\/multi-level-navigation-plugin\/<\/p>\n","protected":false},"template":"","class_list":["post-2908916","topic","type-topic","status-closed","hentry","topic-tag-javascript","topic-tag-wp_enqueue_script"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2908916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2908916\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2908916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}