Note that there are some explanatory texts on larger screens.

plurals
  1. POPreventing DOM elements from getting rendered if JS is not enabled
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COHow do you know when a crawler is going to crawl your site? If you knew, and a user was using this page, would you hide these elements and say to the user, "hang on, the site's being crawled and I need to hide some stuff for a minute. BRB"? The `if` binding won't just hide the DOM elements, it removes the elements from the page. Also, there's no need to add/remove the style>display attribute because the `visible` binding will do this for you. This is the subtle difference between the `if` and `visible` binding. `if` adds/removes elements from the DOM and `visible shows/hides elements.
      singulars
    2. CO@Dennis I don't understand anything in the first part of your comment. And I know the difference between if and visible, that wasn't my question. IF the user has js disabled OR the user is a crawler, I don't want the edit controls on the page. That's the problem I'm trying to solve.
      singulars
    3. COSorry, I'm just a bit confused about the question. It just sounds like you're trying to hide elements with KO which assumes you've already served up the page to a requester who is either a user or a bot. Isn't this something you would check for before rendering the page and using an @if statement to hide the edit controls? I would probably look at the `Request.UserAgent` string in a controller and perform some Regex to see if the requester is a [bot](http://www.useragentstring.com/pages/Crawlerlist/). Then hide/show elements as appropriate.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload