Jump to content

Recommended Posts

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

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

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.