Categories: Jquery

Difference Between window.open() and window.location.href

In this tutorial i will let u know difference between window.location.href and window.open(), both are very important way to redirect user to a target location,both function are commonly used by web developer.

I have explianed below about difference Between Window.location.href and Window.open () methods in JavaScript.

Related Post

Simple use and Example of window.open() method

This a JavaScript method, it takes a target URL as a parameter where you want to redirect user. This function also have many optional parameters. This method will open target URL in new window on browser.
For example:

window.open('http://google.com');

Simple use and Example of window.location.href method

This is not a method, it’s a property .This property tell to you the current URL location of the browser. This property used to set target URL and user will redirect the page in same window.

window.location.href = 'http://google.com';

Recent Posts

Configure and Retrieve S3 Information Using Laravel PHP-AWS-SDK

This tutorial helps integrate a PHP SDK with Laravel. We'll install aws-php-sdk into laravel application and access all aws services… Read More

3 months ago

What is the Purpose of php_eol in PHP?

in this quick PHP tutorial, We'll discuss php_eol with examples. PHP_EOL is a predefined constant in PHP and represents an… Read More

9 months ago

Laravel Table Relationship Methods With Example

This Laravel tutorial helps to understand table Relationships using Elequonte ORM. We'll explore laravel table Relationships usage and best practices… Read More

9 months ago

Exploring the Power of Laravel Eloquent Join?

We'll explore different join methods of Laravel eloquent with examples. The join helps to fetch the data from multiple database… Read More

10 months ago

Quick and Easy Installation of Laravel Valet

in this Laravel tutorial, We'll explore valet, which is a development environment for macOS minimalists. It's a lightweight Laravel development… Read More

10 months ago

What is Laravel Soft Delete and How Does it Work?

I'll go through how to use soft delete in Laravel 10 in this post. The soft deletes are a method… Read More

10 months ago

Categories