[Moo] Request HTML not working

4 messages Options
Embed this post
Permalink
farid silva aboid

[Moo] Request HTML not working

Reply Threaded More More options
Print post
Permalink

Hi, I'm newbie to mootools and trying to make an interactive form
which load sections according previous selection by the user.

under mootools 1.2.3 I'm using Request in this way:

function loadPage(url,container,loadInfoText) {
           var myRequest = new Request(
           {
                 url: url,
                 method: 'get',
                  onRequest: function()
                 {... },
                 onFailure: function()
                 {... },
                 onSuccess: function(response)
                 {
                   $(container).set('html',response);
                   $('divCierre').setStyle('visibility', 'visible');
                 }
           }).send();
 }

This function works fine where there's no more than de involved divs
in the page, but when I try to use it in the "production" page, I get
always the error predefined in onFailure method.

The pages are XHTML 1.0 transitional valids, same as css files

Any idea?

Thanks in advance
Fábio M. Costa

[Moo] Re: Request HTML not working

Reply Threaded More More options
Print post
Permalink
it the onFailure event is firing its because there has been an error on your request, which means you didnt get a code 200 response.

This can happen if the url you are using doesnt exist (error 404) or if theres an error on your server side code (error 500) or any other code that means error.


--
Fábio Miranda Costa
Solucione Sistemas
Engenheiro de interface


On Wed, Nov 4, 2009 at 5:35 PM, farid silva aboid <[hidden email]> wrote:

Hi, I'm newbie to mootools and trying to make an interactive form
which load sections according previous selection by the user.

under mootools 1.2.3 I'm using Request in this way:

function loadPage(url,container,loadInfoText)    {
          var myRequest = new Request(
          {
                url: url,
                method: 'get',
                 onRequest: function()
                {...            },
                onFailure: function()
                {... },
                onSuccess: function(response)
                {
                  $(container).set('html',response);
                  $('divCierre').setStyle('visibility', 'visible');
                }
          }).send();
 }

This function works fine where there's no more than de involved divs
in the page, but when I try to use it in the "production" page, I get
always the error predefined in onFailure method.

The pages are XHTML 1.0 transitional valids, same as css files

Any idea?

Thanks in advance

jiggliemon-2

[Moo] Re: Request HTML not working

Reply Threaded More More options
Print post
Permalink

Try ysing a relative path for your URL:
url: '/index.php?somevar=thisvalue'


On Nov 4, 11:58 am, Fábio M. Costa <[hidden email]> wrote:

> it the onFailure event is firing its because there has been an error on your
> request, which means you didnt get a code 200 response.
>
> This can happen if the url you are using doesnt exist (error 404) or if
> theres an error on your server side code (error 500) or any other code that
> means error.
>
> --
> Fábio Miranda Costa
> Solucione Sistemas
> Engenheiro de interface
>
> On Wed, Nov 4, 2009 at 5:35 PM, farid silva aboid <[hidden email]>wrote:
>
>
>
> > Hi, I'm newbie to mootools and trying to make an interactive form
> > which load sections according previous selection by the user.
>
> > under mootools 1.2.3 I'm using Request in this way:
>
> > function loadPage(url,container,loadInfoText)    {
> >           var myRequest = new Request(
> >           {
> >                 url: url,
> >                 method: 'get',
> >                  onRequest: function()
> >                 {...            },
> >                 onFailure: function()
> >                 {... },
> >                 onSuccess: function(response)
> >                 {
> >                   $(container).set('html',response);
> >                   $('divCierre').setStyle('visibility', 'visible');
> >                 }
> >           }).send();
> >  }
>
> > This function works fine where there's no more than de involved divs
> > in the page, but when I try to use it in the "production" page, I get
> > always the error predefined in onFailure method.
>
> > The pages are XHTML 1.0 transitional valids, same as css files
>
> > Any idea?
>
> > Thanks in advance
farid silva aboid

[Moo] Re: Request HTML not working

Reply Threaded More More options
Print post
Permalink
In reply to this post by farid silva aboid

SOLVED!

The point was the document was valid but generating a warning from
http://validator.w3.org/.
Once the warning was fixed (incorrect DTD declaration) everything
start to working fine.
So I asume that mootools is sensible to that issues...
Thanks everybody for the answers!

On Nov 4, 4:35 pm, farid silva aboid <[hidden email]> wrote:

> Hi, I'm newbie to mootools and trying to make an interactive form
> which load sections according previous selection by the user.
>
> under mootools 1.2.3 I'm using Request in this way:
>
> function loadPage(url,container,loadInfoText)    {
>            var myRequest = new Request(
>            {
>                  url: url,
>                  method: 'get',
>                   onRequest: function()
>                  {...            },
>                  onFailure: function()
>                  {... },
>                  onSuccess: function(response)
>                  {
>                    $(container).set('html',response);
>                    $('divCierre').setStyle('visibility', 'visible');
>                  }
>            }).send();
>  }
>
> This function works fine where there's no more than de involved divs
> in the page, but when I try to use it in the "production" page, I get
> always the error predefined in onFailure method.
>
> The pages are XHTML 1.0 transitional valids, same as css files
>
> Any idea?
>
> Thanks in advance