This is topic HTML JavaScript Mayfly in forum Books, Films, Food and Culture at Hatrack River Forum.


To visit this topic, use this URL:
http://www.hatrack.com/ubb/main/ultimatebb.php?ubb=get_topic;f=2;t=055142

Posted by Blayne Bradley (Member # 8565) on :
 
What I want to do is when someone Clicks on an item in a Dropdown list box, it refreshes an iframe to open a link at a different page then before.


So basically click on Drop down box, scroll down items, click, and then the open box frame place refreshed with information from a different htm.

as the tag for an iframe is bracket iframe url="something" endbracket im not sure how to get it to change it, maybe set it to a variable?

I'ld prefer a simpler way.
 
Posted by scifibum (Member # 7625) on :
 
Blayne, meet http://www.w3schools.com/

Or: take your pick
 
Posted by Blayne Bradley (Member # 8565) on :
 
I'm bad with google, how am I supposed to know Dynamic is the proper search term in theory?

My thought process goes like this "This is what I want to do, but I have no idea of how to express it in such a way google cans earch for it"
 
Posted by scifibum (Member # 7625) on :
 
Dynamic was just my first guess. You could also find it using terms like:

onchange iframe load
iframe source based on selection
menu for iframe

(I'm now 4 for 4 on choosing search terms that return relevant content. Not to brag. Oh, I guess that IS to brag.)

But the question you're asking is about a very straightforward and common element of page design, which is why I included a link to w3schools. If you read their tutorials on Javascript and the DOM, and use their decent reference pages for the DOM (or the actual W3 standards documentation), then you'll be in a place where answering this kind of question is pretty trivial - it's just like looking up the definition of a word.

Nothing wrong with asking here, but it really will be faster for you in the future if you learn to use that kind of resource.

Case in point: on W3Schools, I clicked on DOM, then on DOM Iframe, found the src property, and then clicked on it: and it explains exactly how to set the property with javascript.

http://www.w3schools.com/htmldom/prop_iframe_src.asp

[ April 02, 2009, 01:47 PM: Message edited by: scifibum ]
 
Posted by El JT de Spang (Member # 7742) on :
 
It'll be even faster if our local coders can resist showing off and just link Blayne to the google results.

The reason he comes here is pure laziness, and because it works. We can't do a thing about the former, but we can certainly affect the latter.
 
Posted by scifibum (Member # 7625) on :
 
There's nothing wrong with laziness, IMO, when it comes to "what's that syntax?", but it strikes me as inefficient to come here.
 
Posted by Lisa (Member # 8384) on :
 
Blayne, as much as I hate doing this, I have a page up that does exactly what you're asking. Have a look at the source, if you like.

http://www.starways.net/comics.html

This is what I use to read my webcomics every morning.
 
Posted by Blayne Bradley (Member # 8565) on :
 
Now now, outside of politics we have *very* much in common.

The Foe Yay subtext is kinda creepy.
 
Posted by Blayne Bradley (Member # 8565) on :
 
Hmm, the iframe could be bigger, but damn, nice.

Also your missing The Order of the Stick, 8-Bit Theater, Chris&Trilby and Drow Tales.
 
Posted by Blayne Bradley (Member # 8565) on :
 
Grr curses, my STAGE supervisor keeps asking for more and more complicated additions to the site, damnit man, why can't people be happy with whats simple!!!??
 
Posted by Lisa (Member # 8384) on :
 
quote:
Originally posted by Blayne Bradley:
Hmm, the iframe could be bigger, but damn, nice.

Also your missing The Order of the Stick, 8-Bit Theater, Chris&Trilby and Drow Tales.

How could the iframe be bigger? Other than the strip across the top, it's as big as it gets. And it resizes with the browser.

Do you have URLs for those webcomics? I'll take a look at them and maybe add them.
 
Posted by Strider (Member # 1807) on :
 
Lisa, check out your page in firefox.
 
Posted by scifibum (Member # 7625) on :
 
The dynamic properties you use to set the frame width and height only work in IE (but not in IE8).
 
Posted by Lisa (Member # 8384) on :
 
Huh. You know, I rarely bother with crossbrowser stuff. All the stuff I do at work is IE only (and I have to warn my boss now not to let any of our customers move to IE8). And that's what I use at home.

Sorry, Blayne. It didn't even occur to me to check in other browers.
 
Posted by Blayne Bradley (Member # 8565) on :
 
You might want to put in the code to make it cross platform capable, i havent tried it myself but allegedly its not hard.
 
Posted by scifibum (Member # 7625) on :
 
I was imprecise - IE8 still supports it in IE7 or IE5 mode, whatever that means. (haven't tried ie8 yet myself)
 
Posted by El JT de Spang (Member # 7742) on :
 
quote:
Originally posted by Lisa:
It didn't even occur to me to check in other browsers.

I was going to be :shocked: by this, but then I realized that I've never coded anything meant to be used by only me.

If I did, optimizing only for the browser I used would be the smartest and most efficient way to go. Carry on.
 


Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2