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

Fritz Schenk intrader.intrader at gmail.com
Fri Feb 4 20:14:00 UTC 2011

Thanks Boris. The code for you provided
<bad code does not compile>
	| onclick |
	onclick := html javascript return: ((Javascript.JSStream new)
						nextPutAll: 'confirm';
						argument: (html jQuery
</bad code does not compile>

To my thinking we should strive to say it Seaside. In this case, Seaside does 
handle the desired text correctly when handling

<desired Seaside>
html button
onClick: ((html jQuery expression: '#external_links a') onClick: 'return 
confirm("You are going to visit: "+ this.href)');
with: 'Attach Click'.
</desired Seaside>

<desired result in javascript>
<button onClick="$('#external_links a').click(function() {
    return confirm('You are going to visit: ' + this.href);
});" type="submit" class="submit">Attach Click</button>
</desired result in javascript>
and the jsbin: http://jsbin.com/imuka5/2

More information about the seaside mailing list