Cerca nel supporto

Attenzione alle mail truffa. Mozilla non chiederà mai di chiamare o mandare messaggi a un numero di telefono o di inviare dati personali. Segnalare qualsiasi attività sospetta utilizzando l'opzione “Segnala abuso”.

Learn More

Questa discussione è archiviata. Inserire una nuova richiesta se occorre aiuto.

removeAttribute doesn't seem to do so.

  • 1 risposta
  • 1 ha questo problema
  • 15 visualizzazioni
  • Ultima risposta di briansmither

more options

I am trying to do this in an <img id='player' src=' ' alt='alt' title='title' border='0' onerror="document.getElementById('player').removeAttribute('src');document.getElementById('player').removeAttribute('alt');document.getElementById('player').removeAttribute('title');" /> tag.

When I view Generated Source in FF2 (Web Developer 1.1.9), the attributes are not shown in the source listing, and the title attribute still displays in the page.

When I view Generated Source in FF4, the attributes are present in the source listing, and the title attribute still displays on the page.

I am trying to do this in an &lt;img id='player' src=' ' alt='alt' title='title' border='0' onerror="document.getElementById('player').removeAttribute('src');document.getElementById('player').removeAttribute('alt');document.getElementById('player').removeAttribute('title');" /&gt; tag. When I view Generated Source in FF2 (Web Developer 1.1.9), the attributes are not shown in the source listing, and the title attribute still displays in the page. When I view Generated Source in FF4, the attributes are present in the source listing, and the title attribute still displays on the page.

Modificato da briansmither il

Tutte le risposte (1)

more options

(In my original post above, I had to use a space as the value for the src attribute, otherwise this editor would not show it. But my actual code is a zero-length string.)

I believe that FF4 does not consider a zero-length string as a triggerable error. I change the src attribute's value to '#' and all is working as desired.

Modificato da briansmither il