Re: CGIDEV + AJAX

Brad Stone <[email protected]>
Newsgroups gmane.comp.systems.as400.web
Message-ID <CAAGV8Of4g5JKzM_UvzpiNQDUcXN3KwpO2n94TXa+xPyYzR=UEg@mail.gmail.com>
If the data is being returned as JSON, you'll need to read that in using
Read Standard Input and then parse it with something like YAJL.  YAJL
actually has a function to read standard input and load the JSON right into
it so you can parse it from there.

On Wed, Jul 14, 2021 at 8:28 AM Jay <[email protected]> wrote:

> I'm following your example (except with CGIDEV2).
>
> What does the template file look like for the return coming from the
> program called in the AJAX operation?
>
> I've got the RPG using:
> { "smn":"WHO?","name":"Unknown" }
>
> The kicker is that the #smn=zhbgetvar('smn');  does seem to be returning a
> value from the AJAX call:
>
>     return $.ajax({
>         type: "POST",
>         url: url,
>         data: formData,
>         dataType:"jason",
>         success: function(res) {
>           console.log(res);
>           document.getElementById("smnajax").innerHTML=res.name;
>         },
>         error: function(errMsg) {
>           document.getElementById("smnajax").innerHTML=errMsg;
>         }
>     });
>
>
> > On 07/13/2021 5:16 PM Brad Stone <[email protected]> wrote:
> >
> >
> > I have one here:
> > https://www.fieldexit.com/forum/display?threadid=10
> >
> > And the entire forum may have more info:
> > https://fieldexit.com/forum/thread?groupid=Prog&forumid=WEB
> >
> > On Tue, Jul 13, 2021 at 4:08 PM Jay <[email protected]> wrote:
> >
> > > Has anyone come across a really good example for doing CGIDEV2 and
> RPGLE
> > > with AJAX calls?
> > >
> > > --
> > > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
> mailing
> > > list
> > > To post a message email: [email protected]
> > > To subscribe, unsubscribe, or change list options,
> > > visit: https://lists.midrange.com/mailman/listinfo/web400
> > > or email: [email protected]
> > > Before posting, please take a moment to review the archives
> > > at https://archive.midrange.com/web400.
> > >
> > >
> > --
> > This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
> list
> > To post a message email: [email protected]
> > To subscribe, unsubscribe, or change list options,
> > visit: https://lists.midrange.com/mailman/listinfo/web400
> > or email: [email protected]
> > Before posting, please take a moment to review the archives
> > at https://archive.midrange.com/web400.
> --
> This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
> list
> To post a message email: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/web400
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/web400.
>
>
-- 
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.