I used two jqueries library
<script src="/Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui.min.js" type="text/javascript"></script>
I have a function named onSubmit();
function onSubmit()
{if ($.trim($("#password").val()) != "") {
$("#Command").val("LOGIN");
}
}
When I try to use onSubmit function, intelicense in visual studio find it without any problem, but at run time I get error undefined onSubmit.
I try to use onSubmit function within this piece of code:
$(function () {
$("#slider").draggable({
axis: 'x',
containment: 'parent',
drag: function (event, ui) {
if (ui.position.left > 550) {
$("#well").fadeOut();
onSubmit(); //this line get undefined error
} else {
("opacity", 100 - (ui.position.left / 5))
}
},
stop: function (event, ui) {
if (ui.position.left < 551) {
$(this).animate({
left: 0
})
}
}
});
I declared onSubmit function at bottom of my codes after everythings. Im not sure if it cause problem.
UPDATE: I changed my declaration like this:
window.onSubmit()= function() {
if ($.trim($("#password").val()) != "") {
$("#Command").val("LOGIN");
}
}
onSubmitdefined? Can you provide a complete example?jquery-ui.min.js. May be thats causing problem...$(function () {.. }to$(document.ready(function () {..})..