PDA

View Full Version : ajax tabs content



nikomou
08-12-2008, 04:55 PM
Hello, i'm using the ajax tabs content (found here http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/)

Just wondering if there was a way only allow the "external.html" pages to load within the script? and to redirect if this is the case..

Thanks guys.

ddadmin
08-12-2008, 08:15 PM
Assuming you're using the IFRAME mode to display "external.htm", you can add a simple script inside the later to check that the page is being loaded within a FRAME, and if not, redirect to the main page showing Ajax Tabs Content. So inside "external.htm", you'd add something like:


<script type="text/javascript">

if (parent.frames.length==0){ //if not being viewed inside frame
location.replace("http://mysite.com/ajaxtabs.htm")
}

</script>

This doesn't work if the external page is being included using Ajax, however.

nikomou
08-13-2008, 10:18 AM
thanks, but i am not using the iframe. pages are called using ajax.

nikomou
08-13-2008, 10:22 AM
just thought i'd check, and this does work even if the pages are called using ajax! thank you!