问题
i have a website , login: cyclefreight1@usa.com 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);
but it didn`t work , after click i want to get all the elements from table in the current log section. In the drivers section it works for me
**// @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);**
do you have any idea or tips , than you ^)
来源:https://stackoverflow.com/questions/50358264/get-access-to-table-in-the-iframe