我正在尝试将youtube视频链接转换为iframe,以将其嵌入到我的网站中,但是遇到了问题,因为我已经将url转换为锚标签,并且与youtube url冲突. 这是我的代码:$string = 'https://www.google.com and https://www.youtube.com/watch?v=umFQckeDwEE'; $url = '~(\s|^)(https?://.+?)(\s|$)~im'; $string = preg_replace($url, '[url=$0]$0[/url]', $string); $youtubeURL = '/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z...
我有以下iframe:<iframe name="content" src="" style="position: absolute; left: 0px; top: 28px;" allowtransparency="true" border="0" scrolling="yes" width="100%" frameborder="0" height="90%" id="MyFrame"></iframe>我只是想捕获iframe内容的屏幕快照,我已经尝试了html2canvas,但似乎不起作用.我尝试将iframe放在div内,但没有任何乐趣. 我已经看到了使用php实现此目的的各种方法,但是似乎还不清楚.谁能阐明任何想法?解...
嗨朋友们我开发了一个项目,因为我希望以表格的形式显示来自网站的数据.所以我可以在子窗口iframe中执行该过程,并从子窗口获取表内容到父窗口.一切正常,但这将适用于所有浏览器,除了ie.并且它不会显示任何错误,一位朋友给出答案(http://roneiv.wordpress.com/2008/01/18/get-the-content-of-an-iframe-in-javascript-crossbrowser-solution-for-both-ie-and-firefox/)为此,但它显示错误“访问被拒绝”,请帮助我..解决方法:这是因为您...
我有一个iFrame和一个包含内容的div.我想通过JavaScript删除div,这是可能的,我怎么能这样做? 我不想只是不显示它(例如:display:none via CSS),但是从网站的HTML中删除它.我有JavaScript的基本知识,但没有任何使用iFrame的经验.解决方法:您可以使用$("#iFrameId").contents().find("#yourDiv").empty();最好使用remove() 例如:$(“#iFrameId”).contents().find(“#yourDiv”).remove(); 释 empty()将删除选择的所有内容. remov...
是否可以通过JavaScript API使用Facebook Face Pile指向APP-ID而不是HREF?例如,JavaScript相当于iFrame代码的代码:<iframe src="http://www.facebook.com/plugins/facepile.php?app_id=120600291315567"style="border:none; overflow:hidden; width:300px; height: 70px"> </iframe>解决方法:要显示有多少朋友正在使用您的网站/应用,请使用在https://developers.facebook.com/docs/reference/plugins/facepile/生成的HTML5示例,然...
我正在尝试制作我自己的“网站检查器”以满足特定需求,我在访问iFrame时遇到问题.Uncaught SecurityError: Failed to read the ‘contentDocument’ propertyfrom ‘HTMLIFrameElement’: Blocked a frame with origin “http://checker.xcore.co.il” from accessing a frame with origin “http://xcore.co.il”. The frame requesting access set “document.domain” to“checker.xcore.co.il”, but the frame being accessed...
我一直试图让文件上传在IE8中运行.我只看到解决方案是发布到IFrame.为什么这样做?不可能有一个简单的表格,例如<form action="test.php" method="post" enctype="multipart/form-data">Select image to upload:<input type="file" name="fileToUpload" id="fileToUpload"><input type="submit" value="Upload Image" name="submit"> </form>哪个直接提交给PHP if(isset($_POST["submit"])) {$check = getimagesize($_FILES["fil...
Flow似乎没有认识到querySelector可能会返回HTMLElement的子类型:var myIframe = document.querySelector('iframe');function foo(iframe: HTMLIFrameElement): void {// I want to do iframe stuff! }foo(myIframe);产生10: foo(myIframe);^ HTMLElement. This type is incompatible with 6: function foo(iframe: HTMLIFrameElement): void {^ HTMLIFrameElement在https://flowtype.org/try. 有没有什么方法可以输入myIframe来让...
我有使用HTML和JavaScript的以下问题.我的网站在div中包含一个HTML页面,如下所示:<object name="cont" type="text/html" data="myHtmlPage.html"></object>我有一个javascript函数(链接到主页面),它改变了该对象的内容. 代码运行良好,因为我可以在“内部”页面中导航而不更改外部上下文. 问题是,现在我需要从该对象中加载的html页面调用主页面上的一个函数javascript(需要在主页面上调用一个,因为我必须更改主页面div的一些属性) ...
如果文本可能位于其中一个框架(或iframe)中,是否有办法在HTML文档中查找所选文本? 如果文档没有框架,那很简单:var text; if (document.getSelection) {// Firefox and friendstext = document.getSelection(); } else if (document.selection) {// IE text = document.selection.createRange(); } if (text == undefined || text == '') {// Iterate over all textarea elements and see if one of them has selectionvar areas ...
我有html这样的页面<body><iframe ></iframe><div id="menu">......</div>.....</body>我想得到身体的innerHTML但没有iframe?我怎么能在jquery中这样做?解决方法:试试.clone:$(document.body).clone().find('iframe').remove().end().html();
我们知道对窗口间通信施加的跨域限制以及在HTML5中引入postMessage. 但是,我们想知道iFrame是否还有其他方法可以调用其父窗口中定义的JavaScript函数. 我们发现postMessage对于调用多个方法有点笨拙,每个方法都需要多个参数. 如果不存在HTML5替代方案,则可以在PhoneGap中提供解决方案. PhoneGap详细信息: 我们在PhoneGap“index.html”页面中嵌入了一个iFrame. 从“index.html”,我们可以在iFrame中调用JavaScript函数或访问变量....
我有一个空的iframe和一个按钮: < input type =“button”name =“B1”value =“google”的onclick = “帧[ ‘IFrameName1’] .location.href =的 ‘https://www.google.com/’” > 但是(除了.location.href)我需要设置属性sandbox =“allow-forms allow-scripts allow-same-origin,因为框架网站”deframes“.如何设置位置和沙箱?解决方法:如果您想在一次点击活动中做两件事.有一个函数可以执行这两个操作并在单击时激活该函数...
我正在尝试使用javascript和razor将视图加载到另一个(父)视图中的iframe中. 我尝试将iframe的src设置为此 var url =’@ Url.Action(“myaction”,“MyController”)’; 还有这个: var url =’@ Href(“?/ myform.cshtml”)’;没有成功. 谢谢 谢谢解决方法:如果你使用的是剃须刀引擎.<iframe src = '@Url.Action("myaction", "myController")' width = "100%" height="1000" frameBorder="0"></iframe>
如何使用WebBrowser阅读IFRAME html代码? 我有iframe的网站,只需点击几下,新的URL就会在这个IFRAME中打开HTML代码的某些部分.有没有可能读到这个?当我尝试Navigate()到此URL时,我被重定向到此站点的主页(无法打开此链接两次).Uri IFRAME_URL = webBrowser1.Document.Window.Frames[0].Url;也许有类似的东西:Uri IFRAME_URL = webBrowser1.Document.Window.Frames[0]. ... DOCUMENTTEXT;解决方法:尝试:string content = webBro...