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

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-07-2008, 05:41 PM
supa dupa supa dupa is offline
New Comer (less than 5 posts)
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ajax Tabs, iframes, javascripts....

1) Script Title: Ajax Tabs

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...axtabscontent/

3) Describe problem:

Question.... I understand that you can't use Javascript within the ajax version of this script, so I did use iframes...

A. Seems like I read somewhere that you should avoid iframes? Is this still the case and if so why?

B. The iframe does work greatly except for one issue. The iframe I need to use is rather small (about 200 pixels high.) Problem is that the javascript I am using is for a pop-up video window that is taller than this so that the video pops up within the iframe but the top and bottom visibly get cut off. (The height of the iframe does need to be exact for design reasons.) So, it appears that my only solution would be to use the ajax version, but it appears that that is a no-can-do.

It appears that there isn't any solution for this, but just wanted to double check to see if anyone had any ideas.

Thanks for your help and for the great script!
Reply With Quote
  #2  
Old 08-08-2008, 07:14 AM
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

a) I haven't personally run across any threads saying you should avoid IFRAMEs, at least when it comes to this script.

b) The height of the IFRAME defaults to the height of your content container DIV. If you increase the DIV's height, it should cause the IFRAME to heighten as well. Or inside the .js file, you can explicitly set a height for the IFRAME with the code in red:

Code:
	this.defaultIframe='<iframe src="about:blank" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" class="tabcontentiframe" style="width:100%; height:auto; min-height: 100px; height: 300px"></iframe>'
__________________
DD Admin
Reply With Quote
  #3  
Old 08-13-2008, 10:53 PM
supa dupa supa dupa is offline
New Comer (less than 5 posts)
 
Join Date: Aug 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ddadmin. Just saw your reply. I actually was able to solve this issue. I wasn't able to use the iframe because the iframe by design had to be short vertically and the pop-up videos were taller so it didn't look right. Thankfully all of the pop-ups used the same javascript that was already on the top page, so my issues were fixed when I just adjusted some code.

However...... I do have one other question. I am using drop down menus on my site, however, when this is run:

<script language="JavaScript1.2" type="text/javascript">mmLoadMenus();</script>

It really adds to the loading time of the page as I have a lot of menus. So, I was going to use the Ajax Tabs as basically an On and Off button to make these drop down menus appear and dissapear. So, I don't need to dynamically load any javascript in the head, but I do need to load the mmLoadMenus line above right after the Body tag.

I have tried:

putting mmLoadMenus() in the onajaxpageload area

I have tried the POLL method mentioned in another thread.

Any other possible solutions in this case?

Thanks very much!

supa
Reply With Quote
  #4  
Old 08-14-2008, 06:56 AM
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

Hmm using the Ajax Tabs content script to render and display a script dynamically only works if you're using the IFRAME mode of the later, which probably isn't what you want. The problem is that mmLoadMenus(); most likely contains run time JavaScript (ie: using document.write() or .innerHTML inside the code) that will fail if you try to invoke them dynamically using Ajax, hence their "run time" nature.

For the sake of ease of mantainance down the line, I'd just try and compress the menu script as much as possible using the available JavaScript compressors out there.
__________________
DD Admin
Reply With Quote
Reply

Bookmarks

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 01:09 AM.

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

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