iframe display the curent content website instead of the target of src - iframe

My iframe code is
<iframe src=”http://google.com” width=”400″ height=”600″></iframe>
But instead of showing google it show my own website!
You can take a look at http://tetards.ch/node/112

Ok.. it was stupid. I use stupid ″ instead of ".

Related

ckeditor add <iframe> tag in editor

I am using ckeditor in a drupal 7 site. I want to put iframe tag inside the editor.
Currently what happen when we put iframe in ckeditor.
<iframe src="http://www.lipsum.com/"></iframe>
It convert that iframe tag with a img tag with some special attribute and URL.
<img class="cke_iframe" data-cke-realelement="%3Ciframe%20src%3D%22http%3A%2F%2Fwww.lipsum.com%2F%22%20class%3D%22placeholder-tool%20helpTool-placeholder%22%20scrolling%3D%22no%22%20frameborder%3D%220%22%3E%3C%2Fiframe%3E" data-cke-real-node-type="1" alt="IFrame" title="IFrame" align="" src="http://testsite.com/sites/all/libraries/ckeditor/images/spacer.gif?t=C9A85WF" data-cke-real-element-type="iframe" data-cke-resizable="true">
Which I do not want. I want to make the ckeditor to print exact iframe tag there not the img tag like this.
<iframe src="http://www.lipsum.com/"></iframe>
So that If I want to perform a task in iframe so I can do that inside the editor.
Thank you in advance
Addition 2:
I need the iframe should work in editor itself. It should not convert iframe to img on node add or edit page also.
It should like this
Not like this
Finally, I have to make one line change in ckeditor.js at line number 8194:
return m.createFakeParserElement(p, 'cke_iframe', 'iframe', true);
To
return p;
So it is not creating FakeParser for iframe. And when I put a iframe in edit mode so I see the iframe exactly not the image in place of that.
It is a little hack I used for this functionality.
Thank you Darko for help on this.
Problem solution:
In current newest release of CKEditor (4.5.8) there is a minified file ckeditor.js. In order to have iframe enabled in edit mode you will have to change next line in that file:
return a.createFakeParserElement(b,"cke_iframe","iframe",!0)
into:
return (b)
Due to security reasons that option is by default disabled and this is the way how you can override it.
That is solution for this particular problem. Below are some of possible problem solutions if you have problems with iframe in CKEditor in drupal 7.
Addition:
Go on:
admin/config/content/formats/filtered_html (assuming you use that text format) and add <iframe> in Filter settings (in Allowed HTML tags).
When you post iframe in ckeditor now make sure you don't post it inside any other tag.
ex.:
<p some text <iframe src="http://www.lipsum.com/"></iframe> <br> </p>
that will not work.
<p>some text </p> <iframe src="http://www.lipsum.com/"></iframe>
that will work
Best way is to go on "source" mode in ckeditor and insert iframe there on place you want.
Addition 2:
From your comments i assume you trying all this on online ckeditor? You can't see final result there (node page view) because there is showed only edit view (which is temporary).
Ckeditor converts all your content based on settings (not just basic settings in texts format). For instance ckeditor converts some HTML reserved characters in they entity names or entity numbers because ckeditor itself using HTML to show you preview in edit mode.
ex:
<iframe src="http://www.lipsum.com/"></iframe>
is converted in:
<p><iframe src="http://www.lipsum.com/"></iframe></p>
You can see there that "<" is converted in "<" and ">" is converted in >. Browser need "< >" in source to properly load iframe. So solution is to using "source" option in ckeditor.
So i will repeat once more. Enter text, pictures and all content you need in ckeditor edit mode. When you want to add iframe you go on source mode and put it in content (in that way ckeditor will not convert HTML reserved characters, or maybe some else in your url).
Of course you can edit your iframe there and format size, border, scrolling etc...After saving your content you should see iframe properly loaded. In your case:
Addition 3:
Due to security reasons, to prevent users from breaking site layout and/or to avoid posting invalid HTML that possibility is disabled (like iframe working inside editor). If you are so determent to achieve that you can always go with old modules because in new ones that doesn't work.
In new library there is an option you can try:
admin/config/content/ckeditor
There you can edit Full profile and under ADVANCED CONTENT FILTER you can try disable Advanced content filter. Flush the cache after that. If that not working go with old modules.
Go disable module ckeditor
Install wysiwyg
Install old ckeditor library (just copy old library in /sites/all/libraries )
You need CKEditor 3.3.1 and older
Go on admin/config/content/wysiwyg and select that library
When you do this you should considering all the risks. Hope this post will be helpful for someone else too. Cheers.

How to use PDF open parameter (e.g. fitH) in Chrome/ FireFox browser?

