Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop up window

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello

I'd like to make a pop up window which shows a DIV section without using 'document.write(...)', is it possible?
In fact I uses XSL which make a specified DIV, my XSL file uses a javascript file and I want it to open a window when the user click on an image, and this window should use the DIV content created in my XSL file. How can I call it?
Help!
Thanks
 
to show something in a pop up window it should be send there either from the opening window with ....document.write(...) or by opening a document in it (through "href" of the link or window.open() function).
I am not sure that I understood fully your case (why not to use document.write ?), but may be you could set a JavaScript varaible in your XSL taking the same content as in the DIV and then pass it with popup.document.write(...) to the pop up window. Ivan Pavlov (ip@thehyper.net)

Brainbench MVP for JavaScript
 
Thank you for your response.
You said I could use a variable in my XSL taking the same content as in the DIV, in my example my DIV has an ID so I can call it in my script. But do u know how?
If my id is 'myid' how can I call it with document.write?
document.write(myid) doesn't works is there a solution?
 
It's ok, I made it with a variable.
I thought my script couldn't catch the variable in my XSL but it works! Thanks
 
For IE there is a simple solution, the whole content of the <DIV id=&quot;myid&quot;> is in:
document.all.myid.innerHTML
if you want to have in it also the surrounding tag <DIV> you should use:
document.all.myid.outerHTML

For NN it is more complicated and could be impossible depending from the concrete code, because you should use an anchor <a id=&quot;...&quot;>....</a>) instead (or inside) of the DIV.

In NN you can access the text only of anchors or links, something like:
document.anchors[&quot;myid&quot;].text
and this would work only if you have a plain text in it. Ivan Pavlov (ip@thehyper.net)

Brainbench MVP for JavaScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top