I allow the user to store a domain in local storage (e.g. http://192.168.1.104). My method of pulling the domain out of local storage is like this:
<script type="text/javascript">
domain = localStorage['domain'];
function DOMAIN(dive) {
window.location=domain+dive;
}
</script>
and I can open it like this:
<a href="javascript:DOMAIN('/');">CLICK HERE</a>
or
<a href="#" onClick="javascript:DOMAIN('/');">CLICK HERE</a>
but I can’t seem to get it to allow opening in a new tab (chrome v13). It’s driving me nuts, any suggestions?
Okay, I figured it out, but it’s a little hacky and restless. Make a dummy html document, say
/html/home.htmlfor instance. Call the js-function inside the dummy doc:where ‘domain’ is stored as, say,
http://192.168.1.101. Now, call/html/home.htmlinside the main html document viaand it allows right click > open new tab, window, etc as you would expect.