473,385 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

POST to standard HTML and parse parameters in Javascript

Jay
Hi,
Does anyone know if you can do an HTML POST to a plain html file using
javascript to receive and parse the parameters, instead of using asp,
php, or a plain-old cgi program?
Thanks,
Jay

Mar 23 '06 #1
5 11559


Jay wrote:
Does anyone know if you can do an HTML POST to a plain html file using
javascript to receive and parse the parameters, instead of using asp,
php, or a plain-old cgi program?


You can use J(ava)Script on the server (e.g. in ASP) to process a HTTP
POST request. POSTing data to a plain HTML document should give an error
(usually HTTP 405 Method not allowed).

--

Martin Honnen
http://JavaScript.FAQTs.com/
Mar 23 '06 #2
Jay wrote:
Does anyone know if you can do an HTML POST to a plain html file using
There is no such thing as a "HTML POST". There is the _HTTP_ POST command
and (therefore) request type, ...
javascript to receive and parse the parameters, instead of using asp,
php, or a plain-old cgi program?


.... which is why that is not possible with _client-side_ scripting. "Using
ASP, PHP, or a plain-old CGI program" involves an HTTP server, which is why
it is possible there. You can use _Server-Side_ JavaScript[tm] of course,
but I think you had a client-only solution in mind. There can be none.
PointedEars
Mar 23 '06 #3
Jay
Yeah, I am integrating w/Google Maps and passing a large about of XML
to the webpage via a GET request. Unfortunately there is a limit in
the URL size of about 2083 kb I believe. I believe that using a POST
would allow me to send a larger amount of data. I don't want to stand
up a server or PHP since it is just a single page embedded in an
Internet Explorer ActiveX control. I guess I'll just use COM to invoke
a javascript method and pass the date that way. Thanks for the help!!

Mar 23 '06 #4
Jay wrote:
Yeah,
Are you referring to something? See below.
I am integrating w/Google Maps and passing a large about of XML
to the webpage via a GET request. Unfortunately there is a limit in
the URL size of about 2083 kb I believe.
More like 2083 _bytes_ (here: characters), and AFAIK in Internet Explorer
only.
I believe that using a POST would allow me to send a larger amount of
data.
Yes, it would.
I don't want to stand up a server or PHP since it is just a single page
embedded in an Internet Explorer ActiveX control. I guess I'll just use
COM to invoke a javascript method and pass the date that way.
Not understood. The server you would be POSTing to would be the server
where Google Maps runs on, so you do not need a server of your own. /Iff/
the Google Maps server-side script can handle POST the same way it can
handle GET data, you can make a POST request, using a form[method="POST"],
or an XMLHTTP request object (which is an ActiveX/COM object in IE).
However, with the latter there are some security restrictions (Same Origin
Policy) that may apply here. If these restrictions apply, you will need a
server of your own, though, to facilitate server-side redirection.

Please use "Options, Reply" in Google Groups to quote the minimum you are
replying to next time.
Thanks for the help!!


You are welcome.
PointedEars
Mar 23 '06 #5
Jay
I have an html page that embeds a Google Map in a div layer. In order
to customize
what markers and map locations are being displayed I send XML to the
webpage and parse it using Javascript/MSXML2 object. Unfortunately
there is a limit to the size of XML I can pass using a GET request. So
inorder to send larger amounts of date to the webpage, I would have to
standup a server or cgi program that can handle the large request.
Since my app uses an embedded IE control I can query for the
IHTMLDocument COM interface and eventually call a javascript method
directly using
IDispatch.
Thansk,
Jay
Not understood. The server you would be POSTing to would be the server
where Google Maps runs on, so you do not need a server of your own. /Iff/
the Google Maps server-side script can handle POST the same way it can
handle GET data, you can make a POST request, using a form[method="POST"],
or an XMLHTTP request object (which is an ActiveX/COM object in IE).
However, with the latter there are some security restrictions (Same Origin
Policy) that may apply here. If these restrictions apply, you will need a
server of your own, though, to facilitate server-side redirection.

Please use "Options, Reply" in Google Groups to quote the minimum you are
replying to next time.
Thanks for the help!!


You are welcome.
PointedEars


Mar 23 '06 #6

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

Similar topics

5
by: TG | last post by:
Dear PHP Group, I have two forms that are used to collect user information. The first one takes user inputted values such as fullname, city, address etc. I want these values to display in the...
7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
1
by: Mike Berger | last post by:
I would like to reference the "name=value" parameters sent to my page (submit'ted from a previous page with a <form>.) in my javascript. I can do it if my second form is called with a "get" using...
4
by: PH | last post by:
Does anyone know how to have the pop-up javascript alert, Response.Write("<script language=javascript>alert('HEY!');</script>); , pop-up after the page has been posted back? I am pressing a...
12
by: Assaf | last post by:
Hi all, My client is using an online service provider that processes survey responses. After a user fills survey.aspx and presses the OK button, 2 things need to happen: 1. the data has to...
6
by: Ben | last post by:
Hi I need to design a form that I can programmatically post using this code from a VB .NET Windows Application: Dim web As New System.Net.WebClient() web.Headers.Add("Content-Type",...
10
by: Danny | last post by:
Hi all, I am having some odd problems with AJAX on Firefox (1.5). When I use GET as the request method everything works ok, but when I do a POST the remote function doesn't get the parameters I...
1
by: SpiderSwamy | last post by:
Hi all, I want to pass the value of a field from 1.asp to 2.asp like SSO ID: 123456 this field is there in 1.asp and 2.asp do the form validation and SSO ID: field is there in the 2.html I...
56
by: UKuser | last post by:
Hi, I'm not sure if this can be done as I've searched the web and this forum. I am using an online merchant provider and I must post certain variables to their webforms through a form on my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...

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.