JavaScript - Notepad Help
Hi, i need help with notepad. Im just having knack with Microsoft Notepad on building a page with Jscript. The problem im having is the browser does not seem to render my code well, javascript actually.
What i have done is i have attached a external Jscript file onto html like <script type="text/javascript" src="joke.js"></script> however my browser doesn read it. I just need help with this. Similar TutorialsHello everyone, I've got done with a few hours of coding! What took me the longest was the update system. Now, some features notepad elite has: Color Changing Bold/Italic/Underline/Strike Font Changing Saving/Opening And more! Remember, it may seem like a plain old notepad as it is, but in 30 minutes or so a new update will be released. You can check by pressing this button: Some screenshots: Download Notepad Elite! - http://host-a.net/RSEB/Notepad%20Elite.exe Virus scan: Hello, I am in the midst of designing an HTA application, such that I would be able to open a file via notepad in Javascript using the Shell.Application object. I have the following code, however, It does not work and can't seem to figure the rest out. Code: function test101() { var oShell = new ActiveXObject("Shell.Application") var commandtoRun = 'C:\\WINDOWS\\system32\\notepad.exe "F:\\WEB\\saved items\\A-2010-00455.txt"' oShell.ShellExecute(commandtoRun,"","","open","1"); } Any help with this is greatly appreciated. Thanks in advance. Cheers, Jay I'm trying to get this code to work in browsers other than IE. It prints the contents of a textarea, say, a notepad, first bringing up the print dialog. It does it with an (almost) invisible iframe. At first I thought it was only for IE, but I must have tested incorrectly (after a few dozen times uploading and printing out you lose your sanity) and I now see that it DOES work in FF, but not in Chrome. For me (and maybe others?) that is very good news because it will probably be easier for someone more knowledgeable than me to solve a Chrome problem rather than an "all other than IE" browsers problem. Code: /* for notepad printouts */ function printInput(f){ var ifr = window.frames['printFrame']; if (ifr){ //print the content of the invisible iframe ifr.document.getElementById('content').innerHTML=f.WRKNOTEPAD.value.replace(/\n/g,'<br />'); ifr.focus(); ifr.print(); } else { //print by opening a new window and then closing it var html='<html><head><style type="text/css">div{font:normal 14px Verdana}</style></head><body onload="window.print();window.close()"><div>'+f.WRKNOTEPAD.value.replace(/\n/g,'<br />');+'</div></body></html>' var win = window.open('','_blank','menubar,scrollbars,resizable'); win.document.open(); win.document.write(html); win.document.close(); } } function writeContent(objIframe){ var html='<html><head><style type="text/css">div{font:normal 14px Verdana}</style></head><body><div id="content"></div></body></html>' objIframe.document.write(html); objIframe.document.close(); } I think this bit: if (ifr) tests for IE and if it fails the condition, it dynamically creates a new window to print from. And I now see it does just this in FF. But not in Chrome. So narrowing it down I think the Chrome failure is in this bit: Code: else { //print by opening a new window and then closing it var html='<html><head><style type="text/css">div{font:normal 14px Verdana}</style></head><body onload="window.print();window.close()"><div>'+f.WRKNOTEPAD.value.replace(/\n/g,'<br />');+'</div></body></html>' var win = window.open('','_blank','menubar,scrollbars,resizable'); win.document.open(); win.document.write(html); win.document.close(); } Is there anyone who can see why this would fall over in Chrome? Writing Javascript code in Notepad and saving it in HTML works fine. However when I write js in my DiDaPro editor and go to preview the screen it is blank. Why?
I am working on some sort of a program that will load data from a notepad or Excel file and load it into a ComboBox. The notepad file would have names and phone numbers in it. The ComboBox would only show their names in alphabetical order. There would also be a button that when you click it, it would open up Outlook (if you are signed into Outlook) and auto-fill the form with their phone number @ vtext.net (for texting verizon cell phones). The reason behind this is so the notepad or Excel file can be edited to add more users as the company expands. I'm on a time crunch and haven't really been able to figure out how to do the data on load. If anyone could help and explain their code a little bit I would be very grateful. I haven't touched JavaScript in around 5 years so I'm very rusty. Thanks. |