Search code examples
firefoxdompolymeriron-ajax

Polymer iron-ajax events "on-response" and "on-error" not working on Mozilla FF


Dears, I'm using "iron-ajax"s events to show a success/failure message. For this i'm using respectively "on-response" and "on-error". It is working fine in "Chrome" but it's not triggered in "Mozilla Firefox". Here is a simple example :

<iron-ajax contentType="{{contentType}}" method="{{method}}" on-response="msgSavedResponse" on-error="msgSavedError" id="ajax" url="{{url}}" headers="{{headers}}" handle-as="json"
           last-response="{{lastResponse}}"></iron-ajax>

Then below in Polymer, I have the following methods :

  msgSavedResponse: function(){
      this.$.successToast.text=this.localize('msg.success');
      this.$.successToast.show();
      this.$.messageDialog.close();  
  },
  msgSavedError: function(){
      this.$.errorToast.text=this.localize('msg.fail');
      this.$.errorToast.show();
      this.$.messageDialog.close();  
  },

Solution

  • You forgot to pass the event argument to your handler. For me the events normally worked in FX - does your console show any errors?

    You can also set bubbles property to true and see if that changes anything.