Hi Guys, We normally use window.open to open a page or a popup window (window.open(URTL), is there a way intead makint call to open we make it to save to a file path (eg.c:\temp) using that page url instead of opening it to the screen? Thanks
Generally speaking with window.open being a scripting only solution that's kinda shite from an accessibility standpoint. If you had an anchor you could just add the "download" attribute. <a href="/downloads/whatever.txt" download>Download FIle</a> Code (markup): If it's something you'd be accessing from JS only (boo, hiss) you could always do the old body append, click, and remove trick. let anchor = document.body.appendChild( Object.assign( document.createElement("a"), { download : "someOtherName.txt", href : "/downloads/something.txt" } ) ); anchor.click(); anchor.remove(); Code (markup): Forget not the download attribute can let you name the download if you want it to be something different from the name on the server. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attributes Also if it's something you're generating in your client side scripting, you can encode it into the href: href : "data:text/plain;charset=utf-8," + encodeURIComponent(content), Code (markup): Where "content' is your text. You can also do other mime-types if you have URI safe encoding.
I prefer to use html for popups rather than launching another browser. Example code. css: .BDT_Dialog_Layer { position: absolute; display: table; top: 0px; left: 0px; height: 99%; width: 99%; } .BDT_Dialog_Center { position:fixed; top:5%; width:100%; } .BDT_Dialog_Decoration { position:relative; margin:0 auto; text-align: center; background-color: #ffffff; display: table; /* -- background-color: #DDDDDD; filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#FFFFFF', endColorstr='#BBBBBB'); background-image: -webkit-gradient( linear, left top, left bottom, color-stop(0.1, #FFFFFF), color-stop(1, #BBBBBB) ); background-image: -moz-linear-gradient( center top, #FFFFFF 10%, #BBBBBB 100% ); -- */ -moz-border-radius: 15px; -webkit-border-radius: 15px; -khtml-border-radius: 15px; border-radius: 15px; -moz-box-shadow: 0 1px 8px #666666, 0 1px 4px #000000; -webkit-box-shadow: 0 1px 8px #666666, 0 1px 4px #000000; -khtml-box-shadow: 0 1px 8px #666666, 0 1px 4px #000000; box-shadow: 0 1px 8px #666666, 0 1px 4px #000000; } Code (markup): html: <div id="dialogLayer" class="BDT_Dialog_Layer"> <div class="BDT_Dialog_Center"> <div class="BDT_Dialog_Decoration"> your stuff here. </div> </div> </div> Code (markup):
Which has WHAT to do with their question exactly? Though that code is such broken inaccessible shite, I bet that's another of these new "premium members" that's just an AI bot. DIV soup, endless classes for nothing, display:table doing flex's job, and PX metrics? /FAIL/ hard.