473,804 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Popping up text in a window

Hello,
Just wanted to check if this was possible. I have n blocks of text
and I would like each to pop up in a window. Hoever, I don't want to
create n different HTML pages and invoke each one through window.open.
Is there some way I can call window.open and pass the text to it and
have that text appear in the popup window? Styling is not important.
I don't care if the text just appears in plain font.

Thanks -
Jul 20 '05 #1
2 1951
D. Alvarado wrote:
Hello,
Just wanted to check if this was possible. I have n blocks of text
and I would like each to pop up in a window. Hoever, I don't want to
create n different HTML pages and invoke each one through window.open.
Is there some way I can call window.open and pass the text to it and
have that text appear in the popup window? Styling is not important.
I don't care if the text just appears in plain font.

Thanks -


How about this approach? If you like this, you can make the window any
size, with or without scroll bars, and you can make it appear centered.
Once you get started post your code and you can get specific help for
any features you want to work on.

Mike
<html>
<title>CodeAve. com(JavaScript New Window within Previous Page)</title>
<body bgcolor="#FFFFF F">
<script language="JavaS cript">
<!--
function open_new_window () {
new_window = open("","displa yWindow","width =575,height=290 ,left=10,top=10 ");

// open new document
new_window.docu ment.open();

// Text of the new document goes here
// Replace your " with ' or \" or your document.write statements will fail

new_window.docu ment.write("<ht ml>");
new_window.docu ment.write("<he ad>");
new_window.docu ment.write("<me ta http-equiv='Content-Type'
content='text/html; charset=windows-1252'>");
new_window.docu ment.write("<ti tle>Table of Data</title>");
new_window.docu ment.write("<st yle type='text/css'>");
new_window.docu ment.write(" td { text-align: right; }");
new_window.docu ment.write(" td.1 { text-align: left; }");
new_window.docu ment.write("</style>");
new_window.docu ment.write("</head>");
new_window.docu ment.write("<bo dy>");
new_window.docu ment.write("<ta ble border='1' cellspacing='1' width='555'
height='246' style='border-collapse: collapse'>");
new_window.docu ment.write(" <tr>");
new_window.docu ment.write(" <td class = '1' width='111'>Son nenstand
in Grad über dem Horizont ein<br>Elevatio n of the sun (degrees above the
horizon</td>");
new_window.docu ment.write(" <td class = '1' width='111'>Opt imaler
Anstellwinkel des Spiegels °A<br>Optimal mirror orientation °A</td>");
new_window.docu ment.write(" <td class = '1'
width='111'>Ene rgieerzeugung Watts<br>Power output Watts</td>");
new_window.docu ment.write(" <td class = '1' width='111'>Mit der
erzeugten Energie können Sie Grams<br>With the above displayed energy
you can heat Grams</td>");
new_window.docu ment.write(" <td class = '1' width='111'>con verted to
lbs:</td>");
new_window.docu ment.write(" </tr>");
new_window.docu ment.write(" <tr>");
new_window.docu ment.write(" <td>0°</td>");
new_window.docu ment.write(" <td>60°</td>");
new_window.docu ment.write(" <td>138,56 W</td>");
new_window.docu ment.write(" <td>552 g</td>");
new_window.docu ment.write(" <td>1 lb 3.5 ozs</td>");
new_window.docu ment.write(" </tr>");
new_window.docu ment.write("</table>");
new_window.docu ment.write("</body>");
new_window.docu ment.write("</html>");

// close the document
new_window.docu ment.close();
}
// -->
</script><a onclick="open_n ew_window()"
style="cursor:p ointer;cursor:h and;" ><font color="#008080" ><u>Open New
Window</u></font></a>

</body>
</html>

Jul 20 '05 #2
On Sat, 14 Feb 2004 19:08:05 -0800, mscir <ms***@access4l ess.net> wrote:
<html>
<title>CodeAve. com(JavaScript New Window within Previous Page)</title>
<body bgcolor="#FFFFF F">
Why don't you add this to the CSS rules below?

body {
background-color: #ffffff;
}
<script language="JavaS cript">
Missing the required type attribute. Change to:

<script type="text/javascript">
<!--
Don't use SGML comments in script blocks
function open_new_window () {
new_window =
open("","displa yWindow","width =575,height=290 ,left=10,top=10 ");

// open new document
new_window.docu ment.open();

// Text of the new document goes here
// Replace your " with ' or \" or your document.write statements will //
fail
Or use single quotes for the document.write statements and escape
apostrophes.
new_window.docu ment.write("<ht ml>");
No DOCTYPE? Tsk, tsk.

[snip]
</script><a onclick="open_n ew_window()"
style="cursor:p ointer;cursor:h and;" >
You do realise that the first rule (cursor: pointer) in the style
attribute above is totally useless, don't you?
<font color="#008080" ><u>Open New Window</u></font></a>
Again, why not use a CSS rule instead of deprecated elements?

a {
color: #008080;
cursor: hand;
text-decoration: underline;
}
</body>
</html>


Mike

--
Michael Winter
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2110
by: John | last post by:
Is it possible to use PHP to pop a small window to display some quick information. For example if someone adds an item to a shopping cart, a small window should pop up, saying the item has been added to the shopping cart. How does one do this in PHP? Thank you John
17
3880
by: Paul Rubin | last post by:
Dumb question from a Windows ignoramus: I find myself needing to write a Python app (call it myapp.py) that uses tkinter, which as it happens has to be used under (ugh) Windows. That's Windows XP if it makes any difference. I put a shortcut to myapp.py on the desktop and it shows up as a little green snake icon, which is really cool and Pythonic. When I double click the icon, the app launches just fine and the tkinter interface does...
2
3084
by: Ram | last post by:
I have a console application that brings up a dialog if invoked with no command line parameters. If I double click on my application a console window is briefly displayed before the dialog appears (I have this code in my app: if (args.length ==0) FreeConsole() which causes the console to be closed) Is there a way to prevent this console window from appearing in the first place.
3
1455
by: Lee David | last post by:
I'm trying to have a popup window of new changes when a person comes to my web page and something has changed. I can see the "alert" popping up, but not the page. The page would look better and wouldn't stop the original page from opening until it was closed. Here is my code: <body bgcolor="lightgoldenrodyellow" onload="initindex();"> <div id="flyingimage1" style="position:absolute; left:0px; top:150px; z-index:0;"> <img...
4
1584
by: VB Programmer | last post by:
I am created a ASPX web app. I am using forms authentication and it seems to be working well. After logging in I am redirected to a form that is a "Secure" directory. It's using data coming from a SQL Server db on the internet. Clicking on a listbox item is supposed to populate the form with data. (It's doing a postback.) The first time the form loads it does it fine. But, when I click on a listbox item (to have the form populated...
3
2779
by: Learner | last post by:
Hello, I have two buttons on one of my VehicleDetails.aspx page. Obiviously these two buttons takes the user to two different pages. Now my client is interested in having a linkbutton instead of the two buttons. Once the user clicks on the linkbutton a javascript dialog box popsup that says "Is the Lessee buying this vehicle?" and with two buttons "Yes" and "No". If user clicks "yes" it should go to DealerQuestions.aspx" and if "No" it...
12
2791
by: icarus | last post by:
platform: windows xp professional, python 2.5, wxpython When I double-check on my program file test.py (for simplicity I'll be using this code below), I see the window just fine. But the ms-dos black window pops up in the background. On Linux, no issues at all. How can I get rid of that ms-dos black window in the background? something I need to add to my code? a setting to adjust in windows? thanks in advance.
1
1137
by: Lie Ryan | last post by:
On Wed, 01 Oct 2008 11:33:59 +0100, dudeja.rajat wrote: The root window is the main window, not the DOS box. I think in windows, you should use pythonw.exe or something to open the python script so not to open a dos box.
20
3795
by: cowboyrocks2009 | last post by:
Hi, I need help to automate my code to take data from input file. Also I need to create it as a function so that I can pass it to some other program. I am new to Java so having a bit limitation to do this. My tab delimited Input File looks like this:- 21 p 13e 0 62 1 580001 andrew -14.53 -13.95 0 0 21 p 13d 63 124 580002 1160001 andrew -13.95 -13.37 0 0 21 p 12g 311 364 2900000 3385714 john -11.63 -11.14 0 0 21 q 11.1a 1274 1321...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10354
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10101
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.