$.contextMenu is not a function at HTMLDocument
up vote
0
down vote
favorite
I want to implement contextMenu Plugin but every time got error
$.contextMenu is not a function at HTMLDocument
I tried it like in the demo :
<script type="text/javascript">
$(function () {
$.contextMenu({
selector: '.context-menu-one',
callback: function (key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": { name: "Edit", icon: "edit" },
"cut": { name: "Cut", icon: "cut" },
copy: { name: "Copy", icon: "copy" },
"paste": { name: "Paste", icon: "paste" },
"delete": { name: "Delete", icon: "delete" },
"sep1": "---------",
"quit": {
name: "Quit", icon: function () {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
$('.context-menu-one').on('click', function (e) {
console.log('clicked', this);
})
});
</script>
<span class="context-menu-one btn btn-neutral">right click me</span>
I tried implement libraries by file:
<script src="~/Scripts/jquery.contextMenu.js"></script>
<script src="~/Scripts/jquery.ui.position.min.js"></script>
<link rel="stylesheet" href="~/Content/jquery.contextMenu.min.css">
and by cdnjs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.css"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.ui.position.js"></script>
Nothing works.
javascript jquery contextmenu
add a comment |
up vote
0
down vote
favorite
I want to implement contextMenu Plugin but every time got error
$.contextMenu is not a function at HTMLDocument
I tried it like in the demo :
<script type="text/javascript">
$(function () {
$.contextMenu({
selector: '.context-menu-one',
callback: function (key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": { name: "Edit", icon: "edit" },
"cut": { name: "Cut", icon: "cut" },
copy: { name: "Copy", icon: "copy" },
"paste": { name: "Paste", icon: "paste" },
"delete": { name: "Delete", icon: "delete" },
"sep1": "---------",
"quit": {
name: "Quit", icon: function () {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
$('.context-menu-one').on('click', function (e) {
console.log('clicked', this);
})
});
</script>
<span class="context-menu-one btn btn-neutral">right click me</span>
I tried implement libraries by file:
<script src="~/Scripts/jquery.contextMenu.js"></script>
<script src="~/Scripts/jquery.ui.position.min.js"></script>
<link rel="stylesheet" href="~/Content/jquery.contextMenu.min.css">
and by cdnjs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.css"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.ui.position.js"></script>
Nothing works.
javascript jquery contextmenu
api.jquery.com/contextmenu You seem to have to target it at a specific element.
– Dennis Lukas
Nov 7 at 13:49
3
Your example with cdn is completely works for me: jsfiddle.net/extempl/1dr4tLe8
– extempl
Nov 7 at 13:50
Problem was solved by set up code outside of Jquery $(function () {}) . But my question is why now it works ?
– Peter Tomašovič
Nov 8 at 11:03
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to implement contextMenu Plugin but every time got error
$.contextMenu is not a function at HTMLDocument
I tried it like in the demo :
<script type="text/javascript">
$(function () {
$.contextMenu({
selector: '.context-menu-one',
callback: function (key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": { name: "Edit", icon: "edit" },
"cut": { name: "Cut", icon: "cut" },
copy: { name: "Copy", icon: "copy" },
"paste": { name: "Paste", icon: "paste" },
"delete": { name: "Delete", icon: "delete" },
"sep1": "---------",
"quit": {
name: "Quit", icon: function () {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
$('.context-menu-one').on('click', function (e) {
console.log('clicked', this);
})
});
</script>
<span class="context-menu-one btn btn-neutral">right click me</span>
I tried implement libraries by file:
<script src="~/Scripts/jquery.contextMenu.js"></script>
<script src="~/Scripts/jquery.ui.position.min.js"></script>
<link rel="stylesheet" href="~/Content/jquery.contextMenu.min.css">
and by cdnjs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.css"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.ui.position.js"></script>
Nothing works.
javascript jquery contextmenu
I want to implement contextMenu Plugin but every time got error
$.contextMenu is not a function at HTMLDocument
I tried it like in the demo :
<script type="text/javascript">
$(function () {
$.contextMenu({
selector: '.context-menu-one',
callback: function (key, options) {
var m = "clicked: " + key;
window.console && console.log(m) || alert(m);
},
items: {
"edit": { name: "Edit", icon: "edit" },
"cut": { name: "Cut", icon: "cut" },
copy: { name: "Copy", icon: "copy" },
"paste": { name: "Paste", icon: "paste" },
"delete": { name: "Delete", icon: "delete" },
"sep1": "---------",
"quit": {
name: "Quit", icon: function () {
return 'context-menu-icon context-menu-icon-quit';
}
}
}
});
$('.context-menu-one').on('click', function (e) {
console.log('clicked', this);
})
});
</script>
<span class="context-menu-one btn btn-neutral">right click me</span>
I tried implement libraries by file:
<script src="~/Scripts/jquery.contextMenu.js"></script>
<script src="~/Scripts/jquery.ui.position.min.js"></script>
<link rel="stylesheet" href="~/Content/jquery.contextMenu.min.css">
and by cdnjs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.css"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.contextMenu.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.7.1/jquery.ui.position.js"></script>
Nothing works.
javascript jquery contextmenu
javascript jquery contextmenu
asked Nov 7 at 13:46
Peter Tomašovič
163
163
api.jquery.com/contextmenu You seem to have to target it at a specific element.
– Dennis Lukas
Nov 7 at 13:49
3
Your example with cdn is completely works for me: jsfiddle.net/extempl/1dr4tLe8
– extempl
Nov 7 at 13:50
Problem was solved by set up code outside of Jquery $(function () {}) . But my question is why now it works ?
– Peter Tomašovič
Nov 8 at 11:03
add a comment |
api.jquery.com/contextmenu You seem to have to target it at a specific element.
– Dennis Lukas
Nov 7 at 13:49
3
Your example with cdn is completely works for me: jsfiddle.net/extempl/1dr4tLe8
– extempl
Nov 7 at 13:50
Problem was solved by set up code outside of Jquery $(function () {}) . But my question is why now it works ?
– Peter Tomašovič
Nov 8 at 11:03
api.jquery.com/contextmenu You seem to have to target it at a specific element.
– Dennis Lukas
Nov 7 at 13:49
api.jquery.com/contextmenu You seem to have to target it at a specific element.
– Dennis Lukas
Nov 7 at 13:49
3
3
Your example with cdn is completely works for me: jsfiddle.net/extempl/1dr4tLe8
– extempl
Nov 7 at 13:50
Your example with cdn is completely works for me: jsfiddle.net/extempl/1dr4tLe8
– extempl
Nov 7 at 13:50
Problem was solved by set up code outside of Jquery $(function () {}) . But my question is why now it works ?
– Peter Tomašovič
Nov 8 at 11:03
Problem was solved by set up code outside of Jquery $(function () {}) . But my question is why now it works ?
– Peter Tomašovič
Nov 8 at 11:03
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53190732%2fcontextmenu-is-not-a-function-at-htmldocument%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
api.jquery.com/contextmenu You seem to have to target it at a specific element.
– Dennis Lukas
Nov 7 at 13:49
3
Your example with cdn is completely works for me: jsfiddle.net/extempl/1dr4tLe8
– extempl
Nov 7 at 13:50
Problem was solved by set up code outside of Jquery $(function () {}) . But my question is why now it works ?
– Peter Tomašovič
Nov 8 at 11:03