Capture mouse right click event inside a iframe using jquery

后端 未结 2 1997
余生分开走
余生分开走 2021-01-22 16:27

I need to capture right mouse click event inside a iframe in asp.net using any javascript or jquery codes.

below is the code i have tried so far.



        
2条回答
  •  孤街浪徒
    2021-01-22 17:13

    It is possible if the page inside an iframe is on the same domain.

    IFrame page at same domain: http://fiddle.jshell.net/rathoreahsan/MNtw8/8/show/

    See Demo: http://jsfiddle.net/rathoreahsan/gJtkW/

    While if you access the page of an other domain inside an iframe like you are doing then it is not recommended.

    Edited: See some references given below, hope it will be helpful.

    1. the-iframe-cross-domain-policy-problem

    2. cross-domain-iframe-resizing

提交回复
热议问题