I am trying to create a family tree, parents / grandparents etc, of a single person... My database etc is already working but I cannot find any working examples that I can make sense of... Each of my records has a name, dob and id of each parent.... How can I get X generations from this.. I thought something like this might work.. GetParents For each parent GetParents And so on... But I have no idea how to put this into code...
I've seen dozens of scripts, some in javascript, some in php, that will allow you to do one or the other. Has anyone run across a script that has three buttons/images/links that will let you increase the font size, decrease the font size and switch font families? Either JS or php will suffice.
When I send a form from html to a function in javascript via a button I want to write the values of the html form on the screen. I do so by using the document.write() in javascript. This removes the page with the html form (input boxes etc) and then the only thing displayed is the stuff written by javascript. And the font family I had in the html part is now gone! Only problem is that I want to change the font family (like Times New Roman, Arial Black etc). I have very many document.write()'s, so would be swell if there were something that made me change the entire script's font family!
I am trying to program a script that will output the solution for the towers of hanoi problem, the only problem is that it will not output the solution it just hangs while calculating. Code:
I am having a problem finding the syntax for recursively adding images to a webpage using javascript. I have some pseudo code but no js.
already in a folder function 1 for each file in folder add file to webpage next folder function2 function2 for each folder within folder call function 1
I know the code isn't all that clear, but that's the best way I can describe it.
I am having trouble with a recursive function I created to list out the indexes and values of various nested objects. var macros={ CTRL: { ALT: { ENTER: "<br />", P: "<p>.</p>", A: "<a href="">.</a>", _1: "<h1>.</h1>", _2: "<h2>.</h2>", _3: "<h3>.</h3>", _4: "<h4>.</h4>", _5: "<h5>.</h5>", _6: "<h6>.</h6>" }}};
I want to print out the whole 'bread crumb trail' to each object, ie CTRL ALT 6: <h6>.</h6>, but at the moment my function prints out CTRL ALT twice for 'ENTER' and then never again. The function: function printObj(obj) { for(i in obj) { var n=i.replace("_", ""); document.write(n); if(typeof obj[i]=="string") { document.write(":"); document.write(" "+obj[i].replace(/</g, "<").replace(/>/g, ">")); } else { document.write(n); } if(typeof obj[i]=="object") printObj(obj[i]); document.write(" "); }} printObj(macros);
I am using the module pattern and private/public methods. I'm having a problem where the private method is using setTimeout() to call itself recursively, but I can't get the syntax right. Code:
I have this script. It's supposed to give the Fibonacci numbers but the recursion won't work. It just prints out 1 number that the user entered and that's it. In IE6 it prints 1 number but in Firefox it prints the same number an infinite number of times. Whats going on? Here is the script:
<html> <head> <script language = "javascript">
function fib(form) { var fibVar = Number(document.myform.inputbox.value); document.write(fibVar);
On my webpage, I dynamically create an iFrame when a button is pressed, then load a html page from within my own domain into the iframe, based on what html page is loaded into a variable. My question is, can I dynamically change the font family of the loaded html page from the javascript of the main page? My code to create the iframe is:
function setSubTxt(){ var par = document.getElementById('parentDiv'); par.innerHTML = '<iframe src="'+subTxt+'" style="width: 375px; position: fixed; height: 365px; left: 400px; top: 145px; border=none;" name="subIframe" frameBorder=0></iframe>'; frames['subIframe'].window.location=subTxt; document.subIframe.document.body.style.fontFamily = "Arial"; [Code]....
the variable "subTxt" has the url of the html page to be loaded (always on the same domain). The code: document.subIframe.document.body.style.fontFamily = "Arial"; was my attempt to dynamically change the font, but it didn't work. Also, it should be noted that there is no font family set in the html pages which would override this.
I am using jQuery form plugin to submit my form. It has a file element and when where I am submitting it I am getting "too much recursion" in Firefox. It looks fine in IE 8. It works fine if I submit the form without selecting any file.
What does it mean to "walk the DOM tree"? How do you use it?
I hear programmers using this term loosely and I'm not sure what it means. I understand that DOM means Document Object Module and that they are referencing the additional elements whithin (X)HTML.
I've got a bit of ajax code that loads some content into a div. What I want to do is alter the href and action of all links and forms loaded into the div.
I thought the cleanest way to do this would have been to recursively look at all the child nodes of the div, and alter the href/action of any link or form elements that I encounter, is this do-able?
I need to remove the element with the class "group" on it from the DOM tree with javascript (eventually with prototype, but no other library). I don't only want to hide that paragraph, but remove it entirely from the DOM tree. My solution to use getElementsByClassName does not work.
function hidegroup() { var group= document.getElementsByTagName("p") .getElementsByClassName("group"); group.style.display = 'none'; group.removeChild(); }
THE HTML: <div id="poems"> <div class="poem" id="d1"> <p class="group"> <a href="#">To the top of the page</a> </p></div>
I'm currently moddifying a simple menu tree script, into a way of showing more info, when clicking a headline. It is beginning to work allmost a i want i to, but when i use my own stylesheet, the area of the menutree is shown as a table.
I have the following XML: Code: <root> <MemberProvider name="myName"> <Marker> <Latitude>-32.025469</Latitude> <Longitude>115.950136</Longitude> <Name>Beacon Lighting</Name> <Address>219 21 William Street, Cannington WA 6107</Address> <Phone>08 9356 6422</Phone> <savingText>Members get 10 off RRP</savingText> <disclaimer>Also save 10 off grid connected solar power systems</disclaimer> </Marker> ......
Now in my Javascript, I have Code: var xmlrows = xmlDoc.documentElement.getElementsByTagName("Marker"); var xmlGroups = xmlDoc.documentElement.getElementsByTagName("MemberProvider"); //for the number of Member Providers listed for (var i = 0; i < xmlrows.length; i++) { var xmlrow = xmlrows[i]; var singleGroup = xmlGroups[i]; var xmlcellLongitude = xmlrow.getElementsByTagName("Longitude")[0]; var xmlcellLatitude = xmlrow.getElementsByTagName("Latitude")[0]; var point = new GLatLng(parseFloat(xmlcellLatitude.firstChild.data), parseFloat(xmlcellLongitude.firstChild.data)); //get the name var name = singleGroup.getElementsByTagName("MemberProvider")[0].getAttribute("name");
Why do I have two variables loading the xml doc? The first appears to work, but the second (xmlGroups) does not. Every time I try and get the Name attribute from the MemberProvider node, it throws getElementsByTagName("MemberProvider")[0].getAttribute("name"); is null or not an object.
I desperately need to create a tree menu to function similar to http://support.novell.com (grey menu on the left). I am working on the largest web project of my career and the programming is a little over my head to a relatively new designer...so any help or suggestions would be great. I tried their code to see if I could make it do anything but nothing helps....I'd love any help and would certainly give you proper credit. If you want, you can email me at: wentworth499@msn.com
Note: Does anyone know how it's done in Dw...or some way to copy code and paste in to DW to test it to see if it works...everything I've tried will not work in DW.
Does anyone know of a publicly available drag & drop tree script? Google only turned up a bunch of nice tree scripts, but none of them have drag & drop functionality.
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels.
I developed static HTML tree using http://www.treeview.net. now i need to generate this tree dynamically.