PDA

View Full Version : I know iFrames are terrible, but... (iFrame problem)



dewey
March 14th, 2007, 03:19 PM
I have no other option really at this point...

I don't want to use the src="whatever.jsp" part of the iFrame...

I want to have everything inside... at the moment I have


<style type="text/css">

.mainIMSmacklet{
width: 275px;
height: 425px;
position: absolute;
left: 250px;
top: 66px;
border: #000000 thin solid;
background-image: url("${pageContext.request.contextPath}/images/bg.gif");
z-index: 10000;
}

</style>

<script type='text/javascript' src='/imSmacklet/DWRIMManager/engine.js'></script>
<script type='text/javascript' src='/imSmacklet/DWRIMManager/util.js'></script>

<iframe id="chatSmacklet" class="mainIMSmacklet">
</iframe>



Now this part is working, I have a nice little iFrame, right where I want it on the page. the background is there, and to quote Borat, "is nice!!"

This is my problem, I want to put some stuff in here... nothing I put in, be it tags with text or simple tags, they don't show up...

I can't seem to find any reason why though... any ideas?

Thanks,

--d

s1ntax
March 14th, 2007, 03:34 PM
you need to give it a name ;)



<iframe name="chatSmacklet" id="chatSmacklet" class="mainIMSmacklet" src="something"></iframe>

i recommend you have the NAME and ID attribute the same. to send a link to that frame you just do:



<a href="poontangspoontang.html" target="chatSmacklet">This is a link</a>


if you want something to show up when the frame first loads, use the SRC attribute.

dewey
March 14th, 2007, 03:45 PM
But this is my problem... I don't want to use the SRC attribute... but I do want stuff to be in that frame... this has to be possible, right?

s1ntax
March 14th, 2007, 04:07 PM
if you want the frame to load with content in it you have to use SRC, OR you can put the content within the <iframe></iframe> tags.

if you want to click a link and have different content displayed, you have to use the NAME attribute in <iframe> and the TARGET = NAME attribute in the link.

dewey
March 14th, 2007, 04:13 PM
Oh sorry, I think I may have misread your last post... right now I have some code inside the iFrame... but nothing is showing up... any ideas why that would happen?

dewey
March 14th, 2007, 04:32 PM
Ah forget it, figured out a different way... still with an iFrame... but this new way is better... thanks though!