javascript - history.back(-1) not working in chrome -


the scenario is, have old application in html , javascript. first page/form has dropdown list, search text field, find button , list view. when enter on search field , click find, invokes javascirpt function selects items on list view , goes page/form created javascript function displaying items of list view matched search , button. when button clicked supposed go first form , display selected items on list view. work in ie11 not working in chrome. chrome goes page previous page search text field, find button , list view. same happens if click on chorme browser button. chrome version 61.

find code below:

<input type="button" value="find" onclick="fndtxt(this.form)">  function fndtxt(lgrp) {   var txt=lgrp.srchtxt.value     var stextgrp=txt.split(' ');     var seltxt='you have selected:<br>start date:\n';     var j=0,k=0;     var selfield=''     seltxt += lgrp.sdate.value+' , end date:'+lgrp.edate.value     seltxt += '<br>and following data fields<br>'     for(k=0;k<document.inform.slist.length;k++){ //      document.inform.slist.options[k].selected=false;         }     for(k=0;k<document.inform.slist.length;k++){     oname=document.inform.slist.options[k].text     var sfnd=0;     for(stxt in stextgrp){         re = new regexp(stextgrp[stxt],'i' )                 if( oname.search(re)!= -1 ){             sfnd++             }         }     if(stextgrp.length==sfnd){               document.inform.slist.options[k].selected=true;         seltxt=seltxt+oname+'<br>\n'         selfield +=oname.split(':')[0]+','         }     }     document.write("<html><body text='#f8b008' >");     document.write("<head><link rel=stylesheet type='text/css' href='/wqsys/include/wqsys.css' ></head>");     document.write("<br><br><table align=center text='#f8b008'><tr><td id=cel>");     document.write(seltxt); //  document.write(selfield)     document.write("<form name='getinfo' action='nocall.pl' method=get >")     document.write("<input type=hidden name=fname value='"+selfield+"'>")     document.write("</td></tr><tr><td align=center><input type=button id=expmenu value='back' onclick='history.back(-1);'>")     document.write("</td></tr></table></form></body></html>")     document.close() } 

i have tried window.history.go(-1); return false; no success.

any or suggestion appreciated.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -