question

BobDang-6703 avatar image
0 Votes"
BobDang-6703 asked YijingSun-MSFT answered

1. What is the meaning of the highlighted sections?

I have a few questions:


  1.  What is the meaning of the highlighted sections?
    

197522-image.png


dotnet-csharpdotnet-aspnet-general
image.png (58.4 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You're asking jQuery and DataTable support questions in a C# forum. Read the documentation.


jQuery documentation.
.prepend()
.append()
.find()

DataTable Documentation
pagingType
paging
info
lengthMenu
iDisplayLength
dom


0 Votes 0 ·
BobDang-6703 avatar image
0 Votes"
BobDang-6703 answered

What is the meaning of the dollar sign in javascript?

Thanks for your help.

Best regards,
Bob

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cooldadtx avatar image
0 Votes"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered Bruce-SqlWork edited

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" 



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YijingSun-MSFT avatar image
0 Votes"
YijingSun-MSFT answered

Hi @BobDang-6703 ,
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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.