What you need : Firefox browser and Firebug addon
A simple example:
INSTEAD OF :
function foo() {
if(some condition) {
alert("Status update");
}
}
USE :
function foo() {
if(some condition) {
console.log("Status update");
}
}
function foo() {
if(some condition) {
alert("Status update");
}
}
USE :
function foo() {
if(some condition) {
console.log("Status update");
}
}
var date = new Date();
var sysDate = date.getDate();
var sysMonth = date.getMonth();
var sysYear = date.getFullYear();
document.write(sysMonth + "/" + sysDate + "/" + sysYear);
var date = new Date();
var sysDate = date.getDate();
var sysMonth = date.getMonth();
var sysYear = date.getFullYear();
var monthNames = new Array("January", "February", "March",
"April", "May", "June", "July", "August",
"September", "October", "November",
"December");
document.write(sysDate + "-" + monthNames[sysMonth] + "-" + sysYear);
var date = new Date();
var sysDate = date.getDate();
var sysMonth = date.getMonth();
var sysYear = date.getFullYear();
var monthNames = new Array("January", "February", "March",
"April", "May", "June", "July", "August",
"September", "October", "November",
"December");
var sup = "";
if(sysDate == 1 || sysDate == 21 || sysDate == 31) sup ="st";
else if (sysDate == 2 || sysDate == 22) sup = "nd";
else if (sysDate == 3 || sysDate == 23) sup = "rd";
else sup = "th";
document.write(sysDate + "" + sup + " " + monthNames[sysMonth] + " " + sysYear);
<script src="jquery.js"> </script>
<script src="prototype.js"> </script>
<script type="text/javascript" >
jQuery.noConflict() //now by default, $ is jQuery.
//But you can reassign it to your own variable.
var $jq = jQuery;
//start using $jq for jquery's $
$jq(document).ready(function() {
$jq("div").hide(); });
</script>
<div class="myclassA">first content</div>
<div class="myclassA">second content</div>
<div class="myclassA">third content</div>
Once we have such layout, we can access all the div's easily, some of them would be:
1. In the .CSS file as :
.myclassA{
color : red;
}
2. If ur using JQuery:
$(".myclassA").css("color", "blue");
By giving a ID attribute, we can refer/select EXACTLY one element with that ID.
Example:
<div id="myDivIdA">first content</div>
<div id="myDivIdB">second content</div>
Once we have such layout, we can access EXACTLY one div easily, some of them would be:
1. In the .CSS file as :
#myDivIdA{
color : red;
}
2. If ur using JQuery:
$("#myDivIdB").css("color", "blue");
NOTE:
<script type="text/javascript" >
document.getElementById("mybutton").click;
</script>
chmod 777 -R directoryname
function initDB() {
$group =& $this->User->Group;
//Allow admins to everything
$this->Acl->allow(array( 'model' => 'Group', 'foreign_key' => 1), 'controllers');
//allow managers to posts and widgets
$this->Acl->deny(array( 'model' => 'Group', 'foreign_key' => 2), 'controllers');
$this->Acl->allow(array( 'model' => 'Group', 'foreign_key' => 2), 'controllers/Posts');
$this->Acl->allow(array( 'model' => 'Group', 'foreign_key' => 2), 'controllers/Widgets');
//allow users to only add and edit on posts and widgets
$this->Acl->deny(array( 'model' => 'Group', 'foreign_key' => 3), 'controllers');
$this->Acl->allow(array( 'model' => 'Group', 'foreign_key' => 3), 'controllers/Posts/add');
$this->Acl->allow(array( 'model' => 'Group', 'foreign_key' => 3), 'controllers/Posts/edit');
$this->Acl->allow(array( 'model' => 'Group', 'foreign_key' => 3), 'controllers/Widgets/add');
$this->Acl->allow(array( 'model' => 'Group', 'foreign_key' => 3), 'controllers/Widgets/edit');
}
$("#myDivToFade").fadeOut(function() {
// This code will be executed
// after the animation is complete
});
If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...