JSFiddle - React, Tailwind, and code Playground
by agarcian
HTML
<h1>Welcome to my App</h1>
<p>Welcome to this test app</p>
<button>Click me</button>
JavaScript
//< script src="resources.default.js"> </ script >
var MyApp = MyApp || {};
MyApp.resources = {
One: "One",
Two: "Two",
Three:"Three"
}
// The server decided we needed Spanish translations.
//< script src="resources.es.js"> </ script >
var localizedResources = {
One: "Uno",
Two: "Dos",
Three:"Tres"
}
//< script type="text/javascript">
//Extend the translations into the resources object.
$.extend(MyApp.resources, localizedResources);
$(window).ready(function(){
$('button').click(function(){
alert(MyApp.resources.One);
});
});
//</ script>