Michdd Posted August 7, 2009 Share Posted August 7, 2009 You see it on many websites where content will switch. I know how to do this easily, accept if I want to load a page with a certain starting content it's pretty complicated and I have to use $_GET variables and such. But on many websites I see it's done through like pagename.php#section, is there a standard way for creating dynamic content? If so can you point me in the direction of an example? Link to comment https://forums.phpfreaks.com/topic/169249-dynamic-content/ Share on other sites More sharing options...
watsmyname Posted August 7, 2009 Share Posted August 7, 2009 You see it on many websites where content will switch. I know how to do this easily, accept if I want to load a page with a certain starting content it's pretty complicated and I have to use $_GET variables and such. But on many websites I see it's done through like pagename.php#section, is there a standard way for creating dynamic content? If so can you point me in the direction of an example? I didnt understand what you meant, can you give the example site?? and pagename.php#section is the internal linking. Link to comment https://forums.phpfreaks.com/topic/169249-dynamic-content/#findComment-893095 Share on other sites More sharing options...
haku Posted August 7, 2009 Share Posted August 7, 2009 I don't know if you mean jquery, but with jquery you can do this: $("#target_div").load("source_page.php #source_div#); Which means load the contents of the div that an id of 'source_div' from the page called 'source_page.php' into the div with an id of 'target_div' on the page that this script is on. Link to comment https://forums.phpfreaks.com/topic/169249-dynamic-content/#findComment-893101 Share on other sites More sharing options...
Michdd Posted August 7, 2009 Author Share Posted August 7, 2009 I don't know if you mean jquery, but with jquery you can do this: $("#target_div").load("source_page.php #source_div#); Which means load the contents of the div that an id of 'source_div' from the page called 'source_page.php' into the div with an id of 'target_div' on the page that this script is on. This might be what I'm looking for, but I'm not completely sure. Here's an example: http://www.apple.com/ipodtouch/gallery/ You'll notice the links to change gallery display are like #image2, #image3, etc.. But if you also directly visit http://www.apple.com/ipodtouch/gallery/#image2 it loads that page with the second item. Link to comment https://forums.phpfreaks.com/topic/169249-dynamic-content/#findComment-893125 Share on other sites More sharing options...
Psycho Posted August 7, 2009 Share Posted August 7, 2009 EDIT: nm Link to comment https://forums.phpfreaks.com/topic/169249-dynamic-content/#findComment-893196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.