1

Dollar sign is not work for my project when i was wrote inside a link

//We Use To Prototypes

function Translate(word, language) {
    this.apikey = "c39d8dd7eemsh929c56378f9904ep1b7ee2jsn532547e3980a";
    this.word = word;
    this.language = language;

    //XHR object

    this.xhr = new XMLHttpRequest();
}
Translate.prototype.translateWord = function (callback) {
    
    //Ajax

    const endpoint = 'https://google-translate1.p.rapidapi.com/language/translate/v2/languages?key=${this.apikey}';

};

**I appreciate any help available!

i was trying to insert information to form and automatically to pull information from api and yeah i was adding to jquery to my project so this is not the problem**

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
uLb
  • 11
  • 1

1 Answers1

-1

Instead of quotes, wrap your string in backticks ` (Template literals)

const endpoint = `https://google-translate1.p.rapidapi.com/language/translate/v2/languages?key=${this.apikey}`;
Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313
Ibrahim Hamaty
  • 540
  • 2
  • 18