Where is the pass to close the for cycle?

Anyway you seem to be doing it wrong. web2py code runs on the server, 
javascript runs on the client (browser), if you want python code to be 
executed you need to call a controller, for instance using ajax. Otherwise 
all you can put in the javascript using web2py is stuff you already have 
available in the view that generated it, the same way you put anything else 
in your view templates.

Quarta-feira, 7 de Novembro de 2012 9:39:36 UTC, Ali Alroomi escreveu:
>
> hello  plz i need help i need t write web2py code into javascript ike the 
> following my code plz any help with the this:
>
>
> $.fn.fancybox = function(options) {
>         $(this).data('fancybox', $.extend({}, options));
>
>         $(this).unbind('click.fb').bind('click.fb', function(e) {
>             e.preventDefault();
>
>             if (busy) return;
>
>             busy = true;
>
>             $(this).blur();
>
>             selectedArray    = [];
>             selectedIndex    = 0;
>             {{for i in db().select(db.Project.ALL):}}
>             var rel = $(this).attr('rel') || '';
>             var message = {{=i.CategoryID}};
>             var url = "?pro=" + escape(message);
>
>             if (!rel || rel == '' || rel === 'nofollow') {
>                 selectedArray.push(this);
>
>             } else {
>                 selectedArray    = $("a[rel=" + rel + "], area[rel=" + rel 
> + "]");
>                 selectedIndex    = selectedArray.index( this );
>                 /*window.open(url, "_self");*/
>                 history.replaceState({}, "Title", url);
>
>                 
>             }
>                 
>
>
>
>             
>
>             fancybox_start();
>
>             return false;
>         });
>
>         return this;
>     };
>

-- 



Reply via email to