The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Safari bug on show/hide deprecated attributes in HTML 4 elements pages, js snippet or bookmarklet solution
Frederiek
post Mar 18 2014, 11:14 AM
Post #1


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



The following is for anyone who has followed the thread at http://forums.htmlhelp.com/index.php?showtopic=19793 where we found a bug in Safari on any page of the HTML 4 Elements pages ( starting from http://htmlhelp.com/reference/html40/alist.html ) that doesn't act on the show/hide non-strict attributes button and/or encounters that same problem.

When you are on one of these pages, either use the following in the javascript console of the browser
CODE
document.styleSheets.item(2).disabled=true;

Or save the following as a bookmarklet
Give it a title (e.g.): Show deprecated attributes - htmlhelp ref

CODE
java script:document.styleSheets.item(2).disabled=true;

[edit] There shouldn't be a space between java and script. That was automagically added upon submission

This post has been edited by Frederiek: Mar 18 2014, 11:17 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Mar 18 2014, 12:22 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,732
Joined: 9-August 06
Member No.: 6



Maybe a little browser sniffing should be implemented for those pages. dry.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Mar 19 2014, 04:18 AM
Post #3


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



I don't know.

Have you tried the test file in any PC browser you have? Did it still work without the alternate CSS file?
If yes, then the solution would simply be to delete/comment out the strictHTMLonly.css on all those pages.

BTW, I haven't seen Darin and/or Liam on this subject yet.


I just found out that it's even better to use an anonymous function (which won't conflict with other js on the page):
java script:(function(){document.styleSheets.item(2).disabled=true;})();

Ref: http://code.tutsplus.com/tutorials/create-...-way--net-18154

The advantage is that the button then works too (as long as the bookmarklet is still activated on the page).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 09:54 PM