473,545 Members | 2,051 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 9439
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
20524
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...
13
9413
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...
10
11200
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...
2
3492
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
24672
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...
14
11032
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 =...
6
3053
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...
8
2473
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
3653
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
10212
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" ...
0
7475
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...
0
7409
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...
0
7664
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. ...
0
7918
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...
1
7436
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...
0
5981
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...
0
4958
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...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1022
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.