NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
css path problem with SRV, external IE9, and strict doctype


Joined: 12 Feb 2012
Posts: 5
Reply with quote
Hi All,
I have been running the PhpED IDE for 5 years, now, and it is the only one for me! (currently v 8.0 build 8032)
It has been working a treat. Edit, develop, debug with SRV on a local Windows 7 pc, then upload to the company intranet server, and make it available to the company - to be browsed with IE, Firefox, Chrome, Android Tablets, all the while being able to continue local development on my PC, and even debug the live one if needed. Fantastic. Just what PhpED was made for. But then I needed a :hover feature that IE 7, 8, 9 will only do in Strict doctype mode.

So I changed the DOCTYPE heading from transitional to strict, which broke all my css (the css files could not be found). Reducing it, I ended up with this minimum program which no longer works.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="/js-css/pipe.css">
    </head>
    <body>
        <div class="titlebar">
            PIPE Home
        </div>
    </body>
</html>

This is meant to find a stylesheet to resolve the 'titlebar' class in the /jss-css folder off the main doc root.
With the combination of: SRV (local debug), PLUS external IE browser, PLUS strict doctype, it fails to find the css file to style the titlebar (or anything else in the real programs).
If I relax the doctype, OR if I use any other external browser (FF, Opera, Chrome), OR if I run it on the main apache2 server it finds the stylesheet, and works as required.
I wondered if I could add a specific absolute path to the css file, but I can't find one that works (eg href="http://localhost:8080/js-css/pipe.css"), whereas href="http://pipe.pi/js-css/pipe.css" DOES work above, although it fetches it from the production server (pipe.pi) and not the development pc, localhost.

This has broken my ability to further develop and test any local applications for IE, because the strict doctype needs to go in an include file used by all our apps.
The Default home Directory for the SRV web server is set to "C:\Users\jeremys.PI\Documents\Projects - PI\pippa\PippaApps\Pippa-WebApps\PIPE" which is correct, and works with SRV for all but "external IE" in strict mode.

Even if I could determine a full absolute path that would tell IE where to find the css file, I would be happy, because I can make it conditional in my php depending on whether is is being run locally or remotely.

I have googled till I am blue in the face, but I cannot find if there another setting I should have made to get SRV to correctly tell IE how to find the local css file under the SRV home directory specified. Any help would be greatly appreciated.

Thanks
View user's profileFind all posts by Jeremy StannersSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
I just created a new project using SRV with a single index.php using a copy/paste of your HTML and a single CSS file. Everything is named exactly as you have it and the CSS contained the blank default PhpED declarations plus .titlebar which I set to white text on red background. It worked fine in external IE 9, Chrome, Firefox and Safari. The URL is http://localhost:8080/index.php and the CSS was http://localhost:8080/js-css/pipe.css

I don't know much about SRV as I prefer to use a local Apache server, but it doesn't really sound like a SRV issue. Is there some sort of browser caching issue happening, so an old CSS is cached and reloaded for localhost? I guess you've tried an F5 to force a refresh/reload of the CSS, but maybe also try clearing the IE cache and see if it then loads the correct CSS.

If you have a look in the SRV logs, do you see anything useful such as the request for the CSS file? In my test I saw a GET /js-css/pipe.css HTTP/1.1 which is what is expected.
View user's profileFind all posts by plugnplaySend private message


Joined: 12 Feb 2012
Posts: 5
Reply with quote
Thank you for solving my problem - well, giving me a way forward, at least.

plugnplay wrote:
I just created a new project using SRV with a single index.php using a copy/paste of your HTML and a single CSS file. Everything is named exactly as you have it and the CSS contained the blank default PhpED declarations plus .titlebar which I set to white text on red background. It worked fine in external IE 9, Chrome, Firefox and Safari. The URL is http://localhost:8080/index.php and the CSS was http://localhost:8080/js-css/pipe.css
Thank you so much for doing that. It certainly raises issues for me as to why the difference, which I will look into later as time permits! At least I now know it is not SRV, but is something to do with MY setup.

