how to open href link in same window
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2018 10:03 PM
Hi , Below code i am using to display that href link (catalog item) in new tab. but it is redirecting in same page to that catlog item ut i want to open that in below to the same page.
<select name="select-website"onchange="window.open(this.options[this.selectedIndex].value, '_self');">
<option value="https://www.google.com/" target="_blank">SketchUp Pro</option>
<option value="https://dev68174.service-now.com/sp?id=sc_cat_item&sys_id=4a17d6a3ff133100ba13ffffffffffe7">Dell E7490 (Standard Large Laptop)</option>
<option value="https://www.flipkart.com/"target="_blank">External Monitor</option>
</select>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2018 02:17 AM
Hi,
Use _self as target.
You can learn more about different value for the attribute target here.
Cheers,
Sunil B N
P.S. : Mark this an answer/helpful if it was useful to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2018 04:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2018 08:38 AM
are you trying to open this in an iframe?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2018 08:42 AM
Okay i figured out.. Here your window most likely is in iframe window..
So onchange invoke this method
navigateToURL= function(url){
var win = window.parent? window.parent : window;
win.open(url, '_self');
};
Hope this works.
Cheers,
Sunil B N