HTML Help
HTML Help Central . com

» Online Users: 107

0 members and 107 guests
No Members online
Most users ever online was 695, 02-16-2011 at 07:01 AM.

» Site Navigation

 > FAQ

» Domains For Sale

Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2001
    Location
    Arizona
    Posts
    39

    Load an element from an I-frame

    I am having issues with getting a parameter to work...

    I have the I-frame loading text/titles/quantities, but would like to use it to load the element src. Trouble is, Id of "<p>" doesn't cross over after the load except for the the text... the only thing I can really think of is to have the text load in same color as background and then move it to the src... yet, I don't really want that on the page.


    Anyone got any ideas?

  2. #2
    Join Date
    Sep 2007
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    369
    Hi there Mach_Destroyer,

    Anyone got any ideas?
    Well, for starters, nothing that you have written
    above that question makes any sense at all.

    Perhaps a link to the site that contains the
    "iframe element" could help us to make sense.
    http://www.htmlhelpcentral.com/messageboard/image.php?type=sigpic&userid=8698&dateline=1189772  724

  3. #3
    Join Date
    Jan 2001
    Location
    Arizona
    Posts
    39
    Quote Originally Posted by coothead View Post
    Hi there Mach_Destroyer,


    Well, for starters, nothing that you have written
    above that question makes any sense at all.

    Perhaps a link to the site that contains the
    "iframe element" could help us to make sense.

    oh. I am kind of erratic sometimes. website is kind of a bit complex for posting...

    http://www.luckylynchwebsitez.com

    Code:
    <iframe id="j7o" src="inventory1.html" style="height:0px;width:0px;"></iframe>
    Code:
    <script>
    function inventory1a() {
    	document.getElementById("desc4").innerHTML = ("");
    	document.getElementById("desc2").innerHTML = ("");
    	document.getElementById("desc5").innerHTML = ("");
        var frame9 = document.getElementsByTagName("IFRAME")[0]
        var dessC9 = frame9.contentWindow.document.getElementById("BA1");
        var destC9 = document.importNode(dessC9, true);
    	document.getElementById("desc4").innerHTML = ("We Have:");
    	document.getElementById("desc2").appendChild(destC9);
    	document.getElementById("desc5").innerHTML = ("left in stock");}
    </script>
    
    <script>
    function inventory1b() {
        document.getElementById("desc3").innerHTML = ("");
        var frame9 = document.getElementsByTagName("IFRAME")[0]
    	var dessD9 = frame9.contentWindow.document.getElementById("BB1");
        var destD9 = document.importNode(dessD9, true);
    	document.getElementById("desc3").appendChild(destD9);}
    </script>
    
    <script>
    function inventory1c() {
        document.getElementById("ttl1").innerHTML = ("");
        var frame9 = document.getElementsByTagName("IFRAME")[0]
    	var dessE9 = frame9.contentWindow.document.getElementById("BC1");
        var destE9 = document.importNode(dessE9, true);
    	document.getElementById("ttl1").appendChild(destE9);}
    </script>
    I wanted to load the source of pictures as well... the "ID" loads text from iframe of "inventory1.html" into paragraph on event. The reason there is "" loading is to correct paragraph places is done to clear previous events...

    I hope this is a bit clearer: I already have image switching in place on event. but I want to load in the source of the file name to switch to from the "inventory1.html".



    Code:
    <td align="center" width="620"><table align="center"><tr height="100"><td align="center">
    <img src="scifi2.jpg" name="SciImg" width="200" id="SciImg">
    <br>
    <img id="tmbA" src="" width="30" height="30">
    <img id="tmbB" src="" width="30" height="30">
    <img id="tmbC" src="" width="30" height="30">
    <img id="tmbD" src="" width="30" height="30">
    </td>
    Page loads category image as larger image, and on event loads smaller image... I have them linked of course to change larger image.

    Code:
    <script>
    
    function chngsrc1() {
        document.getElementById("tmbA").onclick = chngsrcA1;
    	function chngsrcA1(){
    	document.getElementById("SciImg").src = '1bop-1.jpg';};
    	document.getElementById("tmbB").onclick = chngsrcB1;
    	function chngsrcB1(){
    	document.getElementById("SciImg").src = '1bop-2.jpg';};
    		document.getElementById("tmbC").onclick = chngsrcC1;
    	function chngsrcC1(){
    	document.getElementById("SciImg").src = '1bop-3.jpg';};
    	document.getElementById("tmbD").onclick = chngsrcD1;
    	function chngsrcD1(){
    	document.getElementById("SciImg").src = '1bop-4.jpg';};
    }
    </script>

    Example of button event "onclick":

    Code:
    <button id="Btn1" onClick="document.getElementById('SciImg').src='1bop-1.jpg', inventory1a(), inventory1b(), inventory1c(), document.getElementById('tmbA').src='1bop-1.jpg', document.getElementById('tmbB').src='1bop-2.jpg', document.getElementById('tmbC').src='1bop-3.jpg', document.getElementById('tmbD').src='1bop-4.jpg', +chngsrc1()">Item 1</button>



    the thought was that these(src) could be altered from text associated with another html file. First changing them to variables in place of the highlighted src's I specified on page event. then, using the like variable method I use currently use to alter the text from the iframe file, the pictures would be altered from file by source.

    Yet, this import node and then appended returns an error to anything but text ("paragraphs") with "id" elements matching... although textareas/forms may import... the image element "src" is what I to change to match text in paragraphs (<p>)file in iframe.

    FYI: These images also have events attributed on click of smaller image...putting them in the place of the larger image denoted in the same section of the yellow highlighted source... I would desire to alter both yellow and pink drawing from file... so either is good refrence
    Last edited by Mach_Destroyer; 12-27-2015 at 03:47 PM. Reason: clarify add highlight

Similar Threads

  1. Accessing a form element in another frame.
    By izacktheyak in forum Javascript / AJAX / VBScript
    Replies: 8
    Last Post: 04-11-2008, 11:25 PM
  2. Google Maps load info box on page load
    By stongest in forum Javascript / AJAX / VBScript
    Replies: 1
    Last Post: 08-03-2007, 04:42 PM
  3. On Load, load HTML in another frame
    By JerryRowe in forum HTML / XHTML / XML
    Replies: 8
    Last Post: 11-07-2003, 08:21 AM
  4. If an image fails to load, my menu won’t load, any suggestions?
    By canada_dry in forum Javascript / AJAX / VBScript
    Replies: 2
    Last Post: 04-22-2003, 12:05 PM
  5. how can i unload and load a movie in another frame?
    By hemal in forum Flash / Multimedia
    Replies: 6
    Last Post: 06-04-2002, 01:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1