#1 (permalink)  
Old 07-17-2005, 05:36 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,445
Opening A Window With Pre-Filled Content

Okay, obviously I know how to open a pre-sized window, and how to turn off the scrollbars, etc.

However, I am curious if there is a simple way to pre-fill that window with content. Rather than saving a separate file with the content that I want displayed, is there an easy way to make the window open, and then load content specified by the page that opened that window.

Here is the code I've tried (from Googling this type of thing), but it doesn't seem to do anything:
In the Head
Code:
	<script language="JavaScript1.2" type="text/javascript">
	<!--
	function open_help ( help_title, help_text ) {
		help_win = window.open( "", "help", "width=300, height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=auto");
		help_win.document.write('<html><head><title>' +help_title+ '</title></head>');
		help_win.document.write('<body style="background-color:#fff;color:#000;">');
		help_win.document.write('<b>' +help_title+ '</b>');
		help_win.document.write(help_text);
		help_win.document.write('</body></html>');
	-->
	</script>
In the body:
Code:
							<a href="#" onClick="javascript:open_help('Entering Page Content','You may type essentially anything you want in the textarea above.  You may use HTML code.  The buttons above the textarea will generate XHTML transitional code.
							<br />However, if you choose more than one style option, you should remove the unnecessary code.  For example, if you choose a font-face, and then you choose a font-size, the following code will be generated:
							<br /><pre>&lt;div style=font-family:Verdana;>&lt;div style=font-size:10;>&lt;/div>&lt;/div></pre>
							<br />You should edit that code to make it look like this:
							<br /><pre>&lt;div style=font-family:Verdana;font-size:10;>&lt;/div></pre>
							<p />In addition, if you want your page to meet XHTML Transitional and CSS requirements, then you will need to add either sans, serif, or monotype to each font-family style choice.  For instance, if you choose Verdana from the list of fonts, the following code will be generated:
							<br /><pre>&lt;div style=font-family:Verdana;>&lt;/div></pre>
							<br/>You should add sans to that font-family tag, like this:
							<br /><pre>&lt;div style=font-family:Verdana,sans>&lt;/div></pre>')">Open Help</a>
I've tried the same type of code with less content to see if maybe that was the problem. It still didn't do anything. Is there a simple way to specify the content of a pop-up window within the parent window?
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote

  #2 (permalink)  
Old 07-23-2005, 11:47 PM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
If would open a popup window with a html file that has a container (div) in it. Then try to modify that with innerHTML. Just a guess though, never tried that.

Hope that helps,
Till
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 05:05 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter