Dave E
Posts: 0
Joined: Sat Mar 30, 2013 12:13 am

Get URL Parameters

Can you please help me to get custom parameters in the URL?

I am appending parameters to the URL like this:
http://project.tiggzi.com/mobile-fram...

When I reference window.location, my custom parameters have been stripped out. Please let me know how I tweak the following function to access my custom parameters.

Thanks!

Dave

function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexString = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexString);
var found = regex.exec(window.location.search);
if(found == null)
return "";
else
return decodeURIComponent(found[1].replace(/\+/g, " "));
}

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Get URL Parameters

Hello! Here is your project URL codehttp://project.tiggzi.com/view/93018f22-2faf-4613-8dfa-bea22d4debce/code

so you need to append parameters to this URL like that:
codehttp://project.tiggzi.com/view/93018f22-2faf-4613-8dfa-bea22d4debce/?myParameter1=123&myParameter2=abc/code

Return to “Issues”