$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>javascript - Uncaught SyntaxError: Invalid destructuring assignment target - Stack Overflow|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Uncaught SyntaxError: Invalid destructuring assignment target - Stack Overflow

matteradmin16PV0评论

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.

Share Improve this question edited May 31, 2019 at 16:14 Rory McCrossan 338k41 gold badges320 silver badges351 bronze badges asked May 31, 2019 at 16:10 Anuj BurnwalAnuj Burnwal 411 silver badge7 bronze badges 5
  • Your syntax is incorrect. You cannot define an object in the arguments of a function. Exactly what are you expecting this code to do? – Rory McCrossan Commented May 31, 2019 at 16:13
  • Also note that you have an extra ) in there, but I assume this is a typo when writing the question – Rory McCrossan Commented May 31, 2019 at 16:14
  • 1 @Rory - please clarify: You cannot define an object in the arguments of a function – Randy Casburn Commented May 31, 2019 at 16:16
  • See MDN, or @Ian's answer below: stackoverflow./a/56398576/519413. – Rory McCrossan Commented May 31, 2019 at 16:19
  • Thanks, for the reply I solved the issue, the issue came because of javascript version. – Anuj Burnwal Commented Jun 3, 2019 at 7:55
Add a ment  | 

1 Answer 1

Reset to default 4

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.

Post a comment

comment list (0)

  1. No comments so far