Jump to content

vmars316

Members
  • Posts

    436
  • Joined

  • Last visited

Everything posted by vmars316

  1. Thanks Ingolme; Yes , this works perfectly , the 'href' allows me to keep current window open: <!DOCTYPE html> <head> <script> function AddEventListner(){ document.querySelector('a').addEventListener('click', event => { OpenSecondPage() }); } </script> <head> </html> <body onload="AddEventListner"()> <a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a> <script> function OpenSecondPage() { window.location.href = "https://www.duckduckgo.com"; // default page }; </script> </body> </html> Thanks Again Btw: I miss your foxy Avatar . I would like to have a copy of it possible ?
  2. Tia; Trying to redirect from one page to another page and still leave 1st page open . This works except that it closes 1st page: window.location.href = "https://www.w3schools.com "; // works fine This doesn't work at all: window.location.href = "https://www.w3schools.com target="_blank" "; // doesn't work Full code: <!DOCTYPE html> <html> <head> <script> function CreateJsListener() { document.querySelector('a').onclick = Redirect(); } </script> </head> <body onload="CreateJsListener()"> <a href="https://www.google.com"> https://www.google.com </a> <script> var timesThru = 0 ; function Redirect() { alert('Redirecting To: https://www.w3schools.com instead'); if (timesThru > 0) { alert('Redirecting To: https://www.w3schools.com instead'); window.location.href = "https://www.w3schools.com target="_blank" "; // doesn't work window.location.href = "https://www.w3schools.com "; // works fine } timesThru = timesThru + 1 ; } </script> </body> </html> Tia
  3. function SpecificSiteLinks(navigateTo) { SafeSite = false ; for (var i = 0; i < specificSiteLinksArray.length; i++) { if (specificSiteLinksArray[i] == navigateTo) { SafeSite = true ; alert("SpecificSiteLinks SafeSite = true " + "navigateTo = " + navigateTo); break ; }else { SafeSite = false ; } } if (SafeSite == false) { alert("SpecificSiteLinks SafeSite = false "+ "navigateTo = " + navigateTo); } } Ok , I see it now , Thanks
  4. It keeps looping this message : alert("SpecificSiteLinks SafeSite = false "+ "navigateTo = " + navigateTo);
  5. Tia ; I need more eyes : Can't figure out my error in function SpecificSiteLinks(navigateTo) . What am I doing wrong , Thanks for your Help... <!DOCTYPE html> <html> <head> <style> span.buttons { display: inline; /* the default for span */ padding: 5px; } p { border: 1px solid blue; } </style> </head> <body> <div style="text-align: center"> <input type="text" placeholder="Enter URL" id="myInput" value="http://www.google.com"> <button type="button" onclick="getInputValue()" >Get URL</button> </div> <p> <span class="buttons"><button onclick="WholeSite(0)">duckduckgo.com/</button></span> <span class="buttons"><button onclick="SpecificSite(0)">http://vmars.us/SafeBrowser/SafeBrowserHome.html</button></span> </p> <p> <span class="buttons"><button onclick="WholeSite(1)">pbskids.org/</button></span> <span class="buttons"><button onclick="SpecificSite(1)">https://www.infoplease.com/</button></span> </p> <p> <span class="buttons"><button onclick="WholeSite(2)">.sesamestreet.org/</button></span> <span class="buttons"><button onclick="SpecificSite(2)">https://www.youtube.com/watch?v=K1MhFN2Ld30</button></span> </p> <script> var wholeSiteLinksArray= ["duckduckgo.com", "pbskids.org/", ".sesamestreet.org/"]; var specificSiteLinksArray= ["http://vmars.us/SafeBrowser/SafeBrowserHome.html", "https://www.infoplease.com/", "https://www.infoplease.com/" , "https://www.youtube.com/watch?v=K1MhFN2Ld30"]; var NavigateTo = "" ; var SafeSite = false ; var arrayPos = 0 ; function WholeSiteLinks(navigateTo) { SafeSite = false ; for (var i = 0; i < wholeSiteLinksArray.length; i++) { if (wholeSiteLinksArray[i] == navigateTo) { SafeSite = true ; alert("WholeSiteLinks SafeSite = true " + "navigateTo = " + navigateTo); }else { SafeSite = false ; alert("WholeSiteLinks SafeSite = false "+ "navigateTo = " + navigateTo); SpecificSiteLinks(navigateTo); } } } function SpecificSiteLinks(navigateTo) { SafeSite = false ; for (var i = 0; i < specificSiteLinksArray.length; i++) { if (specificSiteLinksArray[i] == navigateTo) { SafeSite = true ; alert("SpecificSiteLinks SafeSite = true " + "navigateTo = " + navigateTo); }else { SafeSite = false ; alert("SpecificSiteLinks SafeSite = false "+ "navigateTo = " + navigateTo); } } } function WholeSite(arrayPos) { navigateTo = wholeSiteLinksArray[arrayPos]; alert("function WholeSite(arrayPos) " + "navigateTo = " + navigateTo); WholeSiteLinks(navigateTo); } function SpecificSite(arrayPos) { navigateTo = specificSiteLinksArray[arrayPos]; alert("function specificSiteLinks(arrayPos)" + "navigateTo = " + navigateTo); SpecificSiteLinks(navigateTo); } function getInputValue(){ // Selecting the input element and get its value var inputURL = document.getElementById("myInput").value; // Displaying the value alert("function getInputValue() " + inputURL); navigateTo = inputURL ; WholeSiteLinks(navigateTo); } </script> </body> </html>
  6. Tia ; I want to change all fontWeight of <p and <div>> to bold . <!DOCTYPE html> <html> <head> <title>Bold Text Demo</title> </head> <body> <p> This is a sample paragraph </p> <button id="button"> Make Bold </button> <div>This is a sample div</div> <script> //Get the button element var btn = document.getElementById('button'); //Get paragraph element var makeBold = document.querySelectorAll(p , div); //Define an click event listener on button btn.addEventListener('click', function() { //Change the font weight style to 700 makeBold.style.fontWeight = '700'; }); </script> </body> </html> How can I do that ? Thanks for your Help...
  7. Thanks empressia ; You certainly have gone the extra mile .
  8. Tia ; Getting errors getElementByTagName-ChangeBlankToSelf.html:24 Uncaught TypeError: Cannot read property 'getAttribute' of undefined at ChangeBlankToSelf (getElementByTagName-ChangeBlankToSelf.html:24) at HTMLButtonElement.onclick (getElementByTagName-ChangeBlankToSelf.html:17) with the following code <!DOCTYPE html> <html> <head> </head> <body> <h4>getElementByTagName-ChangeBlankToSelf.html</h4> <p> <a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a> <br> <a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a> </p> <p>getElementByTagName-ChangeBlankToSelf.html</p> <button onclick="ChangeBlankToSelf()">Change_Blank To _Self</button> <script> function ChangeBlankToSelf(){ var linkElements , i; linkElements = document.getElementsByTagName("a"); for (i = 0; i < linkElements.length; i++) { if (linkElements.item[i].getAttribute("target") = "_blank") { linkElements.item[i].setAttribute("target", "_self") } } } </script> </body> </html> I like the new Forum look , Thanks for your Help...
  9. Oops! Sorry I remembered , , <a href="#calibre_link-1"> Thanks
  10. Hello & Thanks ; I have been working on my KidsafeBrowser , in .vb . Sorry . I have forgotten How to do this: Using Calibre I Converted a .pdf into .html . I have a html file : ~reads/Communion-with-God-Son-HolySpirit-ESV.html WIth quite a few in page links and Calibre does this: <p class="calibre1"><a href="file:///C:/Users/vmars/Calibre%20Library/William%20H.%20Gross/Owen%20Communion%20with%20God%20(4)/Of-Communion-with-God-Owen_Gross.html#calibre_link-1"><b class="calibre2">EDITOR’S PREFACE ................................................................................................................................................ I</b> </a></p> <p class="calibre1"><a href="file:///C:/Users/vmars/Calibre%20Library/William%20H.%20Gross/Owen%20Communion%20with%20God%20(4)/Of-Communion-with-God-Owen_Gross.html#calibre_link-2"><b class="calibre2">PART 1. COMMUNION WITH THE FATHER ..................................................................................................... 1</b> </a></p> But I want to make each link to point to an anchor within the same html . Pls , how do I code that ? Thanks for your Help...
  11. That doesnt work for me : I havent been back here for a long time . So didnt notice your Post. I needed two tables side by side by side , such that I could select/copy each table as a column , without effecting the other Tab I ended up doing this: <!doctype html> <html> <head> <title></title> <style> table{ table-layout: fixed; background-color: rgb(232, 230 , 228); width: 100%; border-style: solid; border-width: 3px; border-color: maroon; } .table01 { text-align: left; width: 100%; } .table02 { text-align: left; width: 100%; } td{vertical-align: top; width: 100%; background-color: } p{vertical-align: top; width: 100%; background-color: rgb(246, 244, 242); } </style> </head> <body> <h6 style="text-align:center;">Aside-With-2-Tables-table-layout-fixed-Editable.html <br>[aside style="float: right; width: 50%; font: 20px Calibri;"] </h6> <aside style="float: right; width: 50%; font: 20px Calibri;"> <div> <table class="table01" contenteditable="true" > <tbody> <tr> <td ><p>1</p> </td> </tr> <tr> <td style="vertical-align: top; " ><p>2</p> </td> </tr> <tr> <td style="vertical-align: top; " ><p>3</p> </td> </tr> </tbody> </table> </div> </div> </aside> <aside style="float: left; width: 50%; font: 20px Calibri "> <div> <table class="table02" contenteditable="true" > <tbody> <tr> <td style="vertical-align: top; " ><p>1</p> </td> </tr> <tr> <td style="vertical-align: top; " ><p>2</td> </tr> <tr> <td style="vertical-align: top; " ><p>3</p> </td> </tr> </tbody> </table> </div> </aside> </body> </html> Thanks
  12. Yes , and I can select/copy each Table individually . Thanks What I don't like is that if I hit enter-key It creates what loos like a whole line . Is there a way to stop it from creating a whole new colored line , it looks like a whole new paragraph (sort of) . And keep enter-key text in the same line . I could ignore the enter-key with .js , but then how would I create a new line ? Type in blanks til I overflow to a new line ? Thanks
  13. Ah...What a relief , Thank You Very Much
  14. Thanks ; JMRKR "What does the desired output look like?" Here is exactly how I would like it to behave : <!DOCTYPE html> <html> <style> .Lcol { } .Rcol { } </style> <body> <h4>Editable-Simple-P.html Needs Copy Button + Which Col InputBox</h4> <p class="Lcol " contentEditable = "true" style="display: inline-block; background: yellow; width:45%;">This is a paragraph 1. Lcol</p> <p class="Rcol " contentEditable = "true" style="display: inline-block; background: lightblue; width:45%;">This is a paragraph 4. Rcol<hr></p> <p class="Lcol " contentEditable = "true" style="display: inline-block; background: yellow; width:45%;">This is a paragraph 2. Lcol</p> <p class="Rcol " contentEditable = "true" style="display: inline-block; background: lightblue; width:45%;">This is a paragraph 5. Rcol<hr></p> <p class="Lcol " contentEditable = "true" style="display: inline-block; background: yellow; width:45%;">This is a paragraph 3. Lcol</p> <p class="Rcol " contentEditable = "true" style="display: inline-block; background: lightblue; width:45%;">This is a paragraph 6. Rcol<hr></p> </body> </html> Thanks
  15. Thanks ; JMRKER : Watch what happens when you hold down the 1 key . The whole left table stretches way on top of the right table . I want it to each table to stay in place , and wrap each line . Thanks Validated : <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title></title> <!-- https://www.freeformatter.com/html-validator.html --> <!-- // or /* GOOD For Javascript */ --> <!-- GOOD For HTML --> <!-- /* GOOD For CSS */ --> <style> table { text-align: left; width: 100%; background-color: rgb(232, 230 , 228); border-style: solid; border-color: rgb(113, 30 , 19); } p { background-color: rgb(246, 244, 242); } </style> </head> <body> <h3 style="text-align:center;"> Using multiple HTML5 aside tags . </h3> <aside style="float: right; width: 50%; font: 20px Calibri;"> <div> <table contenteditable="true" > <tbody> <tr> <td style="vertical-align: top; overflow-wrap: break-word; " ><p>1</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word; " ><p>2</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word; "><p>3</p> </td> </tr> </tbody> </table> </div> </aside> <aside style="float: left; width: 50%; font: 20px Calibri "> <div> <table contenteditable="true"> <tbody> <tr> <td style="vertical-align: top; overflow-wrap: break-word; " ><p>1</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word;" ><p>2</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word;"><p>3</p> </td> </tr> </tbody> </table> </div> </aside> </body> </html>
  16. Pls , Let me ask you this This time using <aside> How can I get "word-wrap: break-word; " to work for each cell (td) ? Right now it appears to stretch on into infinity . <!doctype html> <html> <head> <title></title> </head> <body> <h3 style="text-align:center;"> Using multiple HTML5 aside tags . </h3> <aside style="float: right; width: 50%; font: 20px Calibri;"> <div> <table contenteditable="true" style="text-align: left; width: 100%; " border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top; overflow-wrap: break-word; " ><p>1</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word; " ><p>2</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word; "><p>3</p> </td> </tr> </tbody> </table> </div> </div> </aside> <aside style="float: left; width: 50%; font: 20px Calibri "> <div> <table contenteditable="true" style="text-align: left; width: 100%; " border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top; overflow-wrap: break-word; " ><p>1</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word;" ><p>2</p> </td> </tr> <tr> <td style="vertical-align: top; overflow-wrap: break-word;"><p>3</p> </td> </tr> </tbody> </table> </div> </aside> </body> </html> Thanks
  17. Sorry , you are correct . I developed parallel fake tables to get around the no parallel tables linitation . Which woked great . http://vmars.us/ShowMe/FAKE-TABLES-ContentEditable-COPYABLE.html I wonder if parallel Tables in a parallel <aside> situation .
  18. Hi dsonesuk ; I think you are referring to this : http://vmars.us/reads/vmTemplate-2Parallel-Tables-P-Editable-BEST.html But no , that's a different problem . There I was dealing with my own Fake Tables . Now I am using real Tables .
  19. Hello & Thanks ; See Code below ; I would like to Put two tables side by side (on same line) . <!DOCTYPE html> <html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title></title> <style> #span01 { display: inline-block; } #span02 { display: inline-block; } </style> </head> <body contenteditable="true"> <br> <span id="span01"> <table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> </tbody> </table> </span> <!-- <span id="span01"> ----> <br> <br> <br> <span id="span02"> <table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2"> <tbody> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> <tr> <td style="vertical-align: top;"><br> </td> </tr> </tbody> </table> </span> <!-- <div id="span02"> --> <br> <br> <br> <br> <br> </body></html> Thanks for your help .
  20. Hello & Thanks ; Below is my workaround code to create a margin for <tr> . And How to stop border line from appearing between .td1 and .td2 ? Here is the code at : https://www.w3schools.com/code/tryit.asp?filename=GEY9809882WT And or see the code below : <!DOCTYPE html> <html><head><meta content="text/html; "> <!-- http://w3schools.invisionzone.com/forum/6-css/ --> <title>Jesus'sWordsOnly-Forum-Exaample.html</title> <style> body { background-color: rgb(113, 30 , 19); } table { border-style: none; } tr { border-style: none; } .trBetween { } .td1 { color: rgb(0, 0, 0); vertical-align: top; width: 50%; font-size: 17px; border-style:none; //border-color: white white rgb(246, 244, 242) white; //border-width: 2px; background-color: rgb(232, 230 , 228); } .td2 { color: rgb(0, 0, 0); vertical-align: top; width: 50%; font-size: 18px; border-style:none; //border-color: white white rgb(246, 244, 242) white; //border-width: 2px; background-color: rgb(246, 244, 242); } </style> </head> <body> <h6 style="text-align: center; color: rgb(246, 244, 242);">Jesus's-Words-Only.html</h6> <table style="text-align: left; width: 100%;"> <tbody> <tr> <td class="td1" contenteditable="false" style="text-align: center;"> Hover over Bible references in this column <br>to see the GNT version . </td> <td class="td2" contenteditable="false" style="text-align: center;"> Jesus's words in ESV in this column . </td> </tr> <tr class="trBetween">&nbsp;</tr> <tr> <td class="td1" contenteditable="false" style="vertical-align: top;"> The Young Jesus at the Temple (Luke 2:41-52) To His parents looking for Him, Jesus said. </td> <td class="td2" contenteditable="false" style="vertical-align: top; background-color: rgb(246, 244, 242); "> Why were you looking for me? Did you not know that I must be in my Father's house? </td> </tr> <tr class="trBetween">&nbsp;</tr> <tr> <td class="td1" contenteditable="false" style="vertical-align: top;"> John Baptizes Jesus (Matthew 3:13-17, Mark 1:9-11, Luke 3:21-3, John 1:33-4) John protests. </td> <td class="td2" contenteditable="false" style="vertical-align: top; background-color: rgb(246, 244, 242); "> Let it be so now, for thus it is fitting for us to fulfill all righteousness. </td> </tr> <tr class="trBetween">&nbsp;</tr> <tr> <td class="td1" contenteditable="false" style="vertical-align: top;"> Temptation of Jesus (Matthew 4:1-11, Mark 1:12-13, Luke 4:1-13) By satan in the desert. </td> <td class="td2" contenteditable="false" style="vertical-align: top; background-color: rgb(246, 244, 242); "> It is written, Man shall not live by bread alone, but by every word that comes from the mouth of God. <br>Again it is written, You shall not put the Lord your God to the test. <br>You shall worship the Lord your God and him only shall you serve. </td> </tr> <tr class="trBetween">&nbsp;</tr> <tr> <td class="td1" contenteditable="false" style="vertical-align: top;"> Calling the First Disciples (Matthew 4:18-22, Mark 1:16-20, Luke 5:1-11, John 1:35-42) James and John. </td> <td class="td2" contenteditable="false" style="vertical-align: top; background-color: rgb(246, 244, 242); "> Follow me, and I will make you fishers of men. <br>Put out into the deep and let down your nets for a catch. <br>Do not be afraid; from now on you will be catching men. </td> </tr> </tbody> </table> <script src="https://www.biblegateway.com/public/link-to-us/tooltips/bglinks.js" type="text/javascript"> </script> <script type="text/javascript"> BGLinks.version = "GNT"; BGLinks.linkVerses(); </script> <div id="bg_popup-container"></div> </body></html>
  21. This might help : https://www.w3schools.com/html/html_layout.asp
  22. Thanks dsonesuk But even those changes I get same crazy results . https://www.w3schools.com/code/tryit.asp?filename=GEUOARBLQG0S AND <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title></title> <style> body { background-color: rgba(217, 176, 78, 0.1); } table { border-style: none; } tr { border-style: none; } .td1 { color: rgb(0, 0, 0); vertical-align: top; width: 50%; font-size: 16px; border-style:solid; border-color: white white rgb(217, 176, 78) white; border-width: 2px; background-color: rgba(217, 176, 78 , 0.5; } .td2 { vertical-align: top; color: rgb(255, 0, 0); font-size: 18px; width: 50%; border-style:solid; border-color: white white rgb(217, 176, 78) white; border-width: 2px; background-color: rgba(217, 176, 78, 0.5); } </style> </head> <body> <h6>Jesus's-Words-Only.html</h6> <table style="text-align: left; width: 100%;"> <tbody > <tr> <td class="td1"> The Young Jesus at the Temple>Luke 2:41-52) To His parents looking for Him, Jesus said. </td> <td class="td2"> Why were you looking for me? Did you not know that I must be in my Father's house? </td> </tr> <tr> <td class="td1"> John Baptizes Jesus (Matthew3:13-17, Mark 1:9-11, Luke 3:21-3, John 1:33-4) John protests. </td> <td class="td2"> Please do so, because it’s good for us to do what God says is right, </td> </tr> </tbody> </table> <script src="https://www.biblegateway.com/public/link-to-us/tooltips/bglinks.js" type="text/javascript"> </script> <script type="text/javascript"> BGLinks.version = "ESV"; BGLinks.linkVerses(); </script><div id="bg_popup-container"></div> </body></html> Thanks for your help !
×
×
  • Create New...