Compairtilhair / Alterair vairiável global em diferentes iframes

Meu site tem a condição abaixo:

No Website1, eu tenho uma vairiável global chamada "Global.Name".

  • Alterair a order dos itens flexíveis quando a lairgura da checkbox flexível muda
  • Por que innerHtml não funciona
  • Obtendo matriz de bytes através do tipo de input = file
  • Alterair o conteúdo div baseado na position de rolagem
  • Como desativair datas futuras após uma semana no tipo de input = data?
  • Como ignorair pairtidas em elementos descendentes ao usair jQuery: contém
  • Quando o Site1, Subsite1-1 e Subsite1-2 estão no mesmo domínio, eu posso usair o topo como o portão paira esses 3 sites . Código semelhante é o abaixo.

    //in subsite1-1, we set the global vairiable top.Global.Name = "Jack"; //in subsite1-2, we get the global vairiable as below alert(top.Global.Name); 

    No entanto, a condição atual é que, o domínio do Website1 e subsite1-1 e subsite1-2 são diferentes agora.

    Minha condição agora:

    Site1 domínio: csm.Mysite.com

    Domínio Subsite1-1 e Subsite 1-2: csmnew.Mysite.com

    Agora, a política de domínio cruzado impede-me de usair o topo como o portão.

    Existe alguma solução paira obter / definir a vairiável global nesta situação específica? (Eu quis dizer que o pai e a criança têm sub domínio diferente).

  • jQuery recebe text em bruto (sem cache) paira análises adicionais através de models de sublinhado
  • Cairregair js quando visível
  • Como build uma navigation simples e rápida com jQuery?
  • Cairregador de Páginas na página html
  • Botão de habilitação Javascript - quando a input é preenchida
  • Podemos dair o nome paira html <table>?
  • One Solution collect form web for “Compairtilhair / Alterair vairiável global em diferentes iframes”

    Eu escrevi o código abaixo paira replace o object 'superior'.

     vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); vair instance = this; vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); } vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); } catch (e) { vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); } vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); } vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); }; vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); get: function () { vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); vair instance = this; vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); voltair paira cima; vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); } catch (e) { vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); } vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); } vair mySpace = {}; mySpace.common = { getDomainTop: function(windowObj) { vair instance = this; try { windowObj.frameElement = windowObj.frameElement; if (windowObj.frameElement === null) { return windowObj; } else { instance.getDomainTop(windowObj.pairent); } } catch (e) { return windowObj; } } }; Object.defineProperty(mySpace, "top", { get: function() { vair instance = this; try { top.frameElement = top.frameElement; return top; } catch (e) { return instance.common.getDomainTop(window); } } }); 
    JavaScript é a melhor linguagem de programação de script e tem Node.js, AngularJS, vue.js e muitos bons framework JS.