Software Archive
Read-only legacy content
17061 Discussions

Botão Edit Script Sumiu

Patrick_F_
Beginner
1,173 Views

Boa Tarde,

Não sei se no caso é um bug do XDK, mas quando estou criando um botão e seleciono a Action para Custom Script na Interactivity, o botão Edit Script não aparece, quando realizo o procedimento pela 1 vez no projeto ele vai porém quando tento realizar com outro botão não aparece o Edit Script, e quando vou verificar o do 1 botão ele já sumiu, logo ao emular não ocorre a action mesmo já tendo inserido o script na devida parte do código.

Alguém poderia me ajudar com esta questão?

Fico no Aguardo.

0 Kudos
5 Replies
PaulF_IntelCorp
Employee
1,173 Views

Translation of your question:

Good Afternoon,

I'm not sure if it's a bug in XDK , but when I'm creating a button and select the Custom Script Action to the Interactivity , the Edit Script button does not appear when I do the procedure for the first time in the project it will but when I try to accomplish with another button does not appear the Edit script , and when I check the first button he has gone, soon to emulate not the script due part of the code is the same action having already inserted.

Could anyone help me with this issue ?

I'm waiting.

I'll ask one of my colleagues who is more knowledgeable in this area to see if they can help.

0 Kudos
Chris_P_Intel
Employee
1,173 Views

Hello,

I am using build 2170 and for me the Interactiivty pane works correctly. The Edit Script button appears when I click an entry that has Custom Script on it.  If I add Custom Script to a button, the Edit Script button appears.

Be sure to click the entry in the Interactivity pane first. Then you'll see the Edit Script button appear for the selected entry.

Also, is it possible that your edits to index_user_scripts.js have broken that file? What does JSHint say when you open it on that file?

Chris

0 Kudos
Patrick_F_
Beginner
1,173 Views

Quando abro o arquivo index_user_scripts.js está presente o meu código do javascript. Fiz um novo projeto, td estava funcionando até eu colocar o meu código dentro.

Segue abaixo o conteúdo do arquivo index_user_scripts.js:

(function()
{
 "use strict";
 /*
   hook up event handlers 
 */
 function register_event_handlers()
 {
    
    
     /* button  #btn_pesquisar */
    $(document).on("click", "#btn_pesquisar", function(evt)
    {
        /* your code goes here */ 
        
        
        var cep = document.getElementById("cep").value;
        $("#endereco").html("Buscando dados ...");
        
        $.ajax({
            type:"GET",
            dataType:"json",
            url:"http://republicavirtual.com.br/web_cep.php?cep='+"+ cep +"&formato-json",
            timeout: 2000, //2segundos
            
            success: function(cep){
            $("#endereco".html)("Endereço:" + cep.tipo_logradouro + " " + cep.logradouro)
            $("#cidade").html("Cidade: " + cep.cidade)
            $("#estado").html("Estado: " + cep.uf)
            
    });
    
    }
 document.addEventListener("app.Ready", register_event_handlers, false);
})();

 

0 Kudos
Chris_P_Intel
Employee
1,173 Views

Your JS is broken.  Run JS Hint. It'll point out the major problems.

jshint.png

In your case, the success handler function is opened, but not closed. And the Ajax options are not closed.

In other words, you need } and } and )  

...
     $("#estado").html("Estado: " + cep.uf)
     }
  })

 

0 Kudos
Patrick_F_
Beginner
1,173 Views

Thx !!!!!!!!!!!

0 Kudos
Reply