I have in my HTML code this line:
<iframe src="http://example.com"></iframe>
As editor I use Aptana.
How can I solve this warning? What does it mean?
"Should trim empty
<iframe>
."
Answer: Use the filter() Method You can simply use the filter() method to remove empty elements (or falsy values) from a JavaScript array. A falsy value is a value that is considered false in a Boolean context.
Some examples of empty tags are img, embed, area, meta, link, etc. The empty elements are those elements of HTML that cannot have some content like text or child element inside them. There is no need to specify the closing tag, and the opening tag should end with /> instead of >.
It is because there is no body for the iframe
tag.
One option to remove the warning will be putting the closing tag in a different line:
<iframe src="http://example.com">
</iframe>
Or adding a space:
<iframe src="http://example.com"> </iframe>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With