(defmacro with-ps (&body body) `(with-html (:script (:raw (ps ,body))))) (defpsmacro wait-doc (&body body) `(chain ($ document) (ready (lambda () ,body)))) ; in with-page (:script :src "https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js") ; in table-view (with-ps (wait-doc ; wait til page is finished drawing (chain ($ "tr:gt(0)") ; assign a click callback to each row except the first (click (lambda () ; set page window.location.href to the element with the link 's href (setf (@ window location href) (chain ($ this) (find "a.form") (attr "href"))))))))