hmmm
 Haven't done much mochikit but if you're wantign to just update a single
element, consider
using a DIV tag element in the html file and from the javascript file you
have made,
update the element (based on the ID assigned to the DIV tag element earlier)
?


Taking your code into consideration, in your javascript file,
just add this function,


********************* Start ******************

function updatepage(str)
{
    document.getElementById("price").innerHTML = str;
}

********************* End ******************

and where the request is successful, just make a call to it :


********************* Start ******************
                //Checking to see we have a successful response in our
returned data
                if (resp.status == 'Successful')
                {
                    log('the Response has status of successful...');
                   log('mokkie Response has status of successful...');
                    log(resp.data.price);
*                    updatepage(resp.data.price);    <---- Over here :)*
                }
                else
                {
                    log('Response has status of NON successful');

                    //calling our partial function
                    u_message(resp.status);

                    //getting error reason and txt and updating user
                    for (i in resp.error)
                    {
                        log('Error is:',i);
                        log('Reason is:',resp.error[i]);
                        u_error(i+': '+resp.error.i);
                    }
                }

********************* End ******************

Hope it helps:)


Regards,
Gordon Yeong


2009/4/13 <[email protected]>

> hello, Peter,
>
>  Good evening. Thank you for the response.
>
> Yeah, "log(resp.data.price);" prints out the value which  I was expecting.
>  Hence,  I was expecting the line, "p_txt = P({'style':'display:none'},
> resp.data.price); "
> to have worked.
>  alas, your recommendation of "p_txt = P({'style':'display:none'},
> resp.data.price.value);" failed too :(
>
>
>  anyone?? thank you:)
>
>
>
> Quoting Peter Flanigan <[email protected]>:
>
> > [email protected] wrote:
> >
> > > How do I actually get the value (which is the 'price' attribute to
> > display)?
> > > Point of problem: addCallBack method in my javascript file.
> >
> > >  //Creating a callback on success to process our json response
> > >         d.addCallback
> > >         (
> > >             function (req)
> > >             {
> >
> > >                     //elements consult mochikit docs for full
> > details
> > >                     var td_price = TD(null,
> > resp.data.price.value);
> >
> > > // Im stuck here!!! Don't know why the freakin' value won't show
> > :(
> > >
> > >                     p_txt = P({'style':'display:none'},
> > resp.data.price);
> > >                     replaceChildNodes(price, [p_txt]);
> >
> > Am not familiar with Mochikit, but from context should that be
> >
> > p_txt = P({'style':'display:none'}, resp.data.price.value);
> >                                                     ^^^^^^^
> >
> > --
> >
> > Regards
> >
> > _______________________________________________
> > List: [email protected]
> > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> > Searchable archive:
> > http://www.mail-archive.com/[email protected]/
> > Dev site: http://dev.catalyst.perl.org/
> >
> >
> >
>
>
>
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to