1. What is the meaning of the highlighted sections?

Bob Dang 1 Reputation point
2022-04-28T19:30:14.363+00:00

I have a few questions:

  1. What is the meaning of the highlighted sections?
    197522-image.png
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,275 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,280 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Bob Dang 1 Reputation point
    2022-04-28T19:34:37.61+00:00

    What is the meaning of the dollar sign in javascript?

    Thanks for your help.

    Best regards,
    Bob

    0 comments No comments

  2. Michael Taylor 48,581 Reputation points
    2022-04-28T19:38:45.96+00:00

    This is jQuery methods being called. prepend inserts the given HTML before each of the given elements returned by the jQuery selector. The append function inserts the given HTML after each of the given elements. The find function gets the descendants of the given element optionally filtered by the given selector.

    Taken in total, I believe, the code is getting the GridView gvMouldDetails, adding an empty table header before it and appending the first row from the grid after it. Not really sure why it is doing that though. Probably want to look at the HTML to make sure about this.

    You didn't post the entire line so I'm guessing what comes after the append call. Just taken what I can see it appears that it is appending a JSON object to the content as well since append allows additional content elements to be specified. But what that JSON object is doing is unclear as it appears to be custom. You should probably look at the generated HTML to determine that.

    0 comments No comments

  3. Bruce (SqlWork.com) 56,771 Reputation points
    2022-04-28T19:47:29.337+00:00

    its a global function named $

    function $()
    {
    }

    or

    const $ = function() {
    };

    in your case its proxy jQuery, in which case

    const $ = jQuery;

    assignment is done in the include file. the first set of highlighted term are jquery functions. jQuery support chaining, where the function return a jQuery object.

    https://jquery.com

    the last bits, are property names of an anonymous object and their values.

    in javascript functions are first class objects and can have properties.

    function foo () { console.log("foo() called"); 
    foo.bar = function() { console.log("bar() called); 
    
    foo();         // "foo() called" 
    foo.bar();     // "bar() called" 
    
    0 comments No comments

  4. Yijing Sun-MSFT 7,071 Reputation points
    2022-04-29T07:36:10.973+00:00

    Hi @Bob Dang ,
    First,you need to know what's the jquery. $ is another name for jQuery. Prepend,append and find are the methods. And others you highlight are properties. You could learn from this article.
    Best regards,
    Yijing Sun


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments