[英]How do I make sure a redirector page can be dismissed after clicking a link?
I am creating a javascript or html ad to test in my mobile app, however everytime I click on the banner link a white redirector page is left behind when I go back into the application. 我正在创建一个JavaScript或HTML广告来在我的移动应用中进行测试,但是,每当我单击横幅链接时,当我回到该应用中时,都会留下一个白色的重定向器页面。 What can I add to my code to dismiss this after the link redirects to an external site?
链接重定向到外部站点后,我可以在代码中添加些什么以消除这种情况?
Here's an example of what I use: 这是我使用的示例:
a href="https://itunes.apple.com/us/app/candy-crush-saga/id553834731?mt=8"target="_blank"> img src="http://imagehostingurl.com"/> a href =“ https://itunes.apple.com/us/app/candy-crush-saga/id553834731?mt=8” target =“ _blank”> img src =“ http://imagehostingurl.com” />
process the ad being clicked on with ajax therefore no redirection will be necessary on the referrer page. 使用ajax处理被点击的广告,因此在引荐来源网页上无需重定向。 for example when the link is click an event handler is fired providing the ad id.
例如,当点击链接时,将触发提供广告ID的事件处理程序。 the event calls a php script to log the ad being clicked in addition to opening a new window.
除了打开新窗口外,该事件还调用php脚本来记录被点击的广告。 An alternative could be to send the link to script on your sever that redirect to the provided link associated to the ad id.
一种替代方法是将服务器上的脚本链接发送到重定向到提供的与广告ID相关联的链接的服务器上。 records of ads would have an ad id and a link.
广告记录将具有广告ID和链接。
$query = "SELECT from ads where ad_id =". $ query =“从广告中选择,其中ad_id =”。 $adid;
$ adid;
$res = mysql_query($query); $ res = mysql_query($ query);
while($row = mysql_fetch_array($res)) header("Location: " . $row['link']); while($ row = mysql_fetch_array($ res))header(“ Location:”。$ row ['link']);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.