'자바스크립트'에 해당되는 글 3건
- 2008.02.02 전체선택을 위한 자바스크립트 코드
- 2008.01.05 아이프레임 리사이즈 문제 해법
- 2007.09.07 서블릿을 사용할 경우 js파일 경로
<script type="text/javascript">
function select_all() {
var all = document.getElementById("selectAll");
var list = document.getElementsByName("checkList[]");
if(!all.checked) {//전체선택 체크박스가 해제되었다면
for(var i = 0; i <= list .length - 1 ; i++) {//모든 체크박스를 체크해제
list[i].checked = false;
}
} else { //그게 아니라면
for(var i = 0; i <= list .length - 1 ; i++) {
list [i].checked = true;//모든 체크박스를 체크
}
}
}
</script>
.......................................
<tr>
<td>
<input type="checkbox" name="selectAll" onClick="select_all()">
</td>
</tr>
<tr>
<td>
<input type="checkbox" name="checkList[]" value="딸기">
<input type="checkbox" name="checkList[]" value="사과">
<input type="checkbox" name="checkList[]" value="배">
<input type="checkbox" name="checkList[]" value="귤">
<!-- 자바 struts 사용시 ActionForm에서 array로 받으려면 '[]' 이녀석을 꼭 붙여줘야 한다.-->
</td>
<tr>
....................................
원래 코드에서 수정하고 테스트는 안해보았음.
'작업노트 > HTML & Script' 카테고리의 다른 글
[Ajax] innerHTML 삽입시 (0) | 2008.10.30 |
---|---|
프레임구조에서 전체화면에 링크 반영하기 (0) | 2008.08.26 |
아이프레임 리사이즈 문제 해법 (0) | 2008.01.05 |
name과 id의 차이 (0) | 2007.09.15 |
GET방식으로 한글 보내는 방법 (0) | 2007.09.04 |
How To Resize an IFrame to the Size of Its Contents Without Displaying Scroll Bars
Article ID | : | 278469 |
Last Review | : | November 23, 2006 |
Revision | : | 4.1 |
SUMMARY
MORE INFORMATION
The following code demonstrates how to resize an IFrame in this way. Create a new .htm document, and paste the following HTML code. In the SRC attribute for the IFrame, you must supply an HTML page from the same domain that the IFrame loads.
NOTE: This technique may not work correctly if there are absolutely positioned elements that are residing within the IFrame.
<HTML>
<HEAD>
<SCRIPT LANGUAGE=javascript>
<!--
function reSize()
{
try{
var oBody = ifrm.document.body;
var oFrame = document.all("ifrm");
oFrame.style.height = oBody.scrollHeight +
(oBody.offsetHeight - oBody.clientHeight);
oFrame.style.width = oBody.scrollWidth +
(oBody.offsetWidth - oBody.clientWidth);
}
//An error is raised if the IFrame domain !=
its container's domain
catch(e)
{
window.status = 'Error: ' + e.number + '; ' + e.description;
}
}
//-->
</SCRIPT>
</HEAD>
<BODY onload=reSize()>
<iframe onresize=reSize() id=ifrm src=YOUR_PAGE_HERE></iframe>
</BODY>
</HTML>
This example uses try and catch to check for domain consistency, which are only available with Internet Explorer 5 and later. This error checking is included for illustration purposes and is not absolutely necessary; it only allows the script to fail gracefully.Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:
REFERENCES
http://support.microsoft.com/iep (http://support.microsoft.com/iep)
'작업노트 > HTML & Script' 카테고리의 다른 글
프레임구조에서 전체화면에 링크 반영하기 (0) | 2008.08.26 |
---|---|
전체선택을 위한 자바스크립트 코드 (0) | 2008.02.02 |
name과 id의 차이 (0) | 2007.09.15 |
GET방식으로 한글 보내는 방법 (0) | 2007.09.04 |
innerHTML을 사용할 시에 (0) | 2007.08.29 |
.js파일 안에 기입하고 jsp파일과 같은 디렉토리 안에 두고
script태그의 src 프로퍼티로 포함을 시킨 경우라면
그때의 상대경로는 jsp파일이 있는 디렉토리(sub/a.jsp)를 기준으로 하는 것이 아니라
서블릿의 경로명(/a.do)을 기준으로 하는 것이므로,
경로명에 jsp파일이 있는 디렉토리 명을 추가 해주어야 한다.
<script type="text/javascript" src="sub/httpRequest.js"></script>
이런식으로 말이다.
별것도 아닌데 삽질아닌 삽질을 하고야 말았다.
왠지 나중에도 까먹고 삽질할 것 같아 기록을 남긴다.-_-
'작업노트 > Error Handling' 카테고리의 다른 글
[JNDI] NamingException (0) | 2007.12.22 |
---|---|
[Eclipse] Resource is out of sync with the file system : ... (1) | 2007.12.18 |
404 - Servlet action is not available (0) | 2007.07.05 |
error while loading shared libraries (0) | 2007.06.27 |
javax.servlet.ServletException: You have an error in your SQL syntax; (0) | 2007.06.01 |