Beste,

ik wil graag een klein stukje website op een andere website plaatsen. Het is een fixed stukje website, en wil dus met een paar regels kunnen plaatsen. hoe werkt iframe precies, en hoe kan mijn website daarin doen?

mvg jeremy
<iframe src="http://www.MIJNDOMEIN.nl/test1/scripts/main.js"; sandbox="allow-scripts"></iframe>
<iframe src="http://www.MIJNDOMEIN.nl/test1/index.php"; height="100%" frameborder="0" width="100%"></iframe>

Dat heb ik nu. En nu is het de bedoeling dat index.php gewoon de main.js kan uitlezen als het gevragen wordt.

[size=xsmall]Toevoeging op 03/06/2013 16:19:43:[/size]

Kris, het is wel de bedoeling dat bijvoorbeeld jij op je website, mijn iframe kan gaan gebruiken. Javascript zoals bijvoorbeeld kleine hovers etc.
Geef eens een specifiek voorbeeld van wat er in main.js moet gebeuren.

Dit bijvoorbeeld:


  $('#social').click(function(){ 
       if($('#popupSocial').is(':visible')) {
           $('#popupSocial').hide();
       }else{
           checkVisibleForSocial();
           $('#popupSocial').show();
       }        
    });
Onthoud wel dat de sandbox in Opera en < IE9 niet werkt.
Prima, maar ik wil graag weten hoe ik het wel kan doen bijvoorbeeld in chrome
Ik vermoed dat het niet kan, of je zult met cURL in PHP het iFrame-systeem moeten nabootsen.
en hoe zit het dan met deze website?
// Create iframe
  if (!document.getElementById('_BH_frame') && bhNotInParent === false) {
    // Inject the CSS
    var c = document.createElement('link');
    c.type = "text/css";
    c.rel = "stylesheet";
    c.href = bh.guiCSS;
    c.id = "_BH_CSS";
    head.appendChild(c);

    var iframe = document.createElement('iframe');

    // Create our bugherd container iframe
    iframe.setAttribute("style","display:block !important;border:0 !important;overflow:hidden" +
      "!important;position:absolute !important;right:0px !important;position:fixed !important;top:0px" +
      "!important;overflow:hidden !important;width:0%;background-color:transparent !important;");

    iframe.setAttribute('frameBorder', '0');
    iframe.setAttribute('border', '0');
    iframe.setAttribute('allowTransparency', 'true');
    iframe.setAttribute('id', '_BH_frame');
    iframe.setAttribute('name', '_BH_frame');
    iframe.setAttribute('scrolling', 'no');

    document.body.appendChild(iframe);

    // Apply
    bh.iframe = iframe;
    bh.win = iframe.contentWindow;
    bh.doc = bh.win.document;
    bh.doc.open().write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' +
      '<html><head><title>BugHerd Sidebar</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300" rel="stylesheet" type="text/css"></head><body onload="parent.window._bugHerd.loaded()">' +
      bh.data.h + '</body></html>');

    bh.doc.close();
    // Avoid webkit bug which scrolls infinite to the top margin of the iframe
    bh.win.scroll(0,0);
Heeft iemand misschien het idee hoe ik het kan werkend maken inclusief javascript?

Reageren