RTC Forums
May 01, 2024, 12:33:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: css file with IE11  (Read 3358 times)
mteirek
RTC Expired
*
Posts: 9


« 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 ?

Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 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
Logged
mteirek
RTC Expired
*
Posts: 9


« Reply #2 on: June 08, 2015, 12:35:08 PM »

work fine with :

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

thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 17 queries.