dimanche 22 février 2015

jquery uncaught typeerror: undefined is not a function when file is .php


I am trying to figure this out. When my page is .html everything works just fine, but if I do this in a .php file I get:


jquery uncaught typeerror: undefined is not a function


Can anyone explain or tell me what i am missing here?



jQuery(document).ready(function($)
{
var $draggable_portlets = $(".draggable-portlets");

$(".draggable-portlets .sorted" ).sortable({
connectWith: ".draggable-portlets .sorted",
handle: '.panel-heading',
containment: 'window',
start: function()
{
$draggable_portlets.addClass('dragging');
},
stop: function()
{
$draggable_portlets.removeClass('dragging');
}
});

$( ".draggable-portlets .sorted .panel-heading" ).disableSelection();

});


Any help is appreciated :-)


-------------- EDIT -------------


This is how the entire page is setup:



<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>

<!--<script src="assets/js/jquery-1.11.1.min.js"></script>-->
<script src="http://ift.tt/1yCEpkO"></script>

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="http://ift.tt/1xwklwE"></script>
<script src="http://ift.tt/1qIredN"></script>
<![endif]-->

<script type="text/javascript">


jQuery(document).ready(function($){

$(".draggable-portlets .sorted" ).sortable(function(){

});

});
</script>
</head>
<body>

This is an test

</body>
</html>


I still get the error in concern to this line:


$(".draggable-portlets .sorted" ).sortable(function(){


still hoping for help :-)





Aucun commentaire:

Enregistrer un commentaire