Ask A Question


You’re not receiving notifications from this thread.

uncaught syntaxerror unexpected token ' var'

Jim Miller asked in Javascript

Hi all,

I am getting an error "uncaught syntaxerror unexpected token ' var'" . I'm using this JQuery plugin:
The error is showing up on "var updateTime.
Here is the page that I am adding it to:

Can anyone see what I am doing wrong?

Thanks ahead of time!


 var cl ={  cloud_name: 'downtown' });
 //Script for CountDownTimer
 $("#CountDownTimer").TimeCircles({ time: { Days: { show: false }, Hours: { show: false } }});
  var updateTime = function(){
   var date = $("#date").val();
   var time = $("#time").val();
   var datetime = date + ' ' + time + ':00';
   $("#DateCountdown").data('date', datetime).TimeCircles().start();

// Start and stop are methods applied on the public TimeCircles instance
 $(".startTimer").click(function() {
 $(".stopTimer").click(function() {

// Fade in and fade out are examples of how chaining can be done with TimeCircles
 $(".fadeIn").click(function() {
 $(".fadeOut").click(function() {
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 79,047+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.