Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8952843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:57:48+00:00 2026-06-15T13:57:48+00:00

I am trying to use Panoramio’s JavaScript API but it fails to display when

  • 0

I am trying to use Panoramio’s JavaScript API but it fails to display when the MooTools framework is used. Using Chrome’s inspect feature on this jsFiddle reveals this error with the included JavaScript:

Uncaught SyntaxError: Invalid regular expression: /function (keys){
    var obj = {}, length = Math.min(this.length, keys.length);
    for (var i = 0; i < length; i++) obj[keys[i]] = this[i];
    return obj;
}/: Nothing to repeat

The site I am trying to use the API on is a Joomla 2.5 one, hence the use of the MooTools framework. Changing the framework on the fiddle to jQuery or removing it entirely produces the pictures and the error does not appear.

I’ve looked at trying to incorporate jQuery’s noConflict() function somehow and searched for a similar function for MooTools but have had no success.

Any suggestions to solve this would be greatly welcome. Or is it a limitation of Panoramio’s JavaScript API itself?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:57:49+00:00Added an answer on June 15, 2026 at 1:57 pm

    MooTools adds a bunch of functions to Array.prototype without preventing them from being enumerated. This means they show up in for-in loops on arrays.

    It would appear that the Panoramio JavaScript is using for..in on an array without allowing for this, because the error message contains the source of the associate function that MooTools adds:

    // (Result of `String(Array.prototype.associate)` when MooTools is loaded
    function (keys){
        var obj = {}, length = Math.min(this.length, keys.length);
            for (var i = 0; i < length; i++) obj[keys[i]] = this[i];
            return obj;
    }
    

    This is a bug in the Panoramio script, one should never use for..in to loop over an array without correct safeguards. See Myths and realities of for..in (from my blog). If you can get an uncompressed version of the Panoramio script, you can probably fix the relevant loop(s).

    Some would also argue that it’s a bug (or at least, a bad design decision) for MooTools to add enumerable properties to Array.prototype.


    Dimitar Christoff notes in the comments (thanks Dimitar!) that if you load the Panoramio script after loading MooTools, it works: http://jsfiddle.net/DEWvZ/2/ But beware that if you make any calls into Panoramio later, once MooTools is loaded, those could fail, because if they’ve made the mistake in one place (initialization), they’re likely to make it elsewhere as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
Trying to use Net::SFTP, version 2.05 (appears to be the latest). But it fails
I was trying use svn to find a checkin using svn log, but it
i'm trying use facebook API to upload photo in my fan page. I downloaded
I have this panorama viewer that makes use of java, but when trying to
I am trying use filehelpers class builder but I am kinda confused on what
I am trying use a javascript function while passing php variables in it. For
I am trying use a javascript function while passing php variables in it. For
I am trying use javascript regular expressions to do some matching and I found
I am trying use Date Picker and on Select i want to display the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.