How to set up smartphones and PCs. Informational portal

Open in a new window. How to open a link in a new window

Hello. To be honest, this is such an unpleasant glitch when. Somehow it happened on my Windows XP, even when the seven was not there. You go into several folders and you get several windows.

Honestly, I don't even know what causes this problem, or whether some kind of virus is so harmful, and somewhere I heard that this is Internet Explorer making fun of it. But this is not so important, the main thing is how to fix this error, and I will write about this below.

I will show an example of a solution to this problem on the Windows 7 operating system. Yes, we still need to find out which Windows 7 you have installed, 32-bit or 64-bit.

To do this, on the shortcut "My computer" right-click and select "Properties".

A window will open in which we are looking for “System Type” and on the contrary it will be indicated which Windows 7 you have installed. Like this:

As you can see, I have a 32 - bit one, by the way which one I wrote better. Remember what you have, we will still need it.

Now press "Start", go to "All programs", "Standard" and run the program "Command line".

Here we will need to write two commands in turn, but the commands for 32-bit and 64 are different. So we remember what Windows 7 you have and choose the necessary commands for ourselves.

For 32-bit:

regsvr32 “% SystemRoot% System32actxprxy.dll”
regsvr32 “% ProgramFiles% Internet Explorerieproxy.dll”

For 64-bit:

regsvr32 “% WinDir% SysWOW64actxprxy.dll”
regsvr32 “% ProgramFiles (x86)% Internet Explorerieproxy.dll”

Select one line and copy it with the Ctrl + V combination, or right-click and “Copy”. Then we go to the Command line (which we have already launched) and paste the code by clicking on the right mouse button and choosing the "Paste" item.

Then we confirm the execution of the command by pressing “Enter”. And do the same with the second line.

We reboot the computer.

And one more option

Go to "My computer", and at the top left click on “Arrange”, and then "Folder and Search Options"... A window will open in which you need to check that in the "Folder Menu" area the mark is set to "Open a folder in the same window"... If you have checked the item "Open each folder in a new window", then mark the first item and click "OK".

The problem with opening folders should be solved, but if not, then write in the comments. We'll figure out:).

Friends, well, if you have more serious problems than problems with opening folders, for example, you have problems with telephone communication in your company, then I advise you to pay attention to the number 8 800, which will help your clients call you at any time and with pleasure.

More on the site:

What if each folder opens in a new window? updated: January 11, 2015 by the author: admin

The expression open link in new window in this article means that links will open in a new tab or new window, depending on your browser settings. In any case, it is implied that the page from which the link was made will remain open.

What is it for? The visitor is currently on your site, and there is an external link in the article or on the site page. If this link is of interest to the visitor, then after clicking on such an external link, he will be taken to another site.

On another site, he may open a few more pages and after that it will be difficult for him to get back to your site. He did not finish reading your article, and not every computer user will immediately understand how to get back to your site, because people have different backgrounds and it is not always clear for beginners what to do in this case.

In the browser, you can click the back button, and the visitor could close the window on another site altogether, and he wanted to finish reading your article, and not the article that he accidentally got through an external link.

You can open the link in a new browser tab by manually inserting the "target" attribute with the value "_blank" of the tag into each such link ... In HTML it will look like this - target = ”_ blank”... But there can be a lot of such links, and you don't always remember which external links this attribute has not yet been inserted into.

When adding new links and images in an article, in the WordPress admin panel, in a text editor, there are corresponding items, the activation of which allows you to open the added links and images in a new window.

There are several ways to make links open in a new window. In this article, I will describe only the methods that worked on my site.

Some of the methods did not work correctly on my site, in the previous template, so I will not talk about them. In particular, the main page was displayed incorrectly in a way that requires the JavaScript library - jQuery. Also, this method would not work if JavaScript was disabled.

How to open a link in a new window

In order to open absolutely all links on the site in new windows or tabs, you will need to insert a special code into the "Header (header.php)" file.

To insert this code, you need to log into "WordPress Admin Panel" => "Appearance" => "Editor" => "Header (header.php)".

In the file "Header (header.php)" between tags and must be inserted just before the closing tag here's the code:

This setting for opening pages in a new window or tab seems to me not very convenient, because this opens many windows or tabs in the browser. But, I know that for some, on the contrary, it will be convenient to be able to open external and internal links in this way on their site.

Target Blank In Posts And Comments Plugin

The Target Blank In Posts And Comments plugin helps you open links in comments and posts in a new window without affecting other internal links on the site.

You can download the Target Blank In Posts And Comments plugin from here.

This plugin hasn't been updated for a long time, but it works well on the latest version of the WordPress engine, and does a great job. It worked on my site for a while too.

To install the Target Blank In Posts And Comments plugin, you need to log into the WordPress Admin Panel => Plugins => Add New => Install Plugins => Download. After downloading, the plugin needs to be installed and activated.

The Target Blank In Posts And Comments plugin does not require any settings and starts working immediately after its activation.

Using this plugin will allow you to return visitors to your site who have followed an external link from your site. After all, it often happens that a visitor was looking for the necessary information for a long time, and then suddenly clicked on the link that interested him from a comment or from an article, then went somewhere else, and thus the visitor often cannot find the site from which he originally went ...

