简体   繁体   中英

How to submit data to external website using JSON /JQUery and get the results and display in my JSP page

I am new to json and JQuery for clipping html elements from external URL.I tried reading couple books but didn't get it from where and how to start.

example how i need.

i have a jsp page which has text field and button,I entered "java tutorials" and click on button. then it should go to the google.com and paste the string in the text field and click on the google serach. can anyone please help me how this can be achieved using json and jquery.

Thanks in Advance. Srikanth.

You do not need JSON data in order to submit your input information to googles search page. I mean you should not go to googles page and input data to search box and click search. What you should do is redirect user to google like following:

In jquery after DOM ready

$(document).ready(function()
{
    $('#submit').click(function()
    {
        window.location.href='https://google.com/?q='+$('#query_data').val();
    });
});

HTML for this is as following (inside of form tag):

<input type="text" id="query_data">
<input type="button" id="submit" value="Submit">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM