Closed ebrasca closed 1 year ago
I added now (git pull for it):
(defgeneric url-rewrite (clog-window rewrite-url)
(:documentation "Rewrite browser history and url with REWRITE-URL
no redirection of browser takes place. REWRITE-URL must be same domain."))
example:
(clog:url-rewrite (window *body*) "http://127.0.0.1:8080/newurl")
Thank you , it works.
Maybe it is a good idea to make a function to edit just the html arguments in the URL.
Have a nice day!
You may want to look at source/clog-location.lisp (methods on the locaton object) there are many url editing functions there. Strangely rewriting the URL was not one of them (actually there are but they cause redirection).
I asked you after watching in that file. I like your library so far. I am learning it.
Can you give me an example then of what you mean by url editing functions? Maybe worth adding.
For example: Image Viewer that displays all images in a directory I based it on https://github.com/rabbibotton/clog/blob/main/tutorial/27-tutorial.lisp When you click in the image I like it to also change url to be able to share the link to the same image. the url can become domain/?image-name=100.png When you open the page you read the html arguments an initialize the page with them.
I think something like this may be useful: (with-html-arguments (image-name arg2 arg3 &rest rest) (url-search (location body)) body)
(setf (url-search (location body)) (format nil "?image-name=~a" (value lbox))) Without reloading the page!
I am experimenting with what can be done with your library , I hope something may be useful.
Thank you!
You may want to take a look at Quri (clog depends on it, so already there) - https://github.com/fukamachi/quri I'll read this through more carefully tomorrow.
Too bleary eyed to look over but 2 votes :) means we have to do something nice.
I modified tutorial 27 to use url-rewrite and to use load the img passed with ?img=x as long as x in our select box. Sorry took me so long to get to this.
How to change the url without reloading the page?
Thank you!