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
| <script> | |
| function showCount(count){ | |
| if(count) | |
| document.getElementById('fb_fan_count').innerHTML = 'Total fans : ' + count[0].fan_count; | |
| } | |
| </script> | |
| <p id="fb_fan_count"></p> | |
| <script type="text/javascript" src="https://api.facebook.com/method/fql.query?format=json&callback=showCount&query=select+fan_count+from+page+where+page_id%3D80177638103"></script> |
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
| http://jsfiddle.net/GeJkU/ | |
| http://jsfiddle.net/fnVNc/ | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function($){ | |
| $('input[name="item_meta[30]"]').change(function(){ | |
| $('select[name="item_meta[31]"], select[name="item_meta[32]"]').val(''); | |
| }) | |
| }) | |
| </script> | |
| ====================================== |
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
| count href tag in a div | |
| theDivElement.getElementsByTagName('a').length | |
| ================================================================== | |
| Count all first list items in ul | |
| Use the > child selector: | |
| $('ul.menu>li').length |
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
| <form action="#"> | |
| <p><label><input type="checkbox" id="checkAll"/> Check all</label></p> | |
| <fieldset> | |
| <legend>Loads of checkboxes</legend> | |
| <p><label><input type="checkbox" /> Option 1</label></p> | |
| <p><label><input type="checkbox" /> Option 2</label></p> | |
| <p><label><input type="checkbox" /> Option 3</label></p> | |
| <p><label><input type="checkbox" /> Option 4</label></p> | |
| </fieldset> |
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
| GROUP BY ,HAVING | |
| SELECT | |
| YEAR(orderDate) AS year, | |
| SUM(quantityOrdered * priceEach) AS total | |
| FROM | |
| orders | |
| INNER JOIN | |
| orderdetails USING (orderNumber) | |
| WHERE | |
| status = 'Shipped' |
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
| <div ng-app="" ng-controller="ContactController"> | |
| Email:<input type="text" ng-model="newcontact" /> | |
| <button ng-click="add()">Add</button> | |
| <h2>Contacts</h2> | |
| <ul> | |
| ================================================== | |
| function ContactController($scope) { |
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
| <h4>Angular-xeditable Editable row (Bootstrap 3)</h4> | |
| <div ng-app="app" ng-controller="Ctrl"> | |
| <table class="table table-bordered table-hover table-condensed"> | |
| <tr style="font-weight: bold"> | |
| <td style="width:35%">Name</td> | |
| <td style="width:20%">Status</td> | |
| <td style="width:20%">Group</td> | |
| <td style="width:25%">Edit</td> | |
| </tr> | |
| <tr ng-repeat="user in users"> |
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
| INNER JOIN OR Equi join: Returns all rows when there is at least one match in BOTH tables | |
| LEFT JOIN: Return all rows from the left table, and the matched rows from the right table | |
| RIGHT JOIN: Return all rows from the right table, and the matched rows from the left table | |
| FULL JOIN: Return all rows when there is a match in ONE of the tables | |
| Self join:You use self join when you want to combine rows with other rows in the same table. To perform the self join operation, you must use a table alias to help MySQL distinguish the left table from the right table of the same table. | |
| SELECT a.ID, b.NAME, a.SALARY | |
| FROM CUSTOMERS a, CUSTOMERS b | |
| WHERE a.SALARY < b.SALARY; | |
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
| <---------- find by category and limit------------------------> | |
| <?php | |
| global $more; | |
| $more = 0; | |
| $args = array( | |
| 'post_type' => 'post', | |
| 'posts_per_page' => 10, | |
| 'category_name' => 'ayurveda', | |
| ); |
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
| A closure is an inner function that has access to the variables in the outer (enclosing) function’s scope chain. The closure has access to variables in three scopes; specifically: (1) variable in its own scope, (2) variables in the enclosing function’s scope, and (3) global variables. | |
| Here is a simple example: | |
| var globalVar = "xyz"; | |
| (function outerFunc(outerArg) { | |
| var outerVar = 'a'; | |
| (function innerFunc(innerArg) { |