Distinguishing between opening new windows on a page and where ever else.
Wednesday, December 28, 2005 11:29:13 PM
1. Always void when opening a new window. This way doesnt allow the original page to be overwritten. Example below:
javascript:void(window.open('about:blank'))
Which opens about:blank in a new window. and the original web page stays intact.
2. Use an if function to check if the window's location protocol opened is javascript: and target the self or open a new window accordingly.
javascript:if(location.protocol=='javascript:'){alert('Opening page on javascript protocol');window.self.location='about:blank';}else{alert('Opening in new window');window.open('about:blank')}
3. Use same method of checking for javascript: protocol in 2, but instead of setting a window.self.location, use window.close() instead.
javascript:if(location.protocol=='javascript:'){window.open('about:blank');window.open('about:blank');window.open('about:blank');window.close();}else{void(window.open('about:blank'));void(window.open('about:blank'));void(window.open('about:blank'));}
That should help in the steps of making a supersearch or simalar method of opening windows without the useless blank page.

