This is a very basic and silly question but i am facing this problem since a long and now it has confused me 🙁
I am trying to pass a javascript variable value as a querystring parameter in the rel attribute of the anchor tag. But some how I am not able to pass the value.
Here is my code.
this.pid = pid;
console.log('here is pid'+this.pid); // I am getting correct value here.
var formattedUrl = "<a rel=EProgramDetail?programid='+pid+'&format=SD>" + value + "</a>" ;
but onclicking of the url, it gives me an error but if i hardcode the value, it runs fine.
Please help.
Regards
Hp
As the syntax highlighting demonstrates, you’re mixing up your quotes:
Since you started the string with double quotes, you need to end it with double quotes. Single quotes will be treated as a literal single quote, part of the string.