Help - Search - Members - Calendar
Full Version: loading new window in IFrame
HTMLHelp Forums > Programming > Client-side Scripting
kiran peter
Hi,

I want to load google site in my iframe. I am creating iframe dynamically and trying to laod using open() function.

iframe.name = "myframe";
iframe.width = "500px";
iframe.height = "500px";
iframe.frameborder = "none";
iframe.style.border = "none";
iframe.style.allowtransparency = "true";
iframe.style.margin = "1px";
iframe.scrolling = "yes";

user.chatW = open("google.com","myframe","width=250,height=255,resizable=yes");


can i load this new window in the above iframe ?


Thanks in adavnce
Kiran
pandy
No. A new window and a frame are two different things. With HTML you use the target attribute and the name of the frame, http://htmlhelp.com/faq/html/frames.html#frame-target . With JS you do something like this, again using the name of the frame.

CODE
myframe.location.href = 'http://google.com';
kiran peter
Hi,

Actually i am devloping a chat application using jwchat.In jwchat on receiving message it open a window and show message.So i am planning to load that window in iframe as we all see in social nwtwok like orkut and all.

Can u give any advice or any links to refer about it.


Thanks
Kiran
pandy
Well, I don't see anything in orkut since I don't use it, so I don't know what you mean. Don't you want to load google.com in the iframe instead of in the popup?
kiran peter
Hi

I actually mean i want to load chat window into a iframe rather than as popup.


Thanks
Kiran
pandy
OK, you still do it as I told you.
kiran peter
Hi.

I tried it but in that case I will get only iframe object.And in my chat application I need window object,beacuse rest of coding is based on window object It works in FireFox but problem in IE.

Thanks
Dhaneesh
pandy
And if you use the name of the frame? Instead of window.whatever use name_of_frame.whatever.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.