Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #15610

Re: javascript in another file

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: javascript in another file
Date 2012-08-29 22:38 +0200
Organization albasani.net
Message-ID <k1luku$8ce$1@news.albasani.net> (permalink)
References <20299183-1ca3-4cd2-b17e-0cc86bf59f22@googlegroups.com>

Show all headers | View raw


On 2012-08-29 19:14, jags wrote:
> var myvar = 
> {
>  myfunc1: function {},
> myfunc2: function{}
> };

That's a syntax error. Should be
...
  myfunc1: function () {},
  myfunc2: function () {}
...

> in html file i include this script through src
> 
> then on body onload i call myvar.myfunc1;
> 
> in crome dev console i see error near var, why so ?

You could start by telling us what the error message said.

- stefan

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

javascript in another file jags <jagatm@gmail.com> - 2012-08-29 10:14 -0700
  Re: javascript in another file Stefan Weiss <krewecherl@gmail.com> - 2012-08-29 22:38 +0200
    Re: javascript in another file jags <jagatm@gmail.com> - 2012-08-30 04:01 -0700
      Re: javascript in another file jags <jagatm@gmail.com> - 2012-08-30 05:28 -0700

csiph-web