i have a website , login: [email protected] /cdn-cgi/l/email-protection pas: 12345678, log in and go to the drivers section(left menu bar firs item > drivers) I want to make some additional function to this web with tampermonkey. All information about drivers consist in the table, and information about current driver is available when you click to "Go to the current log" button
i try to add some new functions to the current drivers section
all this stuff are in the iframe , so i try to do an event listener to the button like this
// @name drivers
// @match https://eldclient.trackingmap.eu/drivers*
// @grant none
// @require http://code.jquery.com/jquery-1.12.4.min.js
// ==/UserScript==
setTimeout(() => {
var el = document.getElementsByClassName("fa fa-file-text");
console.log(el);
el[1].addEventListener("click",console.log("yeah")) ;
}, 5000);
但它不起作用,单击后我想从当前日志部分的表中获取所有元素。
在驱动程序部分它对我有用
**// @name drivers
// @match https://eldclient.trackingmap.eu/drivers*
// @grant none
// @require http://code.jquery.com/jquery-1.12.4.min.js
// ==/UserScript==
setTimeout(() => {
const rows = document.querySelectorAll("#app table.table-component tr");
console.log(rows);
}, 5000);**
你有什么想法或建议吗^)