[Seaside] Re: I would like to attach an onClick event according to

John McKeon p3anoman at gmail.com
Sat Feb 5 20:15:49 UTC 2011

The difference is pointed out below.

On Sat, Feb 5, 2011 at 2:42 PM, Fritz Schenk <intrader.intrader at gmail.com>wrote:

> Thanks John, unfortunately your code also suffers from the same problem
> <requirement>
> <button onClick="$('#external_links a').click(function() {
>     return confirm('You are going to visit: ' + this.href);
> });" type="submit" class="submit">Attach Click</button>
> "The confirm returns true or false controlling the action of the anchor.
> Very
> simple to say this in JavaScript. See http://jsbin.com/imuka5/2"
> </requirement>

I typed it out using alert, substitute confirm and it works as expected.

> Not so simple in Seaside as we need to work around the double quotes that
> the
> onClick message uses.
> <generated Seaside source>
> <button onclick="$("#external_links a").click(function(){return confirm
> ("Your are going to visit: " + this.href)})" type="submit"
> class="submit">Attach Click</button>
> </generated Seaside source>
> See the nested double quotes.

These have nothing to do with it. I tested what I sent, and it works....
The real reason is below....

> By the way, your code generates exactly the same html as
> <exactly same html as your code>
> onClick: ((html jQuery expression: 'external_links a')
>         onClick: 'return confirm("You are going to visit: "+ this.href)');
>                 with: 'Attach Click'
> </exactly same html as your code>
> Sorry, and thanks again

Not exactly. Add the # before external_links a and you will get the desired
result. It is not about the quotes.

> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110205/562bfdfb/attachment-0001.htm

More information about the seaside mailing list