<html>
<title>淘宝链接手机转电脑</title>
<script>
function toExplore() {
var phoneLink = document.getElementById('phoneLink').value;
if (phoneLink == '' || phoneLink.indexOf('\.com') == -1 || phoneLink.indexOf('\.htm\?') == -1) {
alert('请输入网址');
return;
}
var pageId = phoneLink.substring(phoneLink.indexOf('\.com') + 6, phoneLink.indexOf('\.htm\?'));
window.open('http://item.taobao.com/item.htm?id=' + pageId);
}
</script>
<body>
手机链接:<input id="phoneLink" type="text"><input type="button" value="打开网页" onclick="toExplore();">
</body>
</html>