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 8741341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:17:43+00:00 2026-06-13T11:17:43+00:00

I’m having problems with one of my anchors when clicked, it throws TypeError: obj

  • 0

I’m having problems with one of my anchors when clicked, it throws TypeError: obj is null on a single item. All others work perfectly, there are no differences in the objects that are being passed. In a list of 4 of the same items, there is only one that errors. All console.logs show no data that isn’t set. I’ve come to a part where I’m just utterly stuck with debugging.

    $('.admin-user-list-click').live('click', function(evt) {
        evt.preventDefault();
        var user_id = $(this).attr('user_id');
        var screen_id = $(this).attr('screen_id');
        var href = $(this).attr('href');
        var last_updated = $(this).attr('updated');
        var last_login = $(this).attr('last_login');
        var user_data = [];
        var template_structure = {logged_in: 'last_login', last_updated: 'last_updated', user_data: user_data, screen_id: screen_id, screen_data: [], identifier: 'screen'};
        var displayContainer = $(this).closest('.admin-page').find('.admin-display');
        $.ajax({
            url: href + '/index/'+user_id,
            success: function(data){
                //Basic user information
                var result = $.parseJSON(data);
                $.each(result, function(k, v) {
                    user_data.push({identifier: k, data: v});
                });
                $.ajax({
                    url: href + '/get_user_data/'+user_id,
                    success: function(data){
                        //Question and answers from registeration
                        var decode = $.parseJSON(data);
                        template_structure.screen_data = decode;
                        console.log(displayContainer)
                        console.log(pending_template)
                        console.log(template_structure)
                        console.log(pending_template(template_structure))
                        displayContainer.html(pending_template(template_structure));
                    }
                })

            }// closure of success
        })

}); //closure of click event

Output of console.log(displayContainer) [div.admin-display]


Output of console.log(pending_template) function()


Output of console.log(template_structure) Object { logged_in= "2012-10-26 08:40:16", user_data=[14], screen_id= "0001", more...}


Output of console.log(pending_template(template_structure)) shows nothing

The line in question is on 583 in jquery.1.8.2

// args is for internal usage only
each: function( obj, callback, args ) {
    var name,
        i = 0,
        length = obj.length, //this is the line that errors

When console.log(obj) it shows
When errored
Jquery logs on errored

When it works
Jquery logs on working

  • 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-13T11:17:44+00:00Added an answer on June 13, 2026 at 11:17 am

    Problem was due to the handlebar helper I had created

    Handlebars.registerHelper('json_check', function(answer, answer_type) {
        if(answer_type == 'json' && answer !== ''){
            text = '';
            var response = $.parseJSON(answer);
            $.each(response, function(key, value) {
                text += "<p>"+key+"</p><p>"+value+"</p>";
            });
            return new Handlebars.SafeString(text);
        } else {
            return answer;
        }
    });
    

    The problem was that at first I wasn’t checking if answer was an empty string. So trying to parseJson an empty string threw the error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I'm trying to create an if statement in PHP that prevents a single post
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm making a simple page using Google Maps API 3. My first. One marker

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.