5

My website has a div element (in form of a block) that I want to make invisible whenever a user visits the website through a text based browser like Lynx, that doesn't support JavaScript.

Basically what command or code do I need to write in order for this to happen?

Fredtrix
  • 87
  • 7

2 Answers2

3

Since you can't run javascript there, you have to not send that div in the first place for it to be invisible in the text-mode browser.

You can make a server side user-agent check and do not render that div. Lynx user agents: http://www.useragentstring.com/pages/Lynx/

Quad
  • 1,708
  • 1
  • 10
  • 22
2

You can set the div invisible by default.
and make it visible in your js code.
Thus it'd not appear on a text-mode browser.

yakiang
  • 1,608
  • 1
  • 16
  • 17