Boost your website performance with “Page Speed” tool.
Page Speed is a family of tools for optimizing the performance of web pages.
The Page Speed browser extensions, available for Chrome and Firefox, allow you to evaluate the performance of your web pages and to get suggestions on how to improve them.
Page Speed Tool Download
How to Show hide content using core JavaScript ?
Today I was working on another website and had very long text/content and thought to use Jquery, there are several examples given on internet. I tried to use some of them of course they are very simple but because of some reason it didn’t work for me either in IE and chrome.
So decided to compile my own show hide JavaScript which is based on DOM!
Here is very simple code and it works everywhere, Firefox, Internet Explorer, Chrome, Safari etc.
Steps are self explanatory.
A. Use JavaScript code
B. Use Css Class
C. See the example and compile your own!
<script language="javascript" type="text/javascript">
function PM_show_Hide(pmID) {
if (document.getElementById(pmID)) {
if (document.getElementById(pmID+'-show').style.display != 'none') {
document.getElementById(pmID+'-show').style.display = 'none';
document.getElementById(pmID).style.display = 'block';
}
else {
document.getElementById(pmID+'-show').style.display = 'inline';
document.getElementById(pmID).style.display = 'none';
}
}
}
</script>
<style type="text/css">
.more-pm {
display: none;
</style> |
<p>This is first paragraph of my big content.
<a href="#" id="PM-show" class="showLink" onclick="PM_show_Hide('PM');return false;">Click to See more.</a> <p>
<div id="PM" class="more-PM">
<p>Here is your hidden text which you want to hide!! Copy your text here!</p>
<p><a href="#" id="PM-hide" class="hideLink" onclick="PM_show_Hide('PM');return false;">Click to hide this content.</a></p>
</div> |
How to upgrade Drupal ?
Drupal is always releasing security updates every now and then.
PHP communality called it patches!
So here are the steps you can use to patch your Drupal and lock down security hole in Drupal web application.
1. Download latest release of Drupal package from Drupal site.
2. Put your PHP Drupal site in maintenance mode (offline)
3. Take a database backup/export using any MYSQL tools, like phpmyadmin (I use it in MAMP environment ). Same thing you can do by command line if you want to do so.
(mysql –u ROOT –p YOURPASSWORD yourdatabasename > exporteddbname.sql)
4. Make backup of your Drupal application folder.
5. Now it is time to copy all files – untar or unzip your downloaded new Drupal patch package.
6. Copy all files and folders Except “Site folder”, “.htaccess” file and “robot.txt”, you can have custom configuration and setting to these files and folder so it is good not to overwrite these files and folder.

7. Run CRON in your Drupal application.
8. Run update.php it will detect automatically type of database and schema you are using and update it. It takes few seconds, so please don’t halt upgrading process.
http://localhost/drupal/update.php
9. If above process is successful, put back your site in (Online mode) live mode.
10. See status report and you will notice your Drupal is updated.
Your Drupal application is safe now !

