How to Use IFRAME labels that comply with W3C Web page standards

Source: Internet
Author: User

The website wants to be revised, and there is an advertisement problem. In the past, every advertisement was put on the whole site. Article It is inconvenient and difficult to update it all! I have changed some of the previously recommended articles on the website to the ones I have already recommended! It also wastes my time. So I want to use IFRAME for implementation, but using IFRAME directly does not comply with the standard, so how can I use it to comply with W3C standards?

Direct use of "iframe" does not comply with "W3C Web page standards"

Use js to standardize IFRAME.

1. Create a JS file,CodeAs follows:

Copy code The Code is as follows: function IFR (URL, W, h) {document. write ('<IFRAME id = "IFR" name = "IFR" width = "' + W + '" Height = "' + H + '" border = "0" frameborder = "0" scrolling = "no" src = "'+ URL +'"> </iframe> ');}

Save as "IFR. js"

2. insert code into the webpage

Copy code The Code is as follows: <SCRIPT type = "text/JavaScript" src = "IFR. js"> </SCRIPT>

3. insert Code where IFRAME is needed

Copy code The Code is as follows: <SCRIPT type = "text/JavaScript"> IFR ('HTTP: // www.cwdn.org/', '778', '120'); </SCRIPT>

Function IFR () Instructions for use: IFR ('write address here ', 'Write width here', 'Write length here ',)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.