388 Topics

Member Avatar for
Member Avatar for talisien

Hi all, How do I use data from json in a javascript function? I have something like this! $('#monday').click(function(){ test(); }); function test() { $.getJSON('singleday.php?dld='+ id+'&chkdag=' + 1, function(json) {sday=json}); OtherFunction(); } Now I want to transfer the json date into an other function. something like this function OtherFunction() { …

Member Avatar for talisien
0
200
Member Avatar for cip6791

I would like to check if a user is logged on domain1.com and return a message on domain2. There is a lot more to the code, I only added a basic sample. index.php on [url]http://domain2.com[/url] [CODE]<script type="text/javascript" src="http://domain1.com/test.php?js"></script>[/CODE] test.php is on [url]http://domain1.com[/url]. [CODE] <?php if (isset($_GET['js'])){ header("Content-type:text/javascript"); ?> function doAjax(){ …

Member Avatar for Stefano Mtangoo
0
149
Member Avatar for cacolukia

I need to use Jquery $.ajax() function in order to represent JSON objects in HTML page. JSONs are on a url: [url]http://aaa.aaa.aaa.aaa/demo/example.php[/url]. That is a string of json objects. Please if you have any solution it would be more than helpful. THANKS!!

Member Avatar for McLaren
0
67
Member Avatar for Mbot

Hi, Im having difficulty getting my form contents to send to my php page using ajax, jquery and json. The results just doesnt want to show. My javascript, where I create the JSON object and try to send it through to the php page: [CODE] var JSONobj; var JSONstr; function …

Member Avatar for Airshow
0
2K
Member Avatar for localp

Hello, I have Googled this for days, but couldn't find a suitable code/tutorial. I need to write a simple java webservice that would return a XML/JSON file as its output. For example say there's a button, and when i click on it, it should run a SQL [CODE]select * from …

Member Avatar for ~s.o.s~
0
145
Member Avatar for phorce

Hello, I'm having a problem with a script I'm working on, basically, it outputs a SQL query in JSON, however, it's not doing it properly.. E.g. Right way: [{"id":111,"title":"Event1","start":"2011-10-10","url":"http:\/\/yahoo.com\/"},{"id":222,"title":"Event2","start":"2011-10-20","end":"2011-10-22","url":"http:\/\/yahoo.com\/"}] Wrong way: [{"id":"1","title":"dfssafsaf","start":"2011-10-22","url":"http:\/\/yahoo.com\/"},{"id":"3","title":"dfssafsaf","start":"1-1-1","url":"http:\/\/yahoo.com\/"}[b],][/b] As you can see it inserts a ",]" and I only want it to show "]" because it's …

Member Avatar for pritaeas
0
58
Member Avatar for newmaster

I need autofill script but i dont know where to begin I have mysql databese table like this (records aprox. 400): id | product name | barcode | quantity | price ------------------------------------------------------------- 1 | procuct 1 | 0000001 | 21 | 12 2 | procuct 2 | 0000002 | 23 …

Member Avatar for Airshow
0
141
Member Avatar for bspace

The following request isn't retrieving a response when I look for it in Firebug. Any ideas why? [CODE]$function(){ //json request to flickr $.getJSON('http://api.flickr.com/services/rest/?&method=flickr.photosets.getPhotos&api_key=71282ef5623d61a898f798c7916bed31&photoset_id=72157627882181032&format=json&jsoncallback=?'), });[/CODE]

Member Avatar for Airshow
0
95
Member Avatar for JamesPublic

Hi all, I'm trying to insert an array (which I've decoded from a JSON object) into a mysql database (for the first time!) and keep coming back with a "Could not connect - Column count doesn't match value count at row 1" error message. My server and database connections are …

Member Avatar for JamesPublic
0
313
Member Avatar for h3rb

hi all, i have a problem with multiline json file that i wish to insert into an sql db. my problem arose as i went from one data set to two in the JSON file. the one data set was sucked from the json file to the sql db via …

Member Avatar for cereal
0
237
Member Avatar for pritesh2010

