'페이지'에 해당되는 글 3건

 
  1. 2013.06.19 [JQUERY/JS] 페이지 안에서 검색, Ctrl+F 검색기능
  2. 2010.10.06 [AJAX] 데이타 전송시 에러 Could not complete the operation due to error c00ce514 25
  3. 2010.03.12 [JSP/JAVA] 최상위, 파일 경로 알아내기
2013. 6. 19. 13:21 PROGRAMMING
[JQUERY/JS] 페이지 안에서 검색, Ctrl+F 검색기능

화면안에서 검색할 수 있게 해주는 스크립트 입니다.

DOM방식으로 작동하는 스크립트 소스를 수정한 것입니다.

이 소스는 인풋박스 한개와 버튼 한개를 사용하고 있습니다.



contsrch.js




$('a[name="btnContSrch"]').unbind('click').click(function(){
	var strContSrch=$('input[name="txtContSrch"]').val();
	if(strContSrch==$strContSrchInit || !strContSrch){
		alert('검색어를 입력하세요.');
		$('input[name="txtContSrch"]').focus();
		return false;}
	if(navigator.appName.indexOf("Microsoft")<0){
		if(!window.find(strContSrch,false,false,true,false,false,true)){
		}
		return false;
	}
	bodySearchAll('areaDetail'/*bodySideContent*/,strContSrch,'txtContSrch'/*bdySearch 버튼*/, 'down'/*chkMode*/);
	return false;
});
$('input[name="txtContSrch"]').val($strContSrchInit).bind('focus',function(){
	if($(this).val()==$strContSrchInit) $(this).val('');
}).bind('blur',function(){
	if(!$(this).val()) $(this).val($strContSrchInit);
}).bind('keyup',function(){
	if(event.keyCode!=13) return;
	return $('a[name="btnContSrch"]').click();
	return false;
});
끝;
2010. 10. 6. 13:25 COMPUTER/JAVASCRIPT, JQUERY
[AJAX] 데이타 전송시 에러 Could not complete the operation due to error c00ce514
ajax를 구현해서 리퀘스트를 날렸는데,
Could not complete the operation due to error c00ce514
라는 자바스크립트 에러가 났으면,

제일먼저확인할것은 요청페이지와 응답페이지간의 캐릭터셋이 일치하는지 확인하세요.

만약 요청페이지는 utf-8인데 응답페이지가 euc-kr이면 에러가 날 수 있습니다.
utf-8은 파일저장방식이 유니코드인지도 확인해야합니다.


인코딩 불일치때문에 에러가 나는것이 아니라면, 응답페이지의 캐릭터셋을 변경.

응답페이지가 PHP일때 인코딩을 지정하는 코드 입니다.
header("Content-type: text/html; charset=euc-kr");
또는
header("Content-type: text/html; charset=utf-8");


2010. 3. 12. 04:46 COMPUTER/JAVA, JSP
[JSP/JAVA] 최상위, 파일 경로 알아내기
JSP/Servlet 사이트 경로 1 (드라이브:\사이트경로\)
String strRoot=request.getSession().getServletContext().getRealPath("/");
out.println(strRoot);

JSP/Servlet 사이트 경로 2 (드라이브:\사이트경로\)
String strRoot=getServletContext().getRealPath("/");
out.println(strRoot);

JSP/Servlet 특정 페이지 경로
String strRealPath=getServletContext().getRealPath("경로/파일명");
strRealPath=strRealPath.substring(0,strRealPath.lastIndexOf(System.getProperty("file.separator")));
out.println(strRealPath);

JSP/Servlet 현재 페이지 경로
String strRealPath=getServletContext().getRealPath(request.getRequestURI());
strRealPath=strRealPath.substring(0,strRealPath.lastIndexOf(System.getProperty("file.separator")));
out.println(strRealPath);

JAVA - 현재 클래스 경로
this.getClass().getResource("").getPath();


JAVA - 클래스 디렉토리 경로
this.getClass().getResource("/").getPath();

최근에 올라온 글

최근에 달린 댓글