简体   繁体   中英

jquery load dynamic url return whole page instead selector

I need to refresh/reload a div with jquery and this code works perfect

$("#termlist").load('index.php/?s=1&qact=edit&id=WXU8FFSEBVA8S4AC #termlist');

but I'm working with dynamic php URLs so I can't use that code, I can get the Dynamic ID from HTML element like this

$("#termlist").load('index.php?s=1&qact=edit&id='+ $("input#id").val() + "#termlist");

unfortunately this code refresh the whole HTML/URL instead only a div. so what i miss ? any ideas ? thanks

I had the same problem and that is because your site probably is using some type of routing system.
What you can do is provide the full path to your load method like this:

Localhost:

$("#termlist").load('http://localhost:8888/index.php/?s=1&qact=edit&id=WXU8FFSEBVA8S4AC #termlist');

Server:

$("#termlist").load('http://www.domain.com/index.php/?s=1&qact=edit&id=WXU8FFSEBVA8S4AC #termlist');

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