Apply specific CSS styling exclusively for Mac Safari using jQuery

Encountered a strange issue on my webpage where one of the divs is displaying incorrectly, but only on Mac Safari. Thinking about using a jQuery hack instead of starting from scratch to fix it.

I tried to target Mac Safari with this code, but it didn't work as expected. Can someone help me identify the mistake?

if((navigator.platform.indexOf(“Mac”) != -1) && (navigator.userAgent.match(/msie|trident/i))) {
 $(".hiddenlg img").css('display','none');

Appreciate any assistance!

Answer №1

Consider utilizing the code

navigator.platform.indexOf("Mac")
. Take note of the quotation marks within.

Remember to use "" and not “”.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Enhance your website by adding a <select> element using an AJAX call that

Encountering challenges in dynamically generating <select> elements and then populating them with values from an XML file. The jQuery script appends a <div> containing a select element and adds options based on the data obtained from XML. Thi ...

Pass a variety of data points to PHP using Ajax requests

I am facing a challenge with passing multiple parameters during Ajax calls. The code works perfectly when I only pass one parameter. Here is the code snippet for the Ajax call: $.ajax({ type: "POST", url: "dataCartas.php", ...

Why isn't my jQuery click event triggering?

Visiting this PAGE and scrolling down, you'll find the following code snippet: HTML <ul class="play_navigation"> <li class="active"gt;<a class="barino_story_bottom" href="#">The Story</a> ...

Troubles with Iframe in Selenium using Python

I'm facing a challenge using Selenium with an iframe. The website's structure is as follows: <tbody> <tr> <td> <iframe> <html> </iframe> </td> ...

Find the index of the final empty element in an array using AngularJS

var caseOne = [ {"name":"Felicity", "gender":"F", ... ... ,"type":"Admin"}, {"name":"Tony", "gender":"M", ... ... ,"type":""}, . . . . {"name":"Super Man", "gender":"M", ... ... ,"type":""}, {"name":"Wonder Women", "ge ...

Pair participants within a game search array

I've been contemplating this issue extensively but I'm struggling to come up with a fast and efficient solution using JavaScript. I have an array of objects representing game searches for random players. The array might resemble the following: co ...

How does conditional rending of function components in react affect the positioning of my css elements?

I'm in the process of creating a website as part of a project, where I have set up a vertical navigation bar next to the main content area. Utilizing bootstrap, I divided the layout into two main columns - one for the navigation bar and the other for ...

I'm looking to input data into a PHP table using JavaScript. Is there a way to accomplish this using a database rather than relying on localStorage?

I am looking to transition from using localStorage to working with a database in the code below. I understand that JavaScript is a client-side language and PHP is server-side. Instead of storing data in localStorage, I would like to retrieve and store data ...

[entity: undefined prototype] { type: 'clip', info: 'Watch my latest video!!' } using nodejs - multer

import routes from "./routes"; import multer from "multer"; const multerVideo = multer({ dest: "videos/" }); export const localsMiddleware = (req, res, next) => { res.locals.siteName = "Webtube"; res.locals.routes = routes; res.locals.user = { isA ...

Tips for integrating Grunt with Shopify using Sublime Text 2

I am brand new to Node.js, Grunt, and even Sublime Text 2. After going through this quick tutorial: I believe I have reached the final step, which is step six. Now, all that's left is figuring out how to execute step 6 'grunt watch:shopify&apos ...

Stack the <td> elements vertically rather than reducing the width of each <td> cell

I am currently using a standard HTML table to showcase data pulled from an API. <table style="width:100%"> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td&g ...

Guide to making a leaf node with jstree version 3.0.0

The tree functionality seems to be functioning correctly, however, I am facing an issue with creating a leaf file. Although it is able to create a folder file, the creation of a leaf file seems to be problematic. Below is the code snippet that I am strugg ...

How can I attach the index of a duplicate number within an array as a property of that array?

I have an array containing different types of vehicles like [{type: car}, {type: van}, {type: truck}, {type: car}] My goal is to transform this array into one that includes a count for each type, like so: [{type: car, count: 1}, {type: van, count: 1}, {ty ...

What is the best way to split the data in one array and transfer it to a different array?

In my JavaScript code, I am working with an array that contains information about different cars: cars = [ {color: red, type: sedan, name: ferrari}, {color: blue, type: sedan, name: ferrari}, {color: yellow, type: sedan, name: ferrari}, {color: re ...

In Objective-C, subclassing should be utilized to modify variables in the superclass

I am looking to establish a class hierarchy similar to this structure: AbstractBaseClass -> Subclass1, AbstractBaseClass -> Subclass2 The abstract base class will contain two instance variables (possibly a type id?) and corresponding setters and gett ...

Exploring the Evolution of HTML 5: Unveiling a New Subpage's

I created a website using just one html file and implemented routing with the HTML 5 API History. By using history.pushState, I was able to create subpage addresses like www.mypage.com/about. The issue arises when trying to refresh or directly visit www.m ...

Issues with TypeScript arise when transferring arguments between functions

Encountering a TypeScript error due to this pattern: Error message: 'Argument of type '(string | number)[]' is not assignable to parameter of type 'string[] | number[]' function foo(value: string | number) { return bar([va ...

What is the best way to start a jquery function within a tab that has been loaded using AJAX?

My AJAX loaded tabs are functioning correctly with the following code: <div id="tabs"> <ul> <li><a href="../about-leadership-admin-ajax/">Leadership / Admin</a></li> <li><a href="../about-sales-market ...

Utilizing inputRef in conjunction with MUI's useAutocomplete

Is there a way to pass the "inputRef" to Material UI's useAutocomplete? I'm looking to set a custom reference on the input, but the getInputProps() method from useAutocomplete already requires its own reference. I've attempted various appr ...

How can I locate a specific value within a multidimensional array when I already have a known value to

I am working with a multidimensional array in jQuery and I need to retrieve the conversionSI value based on a known shortname. How can I get this value and store it in a variable, or possibly display it using console.log? Could there be an optimal way to s ...