Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

removeAttribute doesn't seem to do so.

  • 1 trả lời
  • 1 gặp vấn đề này
  • 15 lượt xem
  • Trả lời mới nhất được viết bởi 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.

Được chỉnh sửa bởi briansmither vào

Tất cả các câu trả lời (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.

Được chỉnh sửa bởi briansmither vào