need help using javascript to target a frame!

T

TheKeith

First off, please excuse the crossposting--I really need an answer quickly.

I have a decent amount of experience with html but not javascript. Currently
I'm using dreamweaver to do a photo gallery where I have a whole bunch of
thumbnail pics within an iframe. These thumnail pics are to swap an image in
the parent frame with whichever thumbnail was clicked. I assigned a name to
the pic in the parent frame which is to get replaced (i.e. "viewer") and I'm
using dreamweaver's built-in js code to accomplish the swap. Here is an
example of the code that dreamweaver generated:

<a href="#" onClick="MM_swapImage('viewer','','buildingcorner.jpg',0)"><img
src="buildingcorner.jpg" name="Image1" width="142" height="100" border=0
id="Image1"></a>

the swapimage refers to a function in the head section of the page, but I
don't think there is anything wrong with this as I've used it before without
any problems, but never with frames involved. I did manually change the
section within the parenthesis since dreamweaver doesn't seem to be able to
target other frames. My question is basically, how can I make this code
work. I tried modifying it a bit, like 'parent.viewer', but that did
nothing. What can I do to make this work--help would be greatly
appreciated--thanks.

Keith

kegepet
at
nyc dot
rr dot
com
 
T

TheKeith

I don't really agree that frames are evil. They serve a very good design
purpose for the site I'm doing. I find pop-up windows far more evil and
annoying and every pretentious piece of shit site under the sun uses them in
some form or another. If frames are evil because of compatiblity issues,
then what about the tons of other technologies being used all the time, like
flash and stuff? Are they not evil?

Anyway, here is what I'm working on (not finished)--maybe someone can do a
view source and give me some answers.

http://www.kworks.us/photography/
 
D

DU

TheKeith said:
I don't really agree that frames are evil. They serve a very good design
purpose for the site I'm doing.

Your webpage uses a frameset to render a single frame. Why in the world
would you want or need to do that?


I find pop-up windows far more evil and
annoying and every pretentious piece of shit site under the sun uses them in
some form or another.

I filter a wide and very large majority of unrequested popups. I do not
filter requested popups: I do not want to filter them. You do not seem
to be making any distinction here. Most people use these days popup
killer software.

If frames are evil because of compatiblity issues,
then what about the tons of other technologies being used all the time, like
flash and stuff? Are they not evil?

If A is evil, then B being just as much/more evil will not make A any
better or any more acceptable, justifiable.
Your arguments are extremely weak. You do not explain the differences
between A and B from a webpage design and usability perspective either.
Your arguments can only serve to promote mediocrity, low-level design
manners.
Your posting manners (top-posting and cross-posting in newsgroups for no
good reasons) are very much a reason to killfile you.
Anyway, here is what I'm working on (not finished)--maybe someone can do a
view source and give me some answers.

1- Avoid frames and iframes: there is absolutely nothing in your webpage
which justifies the recourse to frames and iframe
2- use valid markup code and validate your markup code
3- avoid using tables (nested tables are even worse) for layout and
positioning purposes: use tables for tabular data
4- Start reading FAQs (technical ones)
5- Open your mind and just stop claiming you have good experience with
HTML. Throughout history, the human spirit always worked like a parachute.
6- Do not use javascript functions that you do not understand

Brucie replied in an adequate manner to you. Whether you are receptive
to his opinion is up to you. A wide majority of experts in webdesign do
not recommend usage of frames as they imply implementation burden and
difficulties impossible to overcome by normal means. Brucie gave you
links to start reading. How many more links, articles, columns more do
you need? From how many sources, from which sources? Microsoft MSDN?
Netscape DevEdge? WDG? J. Nielsen?
Multi-documents in a webpage is deprecated in more advanced and recent
DTDs: that's not an opinion but an established fact written in W3C TRs.

Don't cross-post if you can not justify cross-posting. Stop top-posting.
Read the FAQs.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
 
T

TheKeith

DU said:
Your webpage uses a frameset to render a single frame. Why in the world
would you want or need to do that?

just an easy way of eliminating scrollbars, which when I'm done with the
page, will have an evident purpose.


