technomark.in
Hot News

$(this) Selector And Children / Find In jQuery

Detect An Undefined Object Property In JavaScript

Rotate And Save Video Using VLC Media Player

Capitalize The First Letter Of String In JavaScript

Convert Any Files To Any Format Using VLC Media Player

Asp.Net AngularJS WCF IIS
DataBase Jquery Bikes Random
HomeContact Us Watch Our YouTube Channel ..........Blog Spot..........

Technomark.in

How To Logout From All Devices In Skype

Technomark.in

How To Embed Google Map In Your Code

Technomark.in

How To Install IIS (Internet Information Services) On Windows

Technomark.in

Enable Directory Browsing In IIS

View All


Download File Using JQuery or JavaScript


Download File Using JQuery

> Here we consider how to Download File Using JQuery or JavaScript.
> For example, Suppose we wants to download a file when you click on a link.
> For downloading the file, we have two methods.
> First method is as shown below.
> Here we would replace the browser URL with the file path.

$('a').click(function(e) {
         var url = "your file url";
          e.preventDefault();
         window.location.href = url;
});



> Second method is by assigning href of link with the file path.
> Let the ID of the link be linkID.
> When we click on the link, its href attribute will be replaced with the file path.
> We can open the downloaded file in a separate new tab.

var url = "your file url";
$('#linkID').attr({target: '_blank', href : url});



> By using above two methods, we can download file using Jquery.

Watch Video of this Content on Video Steaming

Post Your Comment

Name *


Email *


Comment * Please provide all three fields for posting Comment




Comments

Binod:
while(true):
    print("Binod")
Tes:
wtf
Anant:
nope
wew:
weewqewqweewdsfdfdfdfdsfsfsdfds
gfg:
asasc
Vinoth:
Egchiv
Lel:
while(true):
    print("Binod")
cj:
1234567

Technomark.in

Book Train Tickets on IRCTC Quickly During Tatkal Period

Technomark.in

Before You Copy Any Image From Internet

View All

Privacy StatementDisclaimerSitemap