2
Holá, guys, I’m not getting information about this because I don’t know how to look, I tried to get variable jquery, and things like that and didn’t return what I need.
It is as follows: I need to pass a variable in js in the name of the file and inside this file to get this variable:
Ex:
<script src='app.translator.js?lang=pt_BR'></script>
inside the file 'app.translator.js' as I get this variable 'lang'??
var lang = ????????;
============edited from here down with an answer=========================
I want to leave here another solution that I got
<script src='app.translator.js'></script>
//conteudo do arquivo
var appTranslate = function(){
var formLogin = function(lang){
//minha funcao com a lang carregada aqui...
};
return {
init: function(lang){
alert(lang);
// passo a lang para minha funcao
formLogin(lang);
},
};
}();
after loading the app.translator.js on the html page footer, I just called the function
<script src='jquery.js'></script>
<script src='app.translator.js'></script>
<script>
$(function(){
// vai mostrar o alert('pt_BR')
appTranslate.init('pt_BR');
});
</script>
I want to make it clear that this answer served exactly what I wanted. however I found another solution and edited the question with the answer. Thank you all.
– rafaelphp