Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ General Web Design _ browser preference

Posted by: Mindapolis Apr 16 2012, 02:58 PM

Hi, I have seen websites that says works best with a specific browser. Is this a good practice? I have a website that the paypal buy now button will only display in firefox. Is it okay to request users to use firefox?

Posted by: pandy Apr 16 2012, 03:00 PM

No. It's a bad practice stemming from the days of the browser wars.

Posted by: Darin McGrew Apr 16 2012, 04:34 PM

QUOTE
Is this a good practice?
It was bad practice back when I first saw sites telling you to use Netscape Navigator 2. It's still bad practice.

If your site's content/services require certain features, then it's reasonable to require the use of a browser (any browser) that supports those features. But that doesn't seem to be the case here.

Posted by: Mindapolis Apr 16 2012, 07:45 PM

The reason I'm asking is I'm developing a site that has a paypal buy now button and the button displays fine in firefox but not in IE.

Posted by: Mindapolis Apr 16 2012, 08:01 PM

i'm working with the validator right now and what does this error message mean?

Line 363, character 50:

... data: "petName2=<?=$petName2;?>&age2=<?=$age2;?>&breed2=<?=$ ...

CODE

  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function AddDog() {
            if (document.checkOut.moreDogs.checked) {
                $.ajax({
                    type: "POST",
                    url: "addDogDetails.php",
                    data: "petName2=<?=$petName2;?>&age2=<?=$age2;?>&breed2=<?=$breed2;?>&nutritionalNeeds2=<?=$nutritional_needs2;?>&specialInstructions2=<?=$special_instructions2;?>",
                    success: function(rData) {
                        $('#order tr#DgLast').after(rData);
                    }
                });
            }
            else {
                $('.NewDogDetails').remove();
            }
        }
    </script>

Posted by: pandy Apr 16 2012, 08:09 PM

QUOTE(Mindapolis @ Apr 17 2012, 02:45 AM) *

The reason I'm asking is I'm developing a site that has a paypal buy now button and the button displays fine in firefox but not in IE.


We understood that. Fix it so it works in IE.


QUOTE(Mindapolis @ Apr 17 2012, 03:01 AM) *

i'm working with the validator right now and what does this error message mean?

Line 363, character 50:

... data: "petName2=<?=$petName2;?>&age2=<?=$age2;?>&breed2=<?=$ ...

CODE

  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function AddDog() {
            if (document.checkOut.moreDogs.checked) {
                $.ajax({
                    type: "POST",
                    url: "addDogDetails.php",
                    data: "petName2=<?=$petName2;?>&age2=<?=$age2;?>&breed2=<?=$breed2;?>&nutritionalNeeds2=<?=$nutritional_needs2;?>&specialInstructions2=<?=$special_instructions2;?>",
                    success: function(rData) {
                        $('#order tr#DgLast').after(rData);
                    }
                });
            }
            else {
                $('.NewDogDetails').remove();
            }
        }
    </script>



The validator chokes on your JS. It doesn't validate JS, it sees it as peculiar HTML. Use an external script file.

Posted by: Darin McGrew Apr 16 2012, 10:15 PM

QUOTE
We understood that. Fix it so it works in IE.
And in Chrome, Safari, Opera, etc.

Posted by: Mindapolis Apr 17 2012, 12:39 PM

Ok I'm new to javascript so if this is a stupid question I apologize. When I'm copying that script to an external file, does the following code need to go in the external file?


CODE

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">


QUOTE(pandy @ Apr 16 2012, 09:09 PM) *

QUOTE(Mindapolis @ Apr 17 2012, 02:45 AM) *

The reason I'm asking is I'm developing a site that has a paypal buy now button and the button displays fine in firefox but not in IE.


We understood that. Fix it so it works in IE.


QUOTE(Mindapolis @ Apr 17 2012, 03:01 AM) *

i'm working with the validator right now and what does this error message mean?

Line 363, character 50:

... data: "petName2=<?=$petName2;?>&age2=<?=$age2;?>&breed2=<?=$ ...

CODE

  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function AddDog() {
            if (document.checkOut.moreDogs.checked) {
                $.ajax({
                    type: "POST",
                    url: "addDogDetails.php",
                    data: "petName2=<?=$petName2;?>&age2=<?=$age2;?>&breed2=<?=$breed2;?>&nutritionalNeeds2=<?=$nutritional_needs2;?>&specialInstructions2=<?=$special_instructions2;?>",
                    success: function(rData) {
                        $('#order tr#DgLast').after(rData);
                    }
                });
            }
            else {
                $('.NewDogDetails').remove();
            }
        }
    </script>



The validator chokes on your JS. It doesn't validate JS, it sees it as peculiar HTML. Use an external script file.


Posted by: Mindapolis Apr 17 2012, 01:23 PM

I copied and pasted the body of the html document in the validator and I'm still getting a lot of errors dur to the php code that is involved. There were several times when it said there was a missing closing tag so I went through the entire code and made sure every tag had a closing tag but still the buy now button won't appear in internet explorer. Any advice?

Posted by: Darin McGrew Apr 17 2012, 03:11 PM

The validator doesn't know anything about PHP, or Perl CGI, or Java servlets, or any other mechanism for generating HTML. All it knows is HTML.

Don't try to validate the PHP program. Instead, validate the HTML that the program produces.

Posted by: Mindapolis Apr 17 2012, 09:35 PM

Got it working

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)