[Seaside] I would like to attach an onClick event according to
Fritz Schenk
intrader.intrader at gmail.com
Fri Feb 4 01:28:49 UTC 2011
the following JavaScript:
<code>
$('#external_links a').click(function() {
return confirm('You are going to visit: ' + this.href);
});
</code>
The only elements receiving the onClick code are those divs that have anchors.
I have generated code using Seaside as follows:
5 divs with id 'external_links' that contain anchors, and 5 additional divs also
with id 'external_links' that just display text.
The generated 'source' is:
<code>
<div id="external_links">
<a href="/whatever?_s=5NvhIEVCuZvzZGEz&_k=7kFMmFlVjrpxySMO&6">1</a>
</div>
<div id="external_links">
<a href="/whatever?_s=5NvhIEVCuZvzZGEz&_k=7kFMmFlVjrpxySMO&7">2</a>
</div>
<div id="external_links">
<a href="/whatever?_s=5NvhIEVCuZvzZGEz&_k=7kFMmFlVjrpxySMO&8">3</a>
</div>
<div id="external_links">
<a href="/whatever?_s=5NvhIEVCuZvzZGEz&_k=7kFMmFlVjrpxySMO&9">4</a>
</div>
<div id="external_links">
<a href="/whatever?_s=5NvhIEVCuZvzZGEz&_k=7kFMmFlVjrpxySMO&10">5</a>
</div>
<div id="external_links">just some content</div>
<div id="external_links">just some content</div>
<div id="external_links">just some content</div>
<div id="external_links">just some content</div>
<div id="external_links">just some content</div>
</code>
I don't know how to use Seaside to generate the javascript given above. I have
tried adding a button with an onClick event containing 'html jQuery
'external_links a') click: [] - but I don't know what to say for the click:
message.
More information about the seaside
mailing list