0

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? – Kasper Bo Larsen May 19 '18 at 7:11
2

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 '18 at 14:39
  • You can try it browser console. developers.google.com/web/tools/chrome-devtools/console – Yayati May 18 '18 at 15:25
  • I am sorry but it does not answer my question, thanks. – mdevm May 18 '18 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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