Results 1 to 3 of 3

Thread: Ext JS conflict with other scripts on the page

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Vote Rating

    Default Ext JS conflict with other scripts on the page

    I'm using Ext JS with OpenLayers for the map in Drupal, where user can select different WMS maps.
    I'm including following JS files:
    on every page where I've link with popup to the map widget.

    Here is the demo:

    After integrated with others scripts, some of the variables contain weird __proto__ function called remove() which cause JS syntax errors.

    In example:
    Following code works without problems:
        pairs ="\?")[1].split("&");
        for (i in pairs) {
            keyval = pairs[i].split("=");
            if (keyval[0] == "easting" || keyval[0] == "ebl") 
                this.eastBndLon = parseFloat(keyval[1]);
            if (keyval[0] == "westing" || keyval[0] == "wbl") 
                this.westBndLon = parseFloat(keyval[1]);
            if (keyval[0] == "northing" || keyval[0] == "nbl") 
                this.northBndLat = parseFloat(keyval[1]);
            if (keyval[0] == "southing" || keyval[0] == "sbl") 
                this.southBndLat = parseFloat(keyval[1]);
            if (keyval[0] == "url" || keyval[0] == "u") 
    But when I include Ext JS files, pairs contain somehow additional hidden function, which is counted as the last element of pairs, so code trying to execute:
    which is wrong.

    Another example:
        for (var n in userFlags) {
          var flagInfo = userFlags[n].match(/(\w+)_(\d+)/);
          var flagName = flagInfo[1];
          var contentId = flagInfo[2];
          // User flags always default to off and the JavaScript toggles them on.
          if (templates[flagName + '_' + contentId]) {
            $('.flag-' + flagName.flagNameToCSS() + '-' + contentId, context).after(templates[flagName + '_' + contentId]).remove();
    userFlags contain 1 element, but has this weird function remove(). In Chrome Inspector you can't see that this object contain 2 elements, only in Firebug if you eventually analyse it more deeply.
    And this code breaks with error:
    Uncaught TypeError: Object function ({var A=this.indexOf(;if(A!=-1){this.splice(A,1)}return this} has no method 'match'
    because last element of userFlags contains proto function:
    remove: function (B){var A=this.indexOf(B);if(A!=-1){...
    See the screenshot fo details.

  2. #2

  3. #3
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Vote Rating


    and my answer is still the same as it was 3 years ago

    Why don't you just use a traditional for loop?

Similar Threads

  1. Scripts dont work on tab content page
    By AlThar in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 20 Jan 2011, 5:01 AM
  2. Replies: 0
    Last Post: 10 Aug 2010, 5:55 AM
  3. About GXT and EXT CSS conflict
    By likebean in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 12 Jan 2010, 7:22 PM
  4. Css conflict?
    By jchamb2010 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 26 Nov 2009, 9:38 PM
  5. run scripts in a ContentPanel.setUrl loaded page
    By SmyersM in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 11 Apr 2007, 11:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts