JSFiddle - React, Tailwind, and code Playground

by ncapito

HTML

<a class="graphIcon" href="/physical_graph#physical.circular"> 
<img src="http://icons-search.com/img/yellowicon/firefox_win.zip/Firefox_Thunderbird_Win-icons-Firefox.ico-64x64.png" 
id="circular_icon" width="32" height="32" title="Circular layout"/> 
</a>

JavaScript

$(document).ready(function() {
    jQuery('body').delegate('.graphIcon', 'click', function(event){
        event.preventDefault();
        alert('hi')
        jQuery.ajax({
            url:'/physical_graph',
            data:{
                'graph_type': 'physical_graph.circular'
            },
            success: function(data){
               alert('success! ' + data)
            }
        });
    });
});