2
I’m trying to change the content
meta tag Keyword
dynamically.
Have:
<meta name="keywords" id="selKeyword" content="">
and I’m performing as follows:
$("meta[name='keywords']").attr("content", "hello");
I put a display in the Keywords meta and saw that hello was set, but when I go to display source I see that the content is still blank.
Is there any way around this problem?
EDIT: I didn’t have to do this in my project anymore, but in none of the answers I was able to do the solution. I don’t need it anymore. Thank you to everyone who helped me
I don’t know exactly the goal, but if it’s for indexing, it doesn’t do much to change the meta tags with JS. By the time the JS has changed, the bots will have read the previous values and "gone". In fact, what happens is that the JS will touch the DOM, not the original document.
– Bacco
So, I even saw some people talking about it already, but unfortunately I’m an employee and the boss wants it hehehe.
– Pizzanio
@Pizzanio your problem is the boss, not the technology.
– OnoSendai
heheheh... well that, but I managed to convince him how unnecessary it is.
– Pizzanio
@Pizzanio I understand the need, but it is not in Angular that the solution resides.
– OnoSendai