This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Set $ as a wrapper for jQuery | |
jQuery(document).ready(function($){ | |
//Everything inside this function can use the $ wrapper to call jQuery. | |
$(#somefunction) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$(#somefunction) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Describes phone | |
$brand = "HTC"; | |
$model = "One M8"; | |
$os = "Android"; | |
//Sets each string to a key value pair in an array. | |
$phone = compact("brand", "model" , "os"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Describes phone | |
$brand = "HTC"; | |
$model = "One M8"; | |
$os = "Android"; | |
//Creates the phone array using the variables above as key value pairs. | |
$phone = compact("brand", "model" , "os"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$phone = array( 'HTC', 'One M8', 'Android' ); | |
list($brand, $model , $os ) = $phone; | |
//echos "I have a HTC One M8 running Android." | |
echo "I have a $brand $model running $os."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder