Results 1 to 7 of 7

Thread: Loading another script into ajax content

  1. #1
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Loading another script into ajax content

    1) Script Title: Ajax Tabs Content Script (v 2.2)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tent/index.htm

    3) Describe problem:
    HTML Code:
    <ul id="countrytabs" class="shadetabs">
    <li><a href="#" class="selected" rel="#default">Tab 1</a></li>
    <li><a href="external2.htm" rel="countrycontainer">Tab 2</a></li>
    <li><a href="external3.htm" rel="countrycontainer">Tab 3</a></li>
    <li><a href="external4.htm" rel="#iframe">Tab 4</a></li>
    <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li>
    </ul>

    HTML Code:
    <div id="countrydivcontainer" style="border:1px solid gray; width:450px; margin-bottom: 1em; padding: 10px">
    //Optional default content here.
    </div>
    I want to use another script in external2.htm but i dosn`t works!


    somebody has an idea?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    AJAX doesn't load scripts. Use the rel="#iframe" method for that page.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    hello -

    Yes - i use iframe for the scripts! but the thing is, if the user click on "send" (textbox for comments) - Ajax dosn`t load the first page #default!

    And thatīs why i`m asked!

    is there a way to point the iframe tab after reloading to #default? If i choose in the iframe-link target=_top oder target=_parent the tab will come alone!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This now sounds like a separate issue. Instead of running a script, now you want to link from inside one tab to another tab, is that correct? Do you need to do both (run a script in a tab and from the same tab also be able to link to another tab)?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Tommy7 (05-02-2008)

  6. #5
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    i have 3 tabs...

    Read comments (Default) - Make a comment - Info

    so if the user writing now a comment - after sending he will jump to Read comments)

    and now my problem -

    i need for textboxes 1 script (Editor) In the <head> i`m loading it and the textbox got an id and this works but ajax block this script!

    Than - i was using iframe - works good but the only one thing is - if the user now send the comment he will see the comment box again and if i use target=_top - the comment box will come alone!

    is there a way - to use the #default function in iframe?

  7. #6
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    is here a place free to say ajax load #default?

    HTML Code:
    <input type="submit" value="Send" class="input">

  8. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm having a little trouble understanding you because I think you aren't using the technical terms I am used to when describing the situation. I do understand the overall idea pretty much though.

    To get an iframe to run a function on the top page, say the function on the top page is:

    Code:
    function hi(){alert('Hello!');
    In the iframe you would call:

    Code:
    top.hi();
    If you have:

    HTML Code:
    <ul id="countrytabs" class="shadetabs">
    <li><a href="#" class="selected" rel="#default">Tab 1</a></li>
     . . .
    and:

    Code:
    var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
     . . .
    on the top page, you should be able to do this from inside the iframe:

    HTML Code:
    <a href="javascript:top.countries.expandit(0);">Whatever</a>
    to create a link to the default tab that will be displayed in the tabs. However, passing information to it, will not work using this method. You may need to reload the top page in order to do that, or at least modify the script somewhat. Are you trying to pass information from the iframe to the top page, or just trying to get the top page to display its default content that it has stored in a javascript variable?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Tommy7 (05-02-2008)

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
  •