by http://webgeektutorials.blogspot.com

Friday, August 5, 2011

Javascript to get URL of page

In my project, today i need to get the URL of the page, i used a small Javascript to implement it. In Javascript location object contains information about the current URL. It is supported by all the major browsers.
The location object is part of the window object and is accessed through the window.location property. Quite simple script to do this is :


<script language="javascript" type="text/javascript">
    document.write (document.location.href);
</script>

Properties of Location Object
 hash  Returns the anchor portion of a URL
 host  Returns the hostname and port of a URL
 hostname  Returns the hostname of a URL
 href  Returns the entire URL
 pathname  Returns the path name of a URL
 port  Returns the port number the server uses for a URL
 protocol  Returns the protocol of a URL
 search  Returns the query portion of a URL

Note : Please note that this won't work if you are using frames in your page.

Monday, August 1, 2011

Creating Cross-plattform Mobile Applications with Dojo Toolkit

Dojo is an open source toolkit that helps you write robust and efficient JavaScript code. JavaScript is a language that runs within the Web browser, and there are various flavors of Web browser that interpret the JavaScript in slightly different ways. Toolkits such as Dojo, YUI, Prototype, and many others are designed to abstract away the browser idiosyncrasies so that you don't have to learn them all and handle them in your code.
Some points about Dojo : 
  1. Dojo is JavaScript framework released as open source software. This JavaScript toolkit provides many components to develop rich internet applications.
  2. You can use Dojo toolkit to develop dynamic web applications. Dojo toolkit will put life in your web application and turn it into highly interactive application. You can turn your web application into desktop
  3. like web application.
  4. Dojo offers many widgets, utilities and ajax libraries to develop your application.
  5. Dojo is released under BSD or AFL license
  6. Dojo is free and can be used to develop free or commercial application.
There are often several ways to code the same thing using JavaScript. Toolkits like Dojo provide functions you can use to do things in easier or more efficient ways. Using libraries from a toolkit can reduce the lines of code you write and make your JavaScript applications quicker and more stable.The Dojo Toolkit comes with many amazing modules which all are trying to make your life as a developer many times easier. This short introduction to UI Development will introduce you to the main Dojo layout and form widgets.

Why use Dojo/Dijit? ( http://dojotoolkit.org )

One of the great features of dijit is the fact that it is all ready for a11y (accessibility) and i18n (internationalization). Imagine you are working on a new product, your current market is the one of your country and you are not too concerned about delivering your product in several different languages. Thinking about making your product accessible for people with disabilities is way down the list of your priorities.