JavaScript-change Baidu Search Form Submit button (yes that's the "Baidu") behavior

Source: Internet
Author: User

There is a search.php use to file_get_contents get"http://www.baidu.com/s?wd=$keyword"
Which $keyword comes from the parameters of the search.php WD

Search.php file_get_contents After a few substitutions, the last echo content
Then is the use of jQuery, removed some elements of Baidu.

The next question is how to change the Baidu search box next to the "Baidu" submit button action path

, there was a submit in the form, and I changed the Action property of the form it was in, with no effect.

I hope the behavior is 'search.php?wd='+$('#kw').val() not'/s?wd='+$('#kw').val()

Also analyzed the Baidu script. It's definitely messy.

Reply content:

There is a search.php use to file_get_contents get"http://www.baidu.com/s?wd=$keyword"
Which $keyword comes from the parameters of the search.php WD

Search.php file_get_contents After a few substitutions, the last echo content
Then is the use of jQuery, removed some elements of Baidu.

The next question is how to change the Baidu search box next to the "Baidu" submit button action path

, there was a submit in the form, and I changed the Action property of the form it was in, with no effect.

I hope the behavior is 'search.php?wd='+$('#kw').val() not'/s?wd='+$('#kw').val()

Also analyzed the Baidu script. It's definitely messy.

Please make sure that the form is submitted using JS.

    C.delegate("form", "submit",    function() {        C.find("iframe").on("load",        function() {            E()        });        setTimeout(E, 1000)    })

Analysis of Baidu Nu_instant_search.js time to find this piece of code, but I always can not find e this function.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.