I have problem in my jquery code . Can any one help me regarding this error:
Uncaught SyntaxError: Invalid destructuring assignment target
$(function() {
$('#Events').on("slides", function({
generateNextPrev: true,
play: 5000,
pause: 2500,
hoverPause: true,
preload: true,
preloadImage: '/images/loading.gif'
});
// $('#slides_container').css("display", "inline");
);
});
This error is ing in this line generateNextPrev: true,
. Kindly guide me, what's the issue.
I have problem in my jquery code . Can any one help me regarding this error:
Uncaught SyntaxError: Invalid destructuring assignment target
$(function() {
$('#Events').on("slides", function({
generateNextPrev: true,
play: 5000,
pause: 2500,
hoverPause: true,
preload: true,
preloadImage: '/images/loading.gif'
});
// $('#slides_container').css("display", "inline");
);
});
This error is ing in this line generateNextPrev: true,
. Kindly guide me, what's the issue.
)
in there, but I assume this is a typo when writing the question
– Rory McCrossan
Commented
May 31, 2019 at 16:14
This is invalid syntax - take a look at the function declaration on line 1 vs line 2. I don't know what you're trying to acplish, but you must have a function body. You have this: .on("slides", function({...});
which has an unclosed parenthesis and no function body. .on("slides", function(parameters) {/*do stuff here*/});
is the syntax you need; I'm not really sure where the object is intended to go.