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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:02:11+00:00 2026-05-31T19:02:11+00:00

I have got this html: <div id=myDiv> <p class=readMore></p> <p class=readMore></p> <p class=readMore></p> </div>

  • 0

I have got this html:

<div id="myDiv">
<p class="readMore"></p>
<p class="readMore"></p>
<p class="readMore"></p>
</div>

I have got this jquery function:

UPDATE

  <script>
   function getData() 
   { 
     $.ajax({
        url: "http://localhost/test2/ajax.php",
        type: "GET",
        datatype: "json",
        success: function(data)
        {
            alert("This is my data: "+data);
        },
        error: function( error )
        {
           alert(JSON.stringify(error));
        }
        });

     } 
   </script> 

Result status 0 . on the alert
Thats the output from ajax.php page:

[{"Article1":"11111111111111111"},{"Article2":"22222222222222222222"},{"Article3":"333333333333"}] 

I need to take the rows and encode them to a jason..the problem is who do I do that?
And how do I insert the data into the 3 paragraphs on the success of the ajax call.?

  • 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-31T19:02:12+00:00Added an answer on May 31, 2026 at 7:02 pm

    To make up JSON use: http://lv.php.net/manual/en/function.json-encode.php
    To put data into paragraphs… one way to go is to assign ID to each paragraph and then traverse response from server and put data in each appropriate paragraphs. There are other ways to do this, but lets try this – you make something and then I (or we) will help to fix problem if you will run into any.

    In success use something like this:

    $.each(data, function(key, value){
        $('#myDiv').append('<p class="paragraph">' + value[0] + '<br /><br />' + value[1] + '</p>');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this html: <div class=portlet-header> Company Information ... <button> some button here </button>
I've got this html (simplified) <div class=outer style=float:left> <div class=inner style=float:left> <div class=contained style=clear:both>...</div>
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
I have some html that looks like this: <div class=block> <div id=item1></div> <div id=item2></div>
So I've got this UpdatePanel. Inside it I have a nifty little jQuery scroll
I've got this bit of css/javascript/html that uses jQuery 1.5 and jQuery-ui 1.8.9. It's
I have got show|hide script. It work's good but I need to modify html
I have a problem. You see, I've got this code (MVC3) @Using Html.BeginForm() @Html.ValidationSummary(True,
I got this html <tr> <td> Main Alliase/Current Alliase: </td> <td><input type=text id=maina class=countchars
I got this div... <div tabindex=0 class=button-base inline-block button aw-btn button-base-active> <input type=text tabindex=-1

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.