我有一个asp texbox,它有占位符和jquery自动完成功能。两者在chrome方面都运行良好但在IE8占位符不起作用。为了使其工作,我在jquery中为占位符添加水印,但随后显示水印,但自动完成功能无效。所有问题都在IE8中:
<asp:TextBox ID="txtLocation" runat="server" CssClass="frmhometxtLocation" placeholder="Locations"
onblur="Javascript:FormatLocation();"></asp:TextBox>
$("#txtLocation")
// don't navigate away from the field on tab when selecting an item
.bind("keydown", function (event) {
if (event.keyCode === $.ui.keyCode.TAB &&
$(this).autocomplete("instance").menu.active) {
event.preventDefault();
}
})
.autocomplete({
delay: 0,
minLength: 1,
source: function (request, response) {
// delegate back to autocomplete, but extract the last term
response($.ui.autocomplete.filter(
locations, extractLast(request.term)));
},
focus: function () {
// prevent value inserted on focus
return false;
},
select: function (event, ui) {
var terms = split(this.value);
// remove the current input
terms.pop();
// add the selected item
terms.push(ui.item.value);
// add placeholder to get the comma-and-space at the end
terms.push("");
this.value = terms.join(", ");
return false;
}
});
});
答案 0 :(得分:0)
我在这里犯了一个错误,但不包括Watermark.min.js。使用工具提示进行水印。现在它工作得很好。这是正确的代码:
public void executeMultipartPost() throws Exception {
try {
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setCharset(Charset.forName("UTF-8"));
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
byteArray = byteArrayOutputStream.toByteArray();
builder.addTextBody("file1", byteArray.toString());
builder.addTextBody("file2", byteArray2.toString());
// send
InputStream inputStream = null;
HttpClient httpClient = AndroidHttpClient.newInstance("Android");
HttpPost httpPost = new HttpPost(UPLOAD_URL);
httpPost.setEntity(builder.build());
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
inputStream = httpEntity.getContent();
// response
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
StringBuilder stringBuilder = new StringBuilder();
String line = null;
while ((line = bufferedReader.readLine()) != null) {
stringBuilder.append(line + "\n");
}
inputStream.close();
// result
String result = stringBuilder.toString();
} catch (Exception e) {
e.printStackTrace();
}
}