Reputation: 920
I'm trying to convert a Joomla 1.5 plugin to Joomla 2.5 plugin. As this plugin is runnning, Firebug says `TypeError: document.getElement is not a function. Here is my code....
var btn = document.getElement("#imageForm fieldset div [onclick=\"\"]");
console.log(btn);
if (btn.getAttribute("onclick").indexOf("ImageManager") > -1 )
{
if (typeof window.parent.'.$request['rewrite_function'].' === "function")
{
btn.setAttribute("onclick",btn.getAttribute("onclick").replace("ImageManager.onok()","window.parent.'.$request['rewrite_function'].'()"))
}
}
I have been stuck on this for hours now and I can't get it to work. Could you please tell me what is wrong with this javascript or atleast point me in the right direction.
Upvotes: 0
Views: 4010
Reputation: 2771
I recently had this issue when I was trying to use jquery and mootools on the same page. I solved the problem by adding jquery's no conflict at the top of my html and whenever I made a jquery call, I used the $j variable I created instead of the shortcut $:
<script type="text/javascript">
jQuery.noConflict();
var $j = jQuery;
</script>
Upvotes: 2