2010-07-09 6 views
0

우리는 Websphere Portal Server에 몇 개의 포틀릿을 배포했습니다. CSS 파일에는 img 태그에 대한 동작 특성이 포함되어 있습니다.img 동작 태그로 인한 다중 HTTP 요청

<link rel="stylesheet" type="text/css" title="Style" 
    href=''<%=request.getContextPath()+"/theme/stylesheet.css" %>'> 

문제를 다음과 같이

img { 
    position:relative; 
    border:none; 
    outline:none; 
    behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none", this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')", this.src = "transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("', '').replace('")', ''), this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')", this.runtimeStyle.backgroundImage = "none")), this.pngSet=true)); 
} 

우리는이 동작 태그가 여러 HTTP에서 포틀릿 JSP의 requests.In 한 결과 것을 알아 낸, 우리는 스타일 클래스가 경우에만 포함되어있다 그 request.getContextPath()가 있습니다. 실제 컨텍스트 루트로 대체하면 문제가되지 않습니다. 누군가가 그 행동 속성이 문제를 일으키는 이유를 알려주시겠습니까?

답변

1

야후! 제목이 인 기사가 있습니다. 웹 사이트 속도 향상을위한 모범 사례. 한 가지 피할 수있는 것은 CSS에서의 표현입니다. 마우스를 움직이거나 페이지를 스크롤하기 만하면 예상보다 조금 더 자주 평가됩니다.

기사는 여기 읽을 수와 CSS 표현을 피 제목을 찾습니다

http://developer.yahoo.com/performance/rules.html