/    Sign up×
Community /Pin to ProfileBookmark

Help! splicing plugin for second function.

I have a iLayer plugin that is calling a remote text file/stripped html file into a local iLayer
on my webpage right now, I’m trying to splice it to include a second call for another remote
file under a different function (functions intersect and crash each other now if I use the same
function name on two different parts of the page). I ran into a block when if v=1 post data,
since v is already taken I need something different for it to post a positive integer to for
this.has.data.and.will.post, take a look, tell me what you think. Thanks guys!

Origional Plugin:

[code]
var srcFrame;

$(document).ready(function(){
loadOuter(‘layers/main.html’); // …
});

//External content into a layer
function loadOuter(doc) {
srcFrame = document.getElementById(“hiddenContent”);
srcFrame.src = doc;

// workaround for missing onLoad event in IFRAME for NN6
if (!srcFrame.onload) {
setTimeout(“transferHTML()”, 200)
}
}

function transferHTML(){
srcContent=”;
if (srcFrame.contentDocument){
srcContent=srcFrame.contentDocument.getElementsByTagName(“*”)[0].innerHTML;
}
else if (srcFrame.contentWindow){
srcContent=srcFrame.contentWindow.document.body.innerHTML;
}
document.getElementById(“outerDisplay”).innerHTML = srcContent
}

var DocAry=new Array(”);

function SelectList(v){
if (v>0){
loadOuter(DocAry[v-1]);
}

}

[/code]

Code till I hit my road-block:

[code]
var srcFrame;

$(document).ready(function(){
loadOuter(‘layers/main.html’); // …
loadInner(‘layers/space.html’);
});

//External content into a layer
function loadOuter(doc) {
srcFrame = document.getElementById(“loadContent”);
srcFrame.src = doc;

// workaround for missing onLoad event in IFRAME for NN6
if (!srcFrame.onload) {
setTimeout(“xferOuter()”, 200)
}
}

//External content into a layer
function loadInner(doc) {
srcFrame = document.getElementById(“prodContent”);
srcFrame.src = doc;

// workaround for missing onLoad event in IFRAME for NN6
if (!srcFrame.onload) {
setTimeout(“xferInner()”, 200)
}
}

function xferOuter(){
srcContent=”;
if (srcFrame.contentDocument){
srcContent=srcFrame.contentDocument.getElementsByTagName(“*”)[0].innerHTML;
}
else if (srcFrame.contentWindow){
srcContent=srcFrame.contentWindow.document.body.innerHTML;
}
document.getElementById(“outerDisplay”).innerHTML = srcContent
}

function xferInner(){
srcContent=”;
if (srcFrame.contentDocument){
srcContent=srcFrame.contentDocument.getElementsByTagName(“*”)[0].innerHTML;
}
else if (srcFrame.contentWindow){
srcContent=srcFrame.contentWindow.document.body.innerHTML;
}
document.getElementById(“prodDisplay”).innerHTML = srcContent
}

var outAry=new Array(”);
var innAry=new Array(”);

function SelectList(v){
if (v>0){
loadOuter(outAry[v-1]);
}
else if ()

}

function SelectList(v){
if (v>0){
loadInner(outAry[v-1]);
}
else if ()

}

[/code]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @ehime spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...