Since I don't see anything actually creating the tabset elements, I am
working on the assumption that TabSet.makeTabs() is utilizing
document.write() to do its work (like Thawte's script in my example).

---------------------------------------------------------------
<div id="tabset"></div>

<script type="text/javascript">
function createTabset() {
        var tabs = new TabSet();

        tabs.addTab('Prices', '<?=$prices_table?>',
        'tabs_price_normal', 'tabs_price_highlight');
        tabs.addTab('Ratings', '<?= $ratings; ?>');
        tabs.addTab('Photos', '<?= $slides; ?>');

        tabs.makeTabs('tabs_<?= $hotel->table_id; ?>');
}//createTabset()

function sortStuff() {
        $('div#tabset').empty();        //clear existing tabset

        //do your sorting
        //...

        //rereate tabset in its div
        createTabset();
}//sortStuff()

//document ready statements
$(function() {
        //replace doc.write() to work with external object's method
        document.write = (function () {
                for (var i = 0; i < arguments.length; i++) {
                        $('div#tabset').append(arguments[i]);
                }
        });

        //create tabset in its div
        createTabset();
});//$.ready()
</script>
---------------------------------------------------------------

One gotcha is that the overridden document.write() will now append to
that one div for everything that calls it on this page.

This may serve as a starting point, however.

Pyro

> <div class="tabset">
>     <script type="text/javascript">
>         //<![CDATA[
>             try {
>                 var tabs = new TabSet();
>
>                 tabs.addTab('Prices', '<?=$prices_table?>',
> 'tabs_price_normal', 'tabs_price_highlight');
>                 tabs.addTab('Ratings', '<?= $ratings; ?>');
>                 tabs.addTab('Photos', '<?= $slides; ?>');
>
>                 tabs.makeTabs('tabs_<?= $hotel->table_id; ?>');
>
>             } catch (e) {
>                 alert(e);
>             }
>         //]]>
>     </script>
> </div>
>
> This code loads fine and the tabs stuff(not my javscript code) creates divs
> with content in them.  In the sort I sort that data i need to and this block
> of code is part of a big div that get reordered.  At first when i was doing
> this, after reordering the links for the tabs were messed up.  So now what i
> am doing is when i reorder, i remove the html content this javascript create
> so that it can recreate it will the correct linking.  This works fine in FF
> but when i tried it is IE, the javascript code does not seem to be running
> because it is not recreating the tab divs and stuff.  This is the best i can
> explain it and the most code i can show, if it is not enough then i am
> sorry.  Worst case is i have to reload the page to sort.
>
>
>
> Pyrolupuswrote:
>
> > Can you give a code example or a more precise description of your
> > issue?
>
> > I had to overcome a remote script's use of document.write(), but it
> > works properly in all the browsers I test (FF 2, Saf 3, Op 9, IE 6/7):
>
> >http://pyrolupus.com/demo/thawte.html
>
> > In it, a remote script changes the contents of a div.  However, I
> > don't know if this applies to your problem.
>
> > Pyro
>
> > On Sep 10, 2:04 pm, Eridius <[EMAIL PROTECTED]> wrote:
> >> That that is not the issue.  it is not on an event, just plain javascript
> >> that should when it is parsed.
>
> >> Glen Lipka wrote:
>
> >> > Have you tried the Live jQuery plugin?  I'm not sure if this is
> >> applicable
> >> > for your needs.
>
> >> > Glen
>
> >> > On 9/10/07, Eridius <[EMAIL PROTECTED]> wrote:
>
> >> >> I have a script that reorder some content an this content includes
> >> >> javascript
> >> >> that runs.  I basically take the html/javscript text and put it into a
> >> >> variable in the correct order and then i empty out the current content
> >> >> and
> >> >> replace is with the new content.  Now if FF, this works fine because
> >> the
> >> >> javscript gets ran when i load the content dynamically but in IE 7 the
> >> >> javscript does not seems to get run and was wondering if this is an
> >> issue
> >> >> known about IE?

Reply via email to