I have html SELECT
to open pages in new tab
my SELECT here:
<select onchange="window.open(this.options[this.selectedIndex].value,'newWindow')">
<option value="0">select</option>
<option value="Home.aspx">home</option>
<option value="http://wwww.facebook.com">FaceBook</option>
</select>
my list works fine except Safari. I tried it in Android and still works fine. I found this code for Safari:
<script type="text/javascript">
if (/Android|webOS|iPhone|iPod|Blackberry|Windows Phone/i.test(navigator.userAgent)) {
var onchange = ["if ($(this).val()!=''){"];
onchange.push(" var popup=window.open($(this).val());");
onchange.push(" if (!popup||typeof(popup)==='undefined'){");
onchange.push(" window.location = $(this).val();");
onchange.push(" }");
onchange.push("}");
$('#listBoxes select').each(function () {
$(this).attr("onchange", onchange.join(''));
})
}
</script>
but still not working in Safari.
Any ideas?
Thank you