Skip to content

Instantly share code, notes, and snippets.

View jansabbe's full-sized avatar

jansabbe

View GitHub Profile
@jansabbe
jansabbe / gist:1011907
Created June 7, 2011 08:34
Get value of a parameter from a url in javascript
function getParameterByName(parameter, url) {
var parameterValue = RegExp("[?&]" + parameter + "=([^&]*)").exec(url);
return decodeURIComponent(parameterValue[1].replace(/\+/g, " "));
}
@jansabbe
jansabbe / gist:1009277
Created June 5, 2011 19:00
Example calling json webservice with jQuery
var jsonData = JSON.stringify({
stad: 'Leuven',
soort: 'KLEI',
telefoonNummer: '141414'
});
$.ajax('/plaatsen', {
success:function (data) {console.log(data)},
type: 'PUT',
dataType: 'json',
@jansabbe
jansabbe / gist:1002387
Created June 1, 2011 14:27
Creating linecharts with gRaphael
var linechart = Raphael(document.getElementById('holder')).
g.linechart(10,10,400,400,[1,2,3,4,5,6],[[5,4,3,2,1,0],[5,3,4.3,3,2,0]], {
shade:true,
smooth:true,
axisxstep:5,
axis:"0 0 1 1"
});
linechart.axis[0].text.items[3].attr('text','kjfd');
@jansabbe
jansabbe / index.html
Created May 29, 2011 11:45
CSS3 buttons that work on IE8 using PIE.js
<!DOCTYPE HTML>
<html>
<head>
<title>Css button preview</title>
<meta http-equiv="X-UA-Compatible" content="IE=100" >
<!--[if lt IE 10]>
<script type="text/javascript" src="PIE.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript">