Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Jquery UI error
Message
De
13/04/2015 03:52:41
 
 
À
12/04/2015 13:41:48
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01618237
Message ID:
01618276
Vues:
48
J'aime (1)
>I am trying to create an html5, jquery, webapi application and can't even get by the first page, since all of this in brand new to me.
>
>I added the nugget package jquery ui and after install tried to use their accordion tool. I have verified via developer tools that to code.jquery.com are returning valid css and script. I coped most of the code from the jquery ui demo page.
>
>When run, I get the following error message on the call to: $("#accordion").accordion();
> Unhandled exception at line 99, column 21 in http://localhost:64779/Home/Index
> 0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'accordion'
>
>
>Can anybody see what's wrong? Much appreciated.

I assume you mean this code : https://jqueryui.com/accordion/ ?
I did a quick test using the same libraries (see code below) which ran fine. If I comment the loading of jquery-ui I get the above error which implies that in your version it is not getting loaded (which, given your reply to Dmitry doesn't seem to be the case) or is being overwritten by something in the bundles.

Suggestions:
1. Get rid of the bundles.
2. Put a breakpoint on ' $("#accordion").accordion();' and see what ' $("#accordion") ' gives in the watch window

IAC, FWIW I'd agree with all that Rick wrote - try angular/bootstrap then you can forget jquery-ui (and probably jquery itself)

Working code (just adjust the script paths):
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>jQuery UI Accordion - Default functionality</title>
    <link href="Content/themes/base/all.css" rel="stylesheet" />
    <script src="Scripts/jquery-2.1.3.js"></script>
    <script src="Scripts/jquery-ui-1.11.4.js"></script>
    <script>
        $(function () {
            $("#accordion").accordion();
        });
    </script>
</head>
<body>
As sample code.....
</body>
</html>
P.S. : Contrary to how it shows in preview you can enclosed HTML code in pre tags in UT
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform