Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 20th, 2003, 01:51 AM
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default post a http request/response in new window nomenu

Hello,
I need to post a http request and have the response come back in a new window. I have tried the target attribute in the form element to open a new window for the response and it works. However I prefer to not have the menu bar/status bar in the new window. How should I specify these attributes for the new window? I would appreciate your responses.
Thank you.
Reply With Quote
  #2 (permalink)  
Old September 22nd, 2003, 09:07 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You must open the new window first using the window.open method and include a name as the second parameter. Use this anme as the target attribute.

--

Joe
Reply With Quote
  #3 (permalink)  
Old September 22nd, 2003, 04:17 PM
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your response. When I open a new window what should I put for the first parameter (which is the name of some document)?

I could use the window.open instead of target attribute of form element, however then the request becomes a http "get" and there are some rules in the project that I work for that does not allow a http "get" request to come in.
Thank you.


Reply With Quote
  #4 (permalink)  
Old September 23rd, 2003, 11:30 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

The first argument can be an empty string. I don't understand the second question. Instead of a submit button have a normal button with its onclick set to doFormPost():
Code:
function doFormPost()
{
  var oNewWin = window.open("", "newTarget", "");
  while(!oNewWin.document)
  {
    //Wait for window to open
  }
  document.forms[0].submit();
}
Your form would have the target attribute set to "newTarget".

--

Joe
Reply With Quote
  #5 (permalink)  
Old August 12th, 2009, 09:58 AM
Registered User
 
Join Date: Aug 2009
Location: Buenos Aires, Argentina
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile a simpler way...

Hi all,

I use the following code, and it works fine!

Code:
<form name="login" method=post action="https://www.example.com/login.php" target="_blank">
    <input name="user" type="text" value="">
    <input name="pass" type="text" value="">
    <input type="submit" value="Go">
</form>
Greetings.

Joel
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to send http post request via stored procedure kissvineet SQL Server 2000 6 August 18th, 2008 01:26 AM
HTTP post silver_scar C# 2005 0 July 31st, 2006 10:52 AM
Using web request and response to post data to URl cgmenon .NET Framework 1.x 0 July 13th, 2006 11:39 AM



All times are GMT -4. The time now is 07:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.