public function replaceElementUsingLink( $execMethod, $args = [ ], $targetDiv, $linkText, $anchorAttrs = [ ] )
    {
        $url = $this->url( $execMethod, $args, true );
        $attrs = [ ];
        foreach ($anchorAttrs as $k => $v) {
            $attrs[ ] = "{$k}='{$v}'";
        }
        $attrsStr = implode( ' ', $attrs );
        return <<<EOS
        <script type="application/javascript">
            if( typeof(execLink) != "function" ){
                var execLink = function( url, targetDiv ){
                    // Send the data using post
                    var posting = $.get( url, $( form ).serialize() );
                 
                    // Put the results in a div
                    posting.done(function( data ) {
                        $( "#"+targetDiv ).replaceWith( data );
                        $("body").css("cursor", "default");
                    });
    
                    // Show optional progress
                    $("body").css("cursor", "progress");
                }
            }
        </script>
        <a href="#" onclick="execLink( '{$url}', '{$targetDiv}' ); return false;" {$attrsStr}>{$linkText}</a>
EOS;
    }