I find pop-up windows far more evil and

I filter a wide and very large majority of unrequested popups. I do not
filter requested popups: I do not want to filter them. You do not seem
to be making any distinction here. Most people use these days popup
killer software.

of course, the unrequested ones are obvious impositions, but I was actually
talking about the sites that have "legitimate" ues for pop-up, such as for
design purposes. These, I believe are far worse than frames, since they are
opening another window altogether. At least frames keep it within a single
window.

If frames are evil because of compatiblity issues,

If A is evil, then B being just as much/more evil will not make A any
better or any more acceptable, justifiable.
Your arguments are extremely weak. You do not explain the differences
between A and B from a webpage design and usability perspective either.
Your arguments can only serve to promote mediocrity, low-level design
manners.

my point was that neither flash nor frames are inherently evil, and I'm a
bit tired of the frames are evil bs. If a designer wants to use them for
some specific reason and not doing so in an intrusive way, then there's
nothing wrong with that, and you shouldn't presume to know what qualifies as
good design versus bad design--who are you? I didn't post my initial message
to get people's opinion about my use of frames, I was asking about how to do
a very specific thing.

Your posting manners (top-posting and cross-posting in newsgroups for no
good reasons) are very much a reason to killfile you.

this is a legitimate cross-posting--this is what cross-posting is meant for.
I posted the message to applicable groups only. Top-posting I couldn't care
less about. If I felt a need to reply to the individual parts of the above
message, I would have, but I didn't. You can killfile me if you want, in
fact, I wish you would. I don't need your design advice nor your how posting
to the ng's advice, seeing as I've been doing it for close to ten years now.

1- Avoid frames and iframes: there is absolutely nothing in your webpage
which justifies the recourse to frames and iframe

page is not done.

2- use valid markup code and validate your markup code
3- avoid using tables (nested tables are even worse) for layout and
positioning purposes: use tables for tabular data

why? This makes no sense at all.
4- Start reading FAQs (technical ones)
5- Open your mind and just stop claiming you have good experience with
HTML. Throughout history, the human spirit always worked like a parachute.
6- Do not use javascript functions that you do not understand

that's what dreamweaver is good for--I don't need to understand what it does
necessarily. Just like I don't need to understand how to develop games in
order to play them or how to write applications like photoshop in order to
use them.

I think someone else needs to open their mind.

Brucie replied in an adequate manner to you. Whether you are receptive
to his opinion is up to you. A wide majority of experts in webdesign do
not recommend usage of frames as they imply implementation burden and
difficulties impossible to overcome by normal means. Brucie gave you
links to start reading. How many more links, articles, columns more do
you need? From how many sources, from which sources? Microsoft MSDN?
Netscape DevEdge? WDG? J. Nielsen?
Multi-documents in a webpage is deprecated in more advanced and recent
DTDs: that's not an opinion but an established fact written in W3C TRs.

Don't cross-post if you can not justify cross-posting. Stop top-posting.
Read the FAQs.

DU
 
T

TheKeith

DU said:
If content overflows window inner viewport dimensions, then you want
your page to clip content. That is what you propose and request here.
From an usability and accessibility perspective, your design is
anti-user and anti-accessibility.
What's inherently wrong with scrollbars? Please elaborate.
Don't scrollbars visually notify users that some of the content
overflows the window dimensions? Don't they allow users to access and
reach clipped content? Are they a standard fallback mechanism promoting
usability and accessibility?

I don't want any content clipped--it will hurt my design. This way, you will
be forced to have the window opened to at least certain minimum dimensions
so that all I want visible on the screen at one time is.


... but you did not make any distinction when you - only you - brought
up the issue of popup and started condemning popups altogether. You
reproached to Brucie what you actually did with the issue of popups: no
relativity, no demonstration, no explanation of arguments from an
usability perspective, no concrete case on which to discuss such issue.


I was actually

If the design meets implementation and requirement specs, then why do
you denigrate these?

precisely



Your arguments are illogical here. And again, your
comparison does not serve any concrete discussion regarding your initial
post about your webpage.
Shouting frames can be a good design decision still does not justify the
use of frames in *your* webpage. Discussing popups has nothing,
absolutely nothing to do with the use of frames in your page.

