You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by sonxurxo <so...@gmail.com> on 2010/11/23 10:12:03 UTC

Execute JavaScript automatically when loading a Page through XHTTPRequest

Hi all,

Is it possible to tell, from a Wicket Page, to execute some JavaScript
automatically when a page loads through a JavaScript XHTTPRequest? I'm using
AbstractBehavior with renderHead(), and it works when the Page is invoked
from another Wicket component (through Link, etc), but not when I invoke the
Page URL through Javascript, even when the HTML returned contains the
<script> tags in the header, it does not execute it. 

Any ideas? TIA
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055042.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Execute JavaScript automatically when loading a Page through XHTTPRequest

Posted by jcgarciam <jc...@gmail.com>.
Wicket set a header value in the request set to wicket-ajax i believe that
way, wicket is able to detect ajax request from regular request.

On Tue, Nov 23, 2010 at 6:31 AM, Poko Booth [via Apache Wicket] <
ml-node+3055066-291766867-65838@n4.nabble.com<ml...@n4.nabble.com>
> wrote:

> Not sure about this but if you use jQuery, you could try adding a js in the
> head of the page which will have something like $(document).ready(
>      function(){
>          //your javascript here
>      }
> );
>
> Regards,
> Poko
>
>
> On Nov 23, 2010, at 11:12, sonxurxo <[hidden email]<http://user/SendEmail.jtp?type=node&node=3055066&i=0>>
> wrote:
>
> >
> > Hi all,
> >
> > Is it possible to tell, from a Wicket Page, to execute some JavaScript
> > automatically when a page loads through a JavaScript XHTTPRequest? I'm
> using
> > AbstractBehavior with renderHead(), and it works when the Page is invoked
>
> > from another Wicket component (through Link, etc), but not when I invoke
> the
> > Page URL through Javascript, even when the HTML returned contains the
> > <script> tags in the header, it does not execute it.
> >
> > Any ideas? TIA
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055042.html<http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055042.html?by-user=t>
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3055066&i=1>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3055066&i=2>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3055066&i=3>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3055066&i=4>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055066.html
>
> To start a new topic under Apache Wicket, email
> ml-node+1842946-398011874-65838@n4.nabble.com<ml...@n4.nabble.com>
> To unsubscribe from Apache Wicket, click here<http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1842946&code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=>.
>
>



-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
Work smarter, not harder!.

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055072.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Execute JavaScript automatically when loading a Page through XHTTPRequest

Posted by Poko Booth <po...@gmail.com>.
Not sure about this but if you use jQuery, you could try adding a js in the head of the page which will have something like $(document).ready(
     function(){
         //your javascript here
     }
);

Regards,
Poko


On Nov 23, 2010, at 11:12, sonxurxo <so...@gmail.com> wrote:

> 
> Hi all,
> 
> Is it possible to tell, from a Wicket Page, to execute some JavaScript
> automatically when a page loads through a JavaScript XHTTPRequest? I'm using
> AbstractBehavior with renderHead(), and it works when the Page is invoked
> from another Wicket component (through Link, etc), but not when I invoke the
> Page URL through Javascript, even when the HTML returned contains the
> <script> tags in the header, it does not execute it. 
> 
> Any ideas? TIA
> -- 
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055042.html
> Sent from the Users forum mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Execute JavaScript automatically when loading a Page through XHTTPRequest

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
What do you exactly mean by invoke the " I invoke the Page URL through
Javascript"?

Ernesto

On Tue, Nov 23, 2010 at 10:12 AM, sonxurxo <so...@gmail.com> wrote:
>
> Hi all,
>
> Is it possible to tell, from a Wicket Page, to execute some JavaScript
> automatically when a page loads through a JavaScript XHTTPRequest? I'm using
> AbstractBehavior with renderHead(), and it works when the Page is invoked
> from another Wicket component (through Link, etc), but not when I invoke the
> Page URL through Javascript, even when the HTML returned contains the
> <script> tags in the header, it does not execute it.
>
> Any ideas? TIA
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Execute-JavaScript-automatically-when-loading-a-Page-through-XHTTPRequest-tp3055042p3055042.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org