RTC Forums

Subscription => Support => Topic started by: mteirek on June 06, 2015, 01:08:56 AM



Title: css file with IE11
Post by: mteirek on June 06, 2015, 01:08:56 AM

i try to build a web application using javascript Framework.



1- i installed the RTC_WebServer ( demo program ) on a Windows server 2008  r2
2- i am working with shield ui Framework


i put css file + 2 js files on the server

file1-      <link id="themecss" rel="stylesheet" type="text/css" href="all.min.css" />
file2-     <script type="text/javascript" src="jquery-1.11.1.min.js"></script>
file3-     <script type="text/javascript" src="shieldui-all.min.js"></script>

with Chrome no problem ( css file and js files) are received by the client (chrome) and code in the webpage work nice
with IE11 the css file dont work ( not sent or sent partialy ?).  IE11 dont use it





same code work fine in IE11 and chrome if i use a public cdn
file1-      <link id="themecss" rel="stylesheet" type="text/css" href="//www.shieldui.com/shared/components/latest/css/light/all.min.css" />
file2-     <script type="text/javascript" src="jquery-1.11.1.min.js"></script>
file3-     <script type="text/javascript" src="shieldui-all.min.js"></script>




server-headers problem ?
any idea ?



Title: Re: css file with IE11
Post by: D.Tkalcec (RTC) on June 07, 2015, 05:43:10 PM
Chrome is obviously smart enough to determine the content type when downloading a file with CSS extension, but some browsers aren't. To make sure all Browsers will know what to do with the content received, you need to explicitly set the Content-Type HTTP header for all files used by Web Browsers. In the RTC WebServer Demo, that can be done easily by adding CSS to the list of content types on the Main Form. And when you need to write your own code for sending out files to Web Browsers, use the Response.ContentType or Response['Content-Type'] property on the TRtcDataServer(Sender) component to prepare the content type HTTP header before sending out the response with the Write or WriteEx method.

Best Regards,
Danijel Tkalcec


Title: Re: css file with IE11
Post by: mteirek on June 08, 2015, 12:35:08 PM
work fine with :

if ExtractFileExt(qfilename) = '.css'  then begin rdsServer.Response.ContentType := 'text/css';  end;

thanks