Add a bookmark that is only javascript, not a URL

前端 未结 5 1919
傲寒
傲寒 2020-12-08 02:28

I\'m thinking that the reason I can\'t do this is because it might be a huge security hole, but here goes...

I want to have a bookmark on my browser (FF3, preferably

5条回答
  •  广开言路
    2020-12-08 02:57

    It is worthy of note that you can put that in a function wrapper as well. imranamajeed nicely illustrated that for us... but apparently I'm too new to the site to up his post. :P

    so for clarity:

    javascript:(function(){
      location.href = location.href + "#";
    })();
    

    (the carriage returns did not affect performance in chrome and IE)

提交回复
热议问题