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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:49:26+00:00 2026-05-24T12:49:26+00:00

I got this in my html : <script src=http://code.jquery.com/jquery-1.6.2.min.js></script> <script> $.post(mm.php, { func: getNameAndTime

  • 0

I got this in my html :

<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>

<script>
$.post("mm.php", { func: "getNameAndTime" },
  function(data){
    $(data).each(function() {
    $("div").append($(this).name);
    });
  }, "json");
</script>

<div></div>

And my mm.php looks like this :

<?php echo json_encode(array("my" => array("name"=>"John","time"=>"2pm"), "ur"=>array("name"=>"Nah","time"=>"1:13")) ); ?>

This was working before i putted the .each() so doesnt have the including or other problems.

Why isnt this working ?
Where have i been going wrong ?

  • 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-05-24T12:49:27+00:00Added an answer on May 24, 2026 at 12:49 pm

    data is not a DOM element, it’s a JSON object. You need to use $.each instead of .each() Also, inside the each(), this is an object, not a DOM element, so you don’t need $() around it.

    $.each(data, function() {
       $("div").append(this.name);
    });
    

    EDIT: Instead of using this inside the each try this:

    $.each(data, function(i,v) {
       $("div").append(v.name);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that contains this code: <script src=Scripts/jquery-1.4.1.min.js type=text/javascript></script> <script src=Scripts/facebox.js type=text/javascript></script>
Ok, I've got this code: <html> <head> <meta http-equiv=Content-Type content=text/html; charset=iso-8859-1> <script type=text/javascript href=https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js></script>
So i got this snippet of code: $(document).ready(function () { var replacementDoneIn = $(body).html();
I've got HTML code that roughly looks like this: <li id=someid-11> <img src=... alt=alt
I got this colored dir script from http://tasteofpowershell.blogspot.com/2009/02/get-childitem-dir-results-color-coded.html : function ls { $regex_opts =
I've got this code: <html> <head> <link type=text/css href=css/blitzer/jquery-ui-1.7.2.custom.css rel=stylesheet /> <script type=text/javascript src=js/jquery-1.3.2.min.js></script>
I have this HTML code: <html> <head> <script type=text/javascript> function GetDoc(x) { return x.document
I'll make this short, I got this webpage : <html xmlns=http://www.w3.org/1999/xhtml> <head> <link rel=Stylesheet
I've got an html page from where Im making this call periodically: function logon(id)
It's a really simple problem. I've got HTML code like this : <div> <img

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.