Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Fwd: [Gnukhata-devel] separation of js code from mako files
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonathan Vanasco  
View profile  
 More options Oct 26 2012, 11:49 am
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Fri, 26 Oct 2012 08:49:06 -0700 (PDT)
Local: Fri, Oct 26 2012 11:49 am
Subject: Re: Fwd: [Gnukhata-devel] separation of js code from mako files
If i understand you correctly:

Before Editing :
   Your javascript was embedded in mako. and you had variables set in
javascript
After Editing :
   Your javascript is outside of mako, and you need to set variables

If that is your problem, the solution is to re-architect your
javascript so you can set variables in mako but call functions in a
static file.

static.js
    var MyApp = {
       _variable1 : false ,
       _variable2 : false ,
       doSomething : function(){ },
       doSomthingElse : function(input){ },
       flashMessage : function(message){ alert('message') },
    }

dynamic.mako :
    <script type="text/javascript">
       $(document).ready(function(){
           MyApp._variable1 = ${a};
           MyApp._variable2 = ${b};
           MyApp.doSomething();
           MyApp.doSomethingElse('${c}');
           MyApp.flashMessage('${hello}');
       })
    </script>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.