相关疑难解决方法(0)

检测iframe中的点击事件

我正在为TinyMCE编写一个插件,并且在检测iframe中的点击事件时遇到问题.

从我的搜索中我得出了这个:

正在加载iframe:

<iframe src='resource/file.php?mode=tinymce' id='filecontainer'></iframe>
Run Code Online (Sandbox Code Playgroud)

iframe中的HTML:

<input type=button id=choose_pics value='Choose'>
Run Code Online (Sandbox Code Playgroud)

jQuery的:

//Detect click
$("#filecontainer").contents().find("#choose_pic").click(function(){
    //do something      
}); 
Run Code Online (Sandbox Code Playgroud)

我见过的其他帖子通常有不同域名的问题(这没有).但是,仍然没有发现事件.

可以这样做吗?

html javascript iframe jquery tinymce

47
推荐指数
3
解决办法
10万
查看次数

在闪亮的应用程序中重定向

我正在尝试将我的Shiny应用程序重定向到另一个页面.我正在使用httr发送GET请求并查看用户是否已登录.如果不是,我想将其重定向到另一个链接.

我可以只使用R/Shiny做到这一点,还是需要一些额外的库?

样品:

library(httr)
library(shiny)
shinyServer(function(input, output) {
rv <- reactiveValues()
rv$mytoken = session$request$token

observeEvent(input$button1, {
  rv$a <- GET("my.url:3405/authtoken", 
              add_headers(
                .headers = c("token" = rv$mytoken)
              ))
  if (rv$a$status_code == 200) {
  } else {
    # redirect magic
  }
})
}

shinyUI(fluidPage(
  actionButton(button1, "btn")
))
Run Code Online (Sandbox Code Playgroud)

redirect r httr shiny

10
推荐指数
2
解决办法
2404
查看次数

标签 统计

html ×1

httr ×1

iframe ×1

javascript ×1

jquery ×1

r ×1

redirect ×1

shiny ×1

tinymce ×1