Web前端基本用法(一)
来源:互联网 发布:linux查看所有端口命令 编辑:程序博客网 时间:2024/05/29 04:46
一 . 点击按钮显示摘要
1.在<table>...</table>中加入如下一行代码:
<td><button class="button"onclick="show('<%=x.abs%>')">^</button>
2.在末尾加入JS代码如下:
<div class="alert_dialog">
</div>
<script type="text/javascript">
function show(x){
$(".alert_dialog").toggle();#切换hide()和show()方法
$(".alert_dialog").html(x);
}
function cancle(){
$(".alert_dialog").hide();
}
</script>
二. 过滤条件复选框总结:
1.form表单里面:
<form name="input" action=" /bj_search/index "method = "post">
专利信息:
<input type="text" name="names" value=class="info" >
<input type="submit" value="搜索"class="class">
<input type="checkbox"name="condition[]"value="pubNumber">公开(告)号</input>
<input type="submit" name="submit"value="Submit">
</form>
2.table表头里面:
<%if !@condition.blank? && (@condition.include?"pubNumber")%>
<th>公开(告)号</th>
<%end%>
3.table单元格里面:
<%if !@condition.blank? && (@condition.include?"pubNumber")%>
<td><%=x["pubNumber"]%></td>
<%end%>
4.JavaScript在<script>里面:
$(function(){
$(".class").click(function(){
alert($(".info").val() == "");#弹框出提示信息
if($(".info").val() == ""){#.info标签里的val()变量为空,则
$(".info").val("aa"); #则页面显示内容“aa”
return true;
}
return false;
});
三. js弹窗效果:
<!--警告框-->
<script>
function myFunction(){
alert("Hello!I am an alert box!");
}
</script>
<input type="button" onclick="myFunction()"value="show alert box"/>
<!--提示框-->
<script>
function myFunction(){
var x;
var person=prompt("请输入名字","lc");
if (person!=null) {
x = "Hello" + "!how are you today?";
document.getElementById("demo").innerHTML = x;
};
}
</script>
<button onclick="myFunction()">click</button>
<p id="demo"></p>
<!--确认框-->
<button onclick="myFunction()">tryit!</button>
<p id="demo"></p>
<script>
function myFunction(){
var x;
var r = confirm("Press a button!");
if (r == true) {
x = "ok!";
}
else{
x = "cancel!";
}
document.getElementById("demo").innerHTML = x;
}
</script>
- Web前端基本用法(一)
- web前端基本用法(二)
- Web前端工程师的林林总总(一) -- 三种Web前端工程师的基本类型
- WEB 前端(一)
- Web 前端本地化(一)
- web前端学习(一)
- 细说Web前端(一)
- websocket(一)前端基本使用
- HBase基本用法 (一)
- Volley(一), 基本用法
- CoreText(一):基本用法
- tabhost基本用法(一)
- pandas基本用法(一)
- 【SpringMVC】(一)基本用法
- tensorflow基本用法(一)
- Web前端开发规范(一)
- Web前端开发规范(一)
- web前端学习之路(一)
- 用canvas画一个钟表
- 屏幕适配
- Javascript中apply、call、bind的区别
- 一念執著
- 作品展收获
- Web前端基本用法(一)
- hadoop 兼容问题
- C#线程篇---Windows调度线程准则
- 如何在你的网页快速创建分享功能
- GDB十分钟教程
- linux版本Debian VS CentOS
- AsyncTask异步任务
- Spring in Action读书笔记 (二)
- 变色眼镜的原理