jQuery Ajax Success Call jQuery UI
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">Stuff</a></li>
<li><a href="http://localhost:51969/#morestuff">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!
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"></script>
精彩评论