heres the function (it connects to wordpress database so i cant send a
url)

<code>
        function getProductInfo(product_id) {
                jQuery.post(
                        "/wp/wp-admin/admin-ajax.php", {
                                action: "getProductInfo",
                                'cookie': encodeURIComponent(document.cookie),
                                'product_id': product_id
                        },function(obj) {
                                jQuery('#debugger').append(obj);

                        },"JSON");
        }
</code>

On Apr 15, 1:28 pm, dhtml <[email protected]> wrote:
> On Apr 14, 9:34 pm, sneaks <[email protected]> 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?
>
> Garrett

Reply via email to