Skip to content

Instantly share code, notes, and snippets.

​<!-- AJAX Sample Asyc
yahoo weather api
http://developer.yahoo.com/yql/console/#h=select%20*%20from%20weather.forecast%20where%20woeid%3D2502265
http://jsfiddle.net/mbhatamb/mKFY3/1/
-->
<html>
<p>Select City </p>
<hr>
<div class="cities">
@bmakarand2009
bmakarand2009 / DayAndNightExample
Created September 16, 2012 21:51
JQuery-Events
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<!-- Day And Night Example with simple Buttons
http://jsfiddle.net/mbhatamb/ba3FC/1/-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JQuery Dom Maniupulation with list</title>
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<!-- http://jsfiddle.net/mbhatamb/P4kTB/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JQuery Dom Maniupulation with list</title>
</head>
<body>
<h1>Example of tabs() API inconsistency when adding a tab.</h1>
@bmakarand2009
bmakarand2009 / json-basics
Created September 15, 2012 01:37
javascript-json
/*
http://jsfiddle.net/mbhatamb/F9rGz/
Standardized and defined by Douglas Crockford (www.json.org),
Advandates
- lightweight
- fast
- readable
- natural to javascript object
where as XML is verbose. Douglas says, any dumb can create a better format than XML.
@bmakarand2009
bmakarand2009 / class-with-prototype
Created September 14, 2012 21:50
Javascript-classes
//create a class Employee, with first and LastName
//http://jsfiddle.net/mbhatamb/d9WqV/
/* Note : This is the right way to define a class in Javascript,
using the prototype object, which is there for each object
This is the right way to define a Javascript Object..
*/
var Employee = function(fName, lName) {
this.fName = fName;
this.lName = lName;
@bmakarand2009
bmakarand2009 / javascript-callee
Created September 14, 2012 18:31
Javascript Functions
//by default, a function has access to this and arguments objects.
//arguments.callee() function calls the function itself, to use for recursive
function doSomething(){
arguments.callee(); //gives the name of function, without having to explicity name it
}
@bmakarand2009
bmakarand2009 / javascript-dom-sample1
Created September 14, 2012 15:23
Javascript DOM Manipulation
<!DOCTYPE html>
<html>
<head>
<script>
var aElement = document.getElementById("intro");
//Properties that can be invoked on aElement are
/*
x.innerHTML - the text value of x
x.nodeName - the name of x
x.nodeValue - the value of x
@bmakarand2009
bmakarand2009 / javascipt-sample2
Created September 13, 2012 18:30
Javascript-samples
//Rolls a 6 faced dice 6000 times and summarizes the results of
//how many times each face came
var f1 = 0;
var f2 = 0;
var f3 = 0;
var f4 = 0;
var f5 = 0;
var f6 = 0;
var diceFace;
@bmakarand2009
bmakarand2009 / css-embedable-example
Created September 12, 2012 18:23
CSS Inline Style example
<!-- use html editor to try : http://htmledit.squarefree.com/ -->
<?xml version="1.0" encoding="utf-8">
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN" "http://w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title> Welcome , Webpage elements </title>
<!-- meta tags are used by search engines -->
<meta name ="keywords" content="java , html elements, basic html tags"/>
<meta name ="description" content=" This is a sample html page which has most of the commonly used eleemnts"/>
@bmakarand2009
bmakarand2009 / html-basic-elements
Created September 12, 2012 16:32
HTML Elements
<?xml version="1.0" encoding="utf-8">
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Strict//EN" "http://w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title> Welcome , Webpage elements </title>
<!-- meta tags are used by search engines -->
<meta name ="keywords" content="java , html elements, basic html tags"/>
<meta name ="description" content=" This is a sample html page which has most of the commonly used eleemnts"/>