很多站长朋友们都不太清楚计算星座的html怎么写,今天小编就来给大家整理计算星座的html怎么写,希望对各位有所帮助,具体内容如下:
本文目录一览: 1、 用html jsp 语言设计。 用日期查询星座,请问我的问题出在哪里 2、 用html jsp 设计。用日期查询星座,请问我的问题出在哪里,查询不到 3、 【API】拿到api数据接口该怎么写到自己的HTML里面!星座运势API! 用html jsp 语言设计。 用日期查询星座,请问我的问题出在哪里截图的代码看不清。
提供示例代码供参考:
function xingzuo() {
var start = 1901, date=document.getElementById("txtDay").value, month=document.getElementById("txtMonth").value;;
with (document.getElementById("txtXZ")){
if (month == 1 date >=20 || month == 2 date <=18) {value = "水瓶座";}
//if (month == 1 date > 31) {value = "Huh?";}
if (month == 2 date >=19 || month == 3 date <=20) {value = "双鱼座";}
//if (month == 2 date > 29) {value = "Say what?";}
if (month == 3 date >=21 || month == 4 date <=19) {value = "白羊座";}
//if (month == 3 date > 31) {value = "OK. Whatever.";}
if (month == 4 date >=20 || month == 5 date <=20) {value = "金牛座";}
//if (month == 4 date > 30) {value = "I'm soooo sorry!";}
if (month == 5 date >=21 || month == 6 date <=21) {value = "双子座";}
//if (month == 5 date > 31) {value = "Umm ... no.";}
if (month == 6 date >=22 || month == 7 date <=22) {value = "巨蟹座";}
//if (month == 6 date > 30) {value = "Sorry.";}
if (month == 7 date >=23 || month == 8 date <=22) {value = "狮子座";}
//if (month == 7 date > 31) {value = "Excuse me?";}
if (month == 8 date >=23 || month == 9 date <=22) {value = "室女座";}
//if (month == 8 date > 31) {value = "Yeah. Right.";}
if (month == 9 date >=23 || month == 10 date <=22) {value = "天秤座";}
//if (month == 9 date > 30) {value = "Try Again.";}
if (month == 10 date >=23 || month == 11 date <=21) {value = "天蝎座";}
//if (month == 10 date > 31) {value = "Forget it!";}
if (month == 11 date >=22 || month == 12 date <=21) {value = "人马座";}
//if (month == 11 date > 30) {value = "Invalid Date";}
if (month == 12 date >=22 || month == 1 date <=19) {value = "摩羯座";}
//if (month == 12 date > 31) {value = "No way!";}
}
}
用html jsp 设计。用日期查询星座,请问我的问题出在哪里,查询不到就是说:你输入一个日期要显示相应的星座对吧?
有可能是你的判断不对,你输入年月日,但是星座只要取月-日就好了,再判断这个日期在哪个星座的日期之间
【API】拿到api数据接口该怎么写到自己的HTML里面!星座运势API!java发一个http请求过去,带上参数就可以了啊,跟我们在浏览器上访问资源是一样的 只是它返回的是json格式的数据而已给你两个方法吧:
public static String do_post(String url, List<NameValuePair> name_value_pair) throws IOException { String body = "{}"; DefaultHttpClient httpclient = new DefaultHttpClient(); try { HttpPost httpost = new HttpPost(url); httpost.setEntity(new UrlEncodedFormEntity(name_value_pair, StandardCharsets.UTF_8)); HttpResponse response = httpclient.execute(httpost); HttpEntity entity = response.getEntity(); body = EntityUtils.toString(entity); } finally { httpclient.getConnectionManager().shutdown(); } return body; } public static String do_get(String url) throws ClientProtocolException, IOException { String body = "{}"; DefaultHttpClient httpclient = new DefaultHttpClient(); try { HttpGet httpget = new HttpGet(url); HttpResponse response = httpclient.execute(httpget); HttpEntity ent发处篡肺诂镀磋僧单吉ity = response.getEntity(); body = EntityUtils.toString(entity); } finally { httpclient.getConnectionManager().shutdown(); } return body; }
关于计算星座的html怎么写的介绍到此就结束了,不知道本篇文章是否对您有帮助呢?如果你还想了解更多此类信息,记得收藏关注本站,我们会不定期更新哦。
查看更多关于计算星座的html怎么写 html星座代码的详细内容...