Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8489083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:43:37+00:00 2026-06-10T21:43:37+00:00

I get this: Uncaught SyntaxError: Unexpected end of input at the end of the

  • 0

I get this: Uncaught SyntaxError: Unexpected end of input at the end of the tag so I am missing a bracket or something but where oh where?

here my javascript code:

   <script type="text/javascript">

    var boxWidth = 133;
    var spaceBetween = 6;
    var stopScrolling = false;

    function addBoxToEnd() {

        var lastBox = $("div.property-carousel-box:last");
        var rightId = parseInt($(lastBox).attr("pageindex"), 10);
        var jsonUrl = '<%= Url.Action("NextProperty", "Carousel") %>/' + rightId;

        var itemLeft = (parseInt($(lastBox).css("left"), 10) * 1) + boxWidth + spaceBetween;
        $("div#property-carousel-box-container").append("<div class='property-carousel-box property-carousel-box-jquery' style='left: " + itemLeft + "px;'><div class='property-carousel-box-frame'></div></div>");

        $.getJSON(jsonUrl, function (data) {
          if (data != null) {
            var lastBox = $("div.property-carousel-box:last");
            $(lastBox).css("background", "url('" + data.ImageUrl + "') no-repeat");
            $("div.property-carousel-box:last > div.property-carousel-box-frame:first").append(data.Location + "<br />" + data.Rent);
            $(lastBox).attr("propertyid", data.PropertyId);
            $(lastBox).attr("pageindex", data.Page);
            $(lastBox).click(function () {
              location.href = '<%= Url.Action("Details", "Properties") %>/' + data.PropertyId;
            });

    }

    function addBoxToStart() {

        var firstBox = $("div.property-carousel-box:first");
        var leftId = parseInt($(firstBox).attr("pageindex"), 10);
        var jsonUrl = '<%= Url.Action("PreviousProperty", "Carousel") %>/' + leftId;

        var itemLeft = (parseInt($(firstBox).css("left"), 10) * 1) - boxWidth - spaceBetween;
        $("div#property-carousel-box-container").prepend("<div class='property-carousel-box property-carousel-box-jquery' style='left: " + itemLeft + "px;'><div class='property-carousel-box-frame'></div></div>");

        $.getJSON(jsonUrl, function(data) {
            if (data != null) {
                firstBox = $("div.property-carousel-box:first");
                $(firstBox).css("background", "url('" + data.ImageUrl + "') no-repeat");
                $("div.property-carousel-box:first > div.property-carousel-box-frame:first").append(data.Location + "<br />" + data.Rent);
                $(firstBox).attr("propertyid", data.PropertyId);
                $(firstBox).attr("pageindex", data.Page);
                $(firstBox).click(function() {
                  location.href = '<%= Url.Action("Details", "Properties") %>/' + data.PropertyId; 
            });
    }

    function scrollLeft() {
        // Add new box at the start
        addBoxToStart();

        $("div.property-carousel-box").each(function() {
            $(this).animate({ left: '+=' + (boxWidth + spaceBetween) }, 250);
        });

        // Now remove the box at the end
        $("div.property-carousel-box:last").remove();
    }

    function scrollRight() {
        // Add new box at the end
        addBoxToEnd();

        $("div.property-carousel-box").each(function() {
            $(this).animate({ left: '-=' + (boxWidth + spaceBetween) }, 250);
        });

        // Now remove the box at the start
        $("div.property-carousel-box:first").remove();
    }

    $(document).ready(function() {

        $("a#property-scroll-left").addClass("property-scroll-left-link");
        $("a#property-scroll-right").addClass("property-scroll-right-link");
        $("div#property-carousel-box-container").removeClass("property-carousel-box-container").addClass("property-carousel-box-container-jquery");
        $("div.property-carousel-box").addClass("property-carousel-box-jquery");

        var i = 0;
        $("div.property-carousel-box").each(function() {
            $(this).css('left', function() {
                var leftPos = (i * boxWidth) + (spaceBetween * (i + 1));
                return leftPos + 'px';
            });

            var propId = parseInt($(this).attr('propertyid'), 10);
            $(this).click(function() {
                location.href = '<%= Url.Action("Details", "Properties") %>/' + propId;
            });

            i++;
        });

        // Add an extra box at the start and end to have some time to load the new images
        // before they are moved into view.
        addBoxToEnd();
        addBoxToStart();


        $("a#property-scroll-left").click(function() {
            stopScrolling = true;
            scrollLeft();
            return false;
        });

        $("a#property-scroll-right").click(function() {
            stopScrolling = true;
            scrollRight();
            return false;
        });

        // Start the timer that performs the automatic scrolling
        $.timer(3000, function() {
            if (!stopScrolling)
                scrollRight();
            else {
                try {
                    timer.stop();
                } catch (Error) {
                    // Do nothing here...not sure why, but the timer plugin is still
                    // calling the timer.stop() command after the timer has been set to null.
                    // Not our code, so can't fix it.
                }
            }
        });
    });

</script>

where am i missing a bracket?
thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:43:39+00:00Added an answer on June 10, 2026 at 9:43 pm

    Pay attention to your $.getJSON functions, they are missing } for the if (data != null) and }); for the $.getJSON, so

        var boxWidth = 133;
        var spaceBetween = 6;
        var stopScrolling = false;
    
        function addBoxToEnd() {
    
            var lastBox = $("div.property-carousel-box:last");
            var rightId = parseInt($(lastBox).attr("pageindex"), 10);
            var jsonUrl = '<%= Url.Action("NextProperty", "Carousel") %>/' + rightId;
    
            var itemLeft = (parseInt($(lastBox).css("left"), 10) * 1) + boxWidth + spaceBetween;
            $("div#property-carousel-box-container").append("<div class='property-carousel-box property-carousel-box-jquery' style='left: " + itemLeft + "px;'><div class='property-carousel-box-frame'></div></div>");
    
            $.getJSON(jsonUrl, function (data) {
                if (data != null) {
                    var lastBox = $("div.property-carousel-box:last");
                    $(lastBox).css("background", "url('" + data.ImageUrl + "') no-repeat");
                    $("div.property-carousel-box:last > div.property-carousel-box-frame:first").append(data.Location + "<br />" + data.Rent);
                    $(lastBox).attr("propertyid", data.PropertyId);
                    $(lastBox).attr("pageindex", data.Page);
                    $(lastBox).click(function () {
                        location.href = '<%= Url.Action("Details", "Properties") %>/' + data.PropertyId;
                    });
                }
            });
        }
    
        function addBoxToStart() {
    
            var firstBox = $("div.property-carousel-box:first");
            var leftId = parseInt($(firstBox).attr("pageindex"), 10);
            var jsonUrl = '<%= Url.Action("PreviousProperty", "Carousel") %>/' + leftId;
    
            var itemLeft = (parseInt($(firstBox).css("left"), 10) * 1) - boxWidth - spaceBetween;
            $("div#property-carousel-box-container").prepend("<div class='property-carousel-box property-carousel-box-jquery' style='left: " + itemLeft + "px;'><div class='property-carousel-box-frame'></div></div>");
    
            $.getJSON(jsonUrl, function(data) {
                if (data != null) {
                    firstBox = $("div.property-carousel-box:first");
                    $(firstBox).css("background", "url('" + data.ImageUrl + "') no-repeat");
                    $("div.property-carousel-box:first > div.property-carousel-box-frame:first").append(data.Location + "<br />" + data.Rent);
                    $(firstBox).attr("propertyid", data.PropertyId);
                    $(firstBox).attr("pageindex", data.Page);
                    $(firstBox).click(function() {
                      location.href = '<%= Url.Action("Details", "Properties") %>/' + data.PropertyId;
                    });
                }
            });
        }
    
        function scrollLeft() {
            // Add new box at the start
            addBoxToStart();
    
            $("div.property-carousel-box").each(function() {
                $(this).animate({ left: '+=' + (boxWidth + spaceBetween) }, 250);
            });
    
            // Now remove the box at the end
            $("div.property-carousel-box:last").remove();
        }
    
        function scrollRight() {
            // Add new box at the end
            addBoxToEnd();
    
            $("div.property-carousel-box").each(function() {
                $(this).animate({ left: '-=' + (boxWidth + spaceBetween) }, 250);
            });
    
            // Now remove the box at the start
            $("div.property-carousel-box:first").remove();
        }
    
        $(document).ready(function() {
    
            $("a#property-scroll-left").addClass("property-scroll-left-link");
            $("a#property-scroll-right").addClass("property-scroll-right-link");
            $("div#property-carousel-box-container").removeClass("property-carousel-box-container").addClass("property-carousel-box-container-jquery");
            $("div.property-carousel-box").addClass("property-carousel-box-jquery");
    
            var i = 0;
            $("div.property-carousel-box").each(function() {
                $(this).css('left', function() {
                    var leftPos = (i * boxWidth) + (spaceBetween * (i + 1));
                    return leftPos + 'px';
                });
    
                var propId = parseInt($(this).attr('propertyid'), 10);
                $(this).click(function() {
                    location.href = '<%= Url.Action("Details", "Properties") %>/' + propId;
                });
    
                i++;
            });
    
            // Add an extra box at the start and end to have some time to load the new images
            // before they are moved into view.
            addBoxToEnd();
            addBoxToStart();
    
    
            $("a#property-scroll-left").click(function() {
                stopScrolling = true;
                scrollLeft();
                return false;
            });
    
            $("a#property-scroll-right").click(function() {
                stopScrolling = true;
                scrollRight();
                return false;
            });
    
            // Start the timer that performs the automatic scrolling
            $.timer(3000, function() {
                if (!stopScrolling)
                    scrollRight();
                else {
                    try {
                        timer.stop();
                    } catch (Error) {
                        // Do nothing here...not sure why, but the timer plugin is still
                        // calling the timer.stop() command after the timer has been set to null.
                        // Not our code, so can't fix it.
                    }
                }
            });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why do I get this error with this code: Uncaught SyntaxError: Unexpected token {
I am encountering a Uncaught SyntaxError: Unexpected end of input at the following code.
In running this on index.html, I get the following error: Uncaught SyntaxError: Unexpected token
In the following code i have error Uncaught SyntaxError: Unexpected token ; in line
I am getting the following error: Uncaught SyntaxError: Unexpected token ILLEGAL and this is
I get this error when I run the code below. I have normally used
I get this error in my app { error: { message: Missing client_id parameter.,
I'm only just learning javascript so I imagine this is relatively simple but it's
I am trying to get this switch statement to work, but I keep getting
I am experiencing the error Uncaught SyntaxError: Unexpected Token when trying to parse the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.