just like imparting your two-cents about frames has nothing to do with my
initial post, ok mr. newsgroup etiquette who made no mention of using the
"OT:" in the subject line.


At least frames keep it within a single

I claim and repeat loud and clear that there is nothing in your webpage
that justifies a frameset for a single frame with a iframe with nested
tables across all over. Now, it's up to you to proceed from that like a
grown up.

let's say for example I wanted to create a web page without standard
scrollbars and within it, to create a 750x400 size block with scrollable
thumbnails in a left column and a viewer in the right. Which way would you
go about doing it?

I didn't post my initial message

No. You cross-posted an assistance request to several newsgroups
regarding an undefined javascript function...

Not knowing javascript, I mistakenly didn't include the function in my
post--SORRY!

regarding an
unspecified webpage.

Because my web page hadn't been up yet.

If so, then why did you start with excuses? Did you post this:
"First off, please excuse the crossposting--I really need an answer
quickly."

because I know the newsgroups are full of shitheads, whose opinions I really
didn't want to hear ;-)


What is in your mind the relation between cross-posting to 5 newsgroups
and getting a quick answer? Would cross-posting to 20 newsgroups get you
faster answers?

yes as a matter of fact.


Would you like to get many quick but wrong solution
proposals? Would that fit your expectations?

better than getting the replies of anal and utterly unhelpful assholes, who
get their kicks out of imposing their self-righteous opinions on those they
deem lesser than they are.
 
T

TheKeith

DU said:
But if it is, then content will not be accessible because scrollbars
will have been removed by your code, because of your requirements,
because of your will.

no content will be inaccessible, provided the user's browser is open enough
to allow for content 750 pixels wide by 400 pixels high--perfectly
reasonable in my book, as I don't know anyone who doesn't have their screen
res set to at least 800x600, and if you don't, chances are you're not gonna
be able to handle a lot of other sites very well either.


This way, you will

This way, you will force your visitors to comply with undefined,
unspecified dimension requirements: no one can claim you have a site
promoting usability and content accessibility.

are you related to martha stewart

You still have not answered me on 4 questions. What's inherently wrong
with scrollbars?

I never said anything was wrong with scrollbars did I? No, in fact, I'm
using them.

My 2 cents opinion was about your frameset having a single frame
embedding an iframe with nested tables across and all over: that was my
nr 1 issue with you.

The cross-posting, popup, scrollbars, top-posting (and now flash) issues
were secondary and were all initially brought up
by you,
only by you,
because of you.

and the acceptability of using frames was all secondary too, so why don't
you go annoy brucie.


Believe me: I really do not like etiquette discussions. I know some
others are much more stiff and rigid on such. But often poor posting
manners reveal a poor webpage/website designer as well: if he can't
introduce and present the issues involved in a single post, how and why
would you expect him to do better with a website? If a poster has
like-it-or-not manners in a newsgroup, why would you expect him to treat
his website visitors any better?

you *are* related to martha stewart!


That should have been your initial post. A clear concise description of
your webpage situation with the least number of rigid constraining
requirements and posted in alt.html newsgroup only. We're back to square
1 in "how to post in newsgroup" FAQ here.

Actually what I did was simpler. I posted a little piece of dreamweaver's
js, in the hopes that someone in the applicable ng's I posted to, would be
able to tell me, "change this..." and it would have been done with, but no,
people like you have to complicate matters and police newsgroups, trying to
force everyone into compliance with what they consider to be proper.


Here I don't see why scrollbars should not appear if
content overflows windows inner viewport dimensions. As far as I can
understand you, the 750x400 size block you're referring to is your
document inner dimensions.


