1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can we add a script code in an iframe?

Discussion in 'Web Design' started by Arpit malhotra, Jul 2, 2017.

Tags:
  1. Arpit malhotra

    Arpit malhotra BANNED BANNED

    Joined:
    Sep 28, 2016
    Messages:
    163
    Likes Received:
    21
    Gender:
    Male
    The title says it all ;-)
     
  2. dub28

    dub28 Regular Member

    Joined:
    Sep 23, 2012
    Messages:
    209
    Likes Received:
    45
    With no info I just can respond by : Yes.
     
  3. Arpit malhotra

    Arpit malhotra BANNED BANNED

    Joined:
    Sep 28, 2016
    Messages:
    163
    Likes Received:
    21
    Gender:
    Male
    basically i want to run my ad code in the iframe to speed up the site load speed. Will it work?
     
  4. Sophie

    Sophie Jr. VIP Jr. VIP

    Joined:
    Mar 5, 2009
    Messages:
    2,073
    Likes Received:
    3,609
    Gender:
    Female
    Occupation:
       девушка
    I may be wrong but..

    You could create a blank html or php file and embed the ad code. Set body margins to 0.

    Then iframe that html or php file.
     
  5. Arpit malhotra

    Arpit malhotra BANNED BANNED

    Joined:
    Sep 28, 2016
    Messages:
    163
    Likes Received:
    21
    Gender:
    Male
    Will that count the ad impression?
     
  6. Sophie

    Sophie Jr. VIP Jr. VIP

    Joined:
    Mar 5, 2009
    Messages:
    2,073
    Likes Received:
    3,609
    Gender:
    Female
    Occupation:
       девушка
    It should... Give it a try and confirm with us :p
     
  7. Arpit malhotra

    Arpit malhotra BANNED BANNED

    Joined:
    Sep 28, 2016
    Messages:
    163
    Likes Received:
    21
    Gender:
    Male
    Sure ;)
     
  8. dub28

    dub28 Regular Member

    Joined:
    Sep 23, 2012
    Messages:
    209
    Likes Received:
    45
    How this will speed up the site ?
    Are you sure you can do that ? Many Ads networks don't allow an ads in a inframe. Be carefull and ask them.
     
  9. RightFootFanatic

    RightFootFanatic Regular Member

    Joined:
    May 31, 2015
    Messages:
    321
    Likes Received:
    180
    Occupation:
    DevOps
    Location:
    Whimsyshire
    you could asynchronously load that script snippet on document ready. will be much cleaner
     
  10. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    3,411
    Likes Received:
    3,057
    Gender:
    Male
    You can, if the iframe is in the same domain. You can't, if the iframe is not on the same domain. Depends.