Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pass Information from one frame to another ...

    Can someone tell me how to pass event/info/whatever from one frame to another?

    function onclickthing(node)
    {
    document.writeln(node.nodeName NAME:NextFrame)
    }
    that dun seen to work....

    Thanks

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Can you provide enough information of your problem?

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry about that, i was doing the treetable using for loop. after i finish i realise i dunno how to pass the data from one frame(the treetable) to another frame(the frame beside it) . So the site will have two frames one beside another...

    here my part of my treetable(when i onClick i call this function), abit messy....


    function toogle_state(nodeCounter) // this toogle the state
    {
    var location = nodeCounter.sourceIndex // locate the location of the nodeCounter
    var locationIMG = document.all[location + 1] //this locate the IMG tag for this
    var nextDivLocation = document.all[location+2] // location the DIV
    if (nextDivLocation.style.display =="")
    {
    nextDivLocation.style.display = "none"
    locationIMG.src = "plus.gif";
    }
    else
    {
    nextDivLocation.style.display = ""
    locationIMG.src = "minus.gif";
    }
    }

    heres my Index

    <HTML>
    <HEAD>
    <title>Window explorer Copy cat</title>
    <FORM NAME="Index">
    </FORM>
    <FRAMESET rows = "10%,*">
    <FRAME SRC="treementtop.html" NAME="topthingy">
    <FRAMESET cols = "*,80%" >
    <FRAME SRC="finaltree.html" NAME="finaltree">
    <FRAME SRC="sidethingy.html" NAME="sidethingy">
    </frameset>
    </frameset>
    </head>
    </HTML>

    i still lack the skill to pass data/infor/whatever u all call it to another frame...

  • #4
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry for the double post, forget to say that when i onclick i should pass the nodeCounter.data to the other frame... thanks for helping

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Is the code you posted located in finaltree.html (finaltree frame)? And you want to pass the data to the sidethingy.html (sidethingy frame)?

    parent.frames['sidethingy'].document.getElementById("theId").innerHTML=nodeCounter.data;

    sidethingy.html should have a tag with id theId

    <div id="theId"></div>

    Hope this is what you want.

  • #6
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the code doesnt work.... even after i change the getElement's'ById ... it said "Object doesnt support this property or method"

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Can you post the codes?

  • #8
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I had added the <div id="theid"></Div> into the sidethingy.html


    <html>
    <head>
    <script language ="JAVASCRIPT">
    var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.load("note.xml");
    var strContent =""
    var transfernode =""

    function TestChildren(nodes) // write the first layer out
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");
    document.writeln("<A onClick='javaScript:toogle_state(this)'><font color= red><IMG SRC='minus.gif'>"+ nodes.nodeName +"</font></A>");
    if (nodes.hasChildNodes)
    {
    document.writeln("<DIV>")

    for (var i=0; i < nodes.childNodes.length; i++) // write second layer out then pass the third layer to the writechildren() funtion
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");

    if (nodes.childNodes(i).hasChildNodes) // add toogle in
    {
    document.writeln("<font color= red><A onClick='javaScript:toogle_state(this)'><IMG SRC='minus.gif'>"+nodes.childNodes(i).nodeName +"</A></font>");
    writechildren(nodes.childNodes(i))
    }
    else

    {
    document.writeln(nodes.childNodes(i).nodeName);
    }

    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    document.writeln("</DIV>")
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }


    function toogle_state(nodeCounter) // this toogle the state and pass info to the sideView.html side
    {
    var location = nodeCounter.sourceIndex // locate the location of the nodeCounter
    var locationIMG = document.all[location + 1] //this locate the IMG tag for this
    var nextDivLocation = document.all[location+2] // location the DIV
    if (nextDivLocation.style.display =="")
    {
    nextDivLocation.style.display = "none"
    locationIMG.src = "plus.gif";

    parent.frames['sidethingy'].document.getElementsById("theId").innerHTML=nextDivLocation.innerText;
    }
    else
    {
    nextDivLocation.style.display = ""
    locationIMG.src = "minus.gif";
    }
    }


    function writechildren(sianz)
    {
    if (sianz.hasChildNodes)
    {
    document.writeln("<DIV>")
    for (var i=0; i < sianz.childNodes.length; i++) // check the length of the childNOdes
    {
    document.writeln("<table border = 1>");
    document.writeln("<tr>");
    document.writeln("<td>");

    if (sianz.childNodes(i).hasChildNodes) // add toogle in
    {

    if (sianz.childNodes(i).nodeName == "#text")
    {
    document.writeln("<font color= red><A onClick='javaScript:toogle_state(this)'><IMG SRC='minus.gif'>"+ sianz.childNodes(i).text + "</A></font>");
    writechildren(sianz.childNodes(i)) // if this layer got children then pass up so this layer of children can be written
    }
    else
    {
    document.writeln("<font color= red><A onClick='javaScript:toogle_state(this)'><IMG SRC='minus.gif'> "+ sianz.childNodes(i).nodeName + "</A></font>");
    writechildren(sianz.childNodes(i))
    }

    }
    else
    {
    if (sianz.childNodes(i).nodeName == "#text") // no children come here
    {
    document.writeln(sianz.childNodes(i).text);
    writechildren(sianz.childNodes(i))
    }
    else
    {
    document.writeln(sianz.childNodes(i).nodeName);
    writechildren(sianz.childNodes(i))
    }
    }
    document.writeln("</td>");
    document.writeln("</tr>");
    document.writeln("</table>");
    }
    document.writeln("</DIV>")
    }

    }

    function callReadXml()
    {
    root = xmlDoc.documentElement;
    TestChildren(root);
    }

    </script>
    </head>
    <body>
    <script type="text/javascript">
    callReadXml();
    </script>

    </body>
    </html>

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Quote Originally Posted by guowei1000
    parent.frames['sidethingy'].document.getElementsById("theId").innerHTML=nextDivLocation.innerText;
    I didn't put an s in document.getElementById.

  • #10
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey! it work! must be working with getElementsByName too much :P thanks!!

  • #11
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Now i'm able to pass the data to the other frame.... can i control it? like how it display?how do i pass the data to a valuable? i cant see to find the tutorial for this.. then very ambarrassing to keep asking....

  • #12
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts

    Css

    <div id="theid" style="font:normal 12px Verdana;color:blue;"></div>

    or

    <head>
    <style type="text/css">
    div#theid {
    font:normal 12px Verdana;
    color:blue;
    }
    </style>
    </head>
    ...
    <div id="theid"></div>

    Is that what you were asking for?

  • #13
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    arh can u explain the code? try to search for help but nothing come up...

  • #14
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Learn CSS here.

  • #15
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks ! finally find something i can use


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •