Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hiii
i am working on eCommerce website i want to open the product page on right click in new tab
how i do...?????
Posted

Use hyperlink or anchor tag with an href to the link you want to open in a new tab or window. Also, use target="_blank" attribute to open the link in a new window or tab.

Opening a new window or tab all depends on the browser settings on how to open a new window.

<a href="http://github.com" target="_blank">GitHub</a>
 
Share this answer
 
If the user wants to open your product in a new tab by right-clicking....they'll right-click and select "Open link in new tab" (or whatever support their browser offers for this).

You shouldn't interfere with the user experience as users are used to their browser and how it works. If you interfere with that it will only confuse and\or annoy your users. How is the user to know that right-clicking on a link\image does something different on your site when that isn't standard behaviour? What if I want to use by browser's context menu and your site interferes with that by hijacking the right click?

Just leave the user experience for your site as it is, the web (and any client app in general) is about consistent standards and your users expect that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900