Please see below screenshot.

enter image description here

I would like to read/retrieve the ctype that appears in the browser url. I guess this is doable using regular expression but I am not really good with it so can someone please help with the JSOM code to read ctype from the browser url since I am working with OFfice 365/SharePoint online.

Your help will be greatly appreciated. Thanks in advance.

  • It is the internal name you need, right? May 19, 2018 at 7:11

1 Answer 1


There is an in-built function in init.js of SharePoint to read Query String Parameter values.

Try using following to store in a variable named as _ctype:

var _ctype = GetUrlKeyValue('ctype')
  • Thanks @Yayati, can you add more details on how to retrieve ctype using GetUrlKeyValue, potentially store in in a variable using JSOM, i just need to know how do I integrate this in code, is there a reference I have to add etc.
    – mdevm
    May 18, 2018 at 14:39
  • You can try it browser console. developers.google.com/web/tools/chrome-devtools/console
    – Yayati
    May 18, 2018 at 15:25
  • I am sorry but it does not answer my question, thanks.
    – mdevm
    May 18, 2018 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.