0

I have 2 html pages, movies.html and single.html. In movies.html i have added list of movies, clicking on any movie will take us to single to html along with movie link. I have pasted the code below for better understanding.

<a href="single.html?movieLink=https://drive.google.com/u/0/uc?export=download&confirm=6KcH&id=1oezcBrXr8b-ATkIGD1I9ZQakPP9VX_5W">

Assume the movieLink given redirect to single.html and will start downloading the movie directly. For getting the link in next page i have written a java script code.

But what I want is that I want to redirect the page to single.html, there I have given 2 options 720px and 1080px. After clicking on the resolution needed it should start to download the specific file.

which means I have to pass 2 href links from the movie.html page, how can i do that?

Sushma
  • 45
  • 8

1 Answers1

0

So your URL will be

single.html?param1=linkone&param2=linktwo

and then you can use these two as functions to get the two parameters.

var param1 = getParameterByName('param1'); //return linkone
var param2 = getParameterByName('param2'); //return linktwo
Zach P.
  • 342
  • 1
  • 10
  • I have written a javascript code as above to fetch both the variables. movieLink1 value I am getting it is not downloading the movie, movieLink2 value it says undefined. Can you please provide me any solution. – Sushma May 27 '20 at 19:28
  • Yeah, understood the answer but what I am asking is getParameterByName('param1') will be inside script tag in html file right. So if i want to use the variable param1 outside the script tag how can i use. Like download I want to give the variable param1 in href outside the script tag, can you please help. – Sushma May 28 '20 at 05:45
  • @Sushma https://stackoverflow.com/questions/975050/passing-javascript-variable-to-a-href – Zach P. May 28 '20 at 13:23