Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #33353

Re: Instead of iframe onload?

From Martin Honnen <martin.honnen@gmx.de>
Newsgroups comp.lang.javascript
Subject Re: Instead of iframe onload?
Date 2017-05-19 15:25 +0200
Organization Liberty Development
Message-ID <ofmrnu$sc9$1@news.albasani.net> (permalink)
References <5638b17e-4ab2-4605-ac32-b399ddcfa099@googlegroups.com>

Show all headers | View raw


On 18.05.2017 14:40, Dr J R Stockton wrote:
> I use such as
> 
>   <iframe src="someHTML.htm" onload="Procrustes(this)"></iframe>
> 
> to adjust the height of the iframe to fit the displayed
> content from page someHTML.htm ; it works in my Firefoxes.
> 
> BUT
>    (1) I've not tested it on all browsers,
>    (2) If someHTML.htm contains a similar construction,
>        the 'outer' iframe resizes wrongly, for an obvious
>        reason,
>    (3) Validators & testers dislike iframe ... onload.
> 
> Is there a better method, acceptable to at least to
> validator.w3.org, 


I think HTML5 and HTML5.1 do allow the "onload" event handler attribute 
on most elements 
(https://www.w3.org/TR/html5/dom.html#global-attributes) and I don't 
have any problems at https://validator.w3.org/nu/#textarea to validate e.g.

<!DOCTYPE html>
<html lang="en">
<head>
<title>iframe onload test</title>
</head>
<body>
<section>
<h1>test</h1>
<iframe src="http://example.com/" 
onload="console.log(event.type);"></iframe>
</section>
</body>
</html>

so I am not sure why you think that validators dislike the onload 
attribute, at least you haven't told us which document standard you target.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Instead of iframe onload? Dr J R Stockton <J.R.Stockton@physics.org> - 2017-05-18 05:40 -0700
  Re: Instead of iframe onload? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-18 15:07 +0200
    Re: Instead of iframe onload? Dr J R Stockton <J.R.Stockton@physics.org> - 2017-05-18 08:11 -0700
      Re: Instead of iframe onload? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-18 18:09 +0200
        Re: Instead of iframe onload? Andrew Poulos <ap_prog@hotmail.com> - 2017-05-19 12:36 +1000
          Re: Instead of iframe onload? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-19 09:15 +0200
            Re: Instead of iframe onload? Andrew Poulos <ap_prog@hotmail.com> - 2017-05-19 18:12 +1000
              Re: Instead of iframe onload? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-05-19 11:47 +0200
  Re: Instead of iframe onload? Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2017-05-19 02:44 -0700
  Re: Instead of iframe onload? Martin Honnen <martin.honnen@gmx.de> - 2017-05-19 15:25 +0200
    Re: Instead of iframe onload? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-19 18:11 +0200
    Re: Instead of iframe onload? Dr J R Stockton <J.R.Stockton@physics.org> - 2017-05-19 14:30 -0700
      Instead of <iframe onload=... Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-05-20 22:15 +0100
        Re: Instead of <iframe onload=... Stefan Weiss <krewecherl@gmail.com> - 2017-05-21 02:10 +0200
          Re: Instead of <iframe onload=... Dr J R Stockton <J.R.Stockton@physics.org> - 2017-05-21 11:46 -0700
            Re: Instead of <iframe onload=... Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-05-24 23:18 +0100
          Re: Instead of <iframe onload=... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-21 23:22 +0200
            Re: Instead of <iframe onload=... Stefan Weiss <krewecherl@gmail.com> - 2017-05-22 00:39 +0200
              Re: Instead of <iframe onload=... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-22 01:38 +0200
                Re: Instead of <iframe onload=... Stefan Weiss <krewecherl@gmail.com> - 2017-05-22 02:19 +0200
                Re: Instead of <iframe onload=... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-22 02:35 +0200
                Re: Instead of <iframe onload=... Stefan Weiss <krewecherl@gmail.com> - 2017-05-22 12:54 +0200
                Re: Instead of <iframe onload=... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-22 15:37 +0200
                Re: Instead of <iframe onload=... Stefan Weiss <krewecherl@gmail.com> - 2017-05-22 18:23 +0200
                Re: Instead of <iframe onload=... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-23 14:15 +0200
                Re: Instead of <iframe onload=... Stefan Weiss <krewecherl@gmail.com> - 2017-05-23 15:56 +0200
                Re: Instead of <iframe onload=... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-23 18:41 +0200
        Re: Instead of <iframe onload=... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-22 03:27 +0200

csiph-web