Iframe and IE

G

Gianni

If I run the following in FireFox, I am able
to change the picture in the iframe
by clicking on a thumbnail.
If I run it in IE, I am not able to change
the picture.

If I leave off the src="..." in the definition of the iframe,
then I am able to put a picture in the frame and
change it by clicking on the thumbnail.

What am I doing wrong? I want to start the iframe with
a picture in it and to be able to change it.

Thanks


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">
<html xmlns="http://www.w3.org/TR/html4/strict.dtd">
<head>
<title>Iframes</title>
<style type="text/css">

#placeframe {
position:absolute;
top:18px;
left:220px;
}
img, p {
border: none;
margin: 0;
padding: 0;
}

</style>

<script language="Javascript" type="text/javascript">
<!-- Hide script from old browsers

function writeContent(imageno) {
parent.content.document.write('<img src="images/head'+imageno+'.jpg"
width="350" height="524" alt="head1" />')
parent.content.document.close()
}
// End hiding script from old browsers -->
</script>
</head>
<body bgcolor="#ddddff">

<div id="placeframe">
<iframe src="photos/head1.jpg" width="350" height="524" name="content"
align="left" frameborder="1" marginheight="0"
scrolling="no" >Your browser does not support iframes</iframe>
</div>

<p>
<a href="javascript:writeContent(1)" />
<img src="images/head1_thumb.jpg" width="50" height="75"
alt="head1 thumb" />
</a>

</p>
<p>
<a href="javascript:writeContent(2)" />
<img src="images/head2_thumb.jpg" width="50" height="75"
alt="head2 thumb" />
</a>
</p>

</body>
</html>
 
S

SAM

Le 7/16/09 9:39 PM, Gianni a écrit :
If I run the following in FireFox, I am able
to change the picture in the iframe
by clicking on a thumbnail.
If I run it in IE, I am not able to change
the picture.

no problemo in locale with my IE6


You know you can change directly an image ?
(even without giving it sizes)

function show (imageno) {
if(document.images) {
document.viewer.src = 'images/head'+imageno+'.jpg';
}
}

<img name="viewer" src="photos/head1.jpg" />
<a href="javascript:show(1)">image 1</a>


But as you are in xhtml, images have no name, so :

JS:
====
function show (imageno) {
if(document.getElementById) {
document.getElementById('viewer').src = 'images/head'+imageno+'.jpg';
}
else if(document.images) {
var pct = document.images[document.images.length-1];
pct.src = 'images/head'+imageno+'.jpg';
}
}

html:
=====
<p><a href="javascript:show(1)">image 1</a>
<a href="javascript:show(2)">image 2</a>
<a href="javascript:show(3)">image 3</a>
</p>
<p><img id="viewer" src="photos/head0.jpg" /></p>

css:
====
p { text-align: center }
img { border: none }

If I leave off the src="..." in the definition of the iframe,
then I am able to put a picture in the frame and
change it by clicking on the thumbnail.

What am I doing wrong? I want to start the iframe with
a picture in it and to be able to change it.

perhaps my IE was low in protection ?

maybe :

with(parent.content.document) {
open();
write('blah');
close();
 
T

Thomas 'PointedEars' Lahn

Gianni said:
What am I doing wrong? I want to start the iframe with
a picture in it and to be able to change it.
[...]

Not using/writing junk code would be a good start. Then you should be aware
that probably you do not want to use an iframe, but modify the `src'
property of an image (`img' element) object instead. (If you used an
`iframe' element, you would want to embed an (X)HTML document that loads the
image; not a plain image).

<http://jibbering.com/faq/>


PointedEars
 
G

Gianni

Thomas said:
Gianni said:
What am I doing wrong? I want to start the iframe with
a picture in it and to be able to change it.
[...]

Not using/writing junk code would be a good start. Then you should be aware
that probably you do not want to use an iframe, but modify the `src'
property of an image (`img' element) object instead. (If you used an
`iframe' element, you would want to embed an (X)HTML document that loads the
image; not a plain image).

<http://jibbering.com/faq/>


PointedEars
You do not help by responding in this manner.
I have only been doing this for three weeks and
trying to learn. Please don't respond to me again.
 
T

Thomas 'PointedEars' Lahn

Gianni said:
Thomas said:
Gianni said:
What am I doing wrong? I want to start the iframe with
a picture in it and to be able to change it.
[...]
Not using/writing junk code would be a good start. Then you should be aware
that probably you do not want to use an iframe, but modify the `src'
property of an image (`img' element) object instead. (If you used an
`iframe' element, you would want to embed an (X)HTML document that loads the
image; not a plain image).

<http://jibbering.com/faq/>
[...]
You do not help by responding in this manner.
I have only been doing this for three weeks and
trying to learn. Please don't respond to me again.

Then die in ignorance. I won't waste my time with you again.


Score adjusted

PointedEars
 
M

Matthias Reuter

Gianni said:
<script language="Javascript" type="text/javascript">
<!-- Hide script from old browsers [snip]
// End hiding script from old browsers -->
</script>

When Netscape included the script element in NN 3.0, they came up with
this solution to prevent older browsers (that is NN 2) from showing the
source code (This is the basic behaviour of browsers, if you don't know a
tag name just ignore it and display the content).

So if you don't plan to support NN 2 or IE 3, just skip those comments.
You can skip the language attribute as well, the type attribute is
sufficient.

Matt
 
T

Thomas 'PointedEars' Lahn

Matthias said:
Gianni said:
<script language="Javascript" type="text/javascript">
<!-- Hide script from old browsers [snip]
// End hiding script from old browsers -->
</script>

When Netscape included the script element in NN 3.0, they came up with
this solution to prevent older browsers (that is NN 2) from showing the
source code [...]

Interesting statement, given that JavaScript 1.0 was purportedly introduced
with NN 2.0.[1] Something doesn't add up here.


PointedEars
___________
[1] <http://docs.sun.com/source/816-6408-10/preface.htm#1003267>
 
S

SAM

Le 7/17/09 8:35 AM, D.Campagna a écrit :
SAM ha scritto:
T'a trouvé un autre italien, c'est petite l'Internet...

"no problemo" is supposed to be Mexican ;-)
(ref: movie "Terminator")

local*e* could be a typo ?
Can you please explain a bit ? Why this is xhtml and not html?

The mentioned doctype wasn't it XHTML strict ?
(in the code given in the question)
Yup ? no ... :-(

Anyway to use id and gEBI detection is not wrong in html.

Tag 'img' :
<http://www.diodati.org/w3c/html401/struct/objects.html#h-13.2>
[cite]
name = cdata [CI]
Questo attributo designa l'elemento in modo che possa essere
richiamato da fogli di stile o da script. Nota. Questo attributo è stato
incluso per ragioni di compatibilità all'indietro. Le applicazioni
*dovrebbero usare l'attributo id* per identificare gli elementi.
[/cite]

In English:
<http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#h-13.2>
[cite]
name = cdata [CI]
Applications should *use the id attribute* to identify elements
[/cite]
But you put the script in the Iframe, otherwise to what refers 'parent'?

"parent" refers to "parent"
here, as we are in the main/mother window,
the "parent" is the "self" window ;-)

What I want to say :
using "parent" never gives an error if the parent doesn't exist.
(ça ne mange pas de pain)

Just you're sure to be able to call the iFrame by its name doing :
parent.myIframe (iframe's name = 'myIframe')
I don't believe that
window.myIframe
can do the same ?

More: this way of doing can be used regardless in the mother or in her
child.

The main problem is : and if the browser doesn't know iFrames ?
(after the curious way to use iframes when better and simpler way(s) exist)
 
S

SAM

Le 7/17/09 4:11 AM, Gianni a écrit :
Thomas said:
Gianni said:
What am I doing wrong? I want to start the iframe with
a picture in it and to be able to change it.
[...]
Not using/writing junk code would be a good start. Then you should be aware
that probably you do not want to use an iframe, but modify the `src'
property of an image (`img' element) object instead. (If you used an
`iframe' element, you would want to embed an (X)HTML document that loads the
image; not a plain image).

<http://jibbering.com/faq/>


PointedEars
You do not help by responding in this manner.

re-read the Thomas's answer (slowly and attentively)
because he is perfectly right.

(that meets my own previous answer)
(in less words)
I have only been doing this for three weeks and
trying to learn. Please don't respond to me again.

Yes it does ... see the FAQ (whom link was given)
 
G

Gianni

SAM said:
Le 7/17/09 4:11 AM, Gianni a écrit :
Thomas said:
Gianni wrote:
What am I doing wrong? I want to start the iframe with
a picture in it and to be able to change it.
[...]
Not using/writing junk code would be a good start. Then you should be aware
that probably you do not want to use an iframe, but modify the `src'
property of an image (`img' element) object instead. (If you used an
`iframe' element, you would want to embed an (X)HTML document that loads the
image; not a plain image).

<http://jibbering.com/faq/>


PointedEars
You do not help by responding in this manner.

re-read the Thomas's answer (slowly and attentively)
because he is perfectly right.

(that meets my own previous answer)
(in less words)
I have only been doing this for three weeks and
trying to learn. Please don't respond to me again.

Yes it does ... see the FAQ (whom link was given)
Your response and its manner gave me something
to work with. Yes I will look at pointed's response,
slowly and attentively.

Thanks
 
S

SAM

Le 7/17/09 1:38 PM, Gianni a écrit :
Your response and its manner gave me something
to work with.

Ha? it was the "manner" which was not too good ?

Well.
After the posts about xhtml/html,
if you are with an html.4.01 doctype,
images can be named, so :

JS:
====
function show (imageno) {
var pct = (document.getElementById)?
document.getElementById('viewer') :
(document.images)? document.viewer :
document['viewer'];
if(pct.src) pct.src = 'images/head'+imageno+'.jpg';
}

html:
=====
<p><a href="javascript:show(1)">image 1</a>
<a href="javascript:show(2)">image 2</a>
<a href="javascript:show(3)">image 3</a>
</p>
<p><img name="viewer"
id="viewer"
src="photos/head0.jpg"></p>

css:
====
p { text-align: center }
img { border: none }


You know you can do that with *no* JavaScript ?
<http://www.cssplay.co.uk/menu/gallery.html>
 
S

SAM

Le 7/17/09 2:48 PM, D.Campagna a écrit :
SAM ha scritto:

I was really asking, not questioning. HTML4 = xHTML? ?:-/
(Ok, I'll search Wikipedia. I am not clear about HTML XHTML XML and
their differences)

globally n essentially : XHTML = HTML
except :
- names allowed only in form's element's tags
- tags and their attributes all in lowercase
- auto-close-tags : <br /> <input ... /> and so
- well formed html code
syntax errors are not allowed
Oh grazie, finalmente qualcuno che supporta l'italiano!!!

Si, al menos por el W3C :
<http://www.diodati.org/w3c/>
indicado aquì :
<http://www.w3.org/Consortium/Translation/>
oops I missed it. (C'était bien possible d'y arriver, ma faute)
(I worked a lot on iframes the last days, and discovered some
interesting things. So 'top' should do the same maybe, but i got an
error trying to refer to top.something when not in a frame. So I
concluded that 'parent' too could be not correct if not in a frame.)

top as parent wouldn't give an error if we are in a self or a child window
the difference between both is that 'top' reaches the grand grand mother
(the very top/main page containing the imbricated frames)
when 'parent' reach only the mother

top and parent usually are used to reach a frame or an iframe
I think that to reach an image, for instance, you would need
document.myImage
so using parent or top :
parent.document.myImage
top.document.myImage

self, top, parent, here mean window (top = top-window)
 
G

Gianni

SAM said:
Ha? it was the "manner" which was not too good ?

Well.
After the posts about xhtml/html,
if you are with an html.4.01 doctype,
images can be named, so :
Oui, il étais la manière.

I'm not sure what I should have been looking at in
the FAQs.

The CSS example was exactly what I was looking for
except that the tutorial that went with it was for
another example. I did it anyway and learned a few
things, but hover did not seem to work with my IE7.

Your example with names was perfect. It solved the
problem and taught me a few things. I have to go
back now and look at the first example that you gave me.
I didn't understand it at the time, but after the last
few days, I am learning a lot.

Merci encore.
 
G

Gianni

D.Campagna said:
Thomas di solito ti da la risposta giusta, ma poi aggiunge che sei poco
più di un invertebrato per aver fatto quella domanda in quel modo in
quel giorno in quel contesto ecc. ecc. Devi cuccarti la seconda parte se
vuoi la prima.
Anche se non è molto diplomatico è una preziosa fonte di informazioni,
ed anche alquanto disponibile (finché non si incazza e ti mette in un
suo archivio di poster -secondo lui- fetecchiosi, a cui non parla più,
anzi arriva al punto di darti un punteggio, e se vai sotto un certo
limite vai tra i fetecchiosi).
Guarda che non dico che sia giusto o accettabile, dico solo che è così.
HTH
Dan
Grazie per il suo consigio. Ne seguiro.
 
O

Osmo Saarikumpu

SAM kirjoitti:

JFTR, lots of elements in XHTML, besides form, allow the name
attribute. Anyways, they are allowed only in the element's start tag.

BW, Osmo
 
G

Gianni

D.Campagna said:
Gianni ha scritto:


Now I understand that, despite an italian name, you are definitely not
italian, so I wonder why the hell you have such a nickname. Sorry for
talking you in italian in a way that no automated translator can vaguely
translate. I was using a manner to write that is impossible to
translate for a stupid robot.
I'll newer identify myself as 'hakim' or 'joe' or 'li p'eng', anyway,
if'i'd not able to manage answers in arabic, english, chinese.
Where are you from, gianni?
D. Campagna
I have studied and continue to study Italian for a few years.
When I was in a class, we all took an Italian name, thus Gianni.
I liked it and continue using it as a pseudonym to avoid other
problems on the Internet; I don't seem to be the only one to do so.
I thought I caught the meaning of your note with
a little help; obviously I didn't. Sorry.
 
S

SAM

Le 7/19/09 10:39 PM, D.Campagna a écrit :
Gianni ha scritto:

Sorry for talking you in italian in a way that
no automated translator can vaguely translate.

Not so bad (by Google) :

"Thomas généralement vous donne le droit de réponse, mais il ajoute que
vous êtes un peu plus d'invertébrés de cette question en ce sens ce
jour-là et dans ce contexte. etc. Devi Cucchi la deuxième partie, si
vous voulez que la première.
Bien qu'il ne soit pas très diplomatique est une source précieuse
d'information, et même un peu disponibles (jusqu'à ce que vous en colère
et vous avez mis dans un fichier-poster-fetecchiosi selon lui, qui ne
parle, en effet, va jusqu'à donner une client, et si vous allez
au-dessous d'un certain seuil, aller entre fetecchiosi).
Voyez ce que je ne vais pas dire qui est bon ou acceptable, je dis
seulement qu'il est."

"fetecchiosi" ça doit être du Calabrais ou du Napolitan ?
Ha! non! du Romain ?
defecare ? praticamente nulla? merdique quoi. (shit, grab ?)

Re-lecture:
"Thomas généralement vous donne le droit de réponse, mais il ajoute que
vous êtes un peu moins qu'un invertébré en posant cette question de
cette manière, ce jour-là et dans ce contexte. etc.
Devi Cucchi (Tu aurais dû passer ?) la deuxième partie, si tu ne voulais
que la première.
Bien qu'il ne soit pas très diplomatique il est une source précieuse
d'information, et même un peu disponible (jusqu'à ce que vous, en
colère, ne lui mettiez dans un fichier(un mail, un post) - selon lui :
fetecchiosi (inacceptable? merdique? à chier) - tu ne lui parlez plus,
en effet, va jusqu'à donner un score, et si tu vas sous une certaine
limite tu vas entre les fetecchiosi (entre les latrines ?)).
Note que je ne dis pas qu'il est juste ou acceptable, je dis seulement
que c'est comme ça."


La ricerca di fetecchiosi non ha prodotto risultati. :-(
<http://www.dizionario-italiano.it/>
Ha! ...
Flatulenza / flatulency / flatulence
<http://dizionari.hoepli.it/Dizionario_Italiano.aspx>
 
S

SAM

Le 7/20/09 9:44 AM, D.Campagna a écrit :
SAM ha scritto:

:) J'avais sous-estimé les possibilités de Google. Pas mal, en effet.
Mais partie de la signification est perdue...

Comme à son habitude (et même vers l'anglais) il n'a pas manqué de faire
un contre-sens.
Re-lecture:
"Thomas généralement vous donne le droit de réponse, mais il ajoute
[la risposta giusta = la réponse correcte]

Google : Thomas, usually, gives you the right to answer
Dan : Thomas, usually, gives you the right(correct?) answer

Not exactly the same meaning ...
Je crois que ce soit du Napolitain, 'fetecchia' = flatulence
'fetecchioso' est generalement une facon simpatique et vive de décrire
quelque chose de manquant qualité, vieux, gaté ecc.

Alors "merdique" (qui est assez vulgaire) est un peu fort
Ça sert plutôt à désigner une situation "foireuse", confuse, compliquée,
mal engagée, avec plein de problèmes ou un objet de (très) mauvaise
qualité (c'est de la merde) mais sans idée de vieux.
Vioque (ou vioc) = vieux (désigne plutôt les parents père et mère)
Flapi = abattu, épuisé (fatigué)
peut-être : antiquaille ou antiquaillerie ?
fetecchioso +/- = Cancaroun in Provenzale
'Cuccare' est une forme populaire qu'on utilise au nord et signifie
'capturer, prendre', donc connaitre jeunes filles en discoteque, pour
example (draguer?) mais aussi obtenir. La forme réflexive peut au
contraire signifier 'souffrir, accepter'... Donc:

Tu dois accepter la deuxieme partie, si tu ne voulais que la première

(je ne suis pas sur de quoi 'passer' peut signifier! C'etait cela?)

Non c'est le contraire (laisser pisser, zapper) sauter par dessus,
oublier, n'en avoir cure (not cure, to pass (over))
jusqu' au moment qu'IL se mit en colère, (si incazza) et vous met dans
un de ses fichiers de personnes -selon lui- merdiqes (je ne connaissais
pas ce mot, merci)

Ooops! à oublier !
Questo non è un servizio che andrò lì, merdeux i merdique non certo per
essere utilizzato in qualsiasi mondo convesation ;-)
(merdiqe <- typo ==> 'merdique')
è merda, è sporco (merdioso? no, merdiocoso?) (schifezza)
"merdeux" (merdoso? merdioso?) non è la stessa significato "merdique" ma
banbino, aggettivo: vergognoso, pietoso (riflessivo forma)
ma anche: burbero, il male, vizioso
auxquelles il ne parle plus,

C'était donc le 2ième contre-sens de Google.
C'est exaspérant cette facilité qu'a Google de traduire de qui était dit
par son contraire.
Bon, je supposais qu'il serait difficile...

Oui, quand même un peu, surtout avec Google qui traduit à l'envers.
(il est très fort pour cela en français <-> anglais)
 
S

SAM

Le 7/21/09 10:19 AM, D.Campagna a écrit :
SAM ha scritto:

'Fetecchioso' probablement n'existe meme pas,

Ha bon?
tapes ce mot dans Google tu seras surpris !
la seule parole qui existe est 'fetecchia' et c'est
du dialecte, en Italie beaucoup de monde invente des paroles, la seule
règle est que la parole soit raisonnablement compréhensible. J'aurait pu
dir 'merdacchioso', (merdillant? merdouillant? je suppose qe ces mots
n'existent pas) qui n'existe pas, mais est petillant et parfaitement

è lo stesso come per merde/merdique, solo il primo è nel mio dizionario,
ma ...
Merdique = non interesse, priva di valore.
mi dice un dizionario del web
compréhensible. C'était pour cela que j'avais pas d'espoir qu'une
translation automatique functionnerait...

fetecchia -> Google translate -> "No definitions found"
Ici alors google se trompe fort.

Non Google ne traduit rien, c'est juste une tentative de ma part / contexte.
on pourrait dire 'è una merdata' ou 'è una cagata' pour indiquer une
faute ou une action pas trop honnete ou une situation confuse.

Gaguer(verb)
Cagade ici dans le Sud = sottise, bêtise, capharnaum(Cafarnao)
Comme tu vois, j'ai fait les études classiques, et aprés, je me suis
specialisé en merdologie, avant d'approder au javascript. :)

;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top