[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method

2008-11-06 Thread Augusto TMW

WOW!

Thanks very very very much!!!

How a simple comma have the power to make a big problem!

I dont know how I said it, but te devo uma!.

Thanks a lot!!!


On Nov 5, 9:26 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 Your second documentos array (the empty one), has a comma after it, which
 is not followed by another property.

 When I tried to eval your original json, I got an error.

 After removing that comma, it eval'ed correctly.

 Hope this helps.

 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On

 Behalf Of Augusto TMW
 Sent: Wednesday, November 05, 2008 1:56 PM
 To: jQuery (English)
 Subject: [jQuery] Re: Problems with the JSON return from the jQuery.ajax()
 method

 Hi, thanks about your answer.

 This is a example of my JSON:

 {mes:{
         numero:11,
         ano:2008,
         reunioes: [
                         {
                         dia:27,
                         horario:15:50,
                         local:lorem ipsum,
                         titulo:Reunião 03,
                         documentos:[

 {nome:teste5,arquivo:../institucional/downloads/
 teste5.pdf},

 {nome:teste6,arquivo:../institucional/downloads/
 teste6.pdf}
                                 ]
                         },
                         {
                         dia:23,
                         horario:10:20,
                         local:lorem ipsum,
                         titulo:Reunião 04,
                         documentos:[],
                         }
                         ],
                 visitas:[
                         {
                         dia:1,
                         horario:21:15,
                         local:lorem ipsum,
                         titulo:Visita 01,
                         documentos:[

 {nome:teste4,arquivo:../institucional/downloads/teste4.pdf}
                         ]
                         },
                         {
                         dia:25,
                         horario:21:15,
                         local:lorem ipsum,
                         titulo:Visita 02,
                         documentos:[

 {nome:teste5,arquivo:../institucional/downloads/teste5.pdf}
                         ]
                         }
                 ]
 }}

 Where I've to put the comma?

 Thanks very much for your help! =D

 Augusto TMW

 On Nov 5, 12:46 pm, Choan Gálvez [EMAIL PROTECTED] wrote:
  Hi.

  On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote:

   Hi,

   I'm trying do return a JSON with a $.ajax() method.

   here is my entire function:

   function carregaMes(d){
    if(!(_reunioes[reg+d.month+d.year])){
      $.ajax({
              url: reunioes.jsp,
              data: mes=+d.month+ano=+d.year,
              async: false,
              dataType: json,
              success: function(a){
                      _reunioes[reg+d.month+d.year] = a;
              }
      });
      return _reunioes[reg+d.month+d.year];
    } else {
      return _reunioes[reg+d.month+d.year];
    }
   }

   Where _reunioes is an array in window object.

   In FF its ok, but in IE its return undefined. I tried to call a
   normal ajax and use the jQuery.httpData() method to covert my xhr into
   a JSON, but my IE tell me that in line where jQuery tries to convert
   ( data = eval((+data+)); ) has an error Indentifier, sequency or
   number expected.

  I'd bet the input is not valid JSON. Check for extra commas at the end  
  of your JSON array definition.

  Best.
  --
  Choan


[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method

2008-11-05 Thread Choan Gálvez


Hi.

On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote:



Hi,

I'm trying do return a JSON with a $.ajax() method.

here is my entire function:

function carregaMes(d){
 if(!(_reunioes[reg+d.month+d.year])){
$.ajax({
url: reunioes.jsp,
data: mes=+d.month+ano=+d.year,
async: false,
dataType: json,
success: function(a){
_reunioes[reg+d.month+d.year] = a;
}
});
return _reunioes[reg+d.month+d.year];
 } else {
return _reunioes[reg+d.month+d.year];
 }
}

Where _reunioes is an array in window object.

In FF its ok, but in IE its return undefined. I tried to call a
normal ajax and use the jQuery.httpData() method to covert my xhr into
a JSON, but my IE tell me that in line where jQuery tries to convert
( data = eval((+data+)); ) has an error Indentifier, sequency or
number expected.


I'd bet the input is not valid JSON. Check for extra commas at the end  
of your JSON array definition.


Best.
--
Choan


[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method

2008-11-05 Thread Augusto TMW

Hi, thanks about your answer.

This is a example of my JSON:


{mes:{
numero:11,
ano:2008,
reunioes: [
{
dia:27,
horario:15:50,
local:lorem ipsum,
titulo:Reunião 03,
documentos:[

{nome:teste5,arquivo:../institucional/downloads/
teste5.pdf},

{nome:teste6,arquivo:../institucional/downloads/
teste6.pdf}
]
},
{
dia:23,
horario:10:20,
local:lorem ipsum,
titulo:Reunião 04,
documentos:[],
}
],
visitas:[
{
dia:1,
horario:21:15,
local:lorem ipsum,
titulo:Visita 01,
documentos:[

{nome:teste4,arquivo:../institucional/downloads/teste4.pdf}
]
},
{
dia:25,
horario:21:15,
local:lorem ipsum,
titulo:Visita 02,
documentos:[

{nome:teste5,arquivo:../institucional/downloads/teste5.pdf}
]
}
]
}}


Where I've to put the comma?

Thanks very much for your help! =D

Augusto TMW

On Nov 5, 12:46 pm, Choan Gálvez [EMAIL PROTECTED] wrote:
 Hi.

 On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote:





  Hi,

  I'm trying do return a JSON with a $.ajax() method.

  here is my entire function:

  function carregaMes(d){
   if(!(_reunioes[reg+d.month+d.year])){
     $.ajax({
             url: reunioes.jsp,
             data: mes=+d.month+ano=+d.year,
             async: false,
             dataType: json,
             success: function(a){
                     _reunioes[reg+d.month+d.year] = a;
             }
     });
     return _reunioes[reg+d.month+d.year];
   } else {
     return _reunioes[reg+d.month+d.year];
   }
  }

  Where _reunioes is an array in window object.

  In FF its ok, but in IE its return undefined. I tried to call a
  normal ajax and use the jQuery.httpData() method to covert my xhr into
  a JSON, but my IE tell me that in line where jQuery tries to convert
  ( data = eval((+data+)); ) has an error Indentifier, sequency or
  number expected.

 I'd bet the input is not valid JSON. Check for extra commas at the end  
 of your JSON array definition.

 Best.
 --
 Choan


[jQuery] Re: Problems with the JSON return from the jQuery.ajax() method

2008-11-05 Thread Jeffrey Kretz

Your second documentos array (the empty one), has a comma after it, which
is not followed by another property.

When I tried to eval your original json, I got an error.

After removing that comma, it eval'ed correctly.

Hope this helps.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Augusto TMW
Sent: Wednesday, November 05, 2008 1:56 PM
To: jQuery (English)
Subject: [jQuery] Re: Problems with the JSON return from the jQuery.ajax()
method


Hi, thanks about your answer.

This is a example of my JSON:


{mes:{
numero:11,
ano:2008,
reunioes: [
{
dia:27,
horario:15:50,
local:lorem ipsum,
titulo:Reunião 03,
documentos:[

{nome:teste5,arquivo:../institucional/downloads/
teste5.pdf},

{nome:teste6,arquivo:../institucional/downloads/
teste6.pdf}
]
},
{
dia:23,
horario:10:20,
local:lorem ipsum,
titulo:Reunião 04,
documentos:[],
}
],
visitas:[
{
dia:1,
horario:21:15,
local:lorem ipsum,
titulo:Visita 01,
documentos:[

{nome:teste4,arquivo:../institucional/downloads/teste4.pdf}
]
},
{
dia:25,
horario:21:15,
local:lorem ipsum,
titulo:Visita 02,
documentos:[

{nome:teste5,arquivo:../institucional/downloads/teste5.pdf}
]
}
]
}}


Where I've to put the comma?

Thanks very much for your help! =D

Augusto TMW

On Nov 5, 12:46 pm, Choan Gálvez [EMAIL PROTECTED] wrote:
 Hi.

 On Nov 4, 2008, at 10:48 PM, Augusto TMW wrote:





  Hi,

  I'm trying do return a JSON with a $.ajax() method.

  here is my entire function:

  function carregaMes(d){
   if(!(_reunioes[reg+d.month+d.year])){
     $.ajax({
             url: reunioes.jsp,
             data: mes=+d.month+ano=+d.year,
             async: false,
             dataType: json,
             success: function(a){
                     _reunioes[reg+d.month+d.year] = a;
             }
     });
     return _reunioes[reg+d.month+d.year];
   } else {
     return _reunioes[reg+d.month+d.year];
   }
  }

  Where _reunioes is an array in window object.

  In FF its ok, but in IE its return undefined. I tried to call a
  normal ajax and use the jQuery.httpData() method to covert my xhr into
  a JSON, but my IE tell me that in line where jQuery tries to convert
  ( data = eval((+data+)); ) has an error Indentifier, sequency or
  number expected.

 I'd bet the input is not valid JSON. Check for extra commas at the end  
 of your JSON array definition.

 Best.
 --
 Choan