Go Back   Dynamic Drive Forums > DD Scripts > Dynamic Drive scripts help
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 07-12-2008, 09:43 AM
aneeshtan aneeshtan is offline
Junior Coders
 
Join Date: Jul 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic tab script and external javascript files

Hi, your tutorials are really helpful to me . i have a problem ( challenging with for some days ) when i used this tab script (http://www.dynamicdrive.com/dynamici...suppliment.htm ) and i include other PHP files through tabs my only problem is that JavaScript in that file will be disabled and can not be read .

more explanation :
i have JavaScript files that are included in each of my php files . when i include php files in tab script and click on the tab the javascript in that php file can no be read .

any suggestion would be appreciated .
Reply With Quote
  #2  
Old 07-12-2008, 08:55 PM
ddadmin's Avatar
ddadmin ddadmin is offline
Administrator
 
Join Date: Aug 2004
Posts: 7,627
Thanks: 2
Thanked 639 Times in 629 Posts
Blog Entries: 13
Default

If the external pages contain JavaScript (especially run time scripts), you'll need to switch to using the IFRAME mode of fetching them for those tabs (versus Ajax mode).
Reply With Quote
  #3  
Old 07-12-2008, 10:01 PM
aneeshtan aneeshtan is offline
Junior Coders
 
Join Date: Jul 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks, I guessed that solution and i switched to using Iframe ( my only problem is how to create preloading for Iframe )

I used ( onload ( sth) ) but with no appropriate result.

It would be fine if you explain how to create a preload function for Iframe .

tanks
Reply With Quote
  #4  
Old 07-12-2008, 10:56 PM
ddadmin's Avatar
ddadmin ddadmin is offline
Administrator
 
Join Date: Aug 2004
Posts: 7,627
Thanks: 2
Thanked 639 Times in 629 Posts
Blog Entries: 13
Default

One way to preload the IFRAME contents it to load them inside invisible IFRAMEs when the page first loads. Inside the ajaxtabscontent.js, below the following line, add the lines in red to do this:

Code:
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
				if (this.tabs[i].getAttribute("rel")=="#iframe"){ //preload IFRAME contents
					document.write('<iframe src="'+this.tabs[i].href+'" style="position:absolute;left:0;top:0;visibility:hidden"></iframe>')
				}
Reply With Quote
  #5  
Old 07-12-2008, 11:40 PM
aneeshtan aneeshtan is offline
Junior Coders
 
Join Date: Jul 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I add your codes to the js file but to make it clear :

i want this code to be appear in tab section :

ddajaxtabssettings.loadstatustext="<img src='ajaxtabs/loading.gif' /> Requesting content..."

so there would be no difference between Iframe and ajaxcontent

My question is where to add it ?
Reply With Quote
Reply

Bookmarks

Tags
ajax tabs content, preload iframe contents

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:29 PM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.