The Target Blank In Posts And Comments plugin does its job well, it allows you to delay and return visitors to your site.

Opening a link from comments in a new window

If you need to open links with comments without using a plugin, then this can be done after changing the corresponding code. Changes will need to be made in the code of the "comment-template.php" file, which is located in the "wp-includes" folder.

To do this, you will need to connect to your site using an FTP connection using programs such as FileZilla or Total Commander. This can also be done using the file manager found in your hosting's Control Panel.

The file "comment-template.php" is located approximately along the following path - domains / your site name / public_htlm / wp-includes / comment-template.php.

Attention! Before making any changes to the file "comment-template.php", be sure to make a copy of it. In case of problems, after a change in the file code, your site may stop working normally. In this case, you will have to replace the file you modified with the saved original copy of this file.

A similar incident happened to me, and I had to roll back the site to a working state with the help of the technical support of my hosting. I did not save a copy of the original file, made incorrect changes to the file code, and after that my site stopped showing on the Internet for a while.

This would not have happened if I had made a copy of the file before changing it, because I would have immediately replaced the non-working file with a working file.

You will need to copy the "comment-template.php" file to your computer and save it. It is necessary to make a copy of the saved file and make changes in the file code in it by opening it with the Notepad ++ text editor. You can also open the file in notepad, but in notepad it will be very difficult to find the necessary lines of code to change it.

Next, complete the line starting with $ return = "<, выражением target=”_blank” (на изображении это выражение уже вставлено в код). У меня в файле comment-template.php этот участок кода со вставленным выражением выглядит таким образом:

Function get_comment_author_link ($ comment_ID = 0) (/ ** @todo Only call these functions when they are needed. Include in if ... else blocks * / $ url = get_comment_author_url ($ comment_ID); $ author = get_comment_author ($ comment_ID) ; if (empty ($ url) || "http: //" == $ url) $ return = $ author; else $ return = "" $ author "; return apply_filters (" get_comment_author_link ", $ return);)

When making changes to this code, you should carefully look at the quotes (single or double), this may affect the performance of your site. The next step is to replace the "comment-template.php" file in the "wp-includes" folder.

After that, you will need to check your site for performance. If the site page was open at this time, then you should refresh the open page.

Links from comments will now open in a new window until the WordPress version is updated. The fact is that when the WordPress CMS version is updated, the modified comment-template.php file is replaced with the new comment-template.php file.

Therefore, after updating the WordPress version, you will need to re-insert target = ”_ blank” into the comment-template.php file in the wp-includes folder.

Using the rel = "external nofollow" attribute

The rel = ”external” attribute performs exactly the same function as the target = ”_blank” attribute, which is invalid according to the XHTML specification. Now we have merged the rel = ”external” attribute and the rel = ”nofollow” attribute, which prevents links from transferring weight, into one merged rel = ”external nofollow” attribute. As you can see above, in the above code, rel = ”external nofollow” is already included in the WordPress file.

Rel = "external nofollow" attribute alone will not be enough for links from site commentators to open in a new window. You will also need to paste the JavaScript code into the theme file installed on the site, otherwise the links will continue to open in this window.

This JavaScript code will need to be inserted into the header.php file before the tag:

Conclusions of the article

Using the methods described in the article, you can make changes on your site so that the link from the commentator on your site opens in a new window.

One of the site visitors asked how open link in new HTML window... In this article, I will answer this question.

What do you need

The visitor did not specify which editor he uses, so we will assume that he works directly in HTML. But this does not mean that you cannot follow this instruction if you use any visual editor to create your site. You just need to access the page markup. Most editors and blogging platforms allow you to manually edit your HTML code.

For example, if you are using Expression Web, you can edit the page code by switching to Code Mode ( Code mode).

How to customize the opening of links in a new tab or in a new browser window

thesitewizard.com

Change it to look like this:

thesitewizard.com

Now, when users click on this link, it will open in a new window or in a new tab ( depending on which browser they are using and how it is configured).

Note that if you are using a DOCTYPE with strict XHTML 1.0 or 1.1 syntax, you will not be able to use the above code and pass the page validation at the same time. But I suspect that no one uses these standards. The "transitional" versions of these standards for opening in a new HTML window are fine for us, and they also support the target attribute.

If you're working in Expression Web, Dreamweaver, BlueGriffon, or KompoZer, click on the link you want to edit, go to HTML edit mode, and add the target = "_ blank" attribute.

There are not many advantages to this method.

Many aspiring webmasters think that by opening links in a new window, users are less likely to leave the site. This is fundamentally wrong. If someone clicks on a link and then wants to return to your site, they will simply click the Back button. Not even the most tech-savvy people will find out about this feature right after they get to know the Internet. Advanced users also know that you can use the “ Open link in a new tab" (or " Open link in a new window»).

By creating links that open in a new window, you prevent users from returning to the site. It may seem that they can easily return to the first window with your site. In my experience, this is not the case - people are confused by the non-working Back button. They do not even suspect that they are in front of a new tab or a new window. When they can't get back to the previous page quickly, they just give up and move on to other resources.

