문제

Ajax 사이트를 개발 중입니다. 따라서 문제는 브라우저 (Safari, Chrome)는 Strong, EM 등과 같은 태그 후에 Ajax로드 HTML 컨텐츠에 공간을 표시하지 않습니다.

그런 다음 Ajax 출력에 DocType을 추가했습니다. WebKit 브라우저에서 사이트를 테스트하지 않는 한 모든 것이 괜찮 았습니다. Safari에 페이지를로드하면 오류가 발생했습니다.

이 페이지에는 다음 오류가 포함되어 있습니다.

7 열에서 1 행의 오류 : 내부 오류

아래는 첫 번째 오류까지 페이지를 렌더링하는 것입니다.

무엇을해야합니까? 즉, 오류를 얻지 않고 WebKit의 DocType를 출력하는 방법이 있습니까?

출력은 다음과 같습니다.

<div class="topic">
    <div class="colon">
        <div class="topictext">
            <h2><a href="/artikul/1" class="showhuman" id="1" onclick="showhumaninfo (1); return false;">KirillTitov</a> tells us:</h2><p>Here you go.<br/>
<b>Bold text</b> <i>italic text</i> <strike>etc</strike>…</p> 
            </div><!-- topictext -->
            <div class="topicright"></div>
            <div class="clear"></div>
            <div class="topicinfo">
            <div class="topicclock">
                <font title="Timestamp for geeks — 1253816398">24&#0160;september,&#0160;year&#0160;2009</font>
            </div><!-- topicclock -->
            <div class="topiccomment">
                <a href="/joindachat/2" class="entertopic" id="2" onclick="entertopic (2); return false;">Go inside</a> (мнений: 0)
            </div><!-- topiccomment -->
        </div><!-- topicinfo -->
        <div class="topicindex">
            <img src="/img/bgtopicindex.gif" border="0" alt="" />
        </div><!-- topicindex -->
        <div class="blur"></div>
    </div><!-- colon -->
    <div class="colon">
        <div class="indextopcomment">
            <div class="commenttopleft"><img src="/img/bgcommentindexgreen.gif" alt="" border="0" /></div>
            <div class="texttopcomment nonenew">
                No comments here.
            </div>
            <div class="clear"></div>
            </div><!-- indextopcomment -->
            </div><!-- colon -->
            <div class="clear"></div>
        </div><!-- topic -->
    <div class="clear"></div>
</div><!-- topic -->
도움이 되었습니까?

해결책

사용에 대해 생각 했습니까? &nbsp; 그 장소에서?

또한 들어오는 Ajax 결과에 대해 다음을 시도하십시오.

.Replace("\xA0", "&nbsp;").Replace("\x20","&nbsp;");

일부 프레임 워크는 WebKit에서 이상하게 행동하고 표준이 아닌 간격을두고 있습니다. 다른 옵션이없는 경우 교체가 작동하는 경우 후속 조치를 취하지 만 일반적으로 가장 간단하고 빠른 수정입니다. 다음은 Whitespace Oddities의 전체 테이블입니다, 그러나 그것은 브라우저/플랫폼에 따라 정상적으로 타격을받는 퀴크에 달려 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top