Results 1 to 4 of 4

Thread: Ajax Tabs, iframes, javascripts....

  1. #1
    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!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    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

  3. #3
    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

  4. #4
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •