Solved

Disable links from opening in  new tabs or windows

Posted on 2013-01-29
4
252 Views
Last Modified: 2013-02-14
How can i Disable links from opening in  new tabs or windows?
0
Comment
Question by:M. Jayme Nagy
  • 2
  • 2
4 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38833837
You can't prevent a link from opening in a new window or browser if the user forces it.  But if you set your links without a target http://www.w3schools.com/tags/att_link_target.asp it will naturally open up in the same browser.
0
 
LVL 6

Author Comment

by:M. Jayme Nagy
ID: 38840581
the reason why i am asking is that i am considering putting everything in an iframe to hide the URL of all the pages. however if someone right clicks on a button or menu item and selects opening in new tab or something like that i want the new tab to be blank so the URL remains to be hidden. i know that i have come accross it personally but i do not know how to accomplish this. ideas?
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 38841118
The iframe does not hide the url.  Some browsers all you to "open this frame only".  

Let's say you are bringing in a page from  http://www.secret.com/page.html as an iframe to http://www.yourdomain/yourpage.html.  The iframe code is something like <iframe src="http://www.secret.com/page.htm"></iframe> and there you can see the secret url.

I have never tried this but you could try this

ajax post to http://www.yourdomain/scrape.html which in turn does an ajax post to http://www.secret.com/page.htm to scrape the data, bring it to http://www.yourdomain/scrape.html and that brings it to http://www.yourdomain/yourpage.html.

I think that is a bad idea though.   It would still be detectable where the data came from but a little harder.  


Even if  you only scraped just one page, you can embed it on your page then there is no right clicking.
0
 
LVL 6

Author Comment

by:M. Jayme Nagy
ID: 38841353
Hi,

thanks for that padas!!

i realize that i would have to put the source in the iframe but im not too concerned with that.

where can i find more information about embeding pages into one???
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question