修正了网上其它版本的一些错误。完美无错版[html]<html><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title>JS网页图片查看器-可控制图片放大缩小还原移动效果</title><METAHTTP-EQUIV="imagetoolbar"CONTENT="no"><styletype="text/css">body{font-family:"Verdana","Arial","Helvetica","sans-serif";fo...
http://www.jb51.net//article/16495.htm
没什么好说的,都是js,用一个iframe将页面遮挡,iframe上面一个div层,js面向对象做的,其中有部分是js动态生成style。ModeWindow.js[code]<htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title>UntitledPage</title><scriptsrc="ModeWindow.js"></script><scriptlanguage="javascript"type="text/javascrip...
http://www.jb51.net//article/16486.htm
以下程序直接通过HibernateAPI批量更新CUSTOMERS表中年龄大于零的所有记录的AGE字段:tx=session.beginTransaction();Iteratorcustomers=session.find("fromCustomercwherec.age>0").iterator();while(customers.hasNext()){Customercustomer=(Customer)customers.next();customer.setAge(customer.getAge()+1);}tx.commit();session.close();如果CUSTO...
http://www.jb51.net//article/16483.htm
//验证性别(单选按钮验证)functioncheckXb(){vartemp=false;varxbObj1=document.getElementById("xb1");varxbObj2=document.getElementById("xb2");if(xbObj1.checked||xbObj2.checked){temp=true;}returntemp;}functioncheckform(){//验证性别(单选按钮验证)if(!checkXb()){alert("请选择性别");returnfalse;}//验证人员类别(下拉框验证)if(document.getElement...
http://www.jb51.net//article/16482.htm
1,页面上[code]<tdwidth="4%"height="26"align="center"><inputtype="checkbox"name="checkbox"value=<%=user.getId()%>/></td>[/code]2.action[code]String[]checkbox=request.getParameterValues("checkbox");List<Integer>checkboxs=newArrayList<Integer>();intoperatorId=SessionMgr...
http://www.jb51.net//article/16481.htm
例如:[code]HibernateTest.javaimportonlyfun.caterpillar.*;importnet.sf.hibernate.*;importnet.sf.hibernate.cfg.*;importjava.util.*;publicclassHibernateTest{publicstaticvoidmain(String[]args)throwsHibernateException{SessionFactorysessionFactory=newConfiguration().configure().buildSessionFactory();Session...
http://www.jb51.net//article/16478.htm
1、Configuration/SessionFactory/SessionConfiguration实例代表了一个应用程序中Java类型到SQL数据库映射的完整集合.Configuration被用来构建一个(不可变的(immutable))SessionFactory.SessionFactory是线程安全的,创建代价很高。Session是非线程安全的,轻量级的。一个Session对应一个JDBC连接,Session的connection()会获取Session与之对应的数据库连接Connection对象。Session的功能就是操作对象的,这些对象和数据库表有映射关系。Session操作的...
http://www.jb51.net//article/16476.htm
数据的保存,更新和删除:1、Session.save()方法:Session.save()方法用于实体对象的持久化保存,也就是说当执行session.save()方法时会生成对应的insertSQL语句,完成数据的保存。如下面的代码:Useruser=newUser();user.setName(“zx”);Transactiontx=session.beginTransaction();session.save(user);tx.commit();当执行到session.save()方法时,Hibernate并不会马上生成insertSQL语句来进行数据的保存,而是当稍后清理session的...
http://www.jb51.net//article/16475.htm
google找到这样一个解决方法:在上传控件中插入了值,就只能通过form的reset功能来清空了,但是form里面其他的值也被reset了。既然可以使用form的reset清空,那就有办法了:新建一个临时form,然后将需要清空的上传控件移入其中,reset之后,再移回原来所在位置,最后删除创建的临时form。js代码: [code]varUpload={clear:function(id){varup=(typeofid=="string")?document.getElementById(id):id;if(typeofup!="object")returnnull;vartt...
http://www.jb51.net//article/16472.htm
定时刷新:1,<script>setTimeout("location.href='url'",2000)</script>说明:url是要刷新的页面URL地址2000是等待时间=2秒,2,<metaname="Refresh"content="n;url">说明:nisthenumberofsecondstowaitbeforeloadingthespecifiedURL.urlisanabsoluteURLtobeloaded.n,是等待的时间,以秒为单位url是要刷新的页面URL地址3,<%response.redirecturl%>说明:...
http://www.jb51.net//article/16456.htm
1、JavaScript[code]varoSel=document.form1.DropDownCity;while(oSel.options.length>0){oSel.removeChild(oSel.options[0]);}[/code]2、JavaScript[code]<SCRIPTLANGUAGE="JavaScript">functiondel1(){varobj=document.getElementById("s");varcount=obj.options.length;for(vari=0;i<count;i++){obj.options.r...
http://www.jb51.net//article/16446.htm
