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
| drupal_add_js( | |
| "var example = \"$example\";", | |
| array('type' => 'inline', 'scope' => 'header', 'weight' => 10) | |
| ); |
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
| function stateOrProvince() { | |
| $array = array( | |
| '' => '', | |
| 'AL' => 'Alabama', | |
| 'AK' => 'Alaska', | |
| 'AZ' => 'Arizona', | |
| 'AR' => 'Arkansas', | |
| 'CA' => 'California', | |
| 'CO' => 'Colorado', | |
| 'CT' => 'Connecticut', |
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
| module.exports = (function($) { | |
| var trigger_element = '.menu__user--primary__sub-menu'; | |
| var open_class = 'menu__user--primary__sub-menu__toggle'; | |
| // Toggle the user menu when the username is clicked. | |
| $('.menu__user--primary__item__label').click(function(e) { | |
| $(trigger_element).toggleClass(open_class); | |
| e.stopPropagation(); | |
| }); |
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
| const OLD_TAX_RATE = 0.061; | |
| const NEW_TAX_RATE = 0.065; | |
| function calculateOldPurchase(amt) { | |
| amt = amt + (amt * OLD_TAX_RATE); | |
| return amt; | |
| } | |
| function calculateNewPurchase(amt) { | |
| amt = amt + (amt * NEW_TAX_RATE); |
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
| /* Stolen from www.slimframework.com */ | |
| function() { | |
| var a=document.title; | |
| window.onblur=function(){ | |
| document.title="♬ Baby come back! Any kind of fool could see... ♬" | |
| }, | |
| window.onfocus=function(){document.title=a} | |
| } |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Form</title> | |
| <script> | |
| function fieldFocus() { | |
| document.getElementsByTagName("input")[0].style.backgroundColor='yellow'; | |
| } | |
| function noFocus() { |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Form</title> | |
| <script> | |
| function fieldFocus() { | |
| document.getElementById("input").style.backgroundColor='yellow'; | |
| } | |
| function noFocus() { |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>No Mobile</title> | |
| </head> | |
| <body> | |
| <p>We're sorry, but this content isn't available on mobile devices.</p> | |
| </body> |
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
| var currentAge = prompt("Enter your age."); | |
| var yearsEligibleToVote <= currentAge - 18; | |
| if (yearsEligibleToVote > 17) { | |
| alert("You have been eligible to vote for " + yearsEligibleToVote + " years."); | |
| } else { | |
| alert("You are not yet elibige to vote. Come back when you're 18 years old."); | |
| }; |
NewerOlder