[FLOW3-general] Fluid action in a javascript event

Stephan Schuler Stephan.Schuler at netlogix.de
Fri Dec 30 18:33:13 CET 2011


Hi Thomas.


I don't see any error here. Your code should actually work. Sometimes the fluid parser gets confused by JSON strings, but this should not be the case here.

But I would suggest to use the URI as a data property of your DOMNode and add a custom jQuery.click event on that.
This reduces the amount of javascript slightly, in the best case it gets transferred only once per user because of cached .js files.


<div data-fakelink-uri="{f:uri.action(action:'show', controller:'Message')}">Some content</div>

<script type="text/javascript">
// Can be an extra .js file
$(function() {
  $('[data-fakelink-uri]').click(function() {
    alert(this.attr('data-fakelink-uri'));
  });
});
</script>


Regards,


Stephan Schuler
Web-Entwickler

Telefon: +49 (911) 539909 - 0
E-Mail: Stephan.Schuler at netlogix.de
Website: media.netlogix.de


--
netlogix GmbH & Co. KG
IT-Services | IT-Training | Media
Andernacher Straße 53 | 90411 Nürnberg
Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
E-Mail: info at netlogix.de | Internet: http://www.netlogix.de

netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
Umsatzsteuer-Identifikationsnummer: DE 233472254
Geschäftsführer: Stefan Buchta, Matthias Schmidt



-----Ursprüngliche Nachricht-----
Von: flow3-general-bounces at lists.typo3.org [mailto:flow3-general-bounces at lists.typo3.org] Im Auftrag von Thomas Plessis
Gesendet: Freitag, 30. Dezember 2011 17:53
An: General discussion about FLOW3
Betreff: [FLOW3-general] Fluid action in a javascript event

Hi guys,

Question in the mail title... How to get an action url in a onclick javascript event? maybe something like that?

..... onclick="$(location).attr('href', '{f:uri.action(action:'show', controller:'Message')}')">

But it did not work anymore... :/

cheers,

Thomas Plessis
Développeur multimédia
--
TOTEMnumerique
9, Place St Étienne
31000 Toulouse
T. 05 61 14 64 54
F. 05 61 14 64 55

_______________________________________________
FLOW3-general mailing list
FLOW3-general at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general


More information about the FLOW3-general mailing list