Then maybe it would have been a good idea to post (cross-post or not -
that's another issue) your message of urgent assistance request once
your web page was up.
Maybe your expectations from cross-posting were unrealistic. Maybe you
expected a lot from a lot of people.


If your cross-posting was legitimate, then why excuse yourself? Your
first sentence stroke me as inconsequent, incoherent, self-defeating.
The reason you bring up is most likely not the right one either: I think
it has all to do with you not knowing when cross-posting is adequate,
suitable and justified.

and just when is crossposting justified, if not for something like this?

Bottom posting is not a preference in this newsgroup (and in many
newsgroups): it's a requirement. So, you should bring your
like-it-or-not arguments elsewhere.

actually, seeing as no one owns the newgroups, and seeing as how alt.html is
an unmoderated one, you can take *your* arguments elsewhere.

People willing to read and give their best to assist others are
volunteers. Stop perceiving newsgroups like a 24 hour help desk. Stop
expecting to be spoon-fed: read the FAQs and open up your mind a bit.

I know--what's the sense of seeking help on a certain topic in newsgroups
that specialize in that topic? What was I thinking?
 
D

Disco

TheKeith said:
I don't really agree that frames are evil. They serve a very good

Not sure if you want cross browser compatibility, I dont suppose you do, so
here is what you need to do....


function showthefreakinimageintheparentfreakinpage(pIMG) {
parent.document.all.viewer.src=pIMG;
}



<img src="buildingcorner.jpe"
onClick="showthefreakinimageintheparentfreakinpage('buildingcorner.jpe')"
width="142" height="100" style="cursor:hand">

no need to put the onClick on the <A>... might as well simply put it on the
<IMG>

Also...
Its a pretty bad idea to put you thumbs on this frame when all they are are
the original larger image just resized. You should shrink them down a bit.
At the moment, on a slow connect, your page will take a long time to load.
 
T

TheKeith

Disco said:
Not sure if you want cross browser compatibility, I dont suppose you do, so
here is what you need to do....

Oh I missed this part of your post for some reason. It would be nice if this
worked in mozilla/netscape (newer versions are fine)--is there anything I
can do to make that happen?
 
T

TheKeith

----- Original Message -----
From: "Disco" <[email protected]>
Newsgroups: alt.html
Sent: Wednesday, June 25, 2003 6:22 PM
Subject: Re: need help using javascript to target a frame!

Not sure if you want cross browser compatibility, I dont suppose you do, so
here is what you need to do....


function showthefreakinimageintheparentfreakinpage(pIMG) {
parent.document.all.viewer.src=pIMG;
}



<img src="buildingcorner.jpe"
onClick="showthefreakinimageintheparentfreakinpage('buildingcorner.jpe')"
width="142" height="100" style="cursor:hand">

no need to put the onClick on the <A>... might as well simply put it on the
<IMG>

THANKS! It works! I even gave you credit for it. BTW, do you have any idea
why it keeps nudging the frame border over a little depending on whether
it's a horizontal or vertical pic--I can't figure out why it's doing this. I
tried changing the table dimensions to give the right column a bit more
room, but that doesn't really work. Oh well.

Also...
Its a pretty bad idea to put you thumbs on this frame when all they are are
the original larger image just resized. You should shrink them down a bit.
At the moment, on a slow connect, your page will take a long time to load.

yeah, normally I would have just created separate images for the thumbs, but
I got a little lazy. I'll probably change that.

Thanks again!
 
D

Disco

TheKeith said:
THANKS! It works!
You are welcome. I am glad it works for you.

I even gave you credit for it.
Please do not give me credit for this. I would not have this code on my
sites, or any of the sites I am associated with. The only reason I gave it
to you is because that is what you asked for.
 
D

Disco

Oh I missed this part of your post for some reason. It would be nice
if this worked in mozilla/netscape (newer versions are fine)--is
there anything I can do to make that happen?


Try this....
function showthefreakinimageintheparentfreakinpage(pIMG) {
parent.document.forms['whollyfreakinfreak'].viewer.src=pIMG;
}


.... or this...

function showthefreakinimageintheparentfreakinpage(pIMG) {
parent.document.forms[0].viewer.src=pIMG;
}

and surround your table with this....


<form name="whollyfreakinfreak" id="whollyfreakinfreak"
splat="but-why-mummy">
<freakin table goes here />
</form>
 
R

rf

Disco said:
Please do not give me credit for this. I would not have this code on my
sites, or any of the sites I am associated with. The only reason I gave it
to you is because that is what you asked for.

Well said.

Of course your solution does not work in Mozilla :)

