简体   繁体   English

如何确保单击链接后可以关闭重定向器页面?

[英]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.

相关问题 如何确保单击图像会将我重定向到我的主页? - How can I make sure that clicking on an image would redirect me to my home page? 单击链接后,如何使链接不滚动到首页? - How do you make the link doesn't scroll you at the top page after clicking it? 单击链接后如何在另一个页面上进行确认框起作用? - How to make confirmation box on another page after clicking a link, work? 单击链接并加载新页面后,我该如何运行 function? - After clicking a link and loading a new page how can I then run a function? 刷新页面后,如何确保从 localStorage 显示正确的数据? - How can I make sure the right data gets displayed from localStorage after refreshing the page? 单击提交后,如何使我的 HTML 页面保留? - How do i make my HTML page to remain after clicking submit? 单击提交按钮后如何使我的页面停止刷新? - How do I make my page stop refreshing after clicking submit button? 单击链接后如何加载fancybox内容? - how do i get fancybox content to load after clicking the link? 滚动后如何确定整个选项卡可见? - How do I make sure a whole tab is visible after scrolling? 我怎样才能做到只加载选项卡区域而不是单击选项卡后页面跳转到顶部? - How can I make it so only the tab area loads instead of the page jumping to the top after clicking on tab?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM