add txt data into js function
Hi guys,
Im new to this and was hoping I could get some help with my new js store, is there a way to include data from a txt file during a function?
this is what I have and what i need
------------------------------------CURRENT SCRIPT-----------------------------
function store() {
this.products = [
{ num: 1, code: 'CAT', category: 'CAT1', name: 'PRODUCT 1', src: "1.png", description: 'Product 1 Information. ', price: 5.99, cal: 10 },
];
}
-------------------------------------WHAT I NEED------------------------------
function store() {
this.products = [
{Product1.txt},
];
}
or can I have a page that allows me to add a new line into the .js file? I just want to make it easier to load products into my page
Im new to this and was hoping I could get some help with my new js store, is there a way to include data from a txt file during a function?
this is what I have and what i need
------------------------------------CURRENT SCRIPT-----------------------------
function store() {
this.products = [
{ num: 1, code: 'CAT', category: 'CAT1', name: 'PRODUCT 1', src: "1.png", description: 'Product 1 Information. ', price: 5.99, cal: 10 },
];
}
-------------------------------------WHAT I NEED------------------------------
function store() {
this.products = [
{Product1.txt},
];
}
or can I have a page that allows me to add a new line into the .js file? I just want to make it easier to load products into my page
Ryan C
June 2,