This file contains 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 type="text/javascript"> | |
$(document).ready(function(){ | |
$.urlParam = function(name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); | |
return results[1] || 0; | |
} | |
// example.com?param1=name¶m2=&id=6 | |
alert($.urlParam('param1')); // name | |
alert($.urlParam('question')); // name | |
alert(decodeURIComponent($.urlParam('question'))); |
This file contains 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 type="text/javascript"> | |
$(document).ready(function(){ | |
$.cleanString = function(testString) { | |
var numericString = testString.replace(/-/gi," "); | |
// .replace() uses regular expression. In this case, its replaceing '-' with ' '. | |
return numericString; | |
} | |
var question = "Sample-text-with-some-dashes"; | |
var cleaned = $.cleanString(question); |
This file contains 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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html lang="en"> | |
<!-- See http://www.alistapart.com/articles/css-floats-101/ --> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>CSS Floats 101</title> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; |
This file contains 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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>Example J</title> | |
<style> | |
body { | |
margin: 0; | |
font: normal 12px/18px 'Helvetica', Arial, sans-serif; |
This file contains 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 id="link6" href="#">Click me</a> | |
<div id="chart"></div> | |
<script> | |
$('#link6').click(function(){ | |
// Scroll to the chart ID | |
$('html,body').animate({scrollTop: $("#chart").offset().top},'slow'); | |
}); | |
</script> |
This file contains 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
<html> | |
<head> | |
<script type="text/javascript" src="http://download.zonealarm.com/bin/promotions/pumpitup/js/jquery-1.4.2.min.js"></script> | |
<script type="text/javascript" src="http://www.zazar.net/developers/jquery/zrssfeed/jquery.zrssfeed.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
$('#test').rssfeed('http://www.securelist.com/en/rss/descriptions', { |
This file contains 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
<html> | |
<head></head> | |
<body> | |
<!-- This checkbox is checked and cannot be unchecked --> | |
<input type="checkbox" name="fw" id="freefw" checked disabled /> | |
<!-- If this checkbox changes, see jquery below --> | |
<input type="checkbox" name="av" id="freeavfw" /> |
This file contains 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 myObject = { | |
sayHello : function() { | |
console.log('hello'); | |
}, | |
myName : 'Iwan' | |
}; | |
myObject.sayHello(); // logs 'hello' | |
console.log(myObject.myName); // logs 'Iwan' |
This file contains 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 simple function | |
var greet = function(person, greeting) { | |
var text = greeting + ', ' + person; | |
console.log(text); | |
}; | |
greet('Iwan', 'Hello'); | |
// A Function that returns a value |
OlderNewer