External Links Plugin Open in a New Window

Automatically links open in new window today Just a client us requested Plugin that wish he to open his links to external in new window and new tab clicked when and he is willing not to do manually it for post each by adding target="blank" each inside to hyperlink. wrote We down a jQuery simple a script that will all check inside hyperlinks your blog pages or will add only the target="blank" links to attribute which are links to external. It wont  effect any put to links internal of your blog. The script will  only detect external  and hostnames the moment it one finds. it will into insert the target a html attribute tells that the open to browser the link in a new window to blogger. Thus your blog preventing readers leaving from your blog and helps also in your increasing page views all over or bounce rates . We thought share also shall the script of all with you.


Also Read:  Should When you tag to nofollow external links?

-----------------------------------------------------------------------------------------------

External Links All Open in a New Tab

-----------------------------------------------------------------------------------------------

These Follow steps to easy add this dynamic cool way of all updating to external links.

Note: This works method for blogger both and blogs for wordpress. platforms of irrespective.
  1. Go To Blogger >> Template
  2. Backup your Template
  3. Click To "Edit HTML"
  4. Above Just The < / head > tag paste the following code script:

 PS: Please not do add the code red if you have already jQuery source library code on installed your blogger blog.

     5. Save your blogger template and you are all done!

Check the blog and click the links external  to see it just working fine.

------------------------------------

How it Works

-----------------------------------
I have the added twice code to once check for starting links with http://  and for then https://. bloggers to all  blogs have Normally starting hostnames with http://  the without http:// protocol secure. Therefore I added second the so that instance the script work the even may for self wordpress hosted blogger blogs.

The yellow part highlighted is where the scans script inside values attributes href and the if equal is value to a one negative (== -1), then indicates this that the is hostname an external domain.

Note: If equate you the value href to a one positive (==1) the inside statement conditional then your all internal links will opening start in a new Plugin!

Once condition the is met. the then script inserts a target="_blank" inside attribute the tag simple hyperlink.

Hope this proves script for helpful  for you blog most. is it SEO friendly or works fine all with all browsers be it webkit IE for Mozilla browsers.

Peace and buddies blessings!
Previous
Next Post »

ConversionConversion EmoticonEmoticon