Javascript to open a new url

Hello,

I am not sure if this is possible but i need some javascript that will generate a http request with some content fields, and then open the requested url in the current window.

Thanks.
soozhAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
On this page http://www.w3schools.com/js/js_ex_browser.asp , see "Open a new window and control its appearance".  You can add a query string to the end of the URL to pass parameters.
0
soozhAuthor Commented:
ok but i want to add CONTENT fields - not query string,
0
Dave BaldwinFixer of ProblemsCommented:
Content is sent in a URL with a query string in name/value pairs.  Can you give me an example of what you want to send?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

soozhAuthor Commented:
i do not want my data in the url.  Thats why i want to pass it as part of the body of the message...
0
Dave BaldwinFixer of ProblemsCommented:
There is no "body of the message" when you open a web page.  Your choices are limited to two: GET which puts the data in the URL, and POST which does not.  In both cases, the data has to be supplied in "name/value" pairs like you see at the end of internet addresses in your address bar.  Which form you use depends on the requirements of the web site.  You have to send the data in the form that they require.  Do you have directions from them about what they want you to do?  Can you give me the web address that you are trying to open?
0
soozhAuthor Commented:
I would like to do a post.  And add content fields that are not in the url...

do you have any generic code?
0
Dave BaldwinFixer of ProblemsCommented:
See here: http://www.w3schools.com/tags/att_form_target.asp  For POST, you need to use a <form> with a 'target' attribute of '_blank'.  The page that you POST the data to must be a server side page that can receive the data.  A plain HTML page can not do that.
0
soozhAuthor Commented:
Ok i have looked at this example.  

The reason i posted this question here is because i know nothing about get/post blah blah...

I know the question is a very basic one and anyone who has more than 5 mins experience with html/js can do it... but thats not me.

So really i would like an example that does not send the data as name/value pairs in the url.

Thanks.
0
Dave BaldwinFixer of ProblemsCommented:
This page http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_form_method_post shows an example of using POST to go to a new page.  If you are going to transfer data on the web, you need to spend your "5 mins" to learn about GET/POST and forms.  They are the defined ways of transferring info from one page to another.  The pages I have linked can tell you everything you need to know.
0
soozhAuthor Commented:
I am sorry but my question has not been answered.  I have asked for some example JS code because i dont know anything about it.  

It is becoming increasingly common that people answer questions by refering to a link that often does 85% of what you want.

I can search the web... but the reason i have posted the question here is because i only ever find 85% of my solution....
0
Dave BaldwinFixer of ProblemsCommented:
Your question, as you have asked it, is not answerable because what you are asking for does not exist.  You have not given me any examples of what you think you want so I don't see how I can give you sample code to show you what to do.  I have a hundred pages on the web that POST info to other pages so I know how to do it.  But until you give me enough information, I can not answer your question.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.