Controller
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;
}
View
<script src="/Home/GetCategories" type="text/javascript" language="javascript"/>
It runs well on FF, but not in IE.