0
Javascript Frame Target
Hello I have minimal experience in JavaScript and decided to make a bookmark that fills in a form on a website and submit(). I am using the console on the Internet Explorer Developer Tools to test my code. On the website I want to run my commands there is a complication. I can run commands on the website via Developer Tools, only after I change the Target: "_top: New" to Target: "Frame: UIService.aspx" in my Developer Tools Console. My JavaScript codes saved as bookmarks don't work because they are targeting the wrong frame. How do I change the frame from Target: "_top: New" to Target: "Frame: UIService.aspx" in code? They have two different URLs.
2 Réponses
+ 1
document.querySelector('Your_ID_Iframe').contentWindow.document
This is right?
ref: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_element_iframe
0
I tried with no success, these are the outputs:
document.querySelector(' iframe class name ').contentWindow.document
Unable to get property 'contentWindow' of undefined or null reference
However this returns true:
serv = document.getElementsByClassName(' iframe class name ')
serv.length: 1
I need to alter a table inside of this iframe, so I would do:
serv.getElementById(' id of table '); ??
This is not correct?