Created
August 30, 2011 17:50
-
-
Save ilkerde/1181500 to your computer and use it in GitHub Desktop.
double array indexer access example for @asp_net
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Username": { | |
"de-DE": "Benutzername", | |
"en-US": "Username" | |
}, | |
"Language": { | |
"de-DE": "Sprache", | |
"tr-TR": "Dil" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Test</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(function(){ | |
$("#apply").click(function(){ | |
$.getJSON('data.js', function(data){ | |
var label = $("#label").val(); | |
$("#what").text(data[label] ? data[label]["de-DE"] : "n/a"); | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="control"> | |
<label for="label">Label:</label><input type="text" name="label" value="Username" id="label" /> | |
<input type="button" id="apply" value="Go" /> | |
</div> | |
<div id="what"> | |
The german translation for given label should appear here. | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment