Question

I'm building a website in Joomla 3.1, within the Zoo area it uses the Com_media to select for the image. I can use it to browser images, but the pop up gives the error

Uncaught TypeError: Property '$' of object [object Object] is not a function

While browsing the images and clicking on the one I want to use I get the second error

Uncaught TypeError: Cannot call method 'populateFields' of undefined

Any help to resolve these would be great.

Was it helpful?

Solution

When you load jQuery noconflict, the dollar sign $ stops beying connected to jQuery. So you should use jQuery() instead of $().

Keep in mind that MooTools also uses the dollar sign. This MooTools method is for selecting a element by ID and can be replaced by document.id()

The tricky part, if you have both MooTools and jQuery code is to know which library the dollar bellongs to. In the error you pointed above I think its just to replace the $ by jQueryar the line of the error.

OTHER TIPS

Try changing the $ to jQuery where the error is occurring in your code. It is my understading that the issue occurs due to the no conflict jQuery file being loaded in by Joomla:

<script src="/solent/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top