1
컨트롤러는 IE
public ActionResult GetCategories()
{
var htmlText = new StringBuilder();
var scriptText = new StringBuilder();
htmlText.Append("Hello world");
scriptText.AppendFormat("document.write({0});", htmlText.ToString());
var content = new ContentResult();
content.Content = scriptText.ToString();
return content;
}
보기
<script src="/Home/GetCategories" type="text/javascript" language="javascript"/>
그것은 FF에서 잘 실행
있지만 IE에서의 오류 때문이다.
http://stackoverflow.com/questions/69913/why-dont-self-closing-script-tags-work ... 일반을, 당신은 XHTML1의 부록 C를 읽어야합니다 XHTML은 old-school-HTML에서 self-closing 태그와 같은 XHTML 기능을 사용하기 전에 미리 정의해야합니다. http://www.w3.org/TR/xhtml1/#guidelines – bobince