The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    iframe using javascript?

    avatar
    cupcup
    Forumember


    Posts : 36
    Reputation : 1
    Language : english

    iframe using javascript? Empty iframe using javascript?

    Post by cupcup 26/11/2014, 21:20

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


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    iframe using javascript? Empty Re: iframe using javascript?

    Post by _Twisted_Mods_ 26/11/2014, 21:23

    depends what your wanting to do with it
    avatar
    cupcup
    Forumember


    Posts : 36
    Reputation : 1
    Language : english

    iframe using javascript? Empty Re: iframe using javascript?

    Post by cupcup 26/11/2014, 21:26

    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 26/11/2014, 21:40; edited 1 time in total
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    iframe using javascript? Empty Re: iframe using javascript?

    Post by _Twisted_Mods_ 26/11/2014, 21:33

    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
    avatar
    cupcup
    Forumember


    Posts : 36
    Reputation : 1
    Language : english

    iframe using javascript? Empty Re: iframe using javascript?

    Post by cupcup 26/11/2014, 21:36

    _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:
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    iframe using javascript? Empty Re: iframe using javascript?

    Post by _Twisted_Mods_ 26/11/2014, 22:26

    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
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    iframe using javascript? Empty Re: iframe using javascript?

    Post by SLGray 27/11/2014, 00:23

    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?



    iframe using javascript? Slgray10

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


    Posts : 36
    Reputation : 1
    Language : english

    iframe using javascript? Empty Re: iframe using javascript?

    Post by cupcup 27/11/2014, 22:54

    sorry
    doesn't work
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    iframe using javascript? Empty Re: iframe using javascript?

    Post by SLGray 28/11/2014, 00:31

    Could you please tell us what this code will do?



    iframe using javascript? Slgray10

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


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    iframe using javascript? Empty Re: iframe using javascript?

    Post by _Twisted_Mods_ 28/11/2014, 01:48

    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

      Current date/time is 23/9/2024, 02:14