What is the meaning of the dollar sign in javascript?
Thanks for your help.
Best regards,
Bob
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a few questions:
What is the meaning of the dollar sign in javascript?
Thanks for your help.
Best regards,
Bob
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.
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.
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"
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.