Results 1 to 5 of 5

Thread: new external link in same tab

  1. #1
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default new external link in same tab

    1) Script Title:
    Ajax Tabs Content script
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...axtabscontent/
    3) Describe problem:
    I'm trying to upload new external link in same tab.
    can i do that?
    how to?

  2. #2
    Join Date
    Aug 2004
    Posts
    9,889
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    Do you mean load the contents of an external link (ie: http://google.com) inside your page via Ajax when a tab is clicked on? Unfortunately due to security reasons Ajax doesn't allow loading of external sites using it. Something like Tab Document Viewer, which uses iframes, would be what you're describing.

  3. #3
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy not that external

    no.
    lets say we are un the 3 tab and just load example_2.html and we want to load in the same tab example_3.html instade of example_2.html
    Last edited by Gil coder; 03-15-2007 at 11:26 AM. Reason: smile

  4. #4
    Join Date
    Mar 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy still not working

    please help

  5. #5
    Join Date
    Aug 2004
    Posts
    9,889
    Thanks
    3
    Thanked 964 Times in 953 Posts
    Blog Entries
    15

    Default

    I see what you mean. So after loading an external page inside a DIV, you want that page to in turn contain a link that loads another page inside the same DIV, replacing itself?

    There's currently no prebuilt way to do multiple levels of loading pages into a DIV. You can hack it, but it's not exactly intuitive. Inside ajaxtabs.js file, add to it at the very end the below function:

    Code:
    function directloadpage(tabcontentid, divid, tabnumber, url){
    var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
    ajaxpage(url, divid, thetab)
    }
    Then, to create a link inside one of your external pages that loads another external page in the same DIV it currently occupies, do something like:

    Code:
    <a href="javascript: directloadpage('maintab', 'ajaxcontentarea', 0, 'external4.htm' )">Load external page!</a>
    Where

    1) "maintab" is the ID of your Ajax Tabs (the <ul> tag)
    2) "ajaxcontentarea" is the ID Of your DIV that contains the external pages loaded
    3) 0 is the tab number that should be selected when the page is loaded. 0=first tab, 1=second tab etc.
    4) And finally, "external4.htm" is the page on your server to load.

    Yep, you'll need to jump through a few hoops right now if you want to accomplish the above.

    p.s: Please don't start multiple threads on the same question. Dup deleted.

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
  •