我有5个项目的下拉列表.
我想将所选项目发送到下一个jsp页面.
JavaScript代码:
var display= document.getElementById('displayId');
var j;
var count =0;
for(j=0;j< display.options.length;j++){
if(display.options[j].selected){
displaySelected = display.options[j].value;
count++;
}
}
alert(displaySelected);
Run Code Online (Sandbox Code Playgroud)
HTML代码:
<SELECT NAME="displayId" id="displayId" style="width:300px;">
<option>Host</option>
<option>Host And Response Time</option>
<option>Host And User Count</option>
<option>User Count And Reponse Time</option>
<option>Host,UserCount And Response Time</option>
</SELECT>
Run Code Online (Sandbox Code Playgroud)
这适用于Fire fox,但不适用于IE ...任何人都可以找到错误吗?
当在java代码中运行时,可从浏览器访问的URL提供404响应代码.
问题是什么???..任何人都可以解释一下这个
public String login(String url) {
URL targetURL;
long start = 0;
long end = 0;
float difference = 0;
HttpURLConnection httpURLConnection;
StringBuffer strbufstatus = new StringBuffer();
try {
//Connecting to the url
targetURL = new URL(url);
start = System.currentTimeMillis();
httpURLConnection = (HttpURLConnection) targetURL.openConnection();
httpURLConnection.setUseCaches(false);
httpURLConnection.setAllowUserInteraction(false);
httpURLConnection.setDoInput(true);
httpURLConnection.setRequestMethod("GET");
httpURLConnection.connect();
//Getting the respond Code
int responseCode = httpURLConnection.getResponseCode();
strbufstatus.append("Response Code===> " + responseCode + "<br>");
if(responseCode==200){
// System.out.println("respondcode===> " + responseCode);
end = System.currentTimeMillis();
//Calculating the response time
difference = …Run Code Online (Sandbox Code Playgroud)