Read the browser size

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Read the browser size

dtrussardi@tiscali.it
Hi,

        i need to render some components based on the browser size.

        I work with JQuery and i do a test with this  code in the renderContentOn:


                html jQuery ajax  
    callback: [ :width | " do something with width " ]
                  value: (JSStream on: 'window.innerWidth').



        But the callback block is never call.


        Any suggestions ?

        Thank,
                        Dario
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Read the browser size

jtuchel
Hi,

judging from the snippet you provide, the AJAX call is never performed
because there is no event it is registered with, like onClick or such.
AFAIK, there is no use in simply adding an AJAX in a plain
renderContentOn: method.

So you should try first to add a button or link and bind your Ajax to
its onClick: just to see if that is any better. Then you need to find
out if you can bind the Ajax call to an onLoad by using updateRoot: or
similar.

HTH

Joachim

Am 30.10.12 13:42, schrieb [hidden email]:

> Hi,
>
> i need to render some components based on the browser size.
>
> I work with JQuery and i do a test with this  code in the renderContentOn:
>
>
> html jQuery ajax
>     callback: [ :width | " do something with width " ]
> value: (JSStream on: 'window.innerWidth').
>
>
>
> But the callback block is never call.
>
>
> Any suggestions ?
>
> Thank,
> Dario
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
--
-- 
----------------------------------------------------------------------- 
Objektfabrik Joachim Tuchel          mailto:[hidden email] 
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg     http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

smime.p7s (7K) Download Attachment