我有一个jsp页面,表格是。
<form name="contact" action="">
<fieldset>
<div id="res"></div>
<label for="name" id="name_label">Name</label>
<input type="text" name="name" id="name" size="30" value="" class="text-input" />
<label class="error" for="name" id="name_error">This field is required.</label>
<label for="email" id="email_label">Return Email</label>
<input type="text" name="email" id="email" size="30" value="" class="text-input" />
<label class="error" for="email" id="email_error">This field is required.</label>
<label for="phone" id="phone_label">Return Phone</label>
<input type="text" name="phone" id="phone" size="30" value="" class="text-input" />
<label class="error" for="phone" id="phone_error">This field is required.</label>
<br />
<input type="submit" name="submit" class="button" id="submit_btn" value="Send" />
</fieldset>
</form>
<div id="res"></div>
和按钮的ajax
$.ajax({
type: "POST",
url: "processServlet",
data: dataString,
success: function(data) {
$('#res').wrap(data);
}
});
return false;
});
在servlet中我有一个带有html标签的字符串
String te="<div class=\"input-control text\" \n" +
" data-role=\"datepicker\" \n" +
" data-week-start=\"1\"\n" +
" data-format='m/d/yyyy'\n" +
" data-effect='slide'>\n" +
" <input type=\"text\" placeholder=\"Date purchased\"
name=\"DATEPURCHASED\" id=\"DATEPURCHASED\">\n" +
" <button class=\"btn-date\" disabled></button>\n" +
“”;
out.println(te);
servlet将日期选择器返回到jsp页面。当jsp页面中显示datepicker时,datepicker似乎不起作用?我做错了什么?我需要将整个html文件返回到页面吗?看起来他们没有共享主jsp页面的css和js。