Experienced users are no better. They are very annoyed by the "habit" of your site to open new windows without permission. That's why they are experienced users - if they wanted to open a new tab, they would have done it themselves, and they do not at all like that they do it without their consent. It's even worse if all your links open in a new window.

Site becomes vulnerable to phishing attacks

If you use the HTML open in a new window button using target = "_ blank", the linked site gains access to the window / tab with your page and can replace its content.

Not only will this not keep users on the site ( if you opened new tabs for this very purpose), but would also endanger visitors. For example, if you have a user login page, the site located by the link can replace it with a copy of yours, but at the same time collecting usernames and passwords. This type of attack is called phishing.

And this is not a theoretical vulnerability. Google security experts noted “ significant number of messages»About such interception of tabs with the aim of introducing malicious software.

For those who are interested - technical details. A site opened in a new window accesses your page through the JavaScript window.opener object. This is a read / write object that can be manipulated. This includes changing the window.opener.location property to force the browser to navigate to a new location to open the picture in a new HTML window.

Some browsers can prevent this behavior by adding a rel = "noopener noreferrer" attribute to the link. The example given at the beginning of the article will look like this:

thesitewizard.com

In theory, both rel = "noopener" and rel = "noreferrer" should be sufficient to defend against such an attack when the page is opened in a new HTML window. In this case, it is more correct to use the rel = "noopener" attribute, since rel = "noreferrer" has a side effect - the browser will not send the URL of the request source to the site. However, not all browsers currently support the rel = "noopener" attribute. Likewise, rel = "noreferrer" is not supported by some browsers. Therefore, if you want to protect users on as many browsers as possible, you will probably need to use both attributes.

However, this trick only works on current versions of Chrome, Firefox, and Safari. Internet Explorer does not support this feature, although I was able to quickly check version 11 of IE, and it seems to be protected from such an attack with the default security settings. I can't say for sure about the Microsoft Edge browser.

In other words, the method described above cannot be called one hundred percent protection. The best way to avoid this problem is to use normal links without the target = "_blank" attribute.

Conclusion

A general recommendation is to avoid opening tabs in a new HTML window whenever possible. Of course, in some cases this cannot be avoided. In this situation, you can warn site visitors that “ Link opens in a new window". This won't help the average user much or protect them from phishing attacks through your site, but at least it won't annoy more advanced users.

He will simply lose your page, which will worsen the blog's behavioral factors (viewing depth and time spent on the site).

How to insert WordPress links when posting

To prevent the reader from losing the blog, when placing the link, click the Open in a new window / tab checkbox.


Publishing an announcement to the Subscribe mailing list

Compared to the WordPress admin panel, when publishing an announcement, you can also use the option to open a link in a new window.

According to the requirements of the administrators of many groups, such a link is necessary. They are very concerned that the reader does not leave the group's page, stay in touch, and suddenly wants to read something else.

  • highlight the word or phrase you want, click the link icon,
  • in the window that opens, enter the url of the page you want to go to,
  • select "In a new window",
  • write the Title, It will be highlighted when you hover over the link,
  • click Insert.

Html link in a new window. How to open

Open the HTML tab => paste the announcement text => paste the following code

Text Link - UPDATE HTML tab.

Your site address is the URL of the article page.

Don't forget to Refresh your HTML tab and then Post your announcement.

P.S. Is it that simple? Please check in the comments if this information helped you.

SIMILAR ARTICLES:

FRIENDS THANKS FOR SHARING YOUR ARTICLE:

6 reviews for “ Html link in a new window. How to open?

    So everything is clear !!! But I need that in the main menu (top header), the link opens in a new tab, in WordPress in the menu, when you insert the link, there is no checkmark to open in a new tab, what to do is not enough, I rummaged everything, they suggest that everything opens in a new tab , but it does not suit me, please help!

  • Yane: In the admin panel "Appearance" - "Menu". We press. Top right corner - "Screen settings". We press. In the "Show extended menu properties" section, put a tick in the "Link target" checkbox. Select the desired menu item, which should be opened in a new window. We put a tick in the "Open link in a new window / tab" checkbox. We save the menu and enjoy life)))

Task

Solution

By default, links open in the same window where they are located. For any link to open in a new window, to the tag add the target attribute with the value _blank, as shown in example 1.

HTML5 IE Cr Op Sa Fx

Links

Note that when using strictthe target attribute is deprecated in HTML4 and XHTML and will fail validation. In this case, in order to make a link to open in a new window and maintain the correctness of the code, HTML and CSS alone are not enough, so you will have to turn to scripts. First, you need to somehow select the links that will open in a new window, for example, with the rel attribute with the value external. This attribute briefly describes the link or where it leads. Browsers do not accept this attribute, but it is not required because we will be checking all links through JavaScript (example 2). The same target is added to the necessary links. But since this is done programmatically, the validator will not notice the trick.

XHTML 1.0 CSS 2.1 IE Cr Op Sa Fx

Link in a new window

Top related articles