Quote:
I don't know much about SRV as I prefer to use a local Apache server, but it doesn't really sound like a SRV issue. Is there some sort of browser caching issue happening, so an old CSS is cached and reloaded for localhost? I guess you've tried an F5 to force a refresh/reload of the CSS, but maybe also try clearing the IE cache and see if it then loads the correct CSS.
Thanks, Refreshed till the cows came home - in fact alternated between that and launching a fresh copy of the browser - as I selected different external default browsers and kept coming back to IE.

Quote:
If you have a look in the SRV logs, do you see anything useful such as the request for the CSS file? In my test I saw a GET /js-css/pipe.css HTTP/1.1 which is what is expected.
I looked in C:\Program Files (x86)\NuSphere\PhpED, and srv.exe is there, but I could not find a log or anything like it with an srv*.* search! So I could not see if SRV had responded to a GET of the css file.

HOWEVER, you mentioned using a local Apache for doing your work, and that reminded me I have one on my development PC that I used in the past as a "half-way-to-release" platform for testing. I put the file in the apache docroot, and it finds the css files perfectly. Very strange, but I can live with that, and will use it for all my development for now, rather than as a testing platform.

Thank you so much for going to all the effort on my behalf. It is very much appreciated. Now I am running again, and have a much better understanding of where to look for a solution in the future!
Regards, Jeremy
View user's profileFind all posts by Jeremy StannersSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
The SRV log is easy to get to. Whilst SRV is running it has an icon in the task tray, double-click that icon then in the window that pops up you can click on logs. It also shows you the headers, which is quite convenient. You might see something that will give a clue about the cause of the problem.

I must admit that problems like this do make me curious as to what's going on. Hopefully Dmitri will read and might have a useful suggestion.
View user's profileFind all posts by plugnplaySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
If CSS (or JS) does not work, you may want to check for the following situation:
-you checked parse php in JS and/or CSS
In this case - all the JS and CSS files processed by SRV are passed through php interpreter and this php interpreter ADDs content-type (until not issued by js or css themselves). Guess what content type is set by PHP? Right - it's text/html (and shouldn't be anything else - because it does not care if your files end up .html, .js or .css).
In this case I'd recommend either uncheck "parse php" in those files (if they really don't have php parts), or add necessary header() function call specifying Content-Type with appropriate value in appropriate place -- the topmost possible, before the 1st echo.

Regarding debugging html issues, I'd recommend to use live-headers (free) plugin or http-watch (commercial)
They show HTTP requests and HTTP responses.
In case of SRV - you can see them too btw...

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 12 Feb 2012
Posts: 5
Reply with quote
dmitri wrote:
If CSS (or JS) does not work, you may want to check for the following situation:
-you checked parse php in JS and/or CSS

Dmitri, has anyone told you that you are wonderful!?
I never even knew what that setting did! Now it works. And I am "over the moon" with happiness.

dmitri wrote:
In this case - all the JS and CSS files processed by SRV are passed through php interpreter... snip
And, you take the time to give an explanation, and to educate. You go the extra mile and more. Thanks.

dmitri wrote:
or add necessary header() function call specifying Content-Type with appropriate value in appropriate place -- the topmost possible, before the 1st echo.
Is a little bit trickier, I am using Smarty as well, but with a single master template for all my projects, I will go through it carefully, and check that each of the 6 css links, and the 8 js links have appropriate type specified. This will help my main projects, thanks.

dmitri wrote:
Regarding debugging html issues, I'd recommend to use live-headers (free) plugin or http-watch (commercial)
They show HTTP requests and HTTP responses.
In case of SRV - you can see them too btw...

Many thanks, I will get these. I am always on the lookout for useful tools for firefox to help.

plugnplay wrote:
The SRV log is easy to get to. Whilst SRV is running... snip
Thank you thank you. Very helpful.

Again, thanks to you both, plugnplay and dmitri. The problem is now fixed, and I have learned important things from you both, for which I am very grateful.
View user's profileFind all posts by Jeremy StannersSend private message
css path problem with SRV, external IE9, and strict doctype
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic