how to popup the url in same window

service buzz
Tera Contributor

hi everyone,

I am using a following HTML code in one of my portal widget. 

<div>
<!-- your widget template -->
<div>
<button type='link' ng-click="c.generatePassword()"style="color:black;">url</button>
</div>
</div>

for now when we click on the url it is opening in new tab but my req is to open in same frame like for example when we open a record producer and click on preview blink, the form opens in same frame like wise  I want to implement the same with the mentioned url in the widget.

please help.

Thanks.

 

15 REPLIES 15

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

try with the following code:

<div>
<!-- your widget template -->
<div>
<button target="_self" type='link' ng-click="c.generatePassword()"style="color:black;">url</button>
</div>
</div>

If I have answered your question, please mark my response as correct and helpful so that this thread can be closed and others can be benefited by this.

Thank you very much

Cheers
Alberto

HI thanks for your response , i tried this but it opening in next tab.

niharika19
Mega Guru
Mega Guru

Hi,

Try using the target attribute as _self.

target ="_self"

 

Let me know if this helps

Thanks 

asifnoor
Kilo Patron

Not sure if there is button with type=link. Can you try like this.

<div>
<!-- your widget template -->
<div>

<a ng-href="{{ url}}" ng-click="c.generatePassword()"  target="_self">{{url}}</a>
</div>
</div>

Mark the comment as a correct answer and also helpful if this helps to solve the problem.