http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf
There are a set of open parameter specify how the viewer should open the pdf . However, with the Chrome and firefox browser's default viewer , it does not work
<object id = 'zoomPage' type='application/pdf' data= '1.pdf#view=fit'><p>The PDF can not display</p></object>
I have tried the fit which I would like the pdf fill the object. If there is no parameter support , are there any workaround ? I tried a lot of approach but none of them work. For example, I also tried using iframe instead of object. However, the content does not resize. Thanks
<iframe src="1.pdf" width=1300 height=3300></iframe>
Searching a solution for a problem very similar to yours, I found an interesting thread on forum.asp.net. http://forums.asp.net/t/1877403.aspx?Issue+with+embedded+pdf+object+in+chrome+browsers
At the end of the page, there is a workaround by a user working smoothly in Chrome. That seems to solve the problem.
Here it is an example:
<iframe src="/Downloads/MyPdfDocument.pdf#view=fitH" width="700" height="880"></iframe>
For users fighting with http://pdfobject.com/ -> "pdfobject.js" like me, you can change few lines of code on both minified and develop version of pdfobject.
Find:
c.innerHTML='<object data="'+a+'" type="application/pdf" width="'+i+'" height="'+z+'"></object>';return c.getElementsByTagName("object")[0];
and change with this line of code:
c.innerHTML='<iframe src="'+a+'" width="'+i+'" height="'+z+'"></iframe>';return c.getElementsByTagName("iframe")[0];
Hope this helps.
This post is quite old, but nowadays you can put #view=fit on the end of an iframe's src URL to make sure the PDF opens a page to fit within the iframe.

mediaelement.js (wordpress 3.2.1 plugin) - video thumbnail appears blank when page loads

I just installed this and it seems to work like a charm except for one thing. When the page displays, the thumbnail is blank. Is there a way I can use the first video frame as the thumbnail display or something like that?
Thanks in advance for any help you can give me.
To have mediaelement.js load a thumbnail you need to ensure that preload is not set to none. For example:
<video src="myvideo.mp4" controls="controls" preload="metadata"></video>
Setting poster="poster.jpg" as per the example in the documentation won't necessarily work (unless you happen to have a file named poster.jpg). Though you can set the poster attribute to the location of an image to use as a thumbnail prior to loading the video, in the event you don't want the user agent to peek inside the media object.
See this answer for more information on the pre-load options - What are the options for the mediaelement player's "preload" setting?
I believe you need to put a poster="poster.jpg" attribute in the <video> tag.

I can't get out of the iframe inside iframe using watir-webdriver

I'm using watir-webdriver to do multi-browser front-end automation test. Here I got a question. When the driver go into the first iframe of the page, it can get out, to find elements outside iframe, but if driver go into the iframe inside one iframe of the page, it can not go out and find the element of the outside page. the structure may look like this:
the main page:
<div>
<iframe src='a.html'></iframe>
</div>
a.html:
<div>
<iframe src='b.html'></iframe>
</div>
when web driver go into the b.html, and find elements in it, it can not get back to the main page.
Is anyone familiar with watir-webdriver can figure this out??
Thanks so much!
To change focus back to main page from an iframe:
#browser.frame(:index, 0).locate

master page images not showing on child pages

This is probably something really simple but I cant see what!
Any images I have in a masterpage aren't showing up in child pages,
all I get is the box with the red cross in it.
I don't think Ive done anything different from usual and it's not something that's
happened in other sites so im kinda scratchin my head with it.
Any ideas are appreciated!
Kevin's got the essence of the problem right - your URL in your master page is likely relative to the location of the master page, and when it's included in the child page, the relative reference isn't correct anymore. The simplest solution for this sort of thing is to have your master page URLs be relative to the site, not the page. In other words, if you've been doing
<img src="images/picture1.gif">
You need to replace that with
<img src="/images/picture1.gif">
or something similar.
in the master page you use the image src similar to the below line and this will work. this same problem solved usig this way.
src="<%= Page.ResolveUrl("~")%>Images/myimage.png"
Did you give the image runat="server" and use a root relative "~/" path to the file?
The URL to your image is incorrect.
Try using absolute paths to your images.
I've had this problem when using a master file with content pages in different subdirectories.
If you use relative paths to your images, thay should be relative to the content page, not the master.
Edit: This is true if you use the img tag to display your images. asp:Image behaves better =)
It definitely sounds like you have a pathing problem. View the source to your rendered page and take a look at where it's trying to load the image from, that should help you fix your path.
If you set the right path then also you are getting the same problem then you can try this will definitely solve your problem:
Use double dots(..) before the starting of url.
If Content pages are located inside subfolders this problem arises. When a content page is rendered the markup is generated afresh for the master page content as well, and the location of an image may render differently as it appears in the master page. The best way is to replace with asp:Image control instead of HTML image tag. Then define the absolute starting with:~/ to actual location of the image. This should solve the problem. Please remove the entire image tag before inserting asp:Image as attributes are different for both.
Good Luck !!.
If you use image<img> tag instead of this, please use "style="background-image: url('/Images/welc.jpg');"in any other tag. This looks like a silly.But it works for me. I was also getting this problem,after using this thereafter I got image at all my child pages.

Resources