Avatar of Deraldo Silva
Deraldo Silva

asked on 

Local IIS in windows 8.1 do not load scripts

Hi.
I have a web application using jquery. is the example of Brady Gaster at TechEd 2014.

well. When I run it from IISExpress it runs ok.
When I run it from IIS site, I got to 404 for all scripts. The scripts are referred to as:
     <script src = "Scripts / jquery-2.1.1.js"> </ script>
     <script src = "scripts / jquery.signalR-2.1.2.js"> </ script>
When I run the application, in F12, I got this:

  Resource interpreted the script but Transferred with MIME type text / plain: "http: //localhost/HitCounter/Scripts/jquery-2.1.1.js".
Default.aspx: 10 Resource interpreted the script but Transferred with MIME type text / plain: "http: //localhost/HitCounter/Scripts/jquery.signalR-2.1.2.js".
Because of this, I got an "$  is not defined"

the default.aspx is :
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="HitCounter.Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-2.1.1.js"></script>
    <script src="Scripts/jquery.signalR-2.1.2.js"></script>
    <script type="text/javascript">

            $(function () {
                var con = $.hubConnection();
                var hub = con.createHubProxy('hitCounter');
                hub.on('onHitRecorded', function (i) {
                    $('#hitCount').text(i);
                });
                con.start(function () {
                    hub.invoke('recordHit');
                });

            })

    </script>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <div id="hitCount" style="font-size: 200px;"></div>
        </div>
    </form>

</body>
</html>

Open in new window

jQuery

Avatar of undefined
Last Comment
Deraldo Silva

8/22/2022 - Mon