473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I need to append values that i have got from ajax request into html elements

Expand|Select|Wrap|Line Numbers
  1. var chapter_card_common_id = new Array();
  2.     var no_of_questions = new Array();
  3.     var took_the_test = new Array();
  4.     var times_reviewed = new Array();
  5.     var speed = new Array();
  6.     var accuracy = new Array();
  7.     var unattempted = new Array();
  8.     var correct = new Array();
  9.     var wrong = new Array();
  10.     var marked = new Array();
  11.     var notseen = new Array();
  12.     var user_id = 1;
  13.      //alert("hiiiiiiiiii");
  14.         $.post("fill_cards_php.php",function(data1) 
  15.             {
  16.                         alert(data1.chapter_card_common_id.length);
  17.                         for(var ii = 0 ; ii< data1.chapter_card_common_id.length ; ii++) 
  18.                             {
  19.                         chapter_card_common_id[ii] = data1.chapter_card_common_id[ii];
  20.                         no_of_questions[ii] = data1.no_of_questions[ii];
  21.                         took_the_test[ii] = data1.took_the_test[ii];
  22.                         times_reviewed[ii] = data1.times_reviewed[ii];
  23.                         speed[ii] = data1.speed[ii];
  24.                         accuracy[ii] = data1.accuracy[ii];
  25.                         unattempted[ii] = data1.unattempted[ii];
  26.                         correct[ii] = data1.correct[ii];
  27.                         wrong[ii]=data1.wrong[ii];
  28.                         marked[ii]=data1.marked[ii];
  29.                         notseen[ii]=data1.notseen[ii];
  30.  
  31. }
  32.  
  33.             },'json');

Above is the code snippet i am using in my code.
I have got data from ajax request in variable data1.
i have used json.now i need to append those values to html elements like
$('#1_front #times_reviewed').text(variable);
variable->is the variable tat i have set inside ajax request.
Jul 6 '14 #1
1 1029
Dormilich
8,658 Expert Mod 8TB
looks like you want to use standard object access here …
Jul 6 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: Luke | last post by:
Elements with name attribute: form, input, textarea, a, frame, iframe, button, select, map, meta, applet, object, param, img (if you know more reply...) Methods of addresing html elements:...
17
by: petermichaux | last post by:
Hi, Is it possible for an AJAX request to be left open for multiple responses? This could avoid repetitive polling of the server. Thanks, Peter
5
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great...
0
by: arunprabu | last post by:
Hi, I have a problecm with the AJAX request in my webpage. I have some filters on top of the page. I have a submit button and an empty div below the filters. Some of the filters have ajax...
2
by: Prasad | last post by:
Hi all! I am trying to access a page through Synchronous Ajax request in mozilla firefox I could not get the response .. After the requset is sent , "onreadystatechange" function is not being...
3
by: Simon | last post by:
I have the following code in Javascript which is creating and sending an XMLHttpRequest . <code> var xmlHttp; /*@cc_on @*/ /*@if (@_jscript_version >= 5) try { xmlHttp = new...
1
by: FlashPack | last post by:
hi every 1 i have 2 pages and i want to move between these pages using ajax , can i do that ? thanks
1
by: nikki.farrah | last post by:
Hi all, this is my first time posting so any help is appreciated! I am doing a simple AJAX request to our server, and I would like the cursor style changed to 'wait' when the user clicks a button...
7
by: Sebarry | last post by:
Hi, I have a Javascript function that creates an Ajax Request object in order to retrieve data from a database using a PHP script. The Javascript function is invoked by another Javascript function...
8
by: alejrb | last post by:
Hi! I have a pretty simple AJAX request that just GETs the content of a page depending on a name that is fed to it. I'm parsing the page in quite a complex way, so I'm using the DOM to make it a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.