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


Groups > comp.lang.javascript > #19721

Re: Set iframe src without default.

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <1805136.E3oRWK2ye4@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <usenet@PointedEars.de>
Organization PointedEars Software (PES)
Date Thu, 09 May 2013 12:26:44 +0200
User-Agent KNode/4.10.2
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: Set iframe src without default.
Newsgroups comp.lang.javascript
References <ouydnaJoPKrz5hTMnZ2dnUVZ_v2dnZ2d@westnet.com.au> <kmd693$hvp$1@news.albasani.net> <ddudncm65LBvshfMnZ2dnUVZ_rqdnZ2d@westnet.com.au> <3387373.LFUtorD41v@PointedEars.de> <1emdnRJN--PxdBfMnZ2dnUVZ_sqdnZ2d@westnet.com.au>
MIME-Version 1.0
Lines 44
NNTP-Posting-Date 09 May 2013 12:26:44 CEST
NNTP-Posting-Host 63672275.newsspool3.arcor-online.net
X-Trace DXC=XXP[V009:<=^cW`WBF>WQ<McF=Q^Z^V384Fo<]lROoR18kF<OcfhCO;kVJJEDc\6Y6DZm8W4\YJN<b@mF9jNikd5BoKGPB=12A7=DiEYlEg2=3
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:19721

Show key headers only | View raw


Andrew Poulos wrote:

> On 8/05/2013 10:33 PM, Thomas 'PointedEars' Lahn wrote:
>> Andrew Poulos wrote:
>>> Thanks, though I take JKK and PE's comments on board that the only
>>> "real" way to do this is server side.
>>
>> You have misunderstood me at least.  A good solution to your problem is
>> to have the client-side script that changes the iframe document in or
>> included by the iframe document.  For you can only say for sure on the
>> *client* side whether there is client-side script support, whether it is
>> enabled, and whether the support is sufficient for the task – simply by
>> executing the relevant code (which would contain feature tests).
>>
>> Stefan's suggestion is another good idea, but apparently not applicable
>> here.
>>
>> There is also a third way combining both suggestions, but it might not be
>> among the best ones here: You can include the iframe element displaying
>> the default document (or put other content) and replace that
>> programmatically by client-side (DOM) script with a new iframe element
>> that displays another document.  This is the same approach you would
>> choose if, for example, you wanted to include a static Google Maps map
>> (an image) in an HTML document (that would work everywhere), and replace
>> it with an interactive Google Maps map if possible (“progressive
>> enhancement”).
> 
> Is it "better" to replace one iframe with another instead of just
> changing the iframe's src?

Depends.

> I've tried a way that was previously suggested (dropping the noscript,
> and instead dynamically changing the src with a script element
> immediately after the iframe element in the HTML) and it seems to do
> what I need.

It is inherently unreliable, though.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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