Is it possible to serve html page from conditional?

Instead of serving a stylesheet for IE8 I would like to simply introduce a different html page using the same stylesheet.

is that possible?

Thank you

1 Like

You could use javascript to browser sniff, but I’m not sure what that’ll get you. Especially since it’s the css that’s 90% of what you’ll have issues with for IE8

Hi
I have another thread in javascript forum to try to solve a problem with an image slider in IE8. meanwhile I wrote another page where I swapped the 10 images of the caroussel for a single static image. That was simple and then I thought maybe the conditional only works with css

I can try to work the other way round n«but right now can’t see how…

Thanks

The “if IE” conditionals only work with html, not css. But that html may be links to a css file or <style> tags in the head.
So you could put problem scripts and page elements in “Not IE” conditions, then the alternative still image in an “If IE”.

What I meant was that I now have 2 htmls files and would like the main one to give over to the second in case the visitor is on IE8

<!--[if lt IE 9]>
<link rel="stylesheet" type="text/html" href="IE8.html">
<![endif]-->

Then the IE8.html would still use the same css.

I know this is the opposite of what is usually done, but there is no harm in asking…

Now, how am I going to tell a stylesheet no to implement the slider (with 10 images) and display only one?

How can I hide images with css? put each in a div and display:none?

That would require a redirect in the condition.

That was not what I suggested, I only mentioned css to correct this:

The suggestion was:

<head>
<!--[if !IE]> -->
   <script>Some slider script that IE does not like</script>
<!-- <![endif]-->
</head>

and:

<body>
<!--[if !IE]> -->
   <div class="slider"></div>
<!-- <![endif]-->
<!--[if IE]>
   <div class="altimg"><img></div>
<![endif]-->
</body>

My head is getting very confused but I think I follow you and will try something like that as I was wondering if the conditional could disable the slider script.

What I have been doing is this

<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

	
<style>
.single-item{
display:none;
}

.one-img{
display:block;
}
</style>
<![endif]-->

It is here http://pintotours.net/TEMP/TEST/index2.html

But the page is all over the place in IE8 due to the script

<script type="text/javascript">
$('.single-item').slick({
  dots:true,
  slidesToShow: 1,
  slidesToScroll: 1,
  autoplay: true,
  autoplaySpeed: 3000
 });
 </script>

Now, is there a way of disabling the script in the conditional? Maybe a conditional AROUND it saying IF NOT IE8 go ahead

I’ve made a few changes to the file above with conditionals wherever there id slider code . It works OK in the modern browsers but not in IE(, which is all over the place. Could you have a look at it to see if I did something drastically wrong, please?

Yes, that was this bit:

That is a general “not IE” so would include IE9. I’m not sure the correct way for “not IE 8”, possibly this, but I am not sure:

<!--[if !lt IE 9]> -->

Now the validator is throwing up an error…and evn the FF page has gone funny!

Yes, that’s maybe not a valid condition () I did say I was not sure what the correct one was. Or it could be something else…

There are also conditionals in JScript (but not in JavaScript) so you can use those to identify IE8 as well since IE8 only supports JScript and doesn’t support JavaScript.

So, is that my problem?

This is the script for the slider

<script type="text/javascript">
$('.single-item').slick({
  dots:true,
  slidesToShow: 1,
  slidesToScroll: 1,
  autoplay: true,
  autoplaySpeed: 3000
 });
 </script>

…and why don’t my conditionals work?

Hi

I managed to get somewhere, but not all the way.

The conditionals are doing their work but now I have a html problem: the sidebar is way down in IE8 and and can’t work out why.

http://pintotours.net/TEMP/TEST/index2.html

Help appreciated.

Thank you

It seems to be working in IE8 here.

Hi Sam

The sidebar in IE( has been sorted out for the new version that disables the image slider scripts. It is now http://pintotours.net

The original thread was moved and now there are two going…

Thanks

If you could se if the index page is workinf fine in a IE9 and IE10 browsers, i would be grateful

I don’t have those versions available right now. But the index (not test version) is still bad in IE8, and in Firefox I get a small horizontal scroller.

Are you talking about the latest http://pintotours.net/

after clearing cache?

In Ie8 here it is working fine without, of course, the slider.

And I get no problems in IE11, FF, Chrome, or Opera

Please, refresh and let me know if the problems persist and if you are on a PC, tablet, or mobile

It seems to be working now.
But there is still the small scroller in FF.

Can you tell me exactly where in what type of device, please?