Sunday, August 28, 2011

Windows 7 ERROR: No such interface supported

Last August 26 of 2011 I was trying to install IE 7 Standalone on my PC(Windows 7) to test my web project for cross browser scripting then suddenly my pc is throwing an error message (No such interface supported).

All I thought my pc have been infected by a virus/malware so I installed trojan remover, anti-malware, etc....
But still haven't solve anything. :(

And this morning I came up with a simple solution provided by GOOGLE :).

1.) Go to Start > Run, and type in 'cmd' to open Command Prompt.
2.) type: FOR /R C:\ %G IN (*.dll) DO "%systemroot%\system32\regsvr32.exe" /s "%G" and then hit enter.

That's all! you just have to wait for the system to complete re-registration of all DLLs.
Expect a lot of error dialog messages to pop-up. Don't worry, just ignore and close all pop-up error messages.

Wednesday, August 24, 2011

jQuery UI modal dialog with hidden close button


$( "#dialog-msgbox" ).dialog({
modal: true,
height:'auto',
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); },
buttons: {
Ok: function() {
//your scripts here
}
}
});

Friday, August 19, 2011

Working around with jQuery UI tabs select event


$('#tabs').tabs({
select: function(event, ui) {
var selected = ui.panel.id;
switch(selected){
case 'tab1':
//script will be executed when selected
break;

case tab2
//script will be executed when selected
break;

case tab3
//script will be executed when selected
break;

default:
//default script on load
break;
}
}
});

Thursday, August 18, 2011

Working around with jQuery UI accordion change event


This script is useful on change events using jQuery UI accordion.

$("#accordion").accordion({
        change: function(event, ui) {
            var active = $("#accordion").accordion('option','active');
switch(active){
case 0:
//this portion will be executed whenever you activate the first accordion
break;

case 1:
//this portion will be executed whenever you activate the second accordion
break;

case 2:
//this portion will be executed whenever you activate the third accordion
break;

default:
//you can also set a default script
break;
}
        }
    });

Friday, June 10, 2011

PHP Conversion of Time and Date (Timezone)

An example to convert date and time from one timezone to another:

The Code:

$current_date = date('Y-m-d');
$time_to_convert = '03:05:06';


$date = new DateTime($current_date.$time_to_convert, new DateTimeZone('Asia/Taipei'));
echo '
'.$date->format('Y-m-d H:i:s') . '
';

$date->setTimezone(new DateTimeZone('America/New_York'));
echo '
'.$date->format('Y-m-d H:i:s') . '
';
?>


The Output:

2011-06-10 03:05:06
2011-06-09 15:05:06