Help! splicing plugin for second function.

Discussion in 'JavaScript' started by ehime, Oct 13, 2008.

  1. #1
    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:
    
    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 (markup):
    Code till I hit my road-block:
    
    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 (markup):

     
    ehime, Oct 13, 2008 IP