The extension in chrome is not reading $(),click, how to fix?

On the page I add:
<a href="#" id="savetradeBtn" class="btn btn-primary input-group-addon">Save Trade URL</a>


And the extension is not working:

$('#savetradeBtn').click(function() {
console.log("321");
savetrade();
 });


How to fix?
July 8th 19 at 12:04
3 answers
July 8th 19 at 12:06
and jquery is connected, Yes ?
you have #savetradeBtn in jquery and a button called #savetrade
Yes - marlin_Rolfson commented on July 8th 19 at 12:09
: you have different buttons in jquery -> savetradeBtn and the button has #savetrade - Caesar.Keeli commented on July 8th 19 at 12:12
: I already fixed - marlin_Rolfson commented on July 8th 19 at 12:15
: it's working ? - Caesar.Keeli commented on July 8th 19 at 12:18
: No - marlin_Rolfson commented on July 8th 19 at 12:21
: watch my screen https://cloud.mail.ru/public/tbGC/oGHUiGgAS - Caesar.Keeli commented on July 8th 19 at 12:24
so make :



Save Trade URL




- Caesar.Keeli commented on July 8th 19 at 12:27
You read the headline? This plugin - marlin_Rolfson commented on July 8th 19 at 12:30
: Have you read the headline? This plugin - marlin_Rolfson commented on July 8th 19 at 12:33
: Have you read the headline? This plugin - marlin_Rolfson commented on July 8th 19 at 12:36
: where is this plugin ? what is the code ? function looks like ? - Caesar.Keeli commented on July 8th 19 at 12:39
July 8th 19 at 12:08
Usually the "not working" has symptoms,
what gives the error console?
spell your console.log("321"); or it does not reach?
where a piece of code before the call and after the call? Here never comes for some if?
Before and after handler add console.log("start"); console.log("end"); will at least clear code comes here or not.
I have worked , he has no reason to - marlin_Rolfson commented on July 8th 19 at 12:11
: I have my code laid out in comentarii - Caesar.Keeli commented on July 8th 19 at 12:14
: He code in the extension for chromium + all the code is not given, the given chunk taken out of context, I am sure that your code works for it, the question is how the extension and what code prevents this piece. - marlin_Rolfson commented on July 8th 19 at 12:17
: Have you read the headline? This is a plugin? - Caesar.Keeli commented on July 8th 19 at 12:20
: Have you read the headline? This is a plugin? - marlin_Rolfson commented on July 8th 19 at 12:23
In the console nothing is written - Caesar.Keeli commented on July 8th 19 at 12:26
my displays - Caesar.Keeli commented on July 8th 19 at 12:29
: I'm about the same - marlin_Rolfson commented on July 8th 19 at 12:32
: so make :



Save Trade URL









I declared a function and it works , what is the extension don't know code I don't see cansol displayed - marlin_Rolfson commented on July 8th 19 at 12:35
July 8th 19 at 12:10
Where and how add the item and where you have the script? Perhaps you are confusing the background script and content script, or just add the item so that no time to line up the DOM.

Find more questions by tags GoogleJavaScript