Setting production/development in a global file?

0 views
Skip to first unread message

Mark

unread,
Nov 27, 2009, 10:32:31 AM11/27/09
to JavaScriptMVC
Hi there justin,

can you help, i would like to know if its possible to set the
production / development attribute on a global basis. I will
explain .. i have a number of files that all use jmvc - works really
well - each as there own script and attribute i.e. test, production or
development..

I would like to set this in one place so i can control it globally...

I logged a issue a while back here http://code.google.com/p/javascriptmvc/issues/detail?id=60&can=1

and now i am getting ready to upgrade to 2.0 i would like to do this
correctly.

YOu mention here that you can "in 2.0, it should be possible to set
the env before include gets loaded"

Can you explain this? Would this solve my issue?

Thanks in advance

Justin Meyer

unread,
Nov 27, 2009, 11:43:37 AM11/27/09
to javasc...@googlegroups.com
Have a script load before include that looks like

include.env = 'development'

Sent ntfrom my iPhone
> --
>
> You received this message because you are subscribed to the Google
> Groups "JavaScriptMVC" group.
> To post to this group, send email to javasc...@googlegroups.com.
> To unsubscribe from this group, send email to javascriptmv...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en
> .
>
>

Mark

unread,
Nov 27, 2009, 3:06:48 PM11/27/09
to JavaScriptMVC
Thanks Justin,

so what i pass on the script line within my html doesn't matter.. i.e.
i can pass always development for example... but what is in the
include.env is taken over everything else.

when you say script you mean a standard script file with .js
extension ??

Thanks again.

On Nov 27, 5:43 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> Have a script load before include that looks like
>
> include.env = 'development'
>
> Sent ntfrom my iPhone
>
> On Nov 27, 2009, at 9:32 AM, Mark <smit...@live.com> wrote:
>
> > Hi there justin,
>
> > can you help, i would like to know if its possible to set the
> > production / development attribute on a global basis. I will
> > explain .. i have a number of files that all use jmvc - works really
> > well - each as there own script and attribute i.e. test, production or
> > development..
>
> > I would like to set this in one place so i can control it globally...
>
> > I logged a issue a while back herehttp://code.google.com/p/javascriptmvc/issues/detail?id=60&can=1

Justin Meyer

unread,
Nov 27, 2009, 3:15:26 PM11/27/09
to javasc...@googlegroups.com
Yes

<script src='myglobalsettings.js' type='text/javascript'></script>
<script src='jmvc/include.js?myapp' type='text/javascript'></script

Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
justin...@gmail.com

Mark

unread,
Dec 3, 2009, 5:32:02 AM12/3/09
to JavaScriptMVC
Hi Justin,

Ok i am nearly there :-)

I have an error, it says it can't find Include ..... this is my 2
standard lines

<script src='client/apps/myglobalsettings.js' type='text/javascript'></
script>
<script src='client/jmvc/include.js?reservation' type='text/
javascript'></script>

and inside the myglobalsettings.js is simple this

include.env = 'development';

I presume that include hasn't been loaded yet.. But in your original
msg you specifically said to call it before the include but if i
change the order and call it after it seems to work, i see no errors.

But i think the problem is here that its already loaded the file in
the default environment which i presume is development ... so changing
my new "myglobalsettings.js" from development to production has no
effect


Any ideas? I am so close..

I did try this also

<script src='client/jmvc/include.js?myglobalsettings' type='text/
javascript'></script>
<script src='client/jmvc/include.js?reservation' type='text/
javascript'></script>

which is in the correct order but now nothing displays on my page..

I would appreciate any input you have..

thanks in advance



On Nov 27, 9:15 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> Yes
>
> <script src='myglobalsettings.js' type='text/javascript'></script>
> <script src='jmvc/include.js?myapp' type='text/javascript'></script
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
> 847-924-6039
> justinbme...@gmail.com
> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsu...@googlegroups.com>
> > > > .
> > > > For more options, visit this group athttp://
> > groups.google.com/group/javascriptmvc?hl=en
> > > > .
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "JavaScriptMVC" group.
> > To post to this group, send email to javasc...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsu...@googlegroups.com>

Justin Meyer

unread,
Dec 3, 2009, 12:04:52 PM12/3/09
to javasc...@googlegroups.com
include =. {env: 'development'}

Sent from my iPhone

Mark

unread,
Dec 4, 2009, 4:45:58 AM12/4/09
to JavaScriptMVC
Justin, i am really sorry but this isn't working.. I am following your
answers to the "Letter"

I have now edited my myglobalsettings.js file and entered

include = { env: 'development' }

(Please note on yours above you have a "dot" after the =, but i
presume its a typo so i removed it)

i have saved the file

and to confirm i have this in my page file

<script src='client/apps/myglobalsettings.js' type='text/
javascript'></script>
<script src='client/jmvc/include.js?reservation' type='text/
javascript'></script>

Notice how the myglobalsettings.js comes before the include.js

It is failing with the error (via firebug)

uncaught exception: Include is defined as function or an element's id!

I am totally lost, i am sorry to bother you but i can't find any
documentation on it, i have searched the forums and nothing..

???

On Dec 3, 6:04 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> include =. {env: 'development'}
>
> Sent from my iPhone
>

Justin Meyer

unread,
Dec 4, 2009, 11:52:00 AM12/4/09
to javasc...@googlegroups.com
Which version of JMVC are you using?  I'm guessing 1.5.  This won't work with 1.5.

if(typeof include != 'undefined' && include.nodeType)
throw("Include is defined as function or an element's id!");

If you are using 2.0, are you testing this in IE?  Do you have an element with id='include'?

Justin Meyer

Jupiter Consulting
\Development\Training\Support
847-924-6039
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.

Mark

unread,
Dec 20, 2009, 12:32:07 PM12/20/09
to JavaScriptMVC
Yes this works ! I made a mistake when i download 2.0 i didn't put it
in place of the 1.5!!

So yes you were right .. once i replaced it with v2.0 all works as
expected

On Dec 4, 5:52 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> Which version of JMVC are you using?  I'm guessing 1.5.  This won't work
> with 1.5.
>
> if(typeof include != 'undefined' && include.nodeType)
> throw("Include is defined as function or an element's id!");
>
> If you are using 2.0, are you testing this in IE?  Do you have an element
> with id='include'?
>
> Justin Meyer
>
> Jupiter Consulting
> \Development\Training\Support
> 847-924-6039

> justinbme...@gmail.com

> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages