javascript - can't embed some text in js file -


my problem is, have created js file. in file text defined.

channel = {   categorie_one: "hauptsender",   categorie_two: "spartensender",   categorie_three: "regionalsender" } 

now want embed categorie_one in other js file. i'm doing code:

channel.categorie_one; 

but shows in console: cannot read property 'categorie_one' of undefined, logical have linked file...

im including js files in index.html

<script src="javascripts/default.js" type="text/javascript" rel="javascript"></script> <script src="javascripts/resources.default.js" type="text/javascript"></script> 

in default.js have methode load site.

function channelload(listview) {      //there should cateogrie_one } 

could me pls. in advance

add semicolon variable definition:

channel = {    categorie_one: "hauptsender",    categorie_two: "spartensender",    categorie_three: "regionalsender" }; 

syntactically variable definition statement; if placed in row other statements (i assume that's end after inclusion of js files), have separated semicolons.


Comments