Friday, July 26, 2013

Google Fonts Not Displayed in Mozilla Firefox Browser

Sometimes there is a Google Fonts problem with Mozilla Firefox.  The fonts at Google Fonts aren't shown correctly and one sees only regular type. Usually this is caused by the default settings of the NoScript Add-On if it is installed. To change the NoScript settings to show Google fonts properly one must enable the @ font-face setting by doing the following:
  1. In Firefox click on the Tools menu and select Add-ons (or use hotkey Ctrl+Shift+A)
  2. Select the Options button that should appear for NoScript
  3. Click on the Embeddings tab
  4. Uncheck the box for "Forbid @ font-face"
  5. Choose OK to apply change
Go back to Google Fonts and reload the page.  The previously plain type sample text should be rendered using different fonts.  For other problems with Google Fonts and Firefox try looking at this troubleshooting page.

Wednesday, July 24, 2013

JQuery Frequent Class Replacement Between Two Alternatives

Replacing class repeatedly in JQuery using the addClass and removeClass functions is inefficient for some operations.  There is no official replaceClass function but there is a toggleClass function.  To change (toggle) between two classes easily use the code $("element").toggleClass(classname1 classname2) for an element already assigned to class= "classname1".  

Saturday, July 13, 2013

Problem with Deflate or Gzip Compression

So you find out from some optimization or efficiency program like YSlow or PageSpeed that your website could benefit from gzip or deflate compression.  You search online and find code that you put into the .htaccess file in your host server's root directory.  Having followed the apparently simple directions you check to see if compression is actually working by using something like the GidZip Test to verify.  You find out the deflate or gzip compression is not working.

There are a number of possible reasons but perhaps the obvious one that may take time to dig up is that your webhosting service provider has not enabled the feature or does not allow it.  You may need to ask the webhost to activate it.  Some hosts like NearlyFreeSpeech, however, have a policy of not activating it for on the fly compression although static gzip pre-compression may be possible.