hi can any one tell me how to call webservice through json query here is my code. i want pass two variable and i want to get the result of that methos say Add methos of following service. for webservice [CODE] using System; using System.Collections.Generic; using System.Linq; using System.Web; using …

Member Avatar for nakor77
0
147
Member Avatar for scrivomcdivo

Hey folks. I currently have a large JSON file made up of entries similar to the below. The file contains information relating to photographs:- [CODE]{ "SourceFile": "C:/Users/Me/Desktop/Photos/5294030805_9497032cd7_o.jpg", "ExifToolVersion": 8.63, "FileName": "5294030805_9497032cd7_o.jpg", "Directory": "C:/Users/Me/Desktop/Photos", "FileSize": "1094 kB", "FileModifyDate": "2011:09:09 22:40:39+01:00", "FilePermissions": "rw-rw-rw-", "FileType": "JPEG", "MIMEType": "image/jpeg", "JFIFVersion": 1.01, "ExifByteOrder": "Big-endian (Motorola, …

Member Avatar for Momerath
0
273
Member Avatar for Aties

sir i have one json i want deserlize this json how will i do iam try out but "Type 'System.String' is not supported for deserialization of an array." error coming here is my code : in cs file [code] using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using …

Member Avatar for Aties
0
1K
Member Avatar for Aties

how to deserilize json in asp.net i will get this type of data when i use HttpWebRequest [code=text] [{"id":23,"name":"Video Clips"},{"id":15,"name":"Deleted Scenes"},{"id":9,"name":"Music Albums"},{"id":7,"name":"Trailers"},{"id":18,"name":"Short Films"},{"id":21,"name":"Movie Clips"},{"id":1,"name":"Movies "},{"id":4,"name":"Plays"},{"id":22,"name":"Scenes"},{"id":2,"name":"TV Show"},{"id":5,"name":"Kids"},{"id":16,"name":"Interviews"},{"id":11,"name":"Film Songs"},{"id":14,"name":"Making of Movie"}] [/code] now i want deserilize this in asp.net(c#) please friends help me out

Member Avatar for kvprajapati
0
87
Member Avatar for blotind

Hi all the problem lies with the createJSON function for some reason it is breaking no idea why though. please advise... [CODE]<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> <title>User Details</title> <script type="text/javascript"> function validateForm(){ var x=document.forms["myForm"]["username"].value if (x==null || x=="") { alert("username must be filled …

Member Avatar for ddymacek
0
137
Member Avatar for Ichcha

i need help in adding $data into datatable data.setvalue where will be used to generate column chart. first column = x-axis while the rest of the columns = elements. thanks in advance. [CODE] <?php $result=mssql_fetch_array($row); // $result already in correct structure. $data = json_encode($result); ?> <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> …

0
80
Member Avatar for Aesculapius

Scenario: Web Service needed to calculate values and send results back as json. These calls are to be made cross-domain so I'm using jsonp. The problem I'm having occurs both on the same domain and cross-domain. Problem: I'm having an issue getting back json data from a WCF Service. While …

0
72
Member Avatar for Mujahid158

Hello, I'm using Google Maps to show houses listings on the Google map. I'm also using AJAX to allow user to customize search parameters. Map is showing fine but the houses listings on the map is not working. Moreover, I'm getting the following pop up error; [url]http://imageshack.us/photo/my-images/857/screenshotpll.png/[/url] I'm also sharing …

Member Avatar for pritaeas
0
220
Member Avatar for mark22

I have almost given up but thought I would post here in a last attempt. I am pretty new to jquery and I am having an issue. I need to use the same carousel with three different json queries on the same page. I tried putting them in divs with …

0
112
Member Avatar for sithembisophp

Hi, I'm trying JSON for the first time and I have a php file that returns this: [CODE] [{"userID":"39160902151","content":"I really can't wait to get this thing done :-)","published":"2011-06-07 10:33:35"}] [/CODE]. What do I do if I want to display only the userID from this data using javascript. I load this …

Member Avatar for twiss
0
94
Member Avatar for ispeakbinary

[CODE] <script type="text/javascript" src="js/jquery-1.3.2.js"></script> <script type="text/javascript" src="js/jquery-1.3.2-vsdoc.js"></script> <script type="text/javascript"> $(function() { $("#Button1").click(function() { $.getJSON("ticketPriceInArray.js", function(json) { var ticketPriceArray=[json.tickets[0].price, json.tickets[1].price, json.tickets[2].price, json.tickets[3].price, json.tickets[4].price, json.tickets[5].price]; alert(json.tickets[0].type); var inputWord =$("#keyword").val(); if (inputWord=="A"){$("#result").text(ticketPriceArray[0]);} if (inputWord=="B"){$("#result").text(ticketPriceArray[1]);} if (inputWord=="C"){$("#result").text(ticketPriceArray[2]);} if (inputWord=="D"){$("#result").text(ticketPriceArray[3]);} if (inputWord=="E"){$("#result").text(ticketPriceArray[4]);} if (inputWord=="F"){$("#result").text(ticketPriceArray[5]);} }); }); }); </script> [/CODE] Here is "ticketPriceInArray.js" [CODE] { "tickets":[ …

Member Avatar for twiss
0
177
Member Avatar for gloosemo

I'm trying to make an AJAX request to my localhost server. Here is the code for the page that is requested, ajaxresponsecontent.php. The content is queried from a MySQL database then encoded into JSON using PHP. [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" …

0
56
Member Avatar for ttchiwandire

Hie good friends! I have got a Jsp form for creating a database record for students. The form has got a drop down box for Countries, but the countries are too many that a user may spend a lot of time scrolling to locate his/her country. The drop down is …

0
51
Member Avatar for cutexxbaby

hi i am doing a project now i going to use ajax to retrieve coordinate from the json in html and pin the coordinate onto a point on the map using javascript but the problem is i am only able to use one point on the map can tell me …

Member Avatar for Airshow
0
189
Member Avatar for hisan

Hello All, Ii want to know how can i check whether the response from the server is inJSON format or XML format . Please let me know how to do this,

Member Avatar for sneekula
0
348
Member Avatar for praveen_dusari

hi all, i am using json and codeigniter for a project which it has 2 language preferences..english and french...my problem is.. in json number field has to accept (,) instead of (.) in french language can any one guide me on this... thanks, Praveen

Member Avatar for twiss
0
83
Member Avatar for elneco

Forums, I've been trying to get the ASP version of this widget to work but have had no luck: [url]http://www.radoslavdimov.com/jquery-plugins/jquery-plugin-digiclock/[/url] I need help with this urgently and am willing to reimburse anyone that can help me figure this out. Thanks in advance! -jaime

0
72
Member Avatar for sampa420

Hi developers, I develop a feature to recover the password for the user, but I'm having trouble to retrieving the value of json. The problem is....on success the IF condition always run the else I am pasting my code and if someone can help me. My engine JS [CODE]$("#mailResetUsrPass").click(function () …

0
79
Member Avatar for FlyByNight73

Hi Everyone, I am currently working on a site that will have lots of European and Middle-Eastern town names that include accented and other special characters. I have never had to deal with these characters before and I foolishly assumed that setting everything to utf-8 would take care of it …

Member Avatar for arrgh
0
624
Member Avatar for PotaZinga

Hi there please help i want to consume a json web servvices with classic asp . i am still very new at web services a simple detailed sample code should do. thanx in advance...

Member Avatar for PotaZinga
0
99
Member Avatar for McLaren

Hi, I want to get such data using AJAX from PHP. With php I generate data this way: [CODE=php] $return['credits'] = $credits; $return['banners'] = $this->generate_banners($user->id); echo json_encode($return); [/CODE] generate_banners: [CODE=php] function generate_banners($user_id) { $html = ''; $query = $this->db->where('user_id',$user_id)->select('filename')->get('jos_reklama_banners'); if($query->num_rows() > 0) { foreach($query->row() as $filename) { $html .= '<div …

Member Avatar for McLaren
0
762
Member Avatar for persianprez

So, basically I'm trying to fetch part of a json feed and output just that. Example, theres a bunch of posts, comments, and an image on the post. I want to only fetch the image. I've started out with [CODE] document.getElementById('url').innerHTML= url.value; r=function(data) {url=data['results'];};[/CODE] html [CODE]<script type="text/javascript" src="http://www.com/search.json?q=word&callback=r"></script> <style type="text/css" …

Member Avatar for Pnorq
0
67
Member Avatar for jlivvers

Hi, I have inherited a project from a colleague and have an intersting problem. The project attempts to deserialize a type 'Client' into a new 'Client'. [CODE] Client mainClient = null; using ( stream = File.Open(resourceFilePath, FileMode.Open)) { BinaryFormatter bin = new BinaryFormatter(); mainClient = (Client)bin.Deserialize(stream); } [/CODE] this throws …

Member Avatar for kvprajapati
0
127
Member Avatar for chrisglasier

I have made a couple of preliminary versions of a web machine as an HTA and as a web dialog plug in for Google's Sketchup. The machine has moving sliders (hence machine) that get populated with names of real objects in a hierarchical structure set by the user's associations e.g. …

Member Avatar for chrisglasier
0
253
Member Avatar for denizen08

I have been trying to mimic GoogleReader's Json output, particularly the subscription listing. I started out creating classes for deserialization but I don't have a full grasp of the concepts. It crashes when I really try to consume the Json file, but when I generate my own serialized file it …

Member Avatar for denizen08
0
110
Member Avatar for Ambislm

This is my sample application which provides result as follows: [CODE]Array Values : arr[0][0] :6 arr[0][1] :0 arr[0][2] :0 arr[1][0] :0 arr[1][1] :0 arr[1][2] :0[/CODE] am using the jQuery Highcharts: [CODE]chart = new Highcharts.Chart({ chart: { renderTo: 'container', defaultSeriesType: 'column' }, title: { text: document.chart.chartTitle.value }, series: [{ name: 'USA', …

0
83
Member Avatar for sumeetdesaeee

I am new to JSON... I have been told to use it with XStream in my project.. I searched on net... But, I did not get any satisfactory information.... So, can anyone please tell in simple language what is JSON n basically why is it used?

Member Avatar for sumeetdesaeee
0
37
Member Avatar for cj333

Here is the json show: [CODE]{ "results": [ { "title": "Conflicting Reports on Iran\u2019s Arrest of a Foreign Woman", "multimedia":[ { "caption": "Moktada al-Sadr spoke to thousands of supporters on Saturday, stating conditional support for the Iraqi government." } ] } ...] }[/CODE] I tried this code, but I can …

Member Avatar for cj333
0
82
Member Avatar for logicslab

Hi pals , I am really stuck in parsing a JSON string and take it's values. I got the json string as {"user":{"id":"1","firstname":"Freelogin","created":"0000-00-00 00:00:00","lastname":"Administrator","email":"fred@websecurify.com", "usergroup_id":"1","status":"1","ip_enable":"N","priv":"0","expire":""},"data":{ "1":{"5":{"last_update":"2010-12-13 16:16:16","status":"0"},"3":{"last_update":"2010-12-13 16:41:48","status":"1"}},"2":{"6":{"last_update":"2010-12-13 16:41:48","status":"1"}}},"server_array":[{"id":"1","name":"anes.yyy.net"},{ "id":"2","name":"neseema.xxx.net"}],"service_array":[{"id":"5","name":"POP3"}, {"id":"6","name":"Cpanel"},{"id":"3","name":"SMTP"}],"sort_by":"servername", "sort_order":"ASC","pagelinks":"","totrows":"2","offset":"0","limitvalue":"10", "rows_monitor":2,"current":"monitor","uri":false} Friends How to Parse this and take the Results for further processing in javascript.... I am waiting …

Member Avatar for NightLight
0
153
Member Avatar for vishalkhialani

Hi, Below is the data format which I am passing to php via javascript in json format. [CODE] {"name":"Secret","value": "checked","name":"OldSpice","value": "unchecked","name":"Degree","value": "unchecked","name":"Dove","value": "unchecked","name":"Axe","value": "unchecked","name":"Maxim","value": "unchecked","name":"Nivea","value": "unchecked",}[/CODE] I can access the data successfully using the code [CODE]echo $_POST['name'];[/CODE] I want to convert it to an array. I tried to use json_decode() …

Member Avatar for vishalkhialani
0
295
Member Avatar for Capt Spaghetti

I am able to present the organizations for a user selected city and state and I am then able to "down select" using the id which presents me with the json encoded data for a single organization. The problem is that along with the json encoded data I am getting …

Member Avatar for Capt Spaghetti
0
128
Member Avatar for serena5

I am writing Spring web MVC app whereby the client and the server communicates by sending json messages. On the client I am making asynchronous calls to update textboxes. Could you please let me know if I am using the right syntax? I have hit a brick wall and cannot …

0
61
Member Avatar for benhowdle89

hi i'm using this, its working great, but if someone has a hyperlink in their status it doesnt pull it across - is there anything someone can think of? Thanks [CODE] $(document).ready(function(){ var username='xxxxxxxx'; // set user name var format='json'; // set format, you really don't have an option on …

0
90
Member Avatar for lgriess

I'm having a problem with the following code: I have the following jquery call: the problem is that I have several `<select name="^DDLColumns1..2..3..4`. etc.. controls on my page, however this is only populating the first one: `<select name="^DDLColumns1"` anybody know why the select would do this? <script type="text/javascript" language="javascript"> $().ready(function() …

Member Avatar for Airshow
0
176
Member Avatar for Capt Spaghetti

If I run my php file manually I am getting the output as follows: [{"org_id":"39575","orgname":"ARTHRITIS FOUNDATION - VIRGINIA CHAPTER","orgcity":"RICHMOND","orgstate":"VA"}] The php code is as folows: [code=php] <html> <body style="background-color:#33990f"> <?php // connect include require ("connect.php"); $query = "SELECT * FROM orgs WHERE org_id = 39575"; $result = mysql_query($query)or die(mysql_error()); if …

0
91
Member Avatar for ruwanaru

[B]This is the code that not getting the result[/B] [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>Nice select</title> <script Language="JavaScript"> function checkData() { var myTest = me.D1.value; //alert(myTest); var req = new Request.JSON({ url: 'dbselect.php', method: 'post', data: 'brand=' + encodeURIComponent(myTest) }); req.addEvent('success', function(response) { var …

Member Avatar for hielo
0
155
Member Avatar for cpu278

Hi there, I couldn't find a solution to this small problem so posting it here. I have some hardcoded values I want to send back to the browser. When I have this code: [code=php] ... $cr1 = '{"date_added":"8/3","type":"1","contact":"John Smith"}'; $cr2 = '{"date_added":"8/7","type":"2","contact":"Jane Smith"}'; $company_reqs[0] = json_decode($cr1,1); $company_reqs[1] = json_decode($cr2,1); $company_data['reqs'] …

Member Avatar for cpu278
0
95
Member Avatar for jrock2004

Ok so I am trying to setup on my site to have 6 of my recent tweets. I am trying to use the .getJSON method and it is just not working. [CODE] $.getJSON("http://api.twitter.com/1/statuses/user_timeline/jrock2004.json", function(data) { $.each(data, function(){ $('<div></div>') .hide() .append('<span>' + this.text + '</span>') .appendTo('#tweets') .fadeIn(); }); }); [/CODE] Any …

Member Avatar for JJenZz
0
102
Member Avatar for cmhampton

I am having issues parsing JSON data from a web service. The web service is local on my machine, and I have added it as a Web Reference. Simple data types from the service work perfectly. However, if I call a method that returns a complex structure (such as an …

Member Avatar for cmhampton
0
514
Member Avatar for julzk

Hi all, I have a problem. I have a menu and when clicked it loads the data from that menu into my main page divs. However, I want to be able to auto refresh my div#mainview_json every 5 seconds. When I try to implement the auto_refresh = setInterval(blah, 5000); it …

0
50

The End.