a really old tric
I sometimes still use the javascript pseudo protocol in the adressbar of the browser. For instance when diagnosing a javascript related problem when working on a computer with no decent javascript debugger installed.
Until now I always used to put my javascript code inside an alert to avoid being redirected to a new page. But using alert makes it impossible to debug focus and blur events properly. So I searched for an alternative and found out that you can also use void() for this.
So instead of "javascript:alert(put your js code here)" you can do "javascript:void(put your js code here)"
I know it is javascript at it's simplest and it turns out to be standard practice when writing bookmarklets but I didn't know it and haven't seen anyone using it so I thought it was worth mentioning it.
Until now I always used to put my javascript code inside an alert to avoid being redirected to a new page. But using alert makes it impossible to debug focus and blur events properly. So I searched for an alternative and found out that you can also use void() for this.
So instead of "javascript:alert(put your js code here)" you can do "javascript:void(put your js code here)"
I know it is javascript at it's simplest and it turns out to be standard practice when writing bookmarklets but I didn't know it and haven't seen anyone using it so I thought it was worth mentioning it.
0 Comments:
Post a Comment
<< Home