Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Instead of using the top.window method is there any way to use?

SRikanth76
Tera Contributor

Hello,

i have using the top.window method is there any alternative way to use url string its working now but portal not working  please suggest me 

 

find_real_file.png

1 REPLY 1

Oleg
Mega Sage

You can move the code, which initialize urls variable outside of setTimeout (directly after var user = '';) and to use the following:

var urls = (this ? this.top : top).window.location.search;

It should work in both Desktop and Service Portal.