PDA

View Full Version : how to open new DHTML Window from DHTML Window



todort
10-17-2010, 01:25 PM
1) Script Title:

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm
3) Describe problem:
how to open new DHTML Window from other DHTML Window

thank you

jscheuer1
10-17-2010, 04:40 PM
From the demo page Step 2 with modifications highlighted:


parent.uniquevar=parent.dhtmlwindow.open(uniqueID, contenttype, contentsource, title, attributes, [recalonload])


<script type="text/javascript">
parent.googlewin=parent.dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")
</script>

or:


<a href="#" onClick="parent.ajaxwin=parent.dhtmlwindow.open('ajaxbox', 'ajax', 'external.htm', 'Ajax Win Title', 'width=650px,height=400px,left=300px,top=100px,resize=0,scrolling=1'); return false">Create/ Open Ajax Window</a>

todort
10-17-2010, 04:46 PM
yes but it is opened in the same iframe i would like to open it in new iframe

jscheuer1
10-17-2010, 05:29 PM
Make sure you use a unique variable and a unique id, not one you already used on the top page.

If you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

todort
10-19-2010, 04:26 PM
jplus.hit.bg

double click on text box under DEBIT
i want the new whtml window to be opened in new frame not in the same

thank you

jscheuer1
10-20-2010, 05:31 PM
I tried your link and got (with www.jplus.hit.bg and just jplus.hit.bg):


Could not connect to remote server

both last night and again today. Let me know when the server is back up.

Or, if it is up, there must be some other problem in my connecting to it. I did a whois on hit.bg and got:


DOMAIN NAME: hit.bg

requested on: 27/04/1999
processed from: 27/04/1999
activated on: 03/05/1999
expires at: 03/05/2012
domain status: Registered


REGISTRANT:
HIT.BG Ltd.
16, Gurguliat str., BG-1000 Sofia
Sofia, 1000
BULGARIA

. . .

NAME SERVER INFORMATION:
chicken.orbitel.bg
ns.orbitel.bg

Is that the server under which you have your domain? If any case, it also is giving me a:


Could not connect to remote server

I can connect to other .bg domains, so it's not that. I also tried chicken.orbitel.bg/ and got redirected to a login screen of vmail.orbitel.bg

But even that (chicken.orbitel.bg/) was spotty, sometimes connecting, sometimes not, though the redirect address (vmail.orbitel.bg) had no problems loading on its own.

todort
10-21-2010, 03:12 AM
thank you
in my case right code was:
parent.parent.parent.sm=parent.parent.parent.dhtmlwindow.open("sm", "iframe", "http://localhost/smetkoplan.php", "Сметкоплан", "width=800px,height=600px,left=200px,top=100px,resize=1,scrolling=1")
:):):):)

jscheuer1
10-21-2010, 06:01 AM
OK, you must have more than one level of nesting of frames/iframes then.

todort
10-24-2010, 10:30 AM
is there other way to do the same without use of parent.parent.sm=parent.parent.dhtmlwindow.open.....

jscheuer1
10-24-2010, 01:16 PM
If the top page is the page you are after and it's got an iframe on it (is not a frameset page), yes:


top.sm=top.dhtmlwindow.open("sm", "iframe", "http://localhost/smetkoplan.php", "Сметкоплан", "width=800px,height=600px,left=200px,top=100px,resize=1,scrolling=1")

todort
10-24-2010, 01:26 PM
super
thank you

todort
11-08-2010, 08:25 PM
when i open new window likw
top.sm=top.dhtmlwindow.open("sm", "iframe", "http://localhost/smetkoplan.php", "Сметкоплан", "width=800px,height=600px,left=200px,top=100px,resize=1,scrolling=1")

how to close it

top.sm.close(); - do not work

jscheuer1
11-09-2010, 03:52 AM
What browser? If it's IE, try:


top.window.sm.close();

In any case you should avoid using the same variable name as the id for the window, like here:



top.sm=top.dhtmlwindow.open("sm", "iframe", "http://localhost/smetkoplan.php", "Сметкоплан", "width=800px,height=600px,left=200px,top=100px,resize=1,scrolling=1")

Use two different unique names, like:


top.smwin=top.dhtmlwindow.open("sm", "iframe", "http://localhost/smetkoplan.php", "Сметкоплан", "width=800px,height=600px,left=200px,top=100px,resize=1,scrolling=1")

If neither of those help, I would need a link to the live page to investigate.