The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

iframe using javascript?

View previous topic View next topic Go down

iframe using javascript?

Post by cupcup on November 26th 2014, 3:20 pm

Hello how to make iframe using javascript
how to convert this code to javascript
Code:
<iframe src="http://domain.com"></iframe>

cupcup
Forumember

Posts : 36
Reputation : 1
Language : english

Back to top Go down

Re: iframe using javascript?

Post by _Twisted_Mods_ on November 26th 2014, 3:23 pm

depends what your wanting to do with it

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: iframe using javascript?

Post by cupcup on November 26th 2014, 3:26 pm

i just want to convert this code
Code:
<iframe src="domain.com"></iframe>
to
Code:
<script src="domain.com/iframe.js"></script>
I'm just confused how to write in javascript


Last edited by cupcup on November 26th 2014, 3:40 pm; edited 1 time in total

cupcup
Forumember

Posts : 36
Reputation : 1
Language : english

Back to top Go down

Re: iframe using javascript?

Post by _Twisted_Mods_ on November 26th 2014, 3:33 pm

its already javascript
the url links to the javascript and uses it on your site .. but lets say u took it from another site you would have to include the whole link to the js
in the source code of the site just click the .js link and it will take you to the javascript and you can get the full link in the header of your browser

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: iframe using javascript?

Post by cupcup on November 26th 2014, 3:36 pm

@_Twisted_Mods_ wrote:its already javascript
the url links to the javascript and uses it on your site .. but lets say u took it from another site you would have to include the whole link to the js
in the source code of the site just click the .js link and it will take you to the javascript and you can get the full link in the header of your browser
I have already guessed, you better keep quiet if you can not make coding iframe in javascript :wouhou: :wouhou: :wouhou:

cupcup
Forumember

Posts : 36
Reputation : 1
Language : english

Back to top Go down

Re: iframe using javascript?

Post by _Twisted_Mods_ on November 26th 2014, 4:26 pm

theres many ways u can write it like i said b4 it depends what u want to do with it



Code:
$('somelement').append('<iframe src="domain.com"></iframe>');

str += '<iframe src="domain.com"></iframe>'
document.getElementById("namegen").innerHTML=str;


and being rude to people will get you nowhere in life ..
but enjoy i will no longer try to help you
have a nice day

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: iframe using javascript?

Post by SLGray on November 26th 2014, 6:23 pm

In the future, please try to remember everyone here is trying to help you. There is no need to be rude.

What does the code do?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35630
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Re: iframe using javascript?

Post by cupcup on November 27th 2014, 4:54 pm

sorry
doesn't work

cupcup
Forumember

Posts : 36
Reputation : 1
Language : english

Back to top Go down

Re: iframe using javascript?

Post by SLGray on November 27th 2014, 6:31 pm

Could you please tell us what this code will do?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35630
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

Re: iframe using javascript?

Post by _Twisted_Mods_ on November 27th 2014, 7:48 pm

lucky for you i love to help people but next time your disrespectful your own your own

you can use this code to attach the iframe to and element

places it at bottom of the page
Code:
$('body').append('<iframe width="500px" height="500px" src="/portal"></iframe>');

this code will replace the inner html of the body

Code:



  document.body.innerHTML = '<iframe width="500px" height="500px" src="/portal"></iframe>';

this pretty much does same thing

Code:
var str = '<iframe src="/portal"></iframe>';
  $( "body" ).html(str);

without knowing what your doing with the code or where your placing it i cant give u any more info

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum