{"id":6864,"date":"2014-05-07T18:34:17","date_gmt":"2014-05-07T18:34:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/07\/jdocumentrawaddcustomtag-error-on-joomla-component-using-jquery-getjson-collection-of-common-programming-errors\/"},"modified":"2014-05-07T18:34:17","modified_gmt":"2014-05-07T18:34:17","slug":"jdocumentrawaddcustomtag-error-on-joomla-component-using-jquery-getjson-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/07\/jdocumentrawaddcustomtag-error-on-joomla-component-using-jquery-getjson-collection-of-common-programming-errors\/","title":{"rendered":"JDocumentRAW::addCustomTag() error on joomla component using jQuery.getJSON()-Collection of common programming errors"},"content":{"rendered":"<p>i m newbie to joomla, although i have worked a lot with jQuery so i feel comfortable in jQuery rather than mootools, now i m developing a joomla component, so what i do..<\/p>\n<p>on<\/p>\n<blockquote>\n<p>joomla\/administrator\/component\/com_property\/admin.controller.php<\/p>\n<\/blockquote>\n<p>i write below code<\/p>\n<pre><code>defined('_JEXEC') or die('Restricted access');\nJHTML::_('behavior.mootools');\n$document =&amp; JFactory::getDocument();\n$rootURL = JURI::root();\n$document-&gt;addScript($rootURL.'media\/system\/js\/jquery.min.js' );\n<\/code><\/pre>\n<p>now when i go to add a property from<\/p>\n<blockquote>\n<p>http:\/\/localhost\/joomla\/administrator\/index.php?option=com_property&#038;view=addProperty<\/p>\n<\/blockquote>\n<p>Actualy there is select boxes of province &amp; city,on changing province, select box of city changes dynamically, i write<\/p>\n<p><code>jQuery.getJSON(?option=com_property&amp;view=ajaxdata&amp;format=raw)<\/code><\/p>\n<p>everythings was working fine when i add <code>jQuery.noConflict();<\/code> on that specific page<\/p>\n<p><strong>\/joomla\/administrator\/components\/com_property\/views\/addproperty\/tmpl\/default.php<\/strong><\/p>\n<p><strong>BUT<\/strong> if i add<\/p>\n<blockquote>\n<p>$document-&gt;addCustomTag(&#8216;jQuery.noConflict();&#8217;);<\/p>\n<\/blockquote>\n<p>on <strong>admin.controller.php<\/strong><\/p>\n<p>it display below error in firbug console<\/p>\n<blockquote>\n<p><b>Fatal error<\/b>: Call to undefined method JDocumentRAW::addCustomTag() in <b>\/opt\/lampp\/htdocs\/joomla\/administrator\/components\/com_property\/admin.controller.php<\/b> on line <b>22<\/b><\/p>\n<\/blockquote>\n<p>please suggest me how to handle this problem,<\/p>\n<p>actually what i want is<\/p>\n<ul>\n<li>i want o include jquery throughout the website<\/li>\n<li>also want to include <code>jQuery.noConflict()<\/code>, so that there shoud be no confliction between jQuery &amp; Mootools( internally used by joomla), bcoz if i remove addCustomTag() method from <code>admin.controller.php<\/code>, then i need to add <code>jQuery.noConflict()<\/code> on each page where i use jQuery and that is voilation of <em>DRY<\/em> concept<\/li>\n<\/ul>\n<p>please suggest me how to use jQuery in joomla without confliction on all pages of website.<\/p>\n<p>Thank you for Support me always<\/p>\n","protected":false},"excerpt":{"rendered":"<p>i m newbie to joomla, although i have worked a lot with jQuery so i feel comfortable in jQuery rather than mootools, now i m developing a joomla component, so what i do.. on joomla\/administrator\/component\/com_property\/admin.controller.php i write below code defined(&#8216;_JEXEC&#8217;) or die(&#8216;Restricted access&#8217;); JHTML::_(&#8216;behavior.mootools&#8217;); $document =&amp; JFactory::getDocument(); $rootURL = JURI::root(); $document-&gt;addScript($rootURL.&#8217;media\/system\/js\/jquery.min.js&#8217; ); now when i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6864","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6864"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6864\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}