When i was playing around with <iframe> I noticed that it only works on specific browsers but if you view the site without the iframe, it works fine on the browser. Why is that happening? Does each browser have their own specifications or something?

I was playing around in a Moodle CMS, if you are wondering

In each instance when you had this problem, did you view the page's source using the browser to make sure the iframe element was actually there?

In what browser(s) did this not work in?

I don't recall checking on the page's source. I will check that though even though i am certain it is there because it shows up in the editor when i try to edit the page.

Also, the iframe was not working on Firefox (both mac and windows) and Internet explorer but the actual site was working.

Is this site accessible from the Internet?

It is but you would be required to be a member of the school using moodle (don't ask how i got it) :(

Member Avatar for LastMitch

When i was playing around with <iframe> I noticed that it only works on specific browsers but if you view the site without the iframe, it works fine on the browser.

@Micheal

Sorry for replying so late.

iframes usually works for all browsers. It's what inside the iframe might not display. What data are you trying to display. It has be appropriate.

@JorgeM

Congratulation for becoming a Moderator! Didn't notice til now. I been away for a while. Keep up the good work, Dani should give you a bonus. Just lecture Micheal.

iframes usually works for all browsers. It's what inside the iframe might not display. What data are you trying to display. It has be appropriate.

I am trying to display a webpage, the problem is that the webpage displays properly by itself on all browsers but doesn't display on most browsers when i use iframe.

Dani should give you a bonus. Just lecture Micheal.

... (facepalm)

Member Avatar for LastMitch

I am trying to display a webpage, the problem is that the webpage displays properly by itself on all browsers but doesn't display on most browsers when i use iframe.

can you post the code of how your iframe pop up? It should be in javascript.

... (facepalm)

I'm pretty out of date. What is a facepalm? I'm getting old.

I'm pretty out of date. What is a facepalm? I'm getting old.

Basically it is just your palm to your face... kinda like this: http://www.taylorclark.co/wp-content/uploads/2013/04/picard.jpg :D

can you post the code of how your iframe pop up? It should be in javascript.

All i did was this:

<iframe src="http://mywebsite.com/" width="100%" height="745"></iframe>

Also, i was using a cms called moodle (don't ask how i got it ;)), could the cms have anything to do with the problem?

Member Avatar for LastMitch

Basically it is just your palm to your face... kinda like this: http://www.taylorclark.co/wp-content/uploads/2013/04/picard.jpg :D

Thanks now I get it!

Try to add this your webpage:

<a href="javascript: openwindow()"><u>iframe</u></a>

This is your javascript:

<script type="text/javascript">
function openwindow(){
    window.open("http://mywebsite.com/iframe", "mywindow", "location=0,status=0,scrollbars=1,width=445,height=425");
} 
</script>

when you click on the iframe link, that will display the location of the iframe from the using that javascript. Then will display the data from the iframe.

Does that make sense?

I have to go now.

Oh ok, i see now. One last question, should i apply that snippet to my webpage (index.php) or to the cms (moodle editor) i am using to display the page?

Ok... i tried testing the code, so far it isn't working successfully :( It doesn't do anything. Am i missing something?

Member Avatar for LastMitch

Ok... i tried testing the code, so far it isn't working successfully :( It doesn't do anything. Am i missing something?

My bad. Sorry about that. I forgot to add the extension in the javascript. The file should be iframe.html. You have to put the iframe.html either in a folder on your server or just put it where you can link it.

<a href="javascript: openwindow()"><u>iframe</u></a>

This is your javascript:

<script type="text/javascript">
function openwindow(){
window.open("http://mywebsite.com/iframe.html", "mywindow", "location=0,status=0,scrollbars=1,width=445,height=425");
}
</script>

Does that make sense?

i am playing around with the snippet and i still don't see any success. what did i forget to do?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.