Return to Snippet

Revision: 45080
at April 23, 2011 22:30 by mooparmghor


Initial Code
var replaceDigits = function() {
	var map = 
                [
                "&\#1632;","&\#1633;","&\#1634;","&\#1635;","&\#1636;",
                "&\#1637;","&\#1638;","&\#1639;","&\#1640;","&\#1641;"
                ]
				
	document.body.innerHTML = 
		document.body.innerHTML.replace(
			/\d(?=[^<>]*(<|$))/g,
			function($0) { return map[$0] }
		);
}


Example in how to use: 

<!-- in the head tag of the page you want -->
<head>
	<script type="text/javascript">
		window.onload = replaceDigits
	</script>
</head>

Initial URL
http://www.swalif.net/softs/swalif54/softs232281/

Initial Description
Replace English numbers with Arabic numbers in browsers supporting Unicode & JavaScript.

Credits to 
http://www.swalif.net/softs/swalif54/softs232281/

Initial Title
Display Arabic numbers in browsers supporting Unicode & JavaScript

Initial Tags
javascript

Initial Language
JavaScript