Jump to content

vmars316

Members
  • Content Count

    431
  • Joined

  • Last visited

Community Reputation

5 Neutral

About vmars316

  • Rank
    Member

Profile Information

  • Location
    Brownsville, Tx

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. With console.log(allTags[2]) I was expecting to get the 3rd <a> . Why do I get undefined ? <iframe id="iframe1" src="SomeLocalLinks-01.html" name="iFrame1"></iframe> <script> var iframe1 = [] ; var allTags = [] ; iframe1 = document.querySelector("iframe"); console.log(iframe1) var allTags= iframe1.contentDocument.querySelectorAll("a"); //document.querySelectorAll("a"); console.log(allTags) console.log(allTags[2]) </script>
  2. Hmm... I don't understand , why does the Console show "#document" ? What does it represent ? <iframe id="iframe1" src="SomeLocalLinks-01.html" name="iFrame1"> #document <!DOCTYPE html> This doesn't work either ? <script> var iframe1 = [] iframe1 = document.querySelector("iframe1"); console.log(iframe1) var allTags= iframe1.contentWindow.querySelectorAll("a"); console.log(allTags) //for(let i of allTags){i.callMethod} </script> This var allTags= iframe1.contentWindow.querySelectorAll("a"); gives this error: Uncaught TypeError: Cannot re
  3. Are you sure ? Hmm... Making headway , showing iframe elements But I'm still not collecting allTags . Node list is still showing 0 , don't know why . Code: ``` const load = () => { //var iframe1 = document.querySelector(“iframe1”).contentWindow.document; var iframe1 = document.getElementById('iframe1') console.log("iframe1"); console.log(iframe1); var allTags= iframe1.querySelectorAll("a"); console.log("allTags"); console.log(allTags); function WhichLinkWasClicked(evt) { alert( evt.target ) ; evt.preventDefault(); } console.log("for(let i
  4. Hello , I have an html page with an iframe inside . And I am trying unsuccessfully to querySelect a <a> in the iframe . function Function_1(){ console.log("Function-1()") const iFrame1 = document.querySelector("iFrame"); console.log(iFrame1) const iFrame1Body = iFrame1.Document.querySelector("a") ; console.log(iFrame1Body) } No probs with 'querySelector("iFrame")' . But with 'querySelector("iFrame")' I get error 'Uncaught TypeError: Cannot read property 'querySelector' of undefined' . Pls , what am I doing wrong ? Thanks for your Help...
  5. Yes I am working on it . All day this one has me stumped: This line: const myIframe = document.getE1ementById("myIframe") ; What's wrong with it ? Thanks
  6. This : function Function_1(){ alert("Function-1()") // var showThis = iframe.document.documentElement.outerHTML var myIframe = document.querySelector("iframe"); myIframe = iframe.document.documentElement.outerHTML console.log(myIframe); document.getElementById("paragraph_1").innerHTML = myIframe ; } yields this "ReferenceError: iframe is not defined" This function Function_1(){ alert("Function-1()") // var showThis = iframe.document.documentElement.outerHTML var iframe = document.querySelector("iframe"); iframe = iframe.document.documentEl
  7. Hello ; I want to show iframe.document in parent html , but I only get an "Uncaught ReferenceError: iframe is not defined" error . Pls , what am I doing wrong ? <!DOCTYPE html> <html lang="en"> <head> <title>Opening Links in an iFrame</title> <style> iframe { width: 100%; height: 500px; } button {display: inline-block;} iframe { width="100%";} </style> </head> <body> <p style="text-align: center;">Communiation Between 'parent' and 'iframe Child' elements <button onclick="Function_1(
  8. Hello , How can parent-html detect onNewPage in iframe-html , same-domain ? Here is the Prototype of this scenario online: http://vmars.us/Frames_Study/Which-Open-Links-In-iFrame-Which.html or <!DOCTYPE html> <html lang="en"> <head> <title>Opening Links in an iFrame</title> <style> iframe { width: 100%; height: 500px; } </style> </head> <body> <p style="text-align: center;">Communiation Between 'parent' and 'iframe Child' elements <br>On <a> Click in 'iframe' , Send Clicked U
  9. Hello ; I want to Set font-size for contentEditable grid ; but as soon as I enter text , it reverts to some default size . Pls , how to fix this ? Thanks for your Help... <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title></title> <!-- https://www.freeformatter.com/html-validator.html --> <style> /* comment */ body { font-size: 16px; } .grid-container { display: grid; g
  10. Hello; I found exactly what I need here: https://gist.github.com/erickzhao/3f2141be4c6d84c3028742b8998e0f6e
  11. Thanks niche I ended using #mainDiv { text-align: center; width: 55%; background-color: #ffffff; padding: 4px; white-space: nowrap; Thanks
  12. Hello; I want to float a <div> so that it is always centered on the webpage . How can I do this ? <style> body { background-color: #ebe8e4; } #flexBox-container { display: flex; flex-wrap: nowrap; background-color: #fbe9d6; text-align: center; // width: 100%; } </style> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Hello World!</title> <link rel="stylesheet" type="text/css" href="./styles.css"> </head> <body> <div id="flexBox-container"> &l
  13. I am not using: How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process Ask Question. So it is not pertinent to me . I gave these links , just in case you are not proficient with webview/BrowserView in Electron , to give you some context for this question . https://www.electronjs.org/docs/api/webview-tag Recommends not using webview any more . This is the recommended way: https://www.electronjs.org/docs/api/browser-view
  14. Yes it is here: ttps://www.electronjs.org/docs/api/webview-tag
×
×
  • Create New...