javascript - Refreshing a webpage is actualy redirecting to bing -



javascript - Refreshing a webpage is actualy redirecting to bing -

i have script, in adding custom url browser button

for used particular script

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.cookie.js"></script> <script type="text/javascript" src="js/native.history.js"></script> <script type="text/javascript" src="js/go.new.js"></script> <script> $(window).load(function() { settimeout(backtrap, 100); if (!($.cookie("clkd"))){ $.cookie("clkd", 1, { expires : 14 , path: '/'}); } setinterval(toggle_image, 1000); }); window.onpageshow = function (e) { if (e.persisted) { location.reload(); } }; window.onpopstate = function(event) { if (document.location.tostring().indexof("redir=1")>0){ window.location.href = "<?=$$last_offer?>"; //window.location.href = "<?=$szlinkurl?>"; } }; function toggle_image() { var height = $('#banner-img').height(); $('#banner-img').toggle(); $('#loader-img').toggle(); $('#loader-img').css({'height':height+'px'}); } function show_star(rate,id) { $('#al-stars-'+id).html('<span class="stars" id="stars-'+id+'">'+parsefloat(rate)+'</span>'); $('#stars-'+id).stars(); } $.fn.stars = function() { homecoming $(this).each(function() { $(this).html($('<span />').width(math.max(0, (math.min(5, parsefloat($(this).html())))) * 16)); }); } </script>

now script seems work fine, face new proble, is:

when clicking refresh button on browser, page rediecting bing.com

but dont know why happening...

in case if needed here's script in go.new.js

/** * go.js * * functions go.php , backtrap */ // -------------------------------------------------------------------------------------------------------------------- // code parsing query string gratefully lifted http://unixpapa.com/js/querystring.html, // add-on modifying/generating new query strings. // query string parser // // qs= new querystring() // qs= new querystring(string) // // create query string object based on given query string. if // no string given, utilize 1 current page default. // // qs.value(key) // // homecoming value named key. if key not defined, // homecoming undefined. if key multiply defined // homecoming lastly value set. if defined without value, // homecoming empty string. // // qs.values(key) // // homecoming array of values named key. if key not // defined, empty array returned. if key multiply // defined, values given in order appeared on // in query string. // // qs.keys() // // homecoming array of unique keys in query string. order // not same in original query, , repeated // keys listed once. // // querystring.decode(string) // // static method error tolerant version of builtin // function decodeuricomponent(), modified alter pluses // spaces, suitable query string decoding. // shouldn't need phone call value(), // values(), , keys() methods decode return. // // note: w3c recommends ; accepted alternative & // separating query string fields. back upwards that, insert semicolon // after each ampersand in regular look in first // function below. function querystring(qs) { this.dict= {}; // if no query string passed in utilize 1 current page if (!qs) qs= location.search; // delete leading question mark, if there 1 if (qs.charat(0) == '?') qs= qs.substring(1); // parse var re= /([^=&]+)(=([^&]*))?/g; while (match= re.exec(qs)) { var key= decodeuricomponent(match[1].replace(/\+/g,' ')); var value= match[3] ? querystring.decode(match[3]) : ''; if (this.dict[key]) this.dict[key].push(value); else this.dict[key]= [value]; } } querystring.decode= function(s) { s= s.replace(/\+/g,' '); s= s.replace(/%([ef][0-9a-f])%([89ab][0-9a-f])%([89ab][0-9a-f])/g, function(code,hex1,hex2,hex3) { var n1= parseint(hex1,16)-0xe0; var n2= parseint(hex2,16)-0x80; if (n1 == 0 && n2 < 32) homecoming code; var n3= parseint(hex3,16)-0x80; var n= (n1<<12) + (n2<<6) + n3; if (n > 0xffff) homecoming code; homecoming string.fromcharcode(n); }); s= s.replace(/%([cd][0-9a-f])%([89ab][0-9a-f])/g, function(code,hex1,hex2) { var n1= parseint(hex1,16)-0xc0; if (n1 < 2) homecoming code; var n2= parseint(hex2,16)-0x80; homecoming string.fromcharcode((n1<<6)+n2); }); s= s.replace(/%([0-7][0-9a-f])/g, function(code,hex) { homecoming string.fromcharcode(parseint(hex,16)); }); homecoming s; }; querystring.prototype.value= function (key) { var a= this.dict[key]; homecoming ? a[a.length-1] : undefined; }; querystring.prototype.values= function (key) { var a= this.dict[key]; homecoming ? : []; }; querystring.prototype.keys= function () { var a= []; (var key in this.dict) a.push(key); homecoming a; }; querystring.prototype.set = function(key, value) { this.dict[key] = [value]; }; querystring.prototype.add = function(key, value) { if (typeof this.dict[key] == 'undefined') { this.dict[key] = [value]; } else { this.dict[key].push(value); } }; querystring.prototype.tostring = function() { var pieces = []; (var key in this.dict) { (var idx in this.dict[key]) { pieces.push( encodeuricomponent(key) + '=' + encodeuricomponent(this.dict[key][idx])); } } homecoming pieces.join('&'); }; // -------------------------------------------------------------------------------------------------------------------- // load ourselves user's history, altered query string. 'bt' var tells step of // trap lastly on. after that, redirect ourselves next url. function backtrap() { var qs = new querystring(); qs.set('redir', 1); var own_url = window.location.href; var qs_at = own_url.indexof('?'); var doped_url; if (qs_at == -1) { doped_url = own_url + '?' + qs.tostring(); } else { doped_url = own_url.substring(0, qs_at) + '?' + qs.tostring(); } history.pushstate({}, '', doped_url); history.pushstate({} ,'', own_url); alert(doped_url); alert(own_url); }

for improve understanding

check link , detect

http://gomotrak.com/main/click.php?c=2173&key=jm64njqpq608t19bgqi3fwfq&c2=aa09_00000&c3=[zone]

[note] backbutton working fine, there no issue back-button... problem is, when clicking on refresh button of browser in address bar, reloading bing page.

also $$last_offer absolutely fine cause working way

if(stripos($ua,'android') !== false) { $agent = 'a'; setlocale(lc_all, 'pt_br.utf-8'); $last_csvfp = fopen("offer_android.csv", "r"); $last_offer_data = array(); if($last_csvfp !== false) { while(! feof($last_csvfp)) { $last_offer_data[] = fgetcsv($last_csvfp,"",","); } } fclose($last_csvfp); $last_arr_size = count($last_offer_data); $last_offer = "offer".intval(intval($last_arr_size)+1); }

so $last_offer becomes "offer3" eaxmple

and $$last_offer becomes "$offer3" alias of phpvariabledenoted anotherphp variable`

javascript jquery

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -