php - Load a Div from another page into another pages Div -
i'm trying this:
but doesnt work me. , i'm not sure why.
what im wanting is, have mobile site im working with, , want pull story content data thats on main sites div, , place on mobile sites content div way dont have edit anything. whatever gets published on main gets reflected on mobile.
any ideas best way accomplish this? there way include in php or html takes targeted divs content , not else?
if i'm reading correctly, need:
$('#result').load('ajax/test.html #container');
this load page ajax/test.html, grab content of element id "container" , load current pages' element id "result".
more info can found @ http://api.jquery.com/load/
edit: working code based on test files:
<html> <head> <script src="http://code.jquery.com/jquery-git.js"></script> <script> $(document).ready(function(){ $('#result').load('pull4m.shtml #hello'); }); </script> </head> <body> <div id="result"></div> </body> </html>
Comments
Post a Comment