Open a link to new tab inside a ifame of iframe - html

I have a iframe-1 and it contains another iframe-1-1.[1]
Inside iframe-1-1 which contains a link.
When a user click the link:
It should open a new tab (For instance, Firebug/or Chrome).[2]
But it does not work. How can I do that?
[1] Why I have this question: because I code a webpage, it is embedded in Facebook, and I call FB.dialog it will show me a dialog is a iframe too.
[2] It works properly if I use wheel button to click.

You can't instruct a browser to open a new tab. The best you can do is to use target="_blank" and hope that the user is using a browser that will open a tab and not a new window.

Related

How can open whatsapp api link in the same new tab every time

I have a whatsapp contact link on my page. I want to open it in a new tab. But if it is already opened, i want to go to this tab (the already opened) instead of open a new tab.
I tried:
<a target="_blank" href="https://api.whatsapp.com/send?phone=">Whatsapp</a>
But every time it opens in a new tab, any ideas?
For a better solution, try opening the whatsapp tab in a new popup instead of the browser tab.
As a page can not keep track of other pages/tabs open on the client side.
You can use a popup to open up the whatsapp page, and can control it through javascript/jQuery
The latter page can also control the main page through javascript commands like parent.
Try rewriting the link as ,
Whatsapp

Why does a link open in the new tab but not in the current tab?

I have the following link on my page. The link points to an internal address.
Add XYZ and do ABC
When I click on the link, nothing happens. The browser shows a loading icon, but stays on the current page. If I right click on the link and say open in new tab, the link open perfectly in the new tab. What is the reason for this? How do I go about debugging this?
You need to set the target of the hyperlink element
Add XYZ and do ABC
Another example (which if copied directly into a HTML file will work)
Goto Google

window.location.reload refreshing the main window

the following is on a page, when i click it - I DO NOT want the page to refresh, but only the new window which this link opens - i want to refresh that newly opened page, not the main window.
clicking the link opens the new window correctly, but refreshes the main window also (where the link lies). that is undesirable and i want to know how to stop it from doing so.
clik to open new window
clik to open new window
pl advice.
as advised below, but not working: infact it is breaking the new window, new window appears as blank window!
clik to open new window
Here's the proper way to open a link in a new window. If javascript isn't available, the link will still work.
Click Me
mywin is a window name, not a variable.
You need to store the returned wobject from window.open() in a global variable:
onclick="window.mywin = window.open('URL','mywin');">
The problem with the main window reloading is likely the href="" line. This could be causing the browser to navigate to the same page where it is presently (and therefore refreshing). You should add return false; to the js, and likely also adopt a more standard link target like href="#" which will navigate to the top of the same page without a refresh (though this will still get cancelled by the false return).
friends, it is resolved by doing this:
clik to open new window

How to invoke the same browser instance from a web link

I have a link on my web page. When I click it I open a new window and show content in that window.
I would like to be able, in a second time, to click again in that link and, instead of opening a new browser window/tab, to get the previous instance and put content on it.
Is it possible in some way?
Thanks in advance, greetings.
In HTML you do this by specifying a named target:
Link 2
Link 3
Link 4
All will open in the same window.
Note: If the user has their preferences set to open new windows in tabs, these will all reference the same tab (vs. window)

How do I open a different page depending upon if user selects open in new tab or not

I am opening links on a page into an IFrame. But if the user right clicks and selects open in new window that will ruin the look I want since it will not have the parent page holding it. So is there a way to open the page as i have it working now when the user clicks on the link but if they choose to open in new tab to have it load the current page all over again in the new window with the link they selected loaded into the IFrame.
Thankyou
You can change all the links to use javascript instead of direct HREFs. This will mean users can't actually 'open in new tab' but will have to click them like normal. Use an 'empty' href & an onclick event to set your iframe's location property.
Link
Should work
Try dropping the following code into the pages you're trying to open within the frameset:
if (top.location.href == self.location.href) {
top.location.href = '/path/to/frameset/page.aspx?somethingindicatingwhichpagetoloadiniframe';
}
This will determine if a parent frame is present and if not, redirect to the frameset page in which you should preload the original page in the iframe.