简体   繁体   中英

Form submission with Ajax and jquery

I have a PHP file that has an HTML form that submits via AJAX to the database. When I hit the form submit button, every PHP query updates itself. Is this how Ajax normally operates? or if I switch the parent file from PHP to HTML, will it eliminate the unwanted updating of all the PHP on the page?

jQuery ajax submits the request to a seperate php file to load data. You can choose to load only poritions of pages. $.load does this easier. Look here: http://api.jquery.com/load/

You said it submits via AJAX to the database - but have you actually programmed it to do that?

Post a sample of the AJAX code and we can check it for you.

I have a feeling you don't really understand the technology you are using. What is a 'PHP query'? You want to switch the page from PHP to HTML? Well, can you? Does the page have PHP in it or not? It wouldn't make any difference to AJAX code, but I have a feeling you don't actually have AJAX code.

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