-1

I have this code here:

shortenURL('#(campaign.id)', url, function(shortenedURL) {
  if (youtubeID && youtubeID != "") {
    shortenedURL = clientUrl
  }
  $("#textCopiedModal #sharer-link").attr("href", 'javascript:openFacebook("' + shortenedURL + '")')
  $("#textCopiedModal #sharer-link #social-network-name").text('Facebook')
  $('#textCopiedModal').modal()
})

And I do not know what is this mean: $("#textCopiedModal #sharer-link")

It is clearly a JavaScript code. But what specific is it more? Some kind of AJAX expression?

János
  • 32,867
  • 38
  • 193
  • 353
  • It's a selector to select the element with the id of `sharer-link` inside of the element witht the id of `textCopiedModal` (https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors) – Nick Parsons Aug 03 '21 at 10:01
  • jQuery with a selector. – VLAZ Aug 03 '21 at 10:01
  • 1
    Does this answer your question? [What is the meaning of "$" sign in JavaScript](https://stackoverflow.com/questions/1150381/what-is-the-meaning-of-sign-in-javascript) – Ivar Aug 03 '21 at 10:02
  • It's also not a great selector since '#' points to an ID which is meant to be unique. – Rol Aug 03 '21 at 10:02

1 Answers1

1

It's a jQuery code to select the DOM element with Id "sharer-link", which is inside the element with Id "textCopiedModal".

ingdc
  • 760
  • 10
  • 16