You will want to do your string splitting BEFORE you use
decodeURIComponent. Otherwise, if the values contain "&" or "=", you will
get exceptions or bad data.

On Sun, Sep 16, 2018, 07:55 jaffer sadiq <[email protected]> wrote:

> Hi everyone.
>
> I done with the script. added my script as well
>
> var getUrlParameter = function getUrlParameter(sParam) {
> var sPageURL = decodeURIComponent(window.location.search.substring(1)),
> sURLVariables = sPageURL.split('&'),
> sParameterName,
> i;
> for (i = 0; i < sURLVariables.length; i++) {
> sParameterName = sURLVariables[i].split('=');
> if (sParameterName[0] === sParam) {
> return sParameterName[1] === undefined ? true : sParameterName[1];
> }
> }
> };
>
>
> //===In your Case Example
> var id=getUrlParameter('id');
> var cnmae =getUrlParameter('cnmae');
>
> Thanks for everyone response!!
>
> On Thu, Sep 13, 2018 at 6:33 AM Sander Elias <[email protected]>
> wrote:
>
>> Hi Jaffer,
>>
>> Hmm, I just realized you were asking for AngularJS. There is some support
>> in there for URL parsing, but you are better served with the standard URL
>> handler <https://developer.mozilla.org/en-US/docs/Web/API/URL>.
>>
>> Something like this will probably do:
>>
>> const x = new URL('
>> http://localhost:52073/TransRecord/ShowTransRecord?id=%22262115537004%22&cnmae=%22Demo%20Customer%22
>> ')
>>
>> console.log(x.searchParams.get('id'))
>>
>>
>> Hope this helps you a bit,
>> Regards
>> Sander
>>
> --
>> You received this message because you are subscribed to the Google Groups
>> "Angular and AngularJS discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Angular and AngularJS discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Lucas Lacroix
Computer Scientist
Advanced Technology Division, MEDITECH <http://ehr.meditech.com/>
781-774-2293

-- 
 <https://ehr.meditech.com/expanse>             
<https://www.linkedin.com/company/meditech>   
<https://twitter.com/MEDITECH>   <https://www.facebook.com/MeditechEHR>

Subscribe 
<https://info.meditech.com/get-great-meditech-content?hsCtaTracking=864299ec-5abf-4004-9c6d-2d051794101f%7Cc911be42-538a-4a48-8dca-a6d4001c6326>
 
to receive emails from MEDITECH or to change email preferences.

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to