There is a question in this forum here , but it does not solve my problem. I have the includes, including the include jquery in the first row because in that link I found this:
Because, JS interpreter search for $ before is even loaded and defined.
My error is the title of this post. Here's how it is. In the same file I have the include, function and call button
<head>
<title><%=Application("app")%></title>
<script type="text/javascript" src="../../gen/modal/jquery-ui.min.js"></script>
<link href="\gen\css\css002.css" rel="stylesheet" type="text/css">
<!-- Include the code and stylesheet for the grid control. -->
<script language="jscript.encode" src="../../gen/inc/ebagrid.js"></script>
<link type="text/css" rel="stylesheet" href="../../gen/inc/styles/xp/eba.css" />
<script src="../../gen/js/cpaint2.inc.compressed.js" type="text/javascript"></script>
</head>
Here the call button to the function. It's commented because I'm creating it now and seeing if it's loading from the database and etc:
<div><input type="button" id="btn" value="teste" onclick="CarregaTabela();" /></div>
And here is the javascript function with jquery. The function is called LoadTable:
<script language="javascript">
var carregaDados = null;
function reexecute() {
document.form01.action = '<%=session("pgm_retorno")%>';
document.form01.submit();
}
function CarregaTabela() {
var str = "";
$.ajax({
url: '../../prs/asp/prs0061b_crosbrowser.asp',
datatype: 'json',
contentType: 'application/json; charset=utf-8',
type: 'POST',
data: JSON.stringify({carregaDados: rsPesquisa}),
success: function (data) {
alert(data.carregaDados.nome_tipo_prestador);
$(data.resultado_acao).each(function () {
//str += '<option value=' + this.Acao1 + '>' + this.Acao1 + '</option>';
})
//$('#cbxAcao').html(str);
str = "";
},
error: function (error) {
}
})
}
</script>