Problems with: Uncaught ReferenceError: $ is not defined

1

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>
    
asked by anonymous 23.09.2015 / 13:55

1 answer

7

The jQuery import is missing, eg:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"type="text/javascript"></script>

Or download the file from the jQuery site and import:

<script src="meusjavascripts/jquery-2.1.3.min.js" type="text/javascript"></script>

Note: 2.x versions of jQuery do not support versions lower than 9 in Internet Explorer (ie: IE8, IE7, IE6 and etc). If you do not have control of your users' browsers use the latest version 1.x.

    
23.09.2015 / 14:13