Click here to Skip to main content
15,887,875 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Richard Deeming8-Mar-17 8:53
mveRichard Deeming8-Mar-17 8:53 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Kevin Marois8-Mar-17 10:28
professionalKevin Marois8-Mar-17 10:28 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Richard MacCutchan8-Mar-17 21:23
mveRichard MacCutchan8-Mar-17 21:23 
Questionunexpected character EOF Pin
Member 110313048-Mar-17 1:02
Member 110313048-Mar-17 1:02 
AnswerRe: unexpected character EOF Pin
Nathan Minier8-Mar-17 1:15
professionalNathan Minier8-Mar-17 1:15 
GeneralRe: unexpected character EOF Pin
Member 110313048-Mar-17 1:56
Member 110313048-Mar-17 1:56 
GeneralRe: unexpected character EOF Pin
Nathan Minier8-Mar-17 2:02
professionalNathan Minier8-Mar-17 2:02 
QuestionNext Issue - Script Bundle Problem? Pin
Kevin Marois7-Mar-17 11:59
professionalKevin Marois7-Mar-17 11:59 
In _Layout.cshtml, in the Body section, I have
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)

So far so good.

Then in my view, in the body, I have
<a href="https://www.codeproject.com/Members/using">@using</a></a> (@Html.BeginForm("Index", "Home"))
{

        @{
            var grid = new WebGrid(Model);

            <a href="https://www.codeproject.com/Members/grid">@grid</a>.GetHtml(
            mode: WebGridPagerModes.All,
            columns:
            grid.Columns
            (
                grid.Column(columnName: "SiteId", header: "Site Id", format: @@item.SiteId),
                grid.Column(columnName: "Instrument", header: "Instrument", format: @@item.InstrumentId ),
            ))
        }

}

<a href="https://www.codeproject.com/Members/Section">@section</a></a> scripts{
    $(function () {

        console.log("HELLO WORLD");

        $.connection.hub.url = '<a href="http://192.168.51.74:8094/signalr">http://192.168.51.74:8094/signalr</a>';

        var proxy = $.connection.DashboardHub;

        proxy.client.NotifyAllClientsOfChanges = function () {

            var searchUrl = "Home/GetData";

            $.ajax({
                url: searchUrl,
                type: "POST",
                success: function (data) {
                    $("#divData").html(data);
                }
            });
        };

        $.connection.hub.start({ transport: 'auto', xdomain: true })
        .done(function () {
            console.log('Connected.');
        })
        .fail(function (e) {
            console.log('Unable to connect:' + e);
        });
    });

}

I'm not sure what's wrong.. In the Console I see my HELLO WORLD, then the very next item is the error
Cannot read property 'client' of undefined

This did not happen until I moved the scripts into @"section scripts". Before that I had other errors happening.

So this script section seems work because the HELLO WORLD is there, but the Client on the Proxy is not.

WTH am I doing wrong now?????????
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.

AnswerRe: Next Issue - Script Bundle Problem? Pin
Nathan Minier8-Mar-17 1:21
professionalNathan Minier8-Mar-17 1:21 
GeneralRe: Next Issue - Script Bundle Problem? Pin
Kevin Marois8-Mar-17 3:59
professionalKevin Marois8-Mar-17 3:59 
QuestionSetting URL Pin
Kevin Marois7-Mar-17 8:22
professionalKevin Marois7-Mar-17 8:22 
AnswerRe: Setting URL Pin
ZurdoDev7-Mar-17 9:21
professionalZurdoDev7-Mar-17 9:21 
GeneralRe: Setting URL Pin
Kevin Marois7-Mar-17 10:47
professionalKevin Marois7-Mar-17 10:47 
AnswerRe: Page appearing way to wide. Pin
Richard MacCutchan3-Mar-17 21:14
mveRichard MacCutchan3-Mar-17 21:14 
AnswerRe: Page appearing way to wide. Pin
ZurdoDev7-Mar-17 9:23
professionalZurdoDev7-Mar-17 9:23 
QuestionSetting SignalR URL in JQuery Pin
Kevin Marois2-Mar-17 12:21
professionalKevin Marois2-Mar-17 12:21 
AnswerRe: Setting SignalR URL in JQuery Pin
Nathan Minier3-Mar-17 1:26
professionalNathan Minier3-Mar-17 1:26 
QuestionJavaScript Error - Internet Explorer - Object doesn't support property or method 'indexOf' Pin
Kevin Marois2-Mar-17 10:54
professionalKevin Marois2-Mar-17 10:54 
Question(SOLVED) Call to Member function execute() on null... Pin
samflex25-Feb-17 11:36
samflex25-Feb-17 11:36 
AnswerRe: Call to Member function execute() on null... Pin
Richard MacCutchan25-Feb-17 20:47
mveRichard MacCutchan25-Feb-17 20:47 
GeneralRe: Call to Member function execute() on null... Pin
samflex25-Feb-17 21:25
samflex25-Feb-17 21:25 
GeneralRe: Call to Member function execute() on null... Pin
Richard MacCutchan25-Feb-17 21:29
mveRichard MacCutchan25-Feb-17 21:29 
GeneralRe: Call to Member function execute() on null... Pin
samflex25-Feb-17 21:37
samflex25-Feb-17 21:37 
GeneralRe: Call to Member function execute() on null... Pin
Richard MacCutchan25-Feb-17 21:42
mveRichard MacCutchan25-Feb-17 21:42 
GeneralRe: Call to Member function execute() on null... Pin
samflex25-Feb-17 21:47
samflex25-Feb-17 21:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.