targeting links to load in an Iframe?

liunx

Guest
Is it possible to target links on an index/mainpage to an Iframe? none of my books specify whether you can or cant i imagine its possible, but how? i have a site thats mostly arts and graphics and little text i was going to try and make all my text links load into one scrollable Iframe for convenience, does anyone know how to do this?<!--content-->i wonder how many results would have turned up had you used the search button:confused: :rolleyes: <br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"whatever.html" target="NAME_OF_IFRAME"><br />
<br />
<br />
<iframe name="WHATEVERR"><!--content-->It's possible. :) <br />
<br />
First, you have to name your iFrame. In this example, I named it iFrame... I'm lacking originality. ;) <br />
<iframe src=http://www.htmlforums.com/archive/index.php/"something.html" name="iframe"></iframe> <br />
<br />
Next, you need the target attribute (deprecated in XHTML). So you'll have something like this:<br />
<a href=http://www.htmlforums.com/archive/index.php/"something_else.html" target="iframe">some link</a> <br />
<br />
If you want every link to load in the iFrame, instead of adding target="iframe" to every link, you can add this to your header:<br />
<base target="iframe"> <br />
<br />
<br />
I hope this helps [EDIT: despite Gregory beating be to the reply]. :)<!--content-->probably more results than what i would have needed:monkey:<br />
<br />
hehhehe thanks dude<!--content-->:monkey: gotta love those new brinkster pop-ups i see im not the only one using brinkster :D<br />
<br />
thanks again<!--content-->Collado, you've asked a very good question. *g* Now I have a corollary to it.<br />
<br />
How do you link .asp pages to an iframe?<br />
<br />
Here's my difficulty:<br />
<br />
I've got my navigation in one .asp file, the iframe in another. Even when I set the source file just as you have described, Jeff, it won't load into the iframe. It comes up as a separate window - in Simpletext, of all things. However, using the same code for all my links, only two of the .asp pages come up in the iframe. The other two I have come up in Simpletext windows. (Oh, that's sort of like having it open up in Notepad, rather than in the iframe.)<br />
<br />
Now, before I continue tearing my hair out over this, I created most of the pages in Dreamweaver. Because the contents of the iframe are text only, I just used Simpletext to add what little HTML code was necessary. The content pages will show up in Dreamweaver as html files, just not in a browser. Do you think opening the files in DW and saving them as .asp files from there would help? <br />
<br />
Peg<!--content-->:monkey: yeah that is interesting i didnt think of what you posed above:monkey:, just when i thought i had it all figured out:monkey:<br />
<br />
wish i could answer peg:)<br />
<br />
hopefully someone will answer i wanna know myself.<!--content-->*lol* I was doing so well with everything else, too. I'd never done .asp pages or SSI before.<br />
<br />
But that's part of the reason for posting questions. I didn't know anything about iFrames until someone started asking about them. Most of what I know of CSS comes from reading questions and answers in the forum. <br />
<br />
And silly things, like extra spacing in a table code can create extra spaces in the table - even if the spaces are only created by having the </td> tag on another line. Or how to keep a line of images in line when the window width is less than the total image width - like the header images on this site.<br />
<br />
And I learned something from this thread. I didn't know you could create a base target for links. It's not something I'd use for my own site - not right now - but my kids are interested in creating their own sites and most of what they want to post is their writing. With them only having a few pages of stuff, they could have a menu link to each item and even images could be targetted to an iframe. Using the base target would make life much easier. *lol* They have problems enough with spelling and punctuation without adding code for them to misspell or mispunctuate. <br />
<br />
Thanks for asking the question.<br />
<br />
Peg<!--content-->Well peg im playing with it now and so far havent gotten it to work, my first link under my first section titled poetry is the one im trying to target for the iframe. i think it will be cool as soon as i get it to work <br />
:monkey:<!--content-->
 
Back
Top