Replace querystring parameters to href with parameter
$10-30 USD
Suoritettu
Julkaistu noin 2 vuotta sitten
$10-30 USD
Maksettu toimituksen yhteydessä
Example:
I have this URL with querystring parameters
[login to view URL]
And inside HTML code of my page, I have one sharing whatsapp button with parameter also
<a href="whatsapp://send?text=Buy now one red tshirt size big" class="btn btn-whatsapp">
I would like to use the querystring parameters of my domain ?colour=red&size=big and be able to make a replacement inside the whatsapp querystring so whe users share the text will be different depending in the querystrings of my URL.
I am using this code to replace TEXT inside a CLASS. But doesn't work for replacing text inside a querystring on a href.
<script>
// if the page url has a query string
if([login to view URL]){
// get all url search params from the query string
const urlParams = new URLSearchParams([login to view URL]);
// get the value of the 'firstname' search param
// and set it as the .firstname text
$('.colour').text([login to view URL]('colour'));
// get the value of the 'company' search param
// and set it as the .company text
$('.size').text([login to view URL]('size'));
}
</script>
I've checked your description. You didn't write the code properly.
It was good to get urlParams, but after that, you did wrong.
I already have solution and I can help you.
Thanks.
"Hi, I am an expert in Javascript. Can create functions based on your requirement
Skills: PHP, Python, Node, Javascript
Please message me for further discussions.
Thanks!"
Hello, I am an expert in Javascript, Jquery, DOM, CSS, HTML; I ask you to help me with what you need. Write me and we agree, I have immediate availability.
Hi,
i am expert in Php,Laravel, Codeignitor,Jquery,Ajax , wordpress with 5 years experience.
I understand your concern .
Let me do it for you .
Waiting for your response..................!
Thank you.
Hi there,
Thanks for sharing the code sample. It helped a lot.
But I have some more questions to figure out the exact problem.
Can we have a call to discuss on the project?
Regards,
Rakibul Yeasin