Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] My first JSON object
- Date: Tue, 13 Jul 2010 00:01:48 +0900
- From: Dave M G <dave@example.com>
- Subject: Re: [tlug] My first JSON object
- References: <4C1C3348.90506@example.com> <20100619044940.GA18726@example.com> <4C23481B.1090904@example.com> <20100625080744.62b6b298.gstewart@example.com> <32853.61.193.161.149.1277458953.squirrel@example.com> <4C25510C.3090002@example.com> <20100626083312.3f29d97d.gstewart@example.com> <4C26F2F4.80600@example.com> <20100627173336.e2533f06.gstewart@example.com> <4C300FEB.30405@example.com> <4C308DC9.4040309@example.com> <20100704151513.4c0ce0b6.gstewart@example.com> <4C3B14A9.6050707@example.com>
- User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100527 Thunderbird/3.0.5
TLUG, Whoops, noticed a small copy and paste error in my code. Ignore what I had earlier. This is the code I'm using, which isn't working. Javascript: var myJSON = { "name": "my_simple_object" }; $.post('jsonhandler.php', myJSON, showResult, "text"); function showResult(json_data_received) { console.log("The value of the JSON object is: " + JSON.parse(json_data_received)); } And here's my PHP: $data = json_decode(stripslashes($_POST['myJSON'])); Header("Content-Type: application/json"); echo json_encode($data); Just to be clear. The goal is to send JSON data to the PHP script which should just turn around and send it right back. However, the response I'm getting from the server is "null". Any idea where I'm going wrong? Any advice or suggestions much appreciated. -- Dave M G
- Follow-Ups:
- Re: [tlug] My first JSON object [SOLVED]
- From: Dave M G
- References:
- Re: [tlug] My first JSON object
- From: Dave M G
- Re: [tlug] My first JSON object
- From: Fredric Fredricson
- Re: [tlug] My first JSON object
- From: Godwin Stewart
- Re: [tlug] My first JSON object
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] [announcement] 2010-07-10 Technical meeting
- Next by Date: [tlug] Japanese fonts look insane in Java
- Previous by thread: Re: [tlug] My first JSON object
- Next by thread: Re: [tlug] My first JSON object [SOLVED]
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links