Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Remove History in android using phonegap

sir how to remove caching in android.
i have last issue

i have to solve this issue. i use this code but it is not working...:smileysad:

var Backlen=history.length; history.go(-Backlen);
window.location.href=index.html;
Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: Remove History in android using phonegap

What are you not getting....
can you post the code which you are using.. 

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: Remove History in android using phonegap

Use this Code:

window.location.replace(URL);

 

replace(url)

 

Replace the current document with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it. Hope this Will help you..

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Remove History in android using phonegap

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Cache-control" content="no-cache">
	<title>First Group</title>
	<link href="style/style.css" rel="stylesheet" type="text/css" />
	<script language="javascript" type="text/javascript" src="script/actb.js"></script>
	<script language="javascript" type="text/javascript" src="script/actb2.js"></script>
	<script type="text/javascript" src="script/common.js"></script>
	<script type="text/javascript" src="script/soapclient.js"></script>
	<script type="text/javascript" src="script/cordova-1.9.0.js"></script>
	<script type="text/javascript">
   		
		
	    
	    
	
	   
		    var stationList = new Array;	
	           var Backlen=history.length; history.go(-Backlen); 
                     window.location.href=index.html;
   		function GetStationCodes()
  		{    
	  	******calling web service********	                 document.getElementById('loadingImg').style.visibility = "visible"; 
	  		
		     var pl = new SOAPClientParameters();
		     var parameter1 = "";
		     var parameter2 = "";
		     pl.add("parameter1", parameter1);
		     pl.add("parameter2", parameter2);
		     SOAPClient.invoke(WSDLURL, "stationSearch", pl, true, GetStationCodes_callBack);
		}
  		function GetStationCodes_callBack(r)
 		{ 
**********************here i get list of station****	 		document.getElementById('loadingImg').style.visibility = "hidden";
	 		document.getElementById('submitBtn1').removeAttribute('disabled');
			document.getElementById('submitBtn2').removeAttribute('disabled');
			document.getElementById('getStationDesc').removeAttribute('disabled');
			for (var i = 0; i < r.length-1; i++)
          	{
	          	stationList[i] = r[i].stationCode + " - " + r[i].stationName;
          	}
		}	
		function SetAction(flag)
		{
			if(flag==1)
			{
				 document.frmIndex.action="arrival.html";
			}
			else
			{
				 document.frmIndex.action="departure.html";
			}
		}
	</script>
</head>
<body onload="GetStationCodes()">
	<div id="wrapper">
		<div class="login_cont">
			<div class="home_icon"><a href="#"><img src="images/home-icon.png" alt="Home" title="Home" /></a></div>
			<h1 class="fr">Station ID</h1>
			<div class="cl"></div>
			<form name="frmIndex" type=get>
				<div class="log_cont">
					<input id="getStationDesc" name="getStationDesc" type="text" class="log_txtfield" disabled="disabled"/>// this is auto suggested list when i select sation first time its ok , but when i select same station again it will come up a different look(white screen lager size),due to caching i want to remove that caching
					<script>
						var obj = actb(document.getElementById('getStationDesc'),stationList);
						//setTimeout(function(){obj.actb_keywords = custom2;},10000);
						this.actb_timeOut = -1;
						// Number of elements autocomplete can show (-1: no limit)
						this.actb_lim = 10;
						// should the auto complete be limited to the beginning of keyword?
						this.actb_firstText = true;
						// Enable Mouse Support
						this.actb_mouse = true;
						// Delimiter for multiple autocomplete.
						// Set it to empty array for single autocomplete
						this.actb_delimiter = new Array(' ',',');
						// Show widget only after this number of characters is typed in.
						this.actb_startcheck = 1;
						
						this.actb_bgColor = '#dbe3ec';
						this.actb_textColor = '#00256a';
						this.actb_hColor = '#dbe3ec';
						this.actb_fFamily = 'arial';
						this.actb_fSize = '25px';	
						this.actb_hStyle = 'text-decoration:underline;font-weight="bold"';
						function FillValues()
						{
							document.getElementById('getStationCode').value = document.getElementById('getStationDesc').value.substring(0,3);				
						}
					</script>
					<div>
  
      <img src="images/ajax-loader.gif" id="loadingImg" visible =true style="margin:auto; position: absolute; left:50%; top:50%;"/>
  
</div>
				
					<input id="getStationCode" name="getStationCode" type="hidden" /></div>
					<input id="submitBtn1" type=submit  class="heading_btn" style="margin-top:10px" value="Get Arrival Schedule" onclick="FillValues();SetAction(1)"  disabled="disabled">
					<input id="submitBtn2"  type=submit class="heading_btn" style="margin-top:10px" value="Get Departure Schedule" onclick="FillValues();SetAction(2)" disabled="disabled">
					
				</div>
			</form>
		</div>
	</div>
</body>
</html>

 

Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Remove History in android using phonegap

Not getting can you do change in my code..please sir
Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: Remove History in android using phonegap

Use code like this type:

function reloadPageWithHash() {
  var initialPage = window.location.pathname;
  window.location.replace('http://example.com/#' + initialPage);
} 

 Try using this.

 

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Remove History in android using phonegap

i use like this, but it open another page not index.html

&lt;script type="text/javascript">
function GetStationCodes()
{
var initialPage = window.location.pathname;
window.location.replace('http://example.com/#' + initialPage);
}

&lt;/script&gt;
<body onload="GetStationCodes()">
</body>

It open another page ....:smileysad:
Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: Remove History in android using phonegap

Yes It will replace your page to current page.
and it will not store in browser history. 

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.
Developer
ravi1989
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Remove History in android using phonegap

Sir i am not looking for this.
Please use plain text.
Trusted Contributor
NitishSubudhi
Posts: 166
Registered: ‎12-09-2011
My Device: 9550,9300,9800,9700,9900,9850,9860

Re: Remove History in android using phonegap

I didn't have implement this code yet.
And I didn't find any code which remove the browser history from device.

If I get any code regarding to this then I will post here. 

Thanks & Regards,
Nitish Subudhi

Feel Free To Press The Like Button On The Right Side To Thank The User That Helped You.
Please Mark Posts As Solved If You Found a Solution.
Please use plain text.