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
Contributor
ahmed300
Posts: 20
Registered: ‎12-24-2010
My Device: 8520
Accepted Solution

passing variables in the url problem

When I pass a variable in the url like this   window.location='http://www.mysite.com/1/sample.html?test=1' the loading screen works fine until the next page is fully loaded,

 

with window.location='local:///test.html'    The loading screen is fine.

 

The problem is when passing a variable in the url while redirection to a local page window.location='local:///test.html?tt=tt'    the loadding screen works for a second and then a white screen apears until the next page is fully loaded.

 

Any help please.'

Please use plain text.
Trusted Contributor
chicoxml
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: passing variables in the url problem

[ Edited ]

you can use cookies between the pages

 

 

}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1); 
Please use plain text.
Contributor
ahmed300
Posts: 20
Registered: ‎12-24-2010
My Device: 8520

Re: passing variables in the url problem

hi chico,

 

I will try cookies, but do you have any idea about my problem with the url beacause I'm using  variables in the url in all my files and with alot of variables ,

Please use plain text.
Trusted Contributor
chicoxml
Posts: 227
Registered: ‎09-03-2010
My Device: Not Specified

Re: passing variables in the url problem

I had that problem, but I could not solve it.

Please use plain text.
Contributor
ahmed300
Posts: 20
Registered: ‎12-24-2010
My Device: 8520

Re: passing variables in the url problem

hi Chico,

 

I will use cookies as a solution, it will take alot of work to change my code but no other way to solve this.

 

thank you for your help.

Please use plain text.
Contributor
ahmed300
Posts: 20
Registered: ‎12-24-2010
My Device: 8520

Re: passing variables in the url problem

the cookies has a problem, that when set in a html page on the server and try to get the cookie from a local  html page

 

the cookie is undifiend., cookies must be in the same folder.

 

any help

 

 

Please use plain text.