Page 1 of 1

Get URL Parameters

Posted: Thu Apr 04, 2013 8:17 pm
by Dave E

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, " "));
}


Get URL Parameters

Posted: Thu Apr 04, 2013 8:41 pm
by Maryna Brodina

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