like the title said. I only want to display certain contents in for FF browser user. something like this... if($.browser.mozilla){ // do something } Thanks advance
Can't see any valid reason for ever using something like that, but if you insist: Javascript: https://stackoverflow.com/questions...t-using-javascript-only-if-browser-is-firefox (just adapt it to your own example). CSS: https://css-tricks.com/snippets/css/css-hacks-targeting-firefox/
I'm afraid it won't work, no matter if you do browser check using server-side (like PHP) or stuff like JavaScript. Let me explain... If you use PHP-like stuff to check user agent, it can be faked with single line of extra code. This needs to be done by user with PHP skills, however. In short, he will need to write a super-simple content parser which can set any fake user agent user wants. I could write such a script in less than 5 minutes. Of course, "dumb" user won't be able to do that, but some browsers allow to set any other user agent via browser settings. Or user may use some plugin to do that. If you use JavaScript validation, and then hide/unhide some HTML elements on page, these elements will still be there and can be viewed at any time by clicking CTRL+U (or whatever shortcut you use to view page source).