On Apr 15, 4:34 pm, sneaks <deroacheee...@gmail.com> wrote:
[posting order restored]
> On Apr 15, 1:28 pm, dhtml <dhtmlkitc...@gmail.com> wrote:
>
> > On Apr 14, 9:34 pm, sneaks <deroacheee...@gmail.com> wrote:
>
> > > hi! i am trying to use jQuery.post() to send name/value to a php
> > > function which then retreives data from mysql and responds withJSON
> > > which looks like this when i append it directly to my debug output
> > > div:
>
> > [...]
>
> > > i have tried to iterate through theJSONusing the jQuery.each():
>
> > You should provide a reduced testcase so that we can see the problem.
> > This should be a live example on your webhost, ideally (so we don't
> > have to copy all of your files to our own webserver).
>
> > When posting code, you should also format that code to wrap at <= 72
> > chars. Use spaces, not tabs. This makes it easier for us humans to
> > read.
>
> > Plain enumeration is simple. For example:-
>
> > varjson= eval( responseText ),
> > key, value;
>
> > for( key injson) {
> > value =json[key];
>
> > }
>
> > But you are using jQuery. So we'll try and figure out what is going
> > on.
>
> > > Query.each(obj, function(i, val) {
> > > etc...
>
> > Why don't you post up the whole function?
>
> heres the function (it connects to wordpress database so i cant send a
> url)
>
That is not the same function. That is the code that makes the HTTP
Request to the server.
[snipped code]
In order to debug the problem, please provide a simplified test case.
You can include the data that you got back from the server as just a
variable. For example:
<!doctype html>
<html>
<head><title>json in jQuery.each</title>
<script type="text/javascript">
var jsonResponse = "{x:1}";
// rest of code here.
</script>
</head>
<body>
</body>
</html>
Tell us which browsers you used, the results that you got, and the
results you expected.
Without that, about all anyone can do is guess.
Garrett