Jump to content


Photo

Firefox Ignore HTML


  • Please log in to reply
10 replies to this topic

#1 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 13 August 2006 - 08:03 AM

Hey guys,

Is there a way to tell Firefox to ignore a section of code (without Javascript) so that IE will still read it? On my page IE, for once, reads everything fine; but in Firefox my quicktime movie is in the totally wrong position.

I figure that simply telling Firefox to ignore it will be an easier solution to my problem, and it wont use as much of my internet limit each time I view my page.

Thanks a lot. :P

#2 Matthew.

Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 13 August 2006 - 08:08 AM

lol, this is an unusual question :P However thankfully is there an easy non-js way called conditional comments. More commonly used to control stylesheets for ie only etc but it all works :)


<!--[if IE]>
IE only HTML here!
<![endif]-->


#3 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 15 August 2006 - 07:59 AM

Thanks a lot for the reply :P

Im sure that works, so I thank you again... Its a pitty that for some reason MySpace filters this code and changes it to:
<!-- -->[if IE]>
IE only HTML here!
<![endif]-->

Do you know of any work arounds to fool this filter? If not I'll try to find one :P

Thanks

#4 Tromac

Tromac

    Young Padawan

  • Members
  • Pip
  • 56 posts

Posted 09 September 2006 - 06:10 PM

Does anyone know of an equivelent tag for Firefox?

i.e. (Bad choice of acronym there :P)
<!--[if Mozilla]>
Mozilla only HTML here!
<![endif]-->


#5 blackhawk_996

blackhawk_996

    Young Padawan

  • Members
  • Pip
  • 59 posts

Posted 09 September 2006 - 07:24 PM

<!-- Filename: index.php -->
<?php
$gecko = 0;
if strstr($_SERVER["HTTP_USER_AGENT"], "Gecko") {
$gecko = 1;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link href="style.php" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>
<body>
</body>
</html>

// Filename: style.php
<?php
if ($gecko) {
?>
// Gecko rules only.
<?php
}
?>
// The rest of your rules.


I know that HTTP_USER_AGENT can be spoofed, but more often then not it's just Opera pretending to be Internet Explorer isn't it? I do see two things that would have to be taken into consideration though:

1) Unless the Gecko rules are more specific, they will have to be inserted last to take precedence.
2) HTTP_USER_AGENT might be a bit different acrossed other browsers using the Gecko rendering engine, so your if statement might get a bit more complicated.

This should get you moving along

:P

#6 Rory

Rory

    Jedi In Training

  • Members
  • PipPip
  • 378 posts
  • Gender:Male
  • Location:Hastings, Hawkes bay, New Zealand
  • Interests:Php, Html, Css, Javascript, ASP.NET, Photoshop, soccer, rigby, cricket, viticulture, Ruby#, C#, AJAX.

Posted 09 September 2006 - 08:03 PM

Does anyone know of an equivelent tag for Firefox?

i.e. (Bad choice of acronym there :D)

<!--[if Mozilla]>
Mozilla only HTML here!
<![endif]-->


hmm... the easiest way would probably be to go if not firefox and put the code in there you don't want firefox to see but I can't remember the code for it. :D

#7 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 10 September 2006 - 02:24 AM

Actually, HTML conditional statements are unique to IE. So to write something that only FF can see, you would have to use JS, PHP, or some other web development language.

Honestly, the only reason i can think of for differentiating between browsers is CSS and JS, simply because you have to.

Edited by rc69, 10 September 2006 - 02:25 AM.


#8 joe

joe

    Young Padawan

  • Members
  • Pip
  • 115 posts
  • Location:stuck in the middle of cyber space

Posted 15 September 2006 - 01:56 PM

my web got that thing toooo... when i run in IE it's all good. But, when i run in FF... something bad happpennnn.... :)
@RC69 :
i agree with you...

#9 Kiddiecat

Kiddiecat

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 30 April 2011 - 10:07 PM

hmm... the easiest way would probably be to go if not firefox and put the code in there you don't want firefox to see but I can't remember the code for it. :(


What you just said is exactly what I'm looking for right now. If you happen to remember in the future, (or between now and when that post was made) could you send me a message? Thanks.

I already have for if firefox (Admittably I haven't tried it out yet), but I want an if NOT Firefox, so I don't have to create a bunch of styles for all the browsers that aren't IE or Firefox (which I'm not totally sure how to do anyways.)
The reason I need this is because Firefox messes up a code of mine. It shifts it up 3 pixels... the problem with that is that it's not just 3 pixels when it's 3 pixels... it's 3 pixels all the way accross the screen. It matters a lot because the code is for overlapping images.

Edited by Kiddiecat, 30 April 2011 - 10:09 PM.


#10 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 01 May 2011 - 02:54 AM

Actually, HTML conditional statements are unique to IE. So to write something that only FF can see, you would have to use JS, PHP, or some other web development language.

In short, you can't reliably target a specific browser like that.

If you post your issue in a new topic, it's probably a fairly common issue which somebody could help resolve in a more general way.

#11 Kiddiecat

Kiddiecat

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 01 May 2011 - 08:10 PM

I figured out how to arrange it to work with what I had, this is the code to target just Firefox:

@-moz-document url-prefix() {#categoryBackNextButtons{

}}

Then it was just a matter of arrangement, but now I'm getting issues with Opera :mellow: So I'm going to have to check with Safari when I get a chance tomorrow (I'd forgotten that I can check on Opera and Safari at certain times) and then see if I need to find something to target Opera also, or if I just need to use the IE specific code:

<!--[if IE]>
IE only HTML here!
<![endif]-->

(which I haven't actually tried yet) I read somewhere that Firefox had the issue with negative margins, but by the look of it Opera does too. Either that or everyone else is just using a different standard than IE, of which I believe is doing it correct in this instance because I have taken a look at how many pixels are between the text posted on lines, and the reference point IE is using should be the top left of the box this code is being used in. (I wouldn't know for sure because it's a code for a forum; bbcode)

Tomorrow I will know what my new issue is...

Edited by Kiddiecat, 01 May 2011 - 08:13 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users