Friday, 1 February 2013

document.cookie Property



document.cookie Property Javascript DOM  
The cookie property of the document object is used to set and access browser cookies. Cookies are used for creating persistent data storage that will be available over your entire domain because the file is stored in the user's browser software, and is associated with a particular domain name.
SYNTAX document.cookie

Javascript CODE EXAMPLE
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPbJ0m2FKoVgqgv3a6TIyVXkg01OloSyuJqxrw-qg9SHlavQqRiKXHTXTtuB5vuv_jv_2RyPPv35EXrC4GAvP5g5nI2Vz5KlTWEksI2HDtL0o64lEILmn2qvCUxNK9hZ-aLPJlbRXsyP4/s1600/Cookies.bmp


1. Test this on a website and not your local machine so that the browser software can associate the stored cookies with a domain name.
2. An existing cookie can be updated(overwritten) with a new value by re-baking it.
3. Each cookie is called into each page of your site with each request, so using cookies uses extra resources. The more cookies you use, the heavier the resources.
4. Cookies can be read and removed by the user via their browser software.



Monday, 21 January 2013

Web Hosting Introduction



Web Hosting Introduction

How does the Internet work? How can I have my own Web Site?
What is a Web Host? What is an Internet Service Provider?

What is the World Wide Web?
  • The Web is a network of computers all over the world.
  • All the computers in the Web can communicate with each other.
  • All the computers use a communication protocol called HTTP.

How does the WWW work?
  • Web information is stored in documents called web pages
  • Web pages are files stored on computers called web servers.
  • Computers reading the web pages are called web clients.
  • Web clients view the pages with a program called a web browser.
  • Popular browsers are Internet Explorer and Firefox.

How does a Browser Fetch a Web Page?
  • A browser fetches a page from a web server by a request.
  • A request is a standard HTTP request containing a page address.
  • An address may look like this: http://www.example.com/default.htm.

How does a Browser Display a Web Page?
  • All web pages contain instructions for display.
  • The browser displays the page by reading these instructions.
  • The most common display instructions are called HTML tags.
  • HTML tags look like this This is a paragraph.
    .

What is a Web Server?
  • The collection of all your web pages is called your web site.
  • To let others view your web pages, you must publish your web site.
  • To publish your work, you must copy your site to a web server.
  • Your own PC can act as a web server if it is connected to a network.
  • Most common is to use an Internet Service Provider (ISP).

What is an Internet Service Provider?
  • ISP stands for Internet Service Provider.
  • An ISP provides Internet Services.
  • A common Internet service is web hosting.
  • Web hosting means storing your web site on a public server.
  • Web hosting normally includes email services.
  • Web hosting often includes domain name registration.

Friday, 18 January 2013

JavaScript Window History

JavaScript Window History


Window History

The window.history object can be written without the window prefix.
To protect the privacy of the users, there are limitations to how JavaScript can access this object.
Some methods:
  • history.back() - same as clicking back in the browser
  • history.forward() - same as clicking forward in the browser

Window History Back

The history.back() method loads the previous URL in the history list.
This is the same as clicking the Back button in the browser.

Example

Create a back button on a page:









The output of the code above will be:


Window History Forward

The history forward() method loads the next URL in the history list.
This is the same as clicking the Forward button in the browser.

 


Create a forward button on a page:









The output of the code above will be: