This is my first post. I am trying to create a mailto link using 'templated' Javascript that takes the following excerpt from a JSON object:
var menu = {
"menu": [
{
"title": "let's talk",
"link": "mailto:mrlevitas@yahoo.com"
}
]
}
Where '+menu.menu[i].link+' is replaced by "mailto:mrlevitas@yahoo.com"
for (i=0; i<menu.menu.length; i=i+1) {
entry = '<li><a href="'+menu.menu[i].link+'">'+menu.menu[i].title+' </a></li>';
}
$("#navmenu:last").append(entry);
When I click on the page (http://mrlevitas.github.io), nothing happens in either chrome or firefox.
Any advice please?
You might want to use the
for (i=0; i<menu.menu.length; i=i+1) {
entry = '<li><a href="'+menu.menu[i].link+'" target="_BLANK">'+menu.menu[i].title+' </a></li>';
}
$("#navmenu:last").append(entry);
It opens a new window.