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

  • Home
  • SEARCH
  • 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 8230593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:11:15+00:00 2026-06-07T17:11:15+00:00

My Goal: I am writing a widget for a job which will populate a

  • 0

My Goal: I am writing a widget for a job which will populate a div with contents. I dont even get to execute the information as get the error:
Uncaught Syntax Error: Unexpected Token Return

I wrote an object which executes this function as follows:

function TreeView(){
    this.rebuild = contructRoot();
}

function constructRoot(){
    var resultant = ajax_Request();
    var content = $(resultant);

    var root = $("<div>");
    var root_nodes = ajax_Request("/startTreeAJAX");
    root_nodes.split("|");
    root.html(
        $("<div>").html(
            $("<ul>").append($('<li>').html(root_nodes[0])).append($("<li>").html(root_nodes[1]))
        )
    );
    root.find("li").click(function(){
        clickExpand(this);
    });

    return root.html();
}

I am trying to essentially return the elements contents.

  • 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-07T17:11:16+00:00Added an answer on June 7, 2026 at 5:11 pm

    The closing ) of the .click() is missing, and don’t forget to close your function definition with } after the return. When you see a syntax error like an unexpected token, start looking to the things immediately before it to find your problem…

      root.find("li").click(function(){ 
         clickExpand(this);
      }); // <----
    
      return root.html();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a web-framework for Python, of which the goal is to be
I am writing an client application in C# which will be supposed to change
I'm re-writing alibrary with a mandate to make it totally allocation free. The goal
I'm having trouble reading and writing QByteArray data to a file. My goal is
Goal: Produce an Excel document with information from 3 associated models that is similar
I am writing a qt application, with the goal of it being portable to
I am writing a game in XNA. The first main goal is to have
I'm writing this bookmarklet in Javascript, which is also calling some JQuery objects. The
I am writing a program in C++ which involves parsing a lot of text
At the moment, I have a goal of writing an application that contains a

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.