You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Alexandre Corrêa Cruz <al...@gmail.com> on 2008/08/08 04:37:36 UTC
I need help on javascript form.
I'm new using httpclient.
below you can see what I need to do.
<div id="textField" class="bodyText">
<INPUT id="serviceCall" size="15" name="serviceCall" />
<INPUT id="simple" type="hidden" value="no" name="simple" />
<INPUT type="hidden" value="ClickIT" name="app" />
<INPUT onClick="loadSCStatus();" type="image" src="images/go_button.jpg"
align="absmiddle" />
</div>
I need to insert a number on servicecall field, and run loadSCStatus()
javascript. I know httpclient can't handle javascritpt, but someone told me
that we can do this by simulating, on the server side. Can somebody help me
saying what I need to do to put this to work.
Thanks in advance.
--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave
an entire speech once with a bullet lodged in his chest. Some things are a
matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@br.ibm.com
alexandre.r.cruz@sprint.com
--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave
an entire speech once with a bullet lodged in his chest. Some things are a
matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@br.ibm.com
alexandre.r.cruz@sprint.com
Re: I need help on javascript form.
Posted by Justin Tay <ju...@gmail.com>.
Hi,
I already see some good responses, but this would be my approach.
I would ignore the javascript totally. (You can parse and run the javascript
using rhino (http://www.mozilla.org/rhino/), but I see no reason to do so. I
use rhino to parse proxy.pac files to determine the the proxy to use for
urls.)
One suggestion would be to use Wireshark (http://www.wireshark.org/) to look
at the packets your browser sends out.
Another solution that I think would be better would be to use Mozilla
Firefox + Tamper Data (https://addons.mozilla.org/en-US/firefox/addon/966).
It allows you to intercept the POST/GET messages going out and for you to
modify accordingly as well as to replay messages to see if you can get the
desired response.
Hope you're not using this to do anything important. If the guy running the
page changes anything your call is liable to break at any time.
Regards,
Justin Tay
--
View this message in context: http://www.nabble.com/I-need-help-on-javascript-form.-tp18884153p18890062.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: I need help on javascript form.
Posted by Alexandre Corrêa Cruz <al...@gmail.com>.
Thx Guys for the help,
But analyzing the javascritpt did the trick, I found a direct way inside the
function to do what I need.
Thank you all for the help
On Fri, Aug 8, 2008 at 3:50 AM, Quintin Beukes <qu...@last.za.net> wrote:
> Firstly, what are you trying to do?
>
> Please explain it in full sentences and supply a use-case (in words), ex.
> 1.
> User takes out keyboard, 2. Users plugs in keyboard 3. User enters number
> in
> serviceCall field, 4. User becomes depressed.
>
> This sort of thing, just fill in the parts I didn't know (everything other
> than a number in service call).
>
> thanks,
> Q
>
> On Fri, Aug 8, 2008 at 4:37 AM, Alexandre Corrêa Cruz <
> alexandre.correacruz@gmail.com> wrote:
>
> > I'm new using httpclient.
> >
> > below you can see what I need to do.
> >
> > <div id="textField" class="bodyText">
> > <INPUT id="serviceCall" size="15" name="serviceCall" />
> > <INPUT id="simple" type="hidden" value="no" name="simple" />
> > <INPUT type="hidden" value="ClickIT" name="app" />
> > <INPUT onClick="loadSCStatus();" type="image" src="images/go_button.jpg"
> > align="absmiddle" />
> > </div>
> >
> > I need to insert a number on servicecall field, and run loadSCStatus()
> > javascript. I know httpclient can't handle javascritpt, but someone told
> me
> > that we can do this by simulating, on the server side. Can somebody help
> me
> > saying what I need to do to put this to work.
> >
> > Thanks in advance.
> >
> >
> >
> > --
> > "You choose this life, it comes with responsibilities...Teddy Roosevelt
> > gave
> > an entire speech once with a bullet lodged in his chest. Some things are
> a
> > matter of duty."
> > By Corrado Junior Soprano.
> > ----------------------------------------------------------
> > Alexandre Reis Corrêa Cruz
> > IBM - Nastek
> > Sprint Nextel - Analyst P.S.
> > Engenheiro de Computação
> > Crea nº : PR-78525/D
> > Cel: (67) 8122-9262
> > arccruz@br.ibm.com
> > alexandre.r.cruz@sprint.com
> >
> >
> >
> > --
> > "You choose this life, it comes with responsibilities...Teddy Roosevelt
> > gave
> > an entire speech once with a bullet lodged in his chest. Some things are
> a
> > matter of duty."
> > By Corrado Junior Soprano.
> > ----------------------------------------------------------
> > Alexandre Reis Corrêa Cruz
> > IBM - Nastek
> > Sprint Nextel - Analyst P.S.
> > Engenheiro de Computação
> > Crea nº : PR-78525/D
> > Cel: (67) 8122-9262
> > arccruz@br.ibm.com
> > alexandre.r.cruz@sprint.com
> >
>
>
>
> --
> Quintin Beukes
>
--
"You choose this life, it comes with responsibilities...Teddy Roosevelt gave
an entire speech once with a bullet lodged in his chest. Some things are a
matter of duty."
By Corrado Junior Soprano.
----------------------------------------------------------
Alexandre Reis Corrêa Cruz
IBM - Nastek
Sprint Nextel - Analyst P.S.
Engenheiro de Computação
Crea nº : PR-78525/D
Cel: (67) 8122-9262
arccruz@br.ibm.com
alexandre.r.cruz@sprint.com
Re: I need help on javascript form.
Posted by Quintin Beukes <qu...@last.za.net>.
Firstly, what are you trying to do?
Please explain it in full sentences and supply a use-case (in words), ex. 1.
User takes out keyboard, 2. Users plugs in keyboard 3. User enters number in
serviceCall field, 4. User becomes depressed.
This sort of thing, just fill in the parts I didn't know (everything other
than a number in service call).
thanks,
Q
On Fri, Aug 8, 2008 at 4:37 AM, Alexandre Corrêa Cruz <
alexandre.correacruz@gmail.com> wrote:
> I'm new using httpclient.
>
> below you can see what I need to do.
>
> <div id="textField" class="bodyText">
> <INPUT id="serviceCall" size="15" name="serviceCall" />
> <INPUT id="simple" type="hidden" value="no" name="simple" />
> <INPUT type="hidden" value="ClickIT" name="app" />
> <INPUT onClick="loadSCStatus();" type="image" src="images/go_button.jpg"
> align="absmiddle" />
> </div>
>
> I need to insert a number on servicecall field, and run loadSCStatus()
> javascript. I know httpclient can't handle javascritpt, but someone told me
> that we can do this by simulating, on the server side. Can somebody help me
> saying what I need to do to put this to work.
>
> Thanks in advance.
>
>
>
> --
> "You choose this life, it comes with responsibilities...Teddy Roosevelt
> gave
> an entire speech once with a bullet lodged in his chest. Some things are a
> matter of duty."
> By Corrado Junior Soprano.
> ----------------------------------------------------------
> Alexandre Reis Corrêa Cruz
> IBM - Nastek
> Sprint Nextel - Analyst P.S.
> Engenheiro de Computação
> Crea nº : PR-78525/D
> Cel: (67) 8122-9262
> arccruz@br.ibm.com
> alexandre.r.cruz@sprint.com
>
>
>
> --
> "You choose this life, it comes with responsibilities...Teddy Roosevelt
> gave
> an entire speech once with a bullet lodged in his chest. Some things are a
> matter of duty."
> By Corrado Junior Soprano.
> ----------------------------------------------------------
> Alexandre Reis Corrêa Cruz
> IBM - Nastek
> Sprint Nextel - Analyst P.S.
> Engenheiro de Computação
> Crea nº : PR-78525/D
> Cel: (67) 8122-9262
> arccruz@br.ibm.com
> alexandre.r.cruz@sprint.com
>
--
Quintin Beukes
Re: I need help on javascript form.
Posted by "Eduardo J. Ortega U." <ej...@gmail.com>.
Hi:
I can suggest two things:
1) Try rendering the website with a non JS capable browser, see ig the
server supplies a different html code which does not include JS
function calls; some websites do this.
2) If that does not work, you will need to see what the loadSCStatus()
method does. My guess it that it does one or more of the following:
- Set some variable (probably that hidden input)
- make some validation checks on the submitted data
- if validations passes, submit.
So you must build your HTTP request making emulate what would be sent
by a JS capable browser. Try sniffing the HTTP traffic, see what a
browser sends and compare it with what your HTTPClient code is
sending. Set any missing variables.
I hope this was helpful.
Eduardo
On Thu, Aug 7, 2008 at 9:37 PM, Alexandre Corrêa Cruz
<al...@gmail.com> wrote:
> I'm new using httpclient.
>
> below you can see what I need to do.
>
> <div id="textField" class="bodyText">
> <INPUT id="serviceCall" size="15" name="serviceCall" />
> <INPUT id="simple" type="hidden" value="no" name="simple" />
> <INPUT type="hidden" value="ClickIT" name="app" />
> <INPUT onClick="loadSCStatus();" type="image" src="images/go_button.jpg"
> align="absmiddle" />
> </div>
>
> I need to insert a number on servicecall field, and run loadSCStatus()
> javascript. I know httpclient can't handle javascritpt, but someone told me
> that we can do this by simulating, on the server side. Can somebody help me
> saying what I need to do to put this to work.
>
> Thanks in advance.
>
>
>
> --
> "You choose this life, it comes with responsibilities...Teddy Roosevelt gave
> an entire speech once with a bullet lodged in his chest. Some things are a
> matter of duty."
> By Corrado Junior Soprano.
> ----------------------------------------------------------
> Alexandre Reis Corrêa Cruz
> IBM - Nastek
> Sprint Nextel - Analyst P.S.
> Engenheiro de Computação
> Crea nº : PR-78525/D
> Cel: (67) 8122-9262
> arccruz@br.ibm.com
> alexandre.r.cruz@sprint.com
>
>
>
> --
> "You choose this life, it comes with responsibilities...Teddy Roosevelt gave
> an entire speech once with a bullet lodged in his chest. Some things are a
> matter of duty."
> By Corrado Junior Soprano.
> ----------------------------------------------------------
> Alexandre Reis Corrêa Cruz
> IBM - Nastek
> Sprint Nextel - Analyst P.S.
> Engenheiro de Computação
> Crea nº : PR-78525/D
> Cel: (67) 8122-9262
> arccruz@br.ibm.com
> alexandre.r.cruz@sprint.com
>
--
Eduardo J. Ortega U.
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org
Re: I need help on javascript form.
Posted by Jeff Davis <je...@FlyingDiamond.com>.
Hi,
I think I understand what you want to do.
You have to find the javascript code that runs the loadSCStatus()
function. I have no idea what it does, but you want to pay attention
for primarily one thing:
anything that alters one of the POST variables. Your prime candidate is
likely the hidden input field "simple" that gets changed or set to
something.
Your goal is to figure out what happens to the data between the time
it's entered and the POST packet is sent out. You need to in your code
alter the variables accordingly so your POST matches.
I hope that makes sense.
Jeff
Alexandre Corrêa Cruz wrote:
> I'm new using httpclient.
>
> below you can see what I need to do.
>
> <div id="textField" class="bodyText">
> <INPUT id="serviceCall" size="15" name="serviceCall" />
> <INPUT id="simple" type="hidden" value="no" name="simple" />
> <INPUT type="hidden" value="ClickIT" name="app" />
> <INPUT onClick="loadSCStatus();" type="image" src="images/go_button.jpg"
> align="absmiddle" />
> </div>
>
> I need to insert a number on servicecall field, and run loadSCStatus()
> javascript. I know httpclient can't handle javascritpt, but someone told me
> that we can do this by simulating, on the server side. Can somebody help me
> saying what I need to do to put this to work.
>
> Thanks in advance.
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org