Hello, guys, I'm not getting information on this because I do not know how to look, I tried to get jquery variables, and stuff like that and did not return what I need.
It is as follows: I need to pass a variable into js in the file name and within that file get this variable:Ex:
<script src='app.translator.js?lang=pt_BR'></script>
inside the file 'app.translator.js' how do I get this variable 'lang' ??
var lang = ????????;
============ edited from here down with an answer =========================
I want to leave another solution here that I have
<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 app.translator.js into 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>