Jump to content

vmars316

Members
  • Content Count

    423
  • Joined

  • Last visited

Everything posted by vmars316

  1. Do your mean like this ? window.addEventListener("keyup", onPress_ENTER, false); } </script> <script> function onPress_ENTER(event){ var keyPressed = event.keyCode || event.which; //if ENTER is pressed if(keyPressed==13) { // alert('enter pressed'); event.preventDefault(); stopImmediatePropagation(); } else { return false; } } Thanks
  2. Hello & Thanks. Not working as I expected : Intercepts enter-key pressed , but doesn't prevent : event.preventDefault(); stopImmediatePropagation(); Here is mini code : window.addEventListener("keyup", onPress_ENTER, false); } </script> <script> function onPress_ENTER(){ var keyPressed = event.keyCode || event.which; //if ENTER is pressed if(keyPressed==13) { // alert('enter pressed'); event.preventDefault(); stopImmediatePropaga
  3. Thanks , That 'SavePageAs' is working fine now . If I hit the enter-key all looks well until I save the page . The 'saved page' shows that for each time the I hit the enter-key , a '<div>plus text</div> 'is created . See below: </div> <!-- <div class="Cell" --> <div id="Row2Cell2"> <p contenteditable="" id="p_ah">Article Heading</p> <p contenteditable="" id="p_tgh">Text Paragraph</p> <p contenteditable="true" i
  4. Well I'm almost there , not getting any 'console errors', but setAttribute are not working : address_id.setAttribute("href", useThisURL); address_id.setAttribute("download", useThisURL); I think these are the problem areas with the complete code below these: <br><a id="address_id" >Save Page As: </a> and: <script> function savePageAs() { var showMe = "nuttin happened?"; var useThisURL = prompt("If FileName is ok, Click OK , Else Change it:", document_URL) if (useThisURL != nul
  5. Thanks, I was hoping to just force the saveas dialog . So that the user could chose to change the filename . I suppose that I could Prompt the user 1st with the name (document.URL;) and give them the option to change it or not. Then download the page . Think I'll give that a shot. Thanks
  6. Thanks, I was hoping it would be this easy: <!DOCTYPE html> <html> <body> <p>just a paragraph <p> <a href="" download=""> Save This Page As </a> </body> </html> It is, if I'm talking with the server , which I don't want to do . I want to do it locally . Will I need to supply the name of "This Page" ? Or is there an abbreviated version ? Thanks
  7. Hello & Thanks , I would like an Html5 button to Trigger a 'Download File prompt ' for all browsers . Rather than clicking on for example [Browser Customize and Control ] , then clicking [More tools] [Save Page As] etc.. I searched, but nothing related came up . How can this be accomplished ? Thanks for your help !
  8. Thanks , That did it . I did use DevTools but didn't interpret it as anything wrong . I am checking out overflow here: https://www.w3schools.com/cssref/pr_pos_overflow.asp As always. Thanks
  9. Ah... That worked great for between Row1 and Row2 . But between Row2 and Row3 there is still a space . I tried variations of vertical-align: top; and vertical-align: bottom; and margin-bottom: 1001em; and margin-bottom: -1000em; but no go yet . Thanks <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3-Rows-3-Cols.html</title> <!-- file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~H
  10. Hello & Thanks, How to eliminate verticle space between Divs ? I have tried gazillions of solutions but none of them work . Thanks for your help ! <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>3-Rows-3-Cols.html</title> <!-- file:///C:/Users/vmars/Desktop/myPrograms/HeyBuddy/~~Hey-Buddy-WIP/3-Rows-3-Cols.html https://www.dummies.com/web-design-development/css3/using-the-div-tag-to-create-tabl
  11. Thanks , Sorry , I am getting hung up on the term 'anchor ' . Is this the anchor? : var p_bn = document.createElement("li"); Thanks
  12. Hi dsonesuk ; Using your var inner_parent = content.getElementsByTagName('ul')[0] It's not working for me . I must have coded it wrong. With the code below I expected to get two "New Link" s . But only got 1 . Pls , tell me what is my mistake ? Thanks <script contenteditable=""> function createNewButton() { // alert("function createNewButton()"); var p_bn = document.createElement("li"); p_bn.innerHTML = ButtonParagraph; p_bn.setAttribute('contenteditable', 'true'); p_bn.setAttribute("id","li_De
  13. Ah... finally , I got it: However , still 1 problem left: // var content = document.getElementById('ul'); // var content = document.getElementById('nav-01.ul'); var content = document.getElementById('nav-01'); content.appendChild(p_bn); The content.appendChild(p_bn); only works for var content = document.getElementById('nav-01'); . Which puts it AFTER <ul></ul> . But I want it to be put within <ul> as an appendChild . Pls , How can I put the child within <ul> ? Here is the whole mini-mini code" <
  14. Thanks dsonesuk : Oops , I forgot all about : https://www.freeformatter.com/html-validator.html I would like to try that later . Right now my mind set is on 1st working it out with <p> . I put a new example here: http://vmars.us/ShowMe/Html-MasterWIP-Mini-Debug.html Pls , take a look at the source . So there is something I would like to add within each created <p> element . And that is its id="p_ah" and id="p_tgh" elements repectively . I tried: p_tgh.setAttribute("contenteditable", "true" , "id="p_tgh""); But its a no go .
  15. Hi Funce , Those are all cleared up the link below . Kindly go to : http://vmars.us/ShowMe/Html-MasterWIP-Mini.html Try clicking on the [Add New Text Area] Button . Note that the 1st 'Text Paragraph' is Grey , all subsequent 'Text Paragraph's are black . I want them all to be Grey . Pls , how can I correct that ? Thanks for your help !
  16. Here is page code minified . What is troubling me , is that the style settings for ArticleHeading(#p_ah) & TextHeading(p_tgh) are not working . Here is the working page online: Pls, show me how to fix this . http://vmars.us/ShowMe/Html-MasterWIP-Mini.html Thanks for your help ! <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Master-WIP-Mini.html</title> <style> body {margin:0; padding:0; font-family: Sans-Serif; line-height: 1.5em; } #header
  17. I am thinking the reason I haven't received any replies is that this Post is too long . So I am working on a miniature version of this . I'll be back .
  18. I am still working on the same html, css and js, problem (contenteditable & creating Articleheader/TexrArea) working code here: http://vmars.us/ShowMe/DIY-Html-Master-WIP-02.html <!DOCTYPE html> <html> <!-- Go To https://www.google.com/search?num=20&newwindow=1&hl=en&authuser=0&ei=XetDXJKlG46GtQXV1J9Q&q=html5+css+js&oq=html5+css+js&gs_l=psy-ab.12..35i39j0j0i22i30l6j0i22i10i30j0i22i30.239301.283270..287372...2.0..0.112.3082.19j14......0....1..gws-wiz.....6..0i71j0i13i30j0i8i13i30j0i131j0i20i263.RsTbO1V_iYY --> <!-- Go To fil
  19. I am still working on the same html, css and js, problem (contenteditable & creating Articleheader/TexrArea) full code here: http://vmars.us/ShowMe/DIY-Html-Master-WIP-02.html <!DOCTYPE html> <html> <!-- Go To https://www.google.com/search?num=20&newwindow=1&hl=en&authuser=0&ei=XetDXJKlG46GtQXV1J9Q&q=html5+css+js&oq=html5+css+js&gs_l=psy-ab.12..35i39j0j0i22i30l6j0i22i10i30j0i22i30.239301.283270..287372...2.0..0.112.3082.19j14......0....1..gws-wiz.....6..0i71j0i13i30j0i8i13i30j0i131j0i20i263.RsTbO1V_iYY --> <!-- Go To file:
  20. Hello & Thanks ; I did read https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters But it was too much info , I couldn't understand it . I have heard that using global variables is bad practice . Is that true here ? It all runs fine . I read thru w3Schools js css html Tutorials years ago . So yesterday & today , i read thru this series of Tutorials : https://www.digitalocean.com/community/tutorial_series/understanding-the-dom-document-object-model I highly recommend it to newbies or oldies lik
  21. Thanks; I thought I would try global variables . <script type='text/javascript' > var NewLink = "New Link" var TextParagraph = "Text Paragraph" var ArticleHeading = "Article Heading" </script> <script id="js" contenteditable > function createNewLink() { var li_nl = document.createElement("li"); li_nl.innerHTML = NewLink; alert(' function createNewLink = ' + NewLink); li_nl.setAttribute("contenteditable", "true"); var nav = document.getElementById("nav"); nav.appendChild(li_nl); } &
  22. Hello & Thanks : Here is my code: <script id="js" contenteditable > function createArticleHeader(text= "Article Heading") { var p_ah = document.createElement('p'); alert{"p_ah"}; p_ah.innerHTML = text; p_ah.setAttribute('contenteditable', 'true'); var content = document.getElementById('content'); content.appendChild(p_ah); } createArticleHeader("Article Header"); </script> This code runs great, without the alert . But when I add the alert{} line , it doesn't run at all . Is alert{} in the wrong place or what ? Thanks for your help .
  23. Thanks Funce Wow Thank you very much ! It works great ! http://vmars.us/ShowMe/DIY-Html-Master-WIP-01.html I have a lot more to do , but you jump started me . I will Post the final version here later. Thanks
  24. Thanks; "Your text is 'undefined' due to the fact you call CreateTextArea() without any arguments. Which means the text variable is undefined." Sorry , I don't understand what you mean. Pls , explain further. The other errors , I'm working on them. Thanks
  25. Thanks BILU KUMAR SAU : Plenty interesting . Sorry , I should have specified , pure js only . At this point I would rather not tackle learning jquery . Thanks
×
×
  • Create New...