wuxiaomo
V2EX  ›  问与答

JavaScript 中可以屏蔽某个函数的执行吗?

  •  
  •   wuxiaomo · Feb 14, 2016 · 3707 views
    This topic created in 3773 days ago, the information mentioned may be changed or developed.
    RT ,不知道大家有没有办法? 应用场景是,我在某个页面内会嵌入别人的一个 iframe ,在这个 iframe 有一个按钮,点击了会打开另外一个页面,现在想屏蔽 “打开页面动作”,不知道有没有办法?
    6 replies    2016-02-15 12:39:39 +08:00
    ChefIsAwesome
        1
    ChefIsAwesome  
       Feb 14, 2016
    控制不了 iframe 的。你想一下,如果你把淘宝用 iframe 嵌到自己的页面里,能阻止用户点击付款按钮吗?
    virusdefender
        2
    virusdefender  
       Feb 14, 2016 via Android
    window.xxx=function(){}

    没试过
    14ly
        3
    14ly  
       Feb 14, 2016 via iPhone   ❤️ 1
    算好位置,在那个按钮上面盖一个东西就行了,必要的话可以用另一个 iframe 套这个 iframe
    just1
        5
    just1  
       Feb 14, 2016 via Android
    3 楼正解,透明 iframe
    wuxiaomo
        6
    wuxiaomo  
    OP
       Feb 15, 2016
    @14ly 问题就是,这些按钮不固定在一个位置,所以好像盖一层还蛮难
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5509 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 07:54 · PVG 15:54 · LAX 00:54 · JFK 03:54
    ♥ Do have faith in what you're doing.