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 Alternate link postback wiring
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
 
Jeremy Raymond  
View profile  
 More options Apr 16 2012, 10:41 am
From: Jeremy Raymond <jeraym...@gmail.com>
Date: Mon, 16 Apr 2012 07:41:10 -0700 (PDT)
Local: Mon, Apr 16 2012 10:41 am
Subject: Re: Alternate link postback wiring

Hey Jesse,

Using #api{} for the postback works. It's simple enough for what I'm trying
to do. Thanks a lot.

--
Jeremy

On Friday, 13 April 2012 23:01:26 UTC-4, Jesse Gumm wrote:

> Hi Jeremy,

> It's definitely true that a lot of wiring like that can indeed slow it
> down in a browser with a slower javascript engine.

> I do think the best solution is something like a hard wiring event,
> maybe a hard_events attribute that can attempt to intelligently assign
> events to html onclick attributes and the like.

> An alternative you could try to use without reworking the nitrogen
> elements is to use the #api element and then make the links with
> directly typed links.

> IE

> body() ->
>   wf:wire(#api { name=my_postback, tag=links }),
>   [
>      "<a href=\"javascript:;\"
> onclick=\"page.my_postback('link1')\">Link 1</a>",
>      "<a href=\"javascript:;\" onclick=\"page.my_postback('link2')\">Link
> 2</a>"
>   ].

> api_event(my_postback, links, Args) ->
>    do_something_with(Args).

> That's at least a way to avoid having to deal with the slowdown of
> that many links and all the generated javascript associated with
> wiring events, though I admit it's not exactly the most
> straightforward approach.

> -Jesse

> On Fri, Apr 13, 2012 at 12:34 PM, Jeremy Raymond <jeraym...@gmail.com>
> wrote:
> > From what I can tell Nitrogen wires link post backs by running some
> > JavaScript on the client when the page loads. I have some pages with
> > hundreds of links that have postback and it's hella slow on IE.  Is there
> > any alternate way to wire the postbacks (maybe hard wire it somehow in
> via a
> > script action on the link)?

> > --
> > You received this message because you are subscribed to the Google Groups
> > "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msg/nitrogenweb/-/G_FHgZo9b0MJ.
> > To post to this group, send email to nitrogenweb@googlegroups.com.
> > To unsubscribe from this group, send email to
> > nitrogenweb+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/nitrogenweb?hl=en.

> --
> Jesse Gumm
> Owner, Sigma Star Systems
> 414.940.4866 || sigma-star.com || @jessegumm


 
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.