Community Forum

User info

Welcome, Guest! Please login or register.


You are here » Community Forum » Questions for Administration » Problems With Url Parameters


Problems With Url Parameters

Posts 1 to 3 of 3

1

Frankly this is a slight problem im facing here with the home url but all the same it needs to be addressed.
The home Url doesn't accept any params
Eg
http://myforum.tcihosting.cf/ is not same as http://myforum.tcihosting.cf/?i=1 or http://myforum.tcihosting.cf/?param1=x&param2=y

It'll be grand if this can be fixed mainly because i find it that it's easy to paginate posts when we can set e.g ?page=1

Last edited by jonath45 (2018-03-09 08:31:10)

0

2

Hi jonath45,
Did you try location.hash instead?

Example:

Code:
http://myforum.tcihosting.cf/#param1=value1&param2=value2

The function that we used in our project:

Code:
function getParam(sParamName){
	var Params = location.hash.length > 1 ? location.hash.substring(1).split("&") : location.search.substring(1).split("&");
	var variable = ""; for (var i = 0; i < Params.length; i++){
	if (Params[i].split("=")[0] == sParamName){
        if (Params[i].split("=").length > 1)
                variable = Params[i].split("=")[1];
                return variable;
        }
	}
	return "";
}

0

3

yes but on browsers like chrome # params do not reload the page and they do not look beautiful too.
I used it on http://greennaija.tk and it works but i had to add a refresh to the function just to check

0


You are here » Community Forum » Questions for Administration » Problems With Url Parameters