This is driving me nuts. I'm a JQuery noob and this is my first go at using it. I've followed the example on the jQuery-ui web site, but my script fragment gives an error:
on line $("#tabs").tabs();
Error: 0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'tabs'
So, here's what I'm doing. I am developing an ASP.NET MVC4 web app. The jQuery scripts and styles are in the default bundles for the site, and are rendered in my _Layout.cshtml 'master page', like so:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
</head>
Here is my View:
@using Tigra.eStore.BusinessLogic.DomainObjects
@model Tigra.eStore.Storefront.Models.ProductDetailsViewModel
@{
ViewBag.Title = "Details";
}
<h2>Details</h2>
<fieldset>
<legend>@Model.Product.Name</legend>
<div class="display-field">
@Html.DisplayFor(model => model.Product.Name)
</div>
</fieldset>
<p>
@Html.ActionLink("Add to Cart", "Add", "ShoppingCart", new {id = Model.Product.Id}, new {})
@Html.ActionLink("Back to List", "Index")
</p>
<script>
$(function() {
$("#tabs").tabs();
});
</script>
<div class="descriptors">
<div id="tabs">
<ul>
@foreach (ProductDescriptor descriptor in Model.Product.ProductDescriptors)
{
<li><a href="#tabs-@descriptor.SequenceNumber">@descriptor.Title</a></li>
}
</ul>
@foreach (ProductDescriptor descriptor in Model.Product.ProductDescriptors)
{
<div id="tabs-@descriptor.SequenceNumber">
<p>@descriptor.Description</p>
</div>
}
</div>
</div>
I'm pretty sure that jQuery-ui is getting loaded, because it shows up at runtime like so:
It's got to be something simple - sorry if this is blindingly obvious but as I said, I'm a noob at this stuff. Can you see what I'm doing wrong?