JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://github.com/janl/mustache.js/raw/master/mustache.js"></script>
<input type="button" class="list" value="click me"></input>
JavaScript
var echo = function(dataPass) {
$.ajax({
type: "POST",
url: "http://localhost:9000/conf/uploadPage",
data: dataPass,
cache: false,
success: function(json) {
alert("UID=" + json.uid + "\nName=" + json.value);
}
});
};
$('.list').live('click', function() {
$.get("http://localhost:9000/conf/uploadPage", function(data) {
alert(data)
var json = {
json: JSON.stringify(data),
delay: 1
};
echo(json);
});
});
var select1 =
'<label>{{labelName1}}</label>'+
'<select>'+
'{{#options1}}' +
'<option value="{{val}}" {{#sel}}selected{{/sel}}>' +
'{{txt}}' +
'</option>' +
'{{/options1}}'+
'</select>'+
'<br/>'+
'<label>{{labelName2}}</label>'+
'<select>'+
'{{#options2}}' +
'<option value="{{val}}" {{#sel}}selected{{/sel}}>' +
'{{txt}}' +
'</option>' +
'{{/options2}}'+
'</select>'+
'<br/>'+
'<label>{{labelName3}}</label>'+
'<select>'+
'{{#options3}}' +
'<option value="{{val}}" {{#sel}}selected{{/sel}}>' +
'{{txt}}' +
'</option>' +
'{{/options3}}'+
'</select>'+
'<br/>'+
'<label>{{labelName4}}</label>'+
'<input type="text" name="a" placeholder="input value"/>'+
'<input type="file" name="uploadField"/>'+
'<br/>'+
'<label>{{labelName5}}</label>'+
'<textarea rows="4" cols="50">'+
'Committed'+
'</textarea>'+
'<div class="center">'+
'<br/>'+
'<input type="submit" value="submit"/>'+
'<input type="submit" value="reset"/>'+
'</div>',
data = {options1: [
{val: 1, txt: 'Asset Bundle',sel: true},
{val: 2, txt: 'ratePlanJson'}],
labelName1: 'Bundle',
options2: [
{val: 3, txt: 'USA',sel: true},
{val: 4, txt:...