Pedro Chagas
asked on
Jquery - Access to the function
Hi E's, I have this code:
My issue is, I want access to that code, but in other context.
In practice, if I click in #tela_iniciar, the script execute code inside the function.
I have a part in my code where I will need access to that code, but not with the click in #tela_iniciar.
So, my question is, how I access to that function without via #tela_iniciar?
The best regards, JC
$("#tela_inicial").click(function(){
em_jogo = 1;
$(function(){
$.ajax({
type: "POST",
url: "abertura.php",
data: {"nj":numero_jogo, "fase":'1', "ref":ref_puzzle, "ip":ip_cliente},
success: function(dat){
if(dat == ""){
//nao faz nada
} else {
// redirect
window.location=dat;
}
}
});
});
That snippet code shows a function that is executed when click in the div (#tela_inicial).My issue is, I want access to that code, but in other context.
In practice, if I click in #tela_iniciar, the script execute code inside the function.
I have a part in my code where I will need access to that code, but not with the click in #tela_iniciar.
So, my question is, how I access to that function without via #tela_iniciar?
The best regards, JC
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
What matter here, is the access to the same function, but in different way. For my case not matter what is inside the function.
It may not have solution.
~JC