473,606 Members | 2,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

window.open

Hi,
if I opened a php-page using

... onclick=\"help= window.open('he lp.php', 'Help',
'innerHeight=40 0,innerWidth=40 0,screenX=555,s creenY=250,depe ndent=Yes,bar=Y es');
....

is there a way to send data to the invoked page (help.php)? Something
like $_POST[....] if I would use a HTML form-submit?
Setting cookies or store data in mysql are not so very elegant solutions.

Can somebody give me hint?

Lajos
Jul 23 '05 #1
2 9467
Just add a query string after help.php:

... onclick=\"help= window.open('he lp.php?a=10&b=2 0&c=40', 'Help',

'innerHeight=40 0,innerWidth=40 0,screenX=555,s creenY=250,depe ndent=Yes,bar=Y e
s');
...

Hope it helps
Henri

"Lajos Kuljo" <ku***@freemail .hu> a écrit dans le message de
news:o0******** **********@nntp server.swip.net ...
Hi,
if I opened a php-page using

... onclick=\"help= window.open('he lp.php', 'Help',
'innerHeight=40 0,innerWidth=40 0,screenX=555,s creenY=250,depe ndent=Yes,bar=Y e
s'); ...

is there a way to send data to the invoked page (help.php)? Something
like $_POST[....] if I would use a HTML form-submit?
Setting cookies or store data in mysql are not so very elegant solutions.

Can somebody give me hint?

Lajos


Jul 23 '05 #2
Lajos Kuljo wrote:
Hi,
if I opened a php-page using

... onclick=\"help= window.open('he lp.php', 'Help',
'innerHeight=40 0,innerWidth=40 0,screenX=555,s creenY=250,depe ndent=Yes,bar=Y es');
...

is there a way to send data to the invoked page (help.php)? Something
like $_POST[....] if I would use a HTML form-submit?
Setting cookies or store data in mysql are not so very elegant solutions.

Can somebody give me hint?

Lajos


window.open(... ) is a GET operation, you can not POST data to the page being opened.
However, you can pass approximately 2Kb of data on the URL itself during the GET
operation:

window.open(
'help.php?a=' + clientSideVaria ble,
'Help',
'...attributes. ..'
);

If you actually want to POST data, you're going to have to store it in a form and
POST that form:

<form name="myHiddenF orm" method="POST" action="help.ph p" target="Help">
<input type="hidden" name="myHiddenV alue" value="">
</form>
<a href="noJS.html "
onclick="submit Form('myHiddenF orm');return false;">Help</a>
<script type="text/javascript">
function submitForm(name ) {
var f = document.forms[name];
if (f) {
window.newWindo wHtml = [
'<html>',
'<head>',
'<title></title>',
'</head>',
'<body onload="',
'var w;',
'if ((w = window.opener) &&',
'(w = w.document) &&',
'(w = w.forms) &&',
'(w = w[\'' + name + '\'])) {',
'w.submit();',
'}',
'window.focus() ;',
'">',
'</body>',
'</html>'
].join('\n');
window.open(
'javascript:ope ner.newWindowHt ml',
f.target,
'...attributes. ..'
);
}
}
</script>

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq

Jul 23 '05 #3

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

Similar topics

3
20534
by: Michael | last post by:
I am trying to allow a user to view a PDF in a new window. I currently have this working using the following: <a href="./pdf.do?parameter=01121980" target="top"><b>pdf</b></a> The problem with the above solution is the back/forward buttons and all the other browser options. Because of this, I am trying to get the following solution to work: <a href="#" onclick="popUp('./pdf.do?parameter=01121980')"><b>pdf</b></a>
13
9423
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to intercept the key so that I can do stuff on the server side to make the new window behave correctly? (We have a JSP-based webapp which stores state in the session. Now if two windows access (and modify!) the same session, then madness will result....
10
11211
by: Marshall Dudley | last post by:
When I do the following line in Netscape, the popup loads as it should, but the parent window usually, but not always, reloads as well. <a href="#" onClick="window.open('/cgi-bin/displayimage.cgi?/store/demo/image.jpg&YOUR+PRODUCT%27<b>S+NAME+GOES', 'fullimage', 'WIDTH=420,HEIGHT=405,status=0')"> The original window should not reload, but is, and I have tested it with both version 4.72 and 7.02, and they both do it. IE does not do it....
2
3500
by: Samir Pandey | last post by:
Hello, I am using the following javascript code to open a new window. Somehow, IE always opens a new window. It doesn't open target url in the window name given. All i want is, if there is a window "MyWin" already open, then the main window should load the target url in "MyWin" and not open a new window again.
3
24678
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The situation is: A main window opens child windows one at a time as the user requests, each with its own name. The user may click in any child window or the main window to open a summary window, which has a name all windows know. I want to get that...
14
11062
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
6
3058
by: G Dean Blake | last post by:
in my aspx app I am writing a stream that works fine but it replaces what is in the client browser window. The code is as follows: .. .. HttpContext.Current.Response.ClearHeaders() HttpContext.Current.Response.ClearContent() HttpContext.Current.Response.ContentType = "application/pdf" Dim myBuffer(MyStream.Length) As Byte MyStream.Read(myBuffer, 0, CType(MyStream.Length, Integer)) HttpContext.Current.Response.BinaryWrite(myBuffer)
8
2479
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript" type="text/javascript"> <!-- ; var newwindow = ''
7
3657
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses pageA.html 2. User clicks on menu link to open popup.html 3. pageA.html checks if popup.html is already open. It is not, open
3
10226
by: Andrew Poulos | last post by:
There's a HTA application that's running on a local computer (not from a URL) and the user can open a new HTML window by clicking a button The first time the user clicks the button the window opens. Any subsequent click causes this dialog, with this error, to appear: "Error: The remote server machine does not exist or is unavailable" The relevant code is
0
7951
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8430
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...
0
8305
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
6770
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5465
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
3930
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
3977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.