I'm new to js and I'm waiting for a solution.
I have several urls and they all start with https: // 2.bp.blogspot.com , now I want to store this as a first part and the rest in the links something like this:
Javascript=<br>
var **base**= "https: // 2.bp.blogspot.com" (algo como esto no se como se hace)
<br><br>
HTML=<br>
< a href="/-aVpKfrY4hCE/WUBqnQNNt-I/AAAAAAADLKU/iIMtGqmPe7o4EMo2ZlqEr0QR3qCC_-4MwCKgBGAs/s3200/SecW4rs_05_0157.webp">Imagen 01< /a><br>
< a href="/-3FIhHPOdz_w/WUBqnc-30NI/AAAAAAADLKU/8G-BHCDwyi4DHyhORNwLfXudSIVnKO2ugCKgBGAs/s3200/SecW4rs_05_0162.webp">Imagen 02< /a><br><br>
RESULTADO al hacer click=<br>
< a href="**base +**/-aVpKfrY4hCE/WUBqnQNNt-I/AAAAAAADLKU/iIMtGqmPe7o4EMo2ZlqEr0QR3qCC_-4MwCKgBGAs/s3200/SecW4rs_05_0157.webp">Imagen 01< /a><br>
< a href="**base +**/-3FIhHPOdz_w/WUBqnc-30NI/AAAAAAADLKU/8G-BHCDwyi4DHyhORNwLfXudSIVnKO2ugCKgBGAs/s3200/SecW4rs_05_0162.webp">Imagen 02< /a>
<br><br>
That is, when you click open the url even though they are different but with the same first part stored.
An href opens a link directly.
You can create a function in javascript and have it receive the second part from the HTML using
onclick()
Without using javascript, and assuming that all the links on your page went to that site, you can add the
<head>
following to your page:<base href="https://2.bp.blogspot.com">
and all relative links will use that address as base