yes Robson,I already saw it...and this is very strange:a $.getJSON call
returning a html...how do i solve it???

2010/6/9 Robson Dantas <biu.dan...@gmail.com>

> Andre,
>
> You're supposed to return a json in $.getJSON function, but the url
> provided is not returning it. That's why you're getting an error.
>
> Calling
> http://netmony.marestelecom.net/gadget/call_recharge/?jsoncallback=? in my
> browser returns html.
>
>
> Robson Dantas
>
> 2010/6/9 André Luís Moura Lima <azdr3mi...@gmail.com>
>
>> Well,sorry for the resurrect of this thread,but the problem still
>> remains...once the page is submitted,it must to redirect to another
>> page,showing the values that were submitted by the user,something like a
>> voucher...i am doing it this way:
>>  $.getJSON("
>> http://netmony.marestelecom.net/gadget/call_recharge/?jsoncallback=?";,
>> dict, function(data) {
>>
>>                 //$("#cont").html(data);
>>                          alert(data);
>>                 html = "     <div id='conteudo'>" +
>>                        "         <div id='formulario'>" +
>>                        "             <h4>$transacao</h4>" +
>>                        "             <div id='comprovante'>" +
>>                        "                 <div id='compr_topo'></div>" +
>>                        "                 <div>" +
>>                        "                     <table id='compr_tabela'>" +
>>                        "                         <tr>" +
>>                        "                             <td>Nº CELULAR:</td>"
>> +
>>                        "                             <td
>> class='direita'>$celular</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>OPERADORA:</td>"
>> +
>>                        "                             <td
>> class='direita'>$operadora</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>VALOR
>> CREDITADO:</td>" +
>>                        "                             <td
>> class='direita'>R$ $valor</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>VENCIMENTO:</td>"
>> +
>>                        "                             <td
>> class='direita'>$vencimento</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>CODIGO
>> OPERADORA:</td>" +
>>                        "                             <td
>> class='direita'>$cod_operadora</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>COD.
>> VYRTUMONY:</td>" +
>>                        "                             <td
>> class='direita'>$cod_virtumony</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>ID:</td>" +
>>                        "                             <td
>> class='direita'>$user_name</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>DATA:</td>" +
>>                        "                             <td
>> class='direita'>$data</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td>HORA:</td>" +
>>                        "                             <td
>> class='direita'>$hora</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td
>> colspan='2'>&nbsp;</td>" +
>>                        "                         </tr>" +
>>                        "                         <tr>" +
>>                        "                             <td colspan='2'
>> class='centralizado'>$obs</td>" +
>>                        "                         </tr>" +
>>
>>                        "                         <tr>" +
>>                        "                             <td
>> colspan='2'>&nbsp;</td>" +
>>                        "                         </tr>" +
>>                        "                     </table>" +
>>                        "                 </div>" +
>>                        "                 <div id='compr_base'></div>" +
>>                        "             </div>" +
>>                        "             <div id='botoes'
>> class='centralizado'>" +
>>                        "                 <input type='button'
>> name='imprimir' value='Imprimir' class='cBotao' />" +
>>                        "                 <input type='button'
>> name='voltar' value='Voltar' class='cBotao' />" +
>>                        "             </div>" +
>>                        "         </div>" +
>>                        "         <div
>> id='rodape'><div><div></div></div></div>" +
>>                        "     </div>";
>>                 $.each(data, function(i, item) {
>>                     if ( i == 'celular' ) {
>>                         html = html.replace('$'+i, mascaraTel(item));
>>                     } else {
>>                         html = html.replace('$'+i, item);
>>                     }
>>                 });
>>                 $('#conteudo').attr('style', 'display: none');
>>                 $("#comprovante").append(html);
>>                 $("#comprovante").attr('style', 'display: display');
>>             });
>>             appUrl = "http://netmony.marestelecom.net/"; +
>> $("#id_username").val();
>>
>>             postActivity(
>>                 "Eu recarreguei R$ " + $('#id_product_value').val() + ",00
>> com o Virtumony.",
>>                 appUrl
>>             );
>>             closeModal();
>>         });
>>
>> but when I click the recharge button,the activity is posted,but there is
>> no redirect...in firebug i get this error:
>>
>> missing ) after argument list
>> jsonp1276086580843(<link
>> rel="styleshe...estelecom.net/gadget/recharge/"><img s
>>
>>
>> I have no idea what is happening here...anyway,any help from you is
>> welcome...
>> I'm already thankful for the attention.
>>
>>
>>
>>
>>
>> 2010/5/28 Prashant (Google) <p...@google.com>
>>
>> Hi André,
>>>
>>> Thanks for posting back the solution here, much appreciated!
>>>
>>> ~Prashant
>>>
>>> On May 28, 6:09 am, André Luís Moura Lima <azdr3mi...@gmail.com>
>>> wrote:
>>> > no worries guys...problem solved...wrong call on the jQuery file...it
>>> isn't
>>> > jquery.js,it is jquery-latest.js
>>> >
>>> > 2010/5/28 André Luís Moura Lima <azdr3mi...@gmail.com>
>>> >
>>> >
>>> >
>>> > > well I will explain better what my application do:it buys
>>> rechage,this is
>>> > > the principal functionality...beyond this,it posts an activity with
>>> the
>>> > > fields submitted by the user...the activity part works well,but it
>>> doesn't
>>> > > buy recharge...the jquery code calls some php/django code that makes
>>> the
>>> > > application work,that buy recharge...i will post some of this
>>> code,maybe you
>>> > > can help me:
>>> >
>>> > >             $('#submit').click(function() {
>>> > >                 alert('asdf');
>>> > >                 if ( valid() ) {
>>> > >                     alert('11111');
>>> > >                     callModal();
>>> > >                     query = 'action=process' +
>>> > >                     '&ntc=' + remove_mask($('#id_phone1').val()) +
>>> > >                     '&confirm_ntc=' +
>>> remove_mask($('#id_phone2').val()) +
>>> > >                     '&value_product=' + $('#id_product_value').val()
>>> +
>>> > >                     '&username=' + $('#id_username').val() +
>>> > >                     '&password=' + $('#id_password').val() +
>>> > >                     '&type_file=xml' +
>>> > >                     '&cod_product=' + $('#id_product').val();
>>> > >                     $.ajax({
>>> > >                         type: 'POST',
>>> > >                         url: '{% url call_recharge %}',
>>> > >                         //url: '{% url auth_recharge %}',
>>> > >                         data: query,
>>> > >                         success: function(ret) {
>>> > >                             closeModal();
>>> > >                             $('#cont').html(ret);
>>> > >                         }
>>> > >                     });
>>> > >                 } else {
>>> > >                     closeModal();
>>> > >                 }
>>> > >             });
>>> > >             function remove_mask(value) {
>>> > >                 if (value.indexOf('-') == -1) {
>>> > >                     return value;
>>> > >                 } else {
>>> > >                     value = value.replace(/[-]/, "");
>>> > >                     value = value.replace(/[.]/, "");
>>> > >                     value = value.replace(/[(]/, "");
>>> > >                     value = value.replace(/[)]/, "");
>>> > >                     return value;
>>> > >                 }
>>> > >             }
>>> > >             function valid() {
>>> > >                 var status = true;
>>> > >                 status = status && field_valid('id_phone1');
>>> > >                 status = status && field_valid('id_phone2');
>>> > >                 status = status && field_valid('id_mobile_carrier');
>>> > >                 status = status && field_valid('id_product_value');
>>> > >                 status = status && field_valid('id_username');
>>> > >                 status = status && field_valid('id_password');
>>> > >                 status = status && field_valid('id_product');
>>> > >                 return status;
>>> > >             }
>>> > >                         function field_valid(field) {
>>> > >                 $('#div_' + field).removeClass('error');
>>> > >                 $('#error_1_' + field).remove();
>>> > >                 if ( $('#' + field).val() == '' ||  $('#' +
>>> field).val() ==
>>> > > 0) {
>>> > >                     $('#div_' + field).addClass('error');
>>> > >                     $('label[for=' + field + ']').before("<p
>>> id='error_1_"
>>> > > + field + "' class='errorField'>{% trans 'This field is required.'
>>> %}</p>");
>>> > >                     return false;
>>> > >                 } else {
>>> > >                     return true;
>>> > >                 }
>>> > >             }
>>> > >         });
>>> >
>>> > > 2010/5/28 André Lima <azdr3mi...@gmail.com>
>>> >
>>> > > There is some django code on this jQuery code...so it's impossible to
>>> > >> put it on the opensocial gadget...I have to call it
>>> > >> somewhere,somehow...I tried to read jquery-opensocial,but it's in
>>> > >> japanese...if anyone can help me with this...anyway,I already
>>> > >> thankful!
>>> >
>>> > >> On 27 maio, 20:06, André Luís Moura Lima <azdr3mi...@gmail.com>
>>> wrote:
>>> > >> > Hello everybody,
>>> > >> > I'm trying to add some jQuery code in my opensocial gadget,but it
>>> always
>>> > >> > fails...I'm trying to do it using the jquery-opensocial plugin,but
>>> > >> firebug
>>> > >> > don't recognize my calls to jquery files...I'm trying something
>>> like
>>> > >> this:
>>> > >> > <script src="js/jquery.js" type="text/javascript"></script>
>>> > >> > <script src="js/jquery.maskedinput-1.2.2.min.js"
>>> type="text/javascript">
>>> > >> > </script>
>>> > >> > <script src="js/jquery.simplemodal-1.3.5.min.js"
>>> type="text/javascript">
>>> > >> > </script>
>>> > >> > <script src="js/opensocial-jquery.js" type="text/javascript">
>>> > >> > </script>
>>> > >> > <script src="js/opensocial-jquery.min.js" type="text/javascript">
>>> > >> > </script>
>>> > >> > but firebug always shows me the same error:
>>> > >> > $ is not defined
>>> > >> > $(function() {
>>> > >> > I know that this error is shown when the paths of the files aren't
>>> > >> right,but
>>> > >> > in this case they are(though it's not complete here)...The jquery
>>> code
>>> > >> is
>>> > >> > originally in another file,a html...there is any way to get it
>>> instead
>>> > >> of to
>>> > >> > add the jquery code in the opensocial gadget?For now I'm trying to
>>> add
>>> > >> the
>>> > >> > jquery code,but if there is any other way,I will try it.
>>> > >> > Thanks in advance.
>>> >
>>> > >> --
>>> > >> You received this message because you are subscribed to the Google
>>> Groups
>>> > >> "orkut Developer Forum" group.
>>> > >> To post to this group, send email to
>>> opensocial-or...@googlegroups.com.
>>> > >> To unsubscribe from this group, send email to
>>> > >> opensocial-orkut+unsubscr...@googlegroups.com<opensocial-orkut%2bunsubscr...@googlegroups.com><opensocial-orkut%2Bunsubscrib
>>> e...@googlegroups.com>
>>> > >> .
>>> > >> For more options, visit this group at
>>> > >>http://groups.google.com/group/opensocial-orkut?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "orkut Developer Forum" group.
>>> To post to this group, send email to opensocial-or...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> opensocial-orkut+unsubscr...@googlegroups.com<opensocial-orkut%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/opensocial-orkut?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "orkut Developer Forum" group.
>> To post to this group, send email to opensocial-or...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> opensocial-orkut+unsubscr...@googlegroups.com<opensocial-orkut%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/opensocial-orkut?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "orkut Developer Forum" group.
> To post to this group, send email to opensocial-or...@googlegroups.com.
> To unsubscribe from this group, send email to
> opensocial-orkut+unsubscr...@googlegroups.com<opensocial-orkut%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/opensocial-orkut?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"orkut Developer Forum" group.
To post to this group, send email to opensocial-or...@googlegroups.com.
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en.

Reply via email to