Twitter History Search

Easy way for searching your twitter history

Big Words

Inspired by iphone Big Words,Not ask why I build it, and what function!!!!

Multiple Search

This website help you to compare different search results.

Fill in the Blank Generator

This application is useful tool to reduce teacher workload.

Advertise

Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Monday, 3 September 2012

HTML5 - GEOLOCAITON

Desc

The HTML5 Geolocation API is used to get the geographical position of a user. Since this can compromise user privacy, the position is not available unless the user approves it.
code from Head First HTML5 Programming: Building Web Apps with JavaScriptchapter 5 Making your HTML location aware: Geolocation

Source Code - Javascript

window.onload  = getMyLocation;
    
    function getMyLocation() {
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(
                displayLocation, 
                displayError);
        }
        else {
            alert("Oops, no geolocation support");
        }
    }
    
    function displayLocation(position) {
        var latitude = position.coords.latitude;
        var longitude = position.coords.longitude;

        var div = $("#location");
        div.html("You are at Latitude:" + latitude + ", Longitude: " + longitude);
 
    }
    
function displayError(error) {
    var errorTypes = {
        0: "Unknown error",
        1: "Permission denied",
        2: "Position is not available",
        3: "Request timeout"
    };
    var errorMessage = errorTypes[error.code];
    if (error.code == 0 || error.code == 2) {
        errorMessage = errorMessage + " " + error.message;
    }
    var div = document.getElementById("location");
    div.innerHTML = errorMessage;
}    

Source Code - html

<!doctype html> <html> <head> <title>Where am I?</title> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1"> <meta charset="utf-8"> <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="myLocj.js"></script> <link rel="stylesheet" href="myLoc.css"> </head> <body> <div id="location"> Your location will go here. </div> </body> </html>

Friday, 31 August 2012

BookMarkLet


What is BookMarkLet

BookMarkLet is bookMark(hyperlink) with javascript
<a href="javascript: alert('Arbitrary JS code!');">Alert!</a>
draw Alert! to your bookmark Bar Alert! and Click it!!!

Window onblur & focus


Desc

When this window is focused or blurred, a message will appear below telling you when you left and when you came back:

Demo

Source Code

LINKING PAGES USING BUTTNONS


Alert

Some time from SEO angle linking using a button is not a good idea as we loose the anchored text advantage of hyper linking.

Demo

Source Code

Sunday, 26 August 2012

JAVASCRIPT - OBJECT


Intro

Today, I would like to show you how to create an object with javascript. all the resource come from: Head First jQuery ch6 jQuery and JavaScript Luke jQuery, I am your father!

Tutorial

use full screen will be better.

Demo

Entire Code

Friday, 24 August 2012

WINDOW OPEN & CLOSE


Focus

  1. window.open()
  2. window.print()
compatibility:   firefox would not support this close current window
Reason:   firefox can't close windows it didn't create. it can close any window that it open.

main code:

//window.print()
onclick="javascript: window.print();"

//window.open()
onclick="javascript:
                    var win = window.open('', '_self');
                    win.close();return false;"

Entire Source code

Head up!  only HTML,CSS and result are available