Location assign() Method - Javascript Browser Object Model

Javascript examples for Browser Object Model:Location


The assign() method loads a new document.

Parameter Values

Parameter Type Description
URL String Required. URL of the page to navigate to

Return Value

No return value

The following code shows how to Load a new document:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<button onclick="myFunction()">Load new document</button>

function myFunction() {// www  . j  a  va2s  .co  m


Related Tutorials