Detecting Unsaved Changes

Using jQuery: var _isDirty = false; $(“input[type=”text”]”).change(function(){ _isDirty = true; }); // replicate for other input types and selects Combine with onunload/onbeforeunload methods as required. From the comments, the following references all input fields, without duplicating code: $(‘:input’).change(function () { Using $(“:input”) refers to all input, textarea, select, and button elements.

Sum of two numbers with prompt

The function prompt returns a string and + is (unwisely, perhaps) used for both string concatenation and number addition. You do not “specify types” in JavaScript but you can do string to number conversion at run time. There are many ways to so this. The simplest is: var a = +prompt(“Enter first number”); var b … Read more

Command to run a .bat file

“F:\- Big Packets -\kitterengine\Common\Template.bat” maybe prefaced with call (see call /?). Or Cd /d “F:\- Big Packets -\kitterengine\Common\” & Template.bat. CMD Cheat Sheet Cmd.exe Getting Help Punctuation Naming Files Starting Programs Keys CMD.exe First thing to remember its a way of operating a computer. It’s the way we did it before WIMP (Windows, Icons, Mouse, … Read more

Run Command Prompt Commands

this is all you have to do run shell commands from C# string strCmdText; strCmdText= “/C copy /b Image1.jpg + Archive.rar Image2.jpg”; System.Diagnostics.Process.Start(“CMD.exe”,strCmdText); EDIT: This is to hide the cmd window. System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = “cmd.exe”; startInfo.Arguments = “/C copy /b Image1.jpg + Archive.rar … Read more