Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
Probably easy regular expression question
I’ve seen this code before on the forum and it works great. Pass it the parameter in the URL that you are looking for and it returns the value.
var partnerValue = gup('partner');
/***********************************
Get URL Parameter
***********************************/
function gup(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null)
return "";
else
return results[1];
}
Using the above, if I have www.mysite.com/index.html?partner=0104-The Cool Store
It would return “0104-The Cool Store”.
However, I want to further parse out what is returned, either in the gup function or by calling another function afterwards. Basically, I want be able to have two values in the end: