473,327 Members | 2,071 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,327 software developers and data experts.

Insert values from Json Array using Ajax?

Hello,

I am trying to use Ajax in order to improve the speed of my website. I am trying to pull data from a dynamic page and insert the data onto the current page.

There are 3 three things I am trying to accomplish:
1) Have a user click a checkbox to toggle the change of data
2) Pull data from another dynamic page
3) Show that data on the current page that was clicked with a checkbox

Here is the checkbox region of the code:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. $('input[type=checkbox]').live( 'click', refreshData );
  3. </script>
  4.  <input type="checkbox" id="checkbox_<?= $statistic_id; ?>" <?= $i==0 ? 'checked="checked"' : null; ?> />
  5.   <label for="checkbox_<?= $statistic_id; ?>"><?= getStatisticFromId ( $statistic_id ); ?></label>
  6.  
$stastic_id is a value that varies between 1 and 100. getStatisticFromId ( $statistic_id ) returns the name of the Statistic.

The page that I am pulling data from is hosted here: http://tyrone.pae.me/pulldata.php?p=1&s=1. As the value for p varies it changes the data. As the value for s varies it changes the data. s is the $statistic_id referenced above.

Here is the code to show the data on pulldata.php on the current page:
Expand|Select|Wrap|Line Numbers
  1. <script>
  2.    function refreshData() {
  3.    var url = "/frontend.php?p=" + tags + "&s=" + statistic + "&y=" + year;
  4.    $.getJSON( url,
  5.    function(data_from_pulldata){
  6. var data = data_from_pullata;
  7. </script>
  8.  
You'll notice the refreshData function I am trying to run in the Ajax portion is referenced above.

If you can provide any assistance on how I can make all three steps of this process work I would be very appreciative.
Oct 18 '10 #1
0 1719

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

Similar topics

3
by: Sunil | last post by:
Hi, I have a from with around 8 date fields. All these are entered by the user and are to validated for holidays. The holiday validation can only be done on server side. I am planning to use...
4
by: googleAcct | last post by:
see the following example. When I simplified the test case, I seem to be getting an error I cant explain, though the read succeeds and I go on to iterate on the JSON result. Using Firebug or other...
1
by: Sirisha | last post by:
Hello, I want code for insert values into database using storedprocedure and how to write stored procedures. I want code in codebehined file, imean .aspx code Regards,
0
by: Sirisha | last post by:
Hi, I am inserting values into databse using sqlserver stored procedures. i wrote stored preocedure,but in codebehind file(.vb file) i dont know how to pass the parameters, i got error message...
1
by: dan.goyette | last post by:
I'm fairly new to using AJAX. I'm currently developing a data grid application in coldfusion, using AJAX for paging/filter/sorting updates to the grid. So far I've just been returning raw html, and...
1
by: nilu12345 | last post by:
i want to insert selected values from SQL to two dimensional array
2
by: blitzztriger | last post by:
Hello!! how do i insert values into mysql , after parsing a submiting textbox?? I made the arrays, so this should be a basic insertion of them in the db, but something is missing, or in the wrong...
1
by: biggie3384 | last post by:
Is it possible to submit a form using ajax? I have a form with sever inputs and when submited, it writes the input values in a jsp file. I would like to submit the form using ajax in the...
1
by: chennaibala | last post by:
hi frds... in my hiden textbox.i have following values... robert|true|true|false|arun|true|false|true|anu|true|true|false| i want to splits in to token and insert in mysql table in following...
5
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.