Cheers
Richard.
 
T

TheKeith

Disco said:
Oh I missed this part of your post for some reason. It would be nice
if this worked in mozilla/netscape (newer versions are fine)--is
there anything I can do to make that happen?


Try this....
function showthefreakinimageintheparentfreakinpage(pIMG) {
parent.document.forms['whollyfreakinfreak'].viewer.src=pIMG;
}


... or this...

function showthefreakinimageintheparentfreakinpage(pIMG) {
parent.document.forms[0].viewer.src=pIMG;
}

and surround your table with this....


<form name="whollyfreakinfreak" id="whollyfreakinfreak"
splat="but-why-mummy">
<freakin table goes here />
</form>

this may sound strange to you, but before I read this, I was playing around
to see if I could get it to work in mozilla. I simply removed the "all" in
"parent.document.all.viewer" in your function and now it works in mozilla.
Go figure.
 
T

TheKeith

rf said:
Well said.

Of course your solution does not work in Mozilla :)

yeah I removed the "all" in his function and now it works in mozilla (the
latest version anyway).
 
W

Whitecrest

A good web designer - not even a professional one - would not agree with
your design policy. A good web designer would always look for
accessibility and usability of his site and always provide reasonable
fallback mechanisms.

Well that is one way of looking at it. Another way is that a
professional web designer keeps the target audience in mind when
designing a site. Giving them what ever it takes to get then to buy or
be branded. Yes, "everyone" might not be able to see your site, but your
target audience will. And everyone does not buy your product. But your
target audience does. Keep them in mind.
 
T

TheKeith

rf said:
Fine.

I noticed something else. Those thumbnails are not thumbnails. They are the
full sized image resized in the browser. This is just not done. Resize them
in your photo editor and make them into real thumbnails. Each one should be
about 1 or 2K big, not the 30K average they are now.

That single page comes in at 540K. I assume when you add some more images it
will grow accordingly.

You have just eliminated from your list of possible viewers anybody who is
on a dial up connection.

yeah I know, as I said to Disco, normally I would have made a separate set
of images, but I whipped up this site very quickly--it's not nearly
complete. I will create low-res versions of all the images.
 
D

DU

Whitecrest said:
Well that is one way of looking at it. Another way is that a
professional web designer keeps the target audience in mind when
designing a site. Giving them what ever it takes to get then to buy or
be branded. Yes, "everyone" might not be able to see your site, but your
target audience will. And everyone does not buy your product. But your
target audience does. Keep them in mind.

When TheKeith spends dedicated efforts in trying to remove scrollbars
and what it implies in terms of usability and accessibility to content,
then he actively and purposely want to discriminate. That is what his
frameset hack was about. Nothing else.
So the normal question to followup with was what's inherently wrong with
scrollbars anyway? Why would you want to prevent your users from using
scrollbars when their presence would be needed to access clipped
overflowed content?
Your webpage uses a frameset to render a single frame. Why in the world
just an easy way of eliminating scrollbars

DU
 
T

TheKeith

DU said:
When TheKeith spends dedicated efforts in trying to remove scrollbars
and what it implies in terms of usability and accessibility to content,
then he actively and purposely want to discriminate. That is what his
frameset hack was about. Nothing else.
So the normal question to followup with was what's inherently wrong with
scrollbars anyway? Why would you want to prevent your users from using
scrollbars when their presence would be needed to access clipped
overflowed content?

no my intentions are not to discriminate. My goal is to have all the
contents of one particular page in view at one time; this is a design
choice, be it an unconventional one. For what I have planned (which is
likely to change), I found scrollbars to be clumsy and in conflict with my
design goal. If this means that people using wireless devices and screen
readers will have trouble viewing it, then that's a sacrifice I'm willing to
make, especially since my site will be visually-oriented with lots of flash
and other stuff. I'm not doing the citibank site here; it's my own personal
website and I'm just not very concerned about people browsing the web on
their cellphones and pda's.

Anyway, for what its worth, I just came up with a new idea and am not going
to be using frames--happy?
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top