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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:12:50+00:00 2026-06-18T23:12:50+00:00

Often ( too often ) I get this error in chrome console. I really

  • 0

Often ( too often ) I get this error in chrome console. I really can’t find any syntacs error in my javascript code

When I try to locate where this error happen in google chrome, it always shows this:

chrome javascript error

It shows that error is on the beginning of the file ( somewhere around DOCTYPE ). Is this just that chrome doesn’t show more infos or I messed up with inclusion of the files somewhere? ( or maybe even syntacs? ).
Either way, I can’t locate it with help of debug console


this is global.js:

(function() { 

    $("#btadd").click(function() { 

        $(".newlist").slideUp();
        return false;

    });


})();

this is html:

<div class="newlist" style="display:none">
<h4>Title: <input type="text"/></h4>
</div>
<br />
   <a href="javascript:void()" id="btadd"><span>Add New</span></a>
  • 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-18T23:12:51+00:00Added an answer on June 18, 2026 at 11:12 pm

    Change this:

    (function() { 
        $("#btadd").click(function() { 
            $(".newlist").slideUp();
            return false;
        });
    })();
    

    to this:

    $(function () {
        $("#btadd").click(function () {
            $(".newlist").slideUp();
            return false;
        });
    });
    

    Or move your existing JavaScript to the end of the body. You created a self-invoking anonymous function that’s executing before the elements it applies to have been loaded. This would work fine once the DOM is fully loaded, but since it’s in the head of your document it runs too early. By using the example I showed you you’re using jQuery’s document ready event to run the code.

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

Sidebar

Related Questions

I get this message too often and think that it is not usual, how
I don't see this problem too often but I've got a .cshtml that uses
I can't get my head around this: I have an instance of NSMutableArray filled
In the Seam Reference Guide, one can find this paragraph: We can set a
I still often use console output to get ideas what's going on in my
I'm trying to get my code error and notice free. Therefore I should check
I am finding myself doing the following a bit too often: attr = getattr(obj,
I've learned the basic/intermediate levels of VIM (it's too vast to list). I often
Often times I write some SQL like this: string sql = @ -- Multi-line
Often, when restarting Django runserver, if I use the same port number, I get

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.