PDA

View Full Version : Ajax Tabs Content Script (v 2.0) Inserting Link inside the div



ravethither
01-03-2008, 11:18 AM
Hi Dynamic Drive.

This is my first time to post and like very much most of your samples. As ive run tru some of your codes and got downloaded the Ajax Tabs Content Script (v 2.0)

Script: DD Ajax Tabs Content Script (v 2.0)
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/

but when i try to modify it ive been hard time to solve the problem. Hope you would help me with this. This is my problem issue.

Calling an external html file outside the div file works very well, but when i load an external html file and had a link on it or have a link inside a div cause a problem of page reload and redirect to another page. The ajax doesnt work well. Here is my sample code

<div id="countrydivcontainer" style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">

<p>

<a href="link1.html">link1</a>

This is some default tab content, embedded directly inside this space and not via Ajax. It can be shown when no tabs are automatically selected, or associated with a certain tab, in this case, the first tab.</p>
</div>

ddadmin
01-03-2008, 11:52 PM
The script doesn't load any links within the content area using Ajax, only the pages specified in the tabs themselves, for example:


<ul id="countrytabs" class="shadetabs">
<li><a href="#" class="selected" rel="#default">Tab 1</a></li>
<li><a href="external2.htm" rel="countrycontainer">Tab 2</a></li>
<li><a href="external3.htm" rel="countrycontainer">Tab 3</a></li>
<li><a href="external4.htm" rel="#iframe">Tab 4</a></li>
<li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
</ul>

"external2.htm" for example would be loaded via Ajax, but if inside external2.htm there are links as well, clicking on these links will cause them to be loaded in the browser window itself. It's not a recursive feature in that sense. Now, if you're using the IFRAME option to fetch the external pages, links inside those will be loaded in the IFRAME as well, simply due to the way IFRAMEs behave.

ravethither
01-04-2008, 07:04 AM
I already use the IFrame inside the content page but you must need to set height and width to set the exact desired length of your page.

Is there a way to use the ajax inside the page content?.. I've prefer to used this rather than iframe.

BTW thanks for the help.. Hope you guys would help solve the issue..Many Thanks!

Minty the Dalek
07-27-2008, 07:56 PM
Hi folks,

I have been using the excellent scripts and ideas on here for a while now.
I thought it time that I contribute BACK into the site to benfit my fellow new script writer as we were all "NEW" once.

If you see the rest of this thread is taking about how you CAN'T call other info via links from within the dynamically provided content with this script.

I changed the script a bit (appologies and full respect to the original owner and writer of the script) the orignal is excellent and I hope you'll agree this helps to enhance the script.

I've attached the sheet I wrote. donload it and then save it as an external javascript sheet.
Link to it from the "parent page" into which you wish to call the dynamic content.

Read the notes I've attached into the first part of the script which tell you how to call the other pages ypou wish to make links to.

If you don't write the URL variables correctly it will not work !!

Also it wouln't be difficult to modify the script, to reduce the number of URL variables if you were calling them all from the same place in the web site.

Thnaks for readin my little post

regards

Minty the Dalek

:-)



Dear moderator,

I do not mean to infringe any copyrights but only to enhance your scripts.
Please add this to the page on the site that indexes the Ajax dynamic content if you see fit and think it worthy of listing on what is such a well used resource.

regards

Minty the Dalek

ddadmin
07-28-2008, 05:26 AM
Minty the Dalek, please start your own thread (http://www.dynamicdrive.com/forums/forumdisplay.php?f=2) when asking a question.