views:

24

answers:

1

When I call the below in my code, after the element is loaded, the callback is being called but I get "Object does not support..." Any ideas why it can't find the tabs plugin even though I have jQuery and jQuery UI referenced. Another thing to note, is the filename for jQuery UI has two dots jquery-ui-1.8.5*..*min.js and unfortunately thats not the problem, the file is truly poorly named

<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="../../Scripts/jquery-ui-1.8.5..min.js"></script>
<script type="text/javascript">
    function LoadStuff() {
        $("#tabify").tabs(); //This is where it breaks
    }

    $(function () {
        $("#login").click(function () {
            $("#tabContainer").load('/Home/Login', $("#loginForm").serialize(), LoadStuff);
        });
    });
</script>

Here's the element I'm trying to load:

        <div id="tabContainer">
        </div>

Here's the element after loading:

        <div id="tabContainer">
            <div id="tabify">
                <ul>
                    <li><a href="http://localhost:51969/#stuff"&gt;Stuff&lt;/a&gt;&lt;/li&gt;
                    <li><a href="http://localhost:51969/#morestuff"&gt;More Stuff</a></li>
                </ul>
                <div id="stuff">
                    <input id="Radio2" type="radio" name="Ace"><label for="Ace">Ace</label>
                </div>
                <div id="morestuff">
                    <input id="Radio1" type="radio" name="broden"><label for="broden">broden</label>
                </div>
            </div>
        </div>

Thanks in advance!

A: 

The problem is still probably in an inappropriately referenced jQuery UI .js file. Why does your file have 2 dots? The downloaded version is:

jquery-ui-1.8.5.custom.min.js

or:

jquery-ui-1.8.5.min.js

You can also include it directly from the google CDN, for example:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"&gt;&lt;/script&gt;
Nick Craver
The filename has the two dots because I accidentally didn't remove one when renaming without "custom" in the filename. Also, it doesn't seem to be a pathing issue because I am using VS2K10 and its picking up the intellisense from the js file so it doesn't seem to be there. My speculation is: in the completed event am I in the context of the resulting content? If so, that content doesn't contain a reference to any libs since its just a piece of the page?
Benny
@Benny - is it possible you're including jQuery *again* later in the page?
Nick Craver
@Nick, looks like the naming was causing problems. I changed both the physical filename and the reference to the file to exclude one of the dots and it works now. Thanks!
BennyT