javascript - How to load div with dynamic content in jQuery -


i load content dynamically using jquery mobile.

the alert displays not display content. however, if load file disk in browser works okay, if load server not load div.

i validated page content on server using w3c validator. appreciated.

here's javascript:

$(document).on('pagebeforeshow', '#privacy', function(){     $('div#privacy_load').load('http://example.com');     alert('privacy'); /* displays ok */ }); 

here's html

<div class="container" data-role="page" id="privacy">     <div data-role="header">         <h1>privacy</h1>     </div>     <div data-role="content">            <div id="privacy_load"></div> <!-- content not display -->     </div> </div> 

update:

this not work:

<div id="terms_load"></div> <script>alert('alert'); /* alert shows ok */     $("div#terms_load").loadpage("http://example.com"); /* div content not update */ </script> 


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -