- The history object is part of the window object, and contains the URLs visited by the user (within a browser window).
It contains useful methods and properties that let you move back and forth through the user's history, and manipulate the contents of the history stack.
- Syntax:

window.history.property_name
window.history.methodName()

• The history object has two properties: length and state.
window.history.length - returns the number of URLs in the history list.
window.history.state - returns the object added in history with pushState() or replaceState().


Methods of the history object

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which attribute specifies the URL address where to send the form-data?
method action name
<form action="script.php" method="post"> ... </form>
Which CSS property can be used to break lines in the middle of words?
word-wrap line-height font-size
#id {
  width: 100px;
  word-wrap: break-word;
}
Which function sorts the elements of an array into alphabetical order, based on the string values?
pop() sort() shift()
var tutorials = ["php", "html", "css", "flash"];
tutorials.sort();
alert(tutorials[0]);          // css
Indicate the function that returns the value of the last element into an array.
current() next() end()
$code =[10=>"Perl", 20=>"PHP", 21=>"Python", 30=>"JavaScript");
$last = end($code);
echo $last;      // JavaScript
The history object

Last accessed pages

  1. Contact page - CoursesWeb (29359)
  2. Tabs effect with CSS (30021)
  3. Making DIV Contents Scroll Horizontally, with multiple Div`s inside (36710)
  4. Star shapes with CSS (5567)
  5. Get Attribute (ID, Class, Name, Title, Src) with jQuery (64673)

Popular pages this month

  1. Making DIV Contents Scroll Horizontally, with multiple Div`s inside (795)
  2. Contact page - CoursesWeb (773)
  3. Tabs effect with CSS (770)
  4. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (249)
  5. PHP getElementById and getElementsByTagName (188)