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 ',)