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


Groups > comp.lang.javascript > #19682

Re: Set iframe src without default.

Newsgroups comp.lang.javascript
Subject Re: Set iframe src without default.
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <ouydnaJoPKrz5hTMnZ2dnUVZ_v2dnZ2d@westnet.com.au>
Date 2013-05-08 01:14 +0200
Message-ID <XnsA1BAC97A6977eejj99@194.109.133.133> (permalink)

Show all headers | View raw


Andrew Poulos wrote on 08 mei 2013 in comp.lang.javascript:

> I have a page with an iframe in it
> 
> <iframe src="blah.htm"></frame>
> 
> If javascript is enabled then at window.onload the source is changed 
> depending on what's found in the hash part of the URL. If javascript is 
> not enabled then users get to see 'blah.htm' - the default.
> 
> The issue that I'm having is that when the page loads 'blah.htm' often 
> flashes up just before the source is changed.
> 
> If I don't set a src then the 'fails' when javascript is not enabled.
> 
> How do I keep a default src without the default flashing up before the 
> src is dynamically changed?

If you do not like that, why do you make it that way?

It is reasonable to expect some delay, if you first load the iframe with 
the default page, and then only when the total is loaded start changing 
the iframe. There is no reason to wait for the page to be loaded to start 
testing the hash.

But as you show, the whole setup stinks, because it "prefers" noscript,
while most browsers are script enabled, so noscript should be the 
fallback.

If you must, perhaps:

<iframe id='myIframe' style='display:none;'></frame>
<noscript><iframe src='blah.htm'></frame></noscript>

and have script fill the source of the first iframe and change the 
display? 


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


Thread

Set iframe src without default. Andrew Poulos <ap_prog@hotmail.com> - 2013-05-08 08:08 +1000
  Re: Set iframe src without default. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-05-08 01:14 +0200
    Re: Set iframe src without default. Andrew Poulos <ap_prog@hotmail.com> - 2013-05-08 13:18 +1000
      Re: Set iframe src without default. "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-05-08 08:45 +0300
        Re: Set iframe src without default. Andrew Poulos <ap_prog@hotmail.com> - 2013-05-08 16:53 +1000
          Re: Set iframe src without default. "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-05-08 10:25 +0300
  Re: Set iframe src without default. "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-05-08 08:50 +0300
  Re: Set iframe src without default. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-08 10:25 +0200
    Re: Set iframe src without default. Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-05-09 00:12 +0200
      Re: Set iframe src without default. Christoph Becker <cmbecker69@gmx.de> - 2013-05-09 02:06 +0200
        Re: Set iframe src without default. Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-05-09 11:34 +0200
          Re: Set iframe src without default. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-12 17:46 +0200
  Re: Set iframe src without default. Stefan Weiss <krewecherl@gmail.com> - 2013-05-08 11:35 +0200
    Re: Set iframe src without default. Andrew Poulos <ap_prog@hotmail.com> - 2013-05-08 20:58 +1000
      Re: Set iframe src without default. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-08 14:33 +0200
        Re: Set iframe src without default. Andrew Poulos <ap_prog@hotmail.com> - 2013-05-09 10:10 +1000
          Re: Set iframe src without default. Tim Streater <timstreater@greenbee.net> - 2013-05-09 09:33 +0100
          Re: Set iframe src without default. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-09 12:26 +0200
      Re: Set iframe src without default. Matt McDonald <matt@fortybelow.ca> - 2013-05-08 18:52 -0400
        Re: Set iframe src without default. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-09 12:30 +0200

csiph-web