GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Language: JavaScript
This repository was archived by the owner on Aug 5, 2024. It is now read-only.
Language: JavaScript
Neil Fraser edited this page
Each language port of Diff Match Patch uses the same API. These are the language-specific notes regarding JavaScript.
The JavaScript version has no dependencies. It works in Netscape 4, Internet Explorer 5.5, and all browsers released since the year 2000 (the limiting factor is the use of the Here's a minimal example of a diff in JavaScript: <html> <body> <script src="diff_match_patch.js"></script> <script> var dmp = new diff_match_patch(); var diff = dmp.diff_main('Hello World.', 'Goodbye World.'); // Result: [(-1, "Hell"), (1, "G"), (0, "o"), (1, "odbye"), (0, " World.")] dmp.diff_cleanupSemantic(diff); // Result: [(-1, "Hello"), (1, "Goodbye"), (0, " World.")] alert(diff); </script> </body> </html> Save the above as an HTML file in the Unit tests can be performed by pointing a web browser at Speed test for diff can be performed by pointing a web browser at Clone this wiki locally |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |