Montag, 25. Juli 2011

For all your opacity needs

in this order:

opacity: .5; // for all other browsers
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; // for IE8
filter: alpha(opacity=50); // for IE5-7

Samstag, 23. Juli 2011

JS Module Pattern

var someModule = (function(){
//private attributes
  var privateVar = 5;

  //private methods
  var privateMethod = function(){
  return 'Private Test';

  return {
    //public attributes
    publicVar: 10,
    //public methods
    publicMethod: function(){
      return ' Followed By Public Test ';

    //let's access the private members
    getData: function(){
      return privateMethod() + this.publicMethod() + privateVar;
})(); //the parens here cause the anonymous function to execute and return

Dienstag, 19. Juli 2011

Nyromodal Wiki Startpage is defective, use this older version instead

Nyromodal strips / removes script tag on ajax / xhr load

Got me some time to get 'round this, here's the solution:

"If you need to use an external JavaScript content, you could add the attribute rel="forceLoad" to the script tag and nyroModal will load it during the opening modal."

"If you want to use a script which need the content to be visible (many jQuery UI script for instance) you could add the setting rev="shown" to the inline or external script tag to execute it juste before the endShowContent callback."


Donnerstag, 14. Juli 2011

"WindowsUpdate_80070570" "WindowsUpdate_80073712" Errors

Fixed the above stated problem for me. EDIT: It also fixed a problem where the Service Pack couldn't be installed!

net stop wuauserv
net stop bits
net stop cryptsvc
ren %systemroot%\System32\Catroot2 Catroot2.old
net start cryptsvc
ren %systemroot%\SoftwareDistribution SoftwareDistribution.old
regsvr32 wuapi.dll
regsvr32 wuaueng.dll
regsvr32 wucltux.dll
regsvr32 wups2.dll
regsvr32 wups.dll
regsvr32 wuwebv.dll
net start bits
net start wuauserv
net start Eventlog
Reboot and try update again.


Freitag, 8. Juli 2011

On event.preventDefault() error messages in IE 8 (9? 7? 6?)

If checking for event.preventDefault() you get error messages in IE.

A better way is to check for the existence of event.returnValue (which is IEs preventDefault()) and if it doesn't exist you know that you're not on IE.

if (event.returnValue) {
    // this is IE
    event.returnValue = false;
} else {
    // this is Chrome, Firefox, Safari etc.