URL: http://www.apple.com/ae/shop/goto/buy_watch
"https://www.apple.com/ae/shop/buy-watch"); var ses = "; " + document.cookie; var sesParts = ses.split("; s_vi="); ses = sesParts.length == 2 ? sesParts.pop().split(";").shift() : ''; if (ses !== '') { url += url.indexOf('?') >= 0 ? '&' : '?'; url += 'ses=' + encodeURI(ses); } sbNode.name = 'apple-itunes-app'; sbNode.content = 'app-id=375380948, app-argument=' + url; headNode.appendChild(sbNode); } else if (/(iPad).*OS ([6-9]|[1-9][0-9]).*AppleWebKit.*Mobile.*Safari/.test(navigator.userAgent)) { var headNode = document.getElementsByTagName("head")[0]; var sbNode = document.createElement('meta'); var url = decodeURI("https://www.apple.com/ae/shop/buy-watch"); var ses = "; " + document.cookie; var sesParts = ses.split("; s_vi="); ses = sesParts.length == 2 ? sesParts.pop().split(";").shift() : ''; if (ses !== '') { url += url.indexOf('?') >= 0 ? '&' : '?'; url += 'ses=' + encodeURI(ses); } sbNode.name = 'apple-itunes-app'; sbNode.content = 'app-id=375380948, app-argument=' + url; headNode.appendChild(sbNode); }