470,647 Members | 1,306 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

Total NOOB needs java advice

i am using a website with a form that passes criteria to a javascript
to run a query rather than just appending my criteria to parts of the
URL.

i need to import a bunch of records into MS access from this site. this
would be very easy to do if i could just change part of the url and
programatically navigate there. unfortunatly this javascript is doing
all of the querying.

is there a good place to start to be able to get around this?
should i be trying to hack a cookie?
should i (try to) write my own javascript?

...or are there too many variables, and it is just to hard to do?
any help is appreciated. thanks!

ducky

Oct 27 '05 #1
4 1112
VK

ar*******@gmail.com wrote:
i am using a website with a form that passes criteria to a javascript
to run a query rather than just appending my criteria to parts of the
URL.

i need to import a bunch of records into MS access from this site. this
would be very easy to do if i could just change part of the url and
programatically navigate there. unfortunatly this javascript is doing
all of the querying.

is there a good place to start to be able to get around this?
should i be trying to hack a cookie?
should i (try to) write my own javascript?

..or are there too many variables, and it is just to hard to do?


You can use document.location methods:

var s = '';
for (key in myRequestObject) {
s+= escape(key) + '=' + escape(myRequestObject[key]) +'&';
}
document.location.search = s;

That should navigate you properly using GET method. Be aware though
that IE imposes 2048 bytes limit on URL length (including all parts of
URL). So you cannot make GET request too long.

If the GET limit is not big enough for your case you have to use POST
method instead and set the above shown "s" value to some hidden field.
There are many other options.

Oct 29 '05 #2
cool. thanks for the starting point... where would i insert this code?
how would i 'link' it to the website i'm working with?

ducky

Oct 30 '05 #3
VK

ducky wrote:
where would i insert JavaScript code?
ooh... eh...

JavaScript code is placed between tags

<script type="text/javascript">
// your code goes here
</script>

This block has to inserted in the head section of the document (before
closing </head> tag)

how would i 'link' it to the website i'm working with?

If you place your script statements directly in <script> section they
are going to be executed immediately.

If you place your script statements into some function, they will be
executed upon function call.

To call a function you're using interface elements (like buttons) or
events (like "onload").

You really should start then from reading
<http://www.jibbering.com/faq/#FAQ3_2> and looking on code samples in
this group.

Oct 30 '05 #4
thanks VK. this is a great place to start. i'll read at the link you
gave me and see what i can come up with

ducky

Oct 30 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by James Greig | last post: by
11 posts views Thread by Brian Blazer | last post: by
9 posts views Thread by Ben | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.