/    Sign up×
Community /Pin to ProfileBookmark

Ajax tab container and internal links – Help

Hello all. I have downloaded a very simple Ajax tab script to where different pages load into a container. Here is the link:
[url]http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/[/url]

Problem:
When I click on a tab and my page content loads into this ajax container its fine but I click on a link within that page that loaded inside the container and it over rides the parent window and does not load that linked page within the ajax section container.

Is it possible to have the page load into the same container like an Iframe does?

Thanks for the help!

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@CrazyMerlinSep 26.2007 — When you click on a link you are telling the browser to load that links refered page, and if you have no target attribues it will load it into the window in which the link was clicked...the container is not a window (as such).

To get this to work you would need a server-side script. In PHP you could have a script that receives from ajax the location from the link, uses the file_get_contents() method to get the page, and return it as text/html which will appear in the ajax request object's responseText. You can then simply write this to the innerHTML of the container.

//erlin!
Copy linkTweet thisAlerts:
@HDCauthorSep 27.2007 — Thank you for your suggestions. Can this be done through perl? Right now in the main page that has my ajax script and the ajax container page are both html template from perl scripts.

My internal container page links look similar to this:

xxx.pl?action=add
Copy linkTweet thisAlerts:
@HDCauthorSep 27.2007 — To do this in php would I have to alter the actual ajax.js script in any way? Would my script code remain the same in the actual html page? Is there php code out there that demonstrates this as I do not know much php.

thanks
Copy linkTweet thisAlerts:
@HDCauthorSep 27.2007 — Can anyone else help on this one?
×

Success!

Help @HDC spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...