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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:06:42+00:00 2026-06-17T12:06:42+00:00

I am trying to learn how to debug jquery. I tried to make a

  • 0

I am trying to learn how to debug jquery. I tried to make a page which will dynamically add input feilds. The data is sent to the jquery. Now for debugging, I tried to console.log the whole array, but I am getting this error in Firefox:

[17:40:27.073] The character encoding of the HTML document was not
declared. The document will render with garbled text in some browser
configurations if the document contains characters from outside the
US-ASCII range. The character encoding of the page must be declared in
the document or in the transfer protocol. @
file:///Users/ateevchopra/Desktop/takemehome%20dynamic/TakeMeHome/index.html

Please explain what this means of if there is some mistake in my code. Heres my code

HTML:

<!doctype html>
<html>

 <head>
    <title>TakeMeHome</title>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.1.custom.min.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <script type='text/javascript' src='js/app.js'></script>

  </head>

  <body>
    <center><form id="details">
      Your Place:<input id="source" type="text"><br><br>
      Friend1:<input id="friend1" type="text"><br><br>
      <div id="friends"></div>
      <div id="button">Add!</div><br><br>

       <input type="submit" value="go">
    </form>
  </body>

</html>

jQuery:

 var j=2;
var friends = [];


$(document).ready(function(){

    $('#button').click(function(){
      if(j<11){
          $('#friends').append('Friend'+j+':<input type="text" id="friend'+j+'"/><br/><br/>'); 
        j++;
      }
     else
      {
     alert("Limit reached");
   }
    });



});


$("form").submit(function(){

    friends[0] = ('#source').val();
    for(var i=1;i<j;i++)
    {
        friends[i] = ('#friends'+i+'').val();
    }

    console.log(friends);
});
  • 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-17T12:06:43+00:00Added an answer on June 17, 2026 at 12:06 pm

    your code is working perfectly you can see it from this
    console.log is good for debuging but i prefer you to use firebug for debuging.
    Using firebug you can debug each and every line and you can also view the values of each variable.
    I am using firebug with firefox.
    You can download firebug for firefox from that link .I hope that it helps you.

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

Sidebar

Related Questions

I am trying to learn javascript/jquery, using firebug to debug and have built a
I'm trying to learn sockets using Java and I sucessfully sent data to a
I am trying to learn the trick on how to run the code which
I'm trying to learn Boost Spirit and as an exercise, I've tried to parse
I am trying to learn how to debug programs with gdb following Debugging with
I'm trying to learn how to debug static libraries and I am trying to
I am attempting to learn debugging in x86 assembly and am trying to debug
I am now trying to learn ruby-debug gem, but there are many jargons I
I'm trying learn more about RavenDB and at the moment to focus on how
I am trying learn the use of lambda expressions and hence still struggling to

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.