Hope I´ve come to the right place, but this I´m farely sure about; AJAX and java are pretty closely related…
Anyhow, got a site here at http://openeye-design.com/beta2/ where I chosen to use AJAX off course to prevent the whole site from loading but just the contentholder. However, for som reason I can´t figure out how to link internally.
Would like to link to another tab content from the frontpage. This is of course is the be opened in the content div as it normally would. But no matter what i try the link just opens as plain text. So it doesn´t fetched my AJAX-driven content at all. Off course I´m aware that a classic <a href> won´t cut it here, but is there a jQuery script to be used?
Nevermind that the content isn´t formatted yet, i´ll get to that
Chances are that this is pretty simple, but can´t find any information on this process. Even Google have let me down.
You will need to overtake the onclick event of links. If the link is a fragment identifier (such as “#products”), then that is an internal link that you’ll need to specially handle.
When the link is a fragment identifiers (typically used internally), you’ll need to load the tab that applies to it, and when the tab has finished loading you can then go to the intended destination, by setting the location hash to that fragment identifer. Now that the target exists, the page should behave as it normally would.
How do you know which tab that the link applies to? There are two ways.
You can look for the fragment identifier in your cache, and if it’s not there you can load up the remaining tabs that haven’t been loaded to check them as well.
Or, and this might be preferred, you can specify which tab the link belongs with, so that you can activate the tab and then set the location hash with the fragment identifier.