Click here to Skip to main content
15,918,967 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Kevin Marois8-Mar-17 8:11
professionalKevin Marois8-Mar-17 8:11 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Richard Deeming8-Mar-17 8:13
mveRichard Deeming8-Mar-17 8:13 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Kevin Marois8-Mar-17 8:17
professionalKevin Marois8-Mar-17 8:17 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Richard Deeming8-Mar-17 8:22
mveRichard Deeming8-Mar-17 8:22 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Kevin Marois8-Mar-17 8:26
professionalKevin Marois8-Mar-17 8:26 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Kevin Marois8-Mar-17 8:27
professionalKevin Marois8-Mar-17 8:27 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Richard Deeming8-Mar-17 8:40
mveRichard Deeming8-Mar-17 8:40 
GeneralRe: OK, What Am I doing Wrong ???? Pin
Kevin Marois8-Mar-17 8:42
professionalKevin Marois8-Mar-17 8:42 
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 
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 
I'm following this example

There's a code block about halfway down where there is
JavaScript
<script type="text/javascript">
        $(function () {
            // Declare a proxy to reference the hub. 
            var chat = $.connection.chatHub;
            // Create a function that the hub can call to broadcast messages.
            chat.client.broadcastMessage = function (name, message) {
                // Html encode display name and message. 
                var encodedName = $('<div />').text(name).html();
                var encodedMsg = $('<div />').text(message).html();
                // Add the message to the page. 
                $('#discussion').append('<li>' + encodedName
                    + ':  ' + encodedMsg + '</li>');
            };
            // Get the user name and store it to prepend to messages.
            $('#displayname').val(prompt('Enter your name:', ''));
            // Set initial focus to message input box.<br />
            $('#message').focus();
            // Start the connection.
            $.connection.hub.start().done(function () {
                $('#sendmessage').click(function () {
                    // Call the Send method on the hub. 
                    chat.server.send($('#displayname').val(), $('#message').val());
                    // Clear text box and reset focus for next comment. 
                    $('#message').val('').focus();
                });
            });
        });
    </script>

I tried adding
JavaScript
$.connection.url = "myurl"

right above the $.connection, but I then get "Cannot read property '' of undefined"

I take this to mean that the ".connection' object is not set.

What's wrong here? How does the URL to the server get set??Confused | :confused: Confused | :confused:
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.


modified 2-Mar-17 18:33pm.

AnswerRe: Setting SignalR URL in JQuery Pin
Nathan Minier3-Mar-17 1:26
professionalNathan Minier3-Mar-17 1:26 

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.