K
K
Konstantin Kazanov2015-11-12 11:19:15
JavaScript
Konstantin Kazanov, 2015-11-12 11:19:15

How to generate title using JSON?

I have an html page with JqueryTemplate attached.
There is a js with a catalog:
var products = [
{
Name: "Product 1",
Link: "catalog/product1.html",
Desc: "Description",
},
{
Name: "Product 2",
Link: "catalog/product2. html",
Desc: "Description",
},
];
How do I put the Name variable in the title of the page?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Inchin ☢, 2015-11-12
@Ka3anow

document.title = products[0].Name;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question