var url = document.URL.parseQuery() is not working in Catalog Client Script

Jatin Jaiswal
Tera Contributor

var url = document.URL.parseQuery() is not working in Catalog Client Script.

I used the above line to set the value of the Services which is required to modified using a catalog item.

Thanks for the help in advance.

1 ACCEPTED SOLUTION

suvro
Mega Sage
Mega Sage

Hi Jatin,

 

Uncheck the isolate script checkbox. Then it will work fine

View solution in original post

7 REPLIES 7

Hi,

using DOM is not recommended.

There is an alternative to this as well.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi,

What I can use instead of DOM?

Thanks,

Jatin

@Jatin Jaiswal 

this should work

var url = top.location.href;
var comp = new URLSearchParams(url).get("sysparm_Comp");

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader