简体   繁体   中英

Strange behaviour with jquery load function

I am using jquery's load function to updated a div inside my jsp. However the issue is, even if I give the wrong div id the correct div gets updated but if I give the correct div id , it doesn't work.

Inside my jsp:

<div id="markers" class="height-400"></div>

Inside Js:

$("#marker").load(location.href + " #marker>*", ""); //works (notice marker instead of markers)

$("#markers").load(location.href + " #markers>*", ""); // Doesn't work

Can someone please help me understand what's going on here. Referring to this post Refresh/reload the content in Div using jquery/ajax

在CLASS / ID之后尝试使用不带双引号的代码。

$("#markers").load(location.href + " #markers>*");

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