Jump to content

george

Members
  • Posts

    377
  • Joined

  • Last visited

Everything posted by george

  1. I have some jQuery code thar works just fine: $("a div").hover(function(){var token = $(this).attr('id');alert(token);} my alert(token) gives me just what I want it to. My problem is that I want to combine the variable 'token' with a litteral selector, where the selector is a P element with an ID of token. Then to further complicate my lfe, I want to access not the selector with the ID of token, but it's direct child, which is a <pre element with a class of green. So, I tried : $("p#"+token+" > pre.green").show(); since that is what I want to show. But nothing shows. Is my selector valid? And if not, how can I make it valid. TIA <- someday I will have a job, and will be able to donate to w3school's forum.
  2. How can I save a little PHP code to $Tom, and then evaluate $Tom and save that to a variable as attempted below:? $Tom = "echo 'blah'"eval($Tom); When I try and use eval here, I get the following error: Parse error: syntax error, unexpected $end, expecting ',' or ';' Worse still, I want to save the result of eval to an array element. as for saving the value to an array, I tried $bob = eval($Tom);and array_push($myarray, $varone, "'".eval($Tom)."'") Didn't work. I am very frustrated with eval. How can I do what I am trying to do? That is, save the result of eval to an array element? I did a search on eval, and got a lot of suggestions and saw lots of requests for a replacement function, but the suggestions were what I have seen before, and did not know how to apply, and the requests for a replacement function went unanswered. Thanks You guys are great.
  3. Bingo, that did it! Thank you so much!
  4. In the CSS file, how would I reference a div with both an id and a class, where both must be present? I have tried id followed immediately by class #navagation.custommenuclass a { text-decoration:none; }#navagation.custommenuclass a:link, a:visited { color:#FFDFAA; }#navagation.custommenuclass a:hover { color:#FFFF00; }#navagation.custommenuclass a:active { color:#FFFFFF; }and I have tried this with the id followed by a space then the class. Neither of these seem to limit the attributes from cascading to every link on the site. Ideas, Solutions Thanks
  5. george

    Media Queries

    In my CSS script I have p { display:none; margin-left:20px; } /**** Use only when screen is 480 or less*/@media only screen and (max-width: 480px), only screen and (max-device-width: 480px) { #line { width: 96%; height:60px; border:#2ABF00 thick solid; } #line p { display:block; }}/**** Use for container width greater than 900*/@media only screen and (min-width:900px), only screen and (min-device-width:900px){ #letsc { width:96%; height:60px; border:#FF0055 thick double; } #letsc p { display:block; }} And my HTML <body><div id="letsc"><p>content > 900</p></div><div id="line"><p>max-width: 480px</p></div></body> What I expect to see is the div containing content for > 900px only appearing when my screen area is greater than 900 pixels.The div for max-device-width 480px works as I expect. That is, the div and it's content only appears when the window is shrunk down below 480 Pixels. But I also expect to see the top div and content dissapear when the browser window is opened to greater than 900px. I am just trying to get a handel on how media queries work. There are many examples on the net, but they brought me to my present problem. The whole HTML file is attached. exp.html
  6. george

    Triangle after a box

    Thank you Deirdre's Dad. Hope all is well with you.
  7. I am trying to create a triangle at the right end of a box. My HTML is <div class="exampOne"></div> and my CSS .exampOne { background-color:green; width:30px; height:20px; }.exampOne:after { border-color: transparent transparent transparent blue; border-style:solid;border-width:20px;height:0px;width:0px;z-index: 3;} What am I doing wrong?Thanks
  8. george

    Styling iFrame

    That did it dsonesuk.Now to document why this works, so I can learn something.
  9. george

    Styling iFrame

    Using the approach suggested above, I get unexpected results. Right now, my site presents an alert box giving the scrollHeight for the iFrame content.If you go to the site, when it initially loads the Home page in the iFrame, and you will see the frame scrollHeight given, and when you scroll the page, you will see this is very close. When you select the My Resources menu option, the iFrame source is updated, and the alert box reflects the change in scrollHeight very closely.But then select the Home option, and the alert box shows a new value, which is far too large, and the height of the iFrame is also far too large. And when I keep selecting Home, each time the scrollHeight decriments. Mystery. Any ideas?
  10. george

    Styling iFrame

    Thank you dsonesuk
  11. george

    Styling iFrame

    I have an iFrame which is linked to from a few anchor tags. That part works fine. My problem is, I'd like the height of my iFrame to be inherited from it's contents. I did notice that in the example page for iFrames setting the height to 100% works as I would expect. But not on my page. I did notice that when I create a CSS property using the iFrame's ID tag, and put a number of pixels in the CSS width and height attributes, they were accepted and the browser rendered appropriately. But not when I try and use 100% or auto or inherit. What can I do so the height is based on the content of the iFrame?
  12. Hi, I'm george, and I am full of questions. Like, when I throw the ball up, why does it keep on going up? The various satellite agencies have requested that I stop throwing up balls. But I just can't believe my balls wont come back down. Every body else's ball comes back down. It is supposed to come back down. Wait, there is a knock at the door. It is the Army. They want me. This is how my programming career has been. I want to juggle, but I keep loosing balls. I envy thoes whose balls stay on the ground. I really do. You get to kick yours around a little without worry of starting an international crisis. Well, that is all about me.
  13. Me too. BTW: how do you compress a Javascript file? Is it just a zipped file?
  14. george

    if in a while loop

    I need an if within a loop. It seems as though PHP does not like this. Is there a workaround? while($row = mysql_fetch_array($result)) { $Smarty .= "<tr id='".$row['eventStage']."' >"; $Smarty .= "<td>" . $row['propDate'] . " </td>"; $Smarty .= "<td> " . $row['hvName'] . " </td>"; $Smarty .= "<td>" if (row['eventstatus'] == 'proposedbyinst') { $Smarty .= "<input type='radio' id='Yes" .$row['propid']. "' name='Approve" .$row['propid']. "'' value='Yes' /><label for='Yes'>Yes</label>"; $Smarty .= "<input type='radio' id='No" .$row['propid']. "' name='Approve" .$row['propid']. "'' value='No' /><label for='No'>No</label>"; } elseif ( row['eventstatus'] == 'approvedbyTCP') { etc. etc. The error is unexpected T_IF
  15. george

    endless loop

    I just inadvertiantly got my php code to perform an endless loop. The php code is on the server. I closed my cliebt side browser through Windows Task Manager. Is my endless loop still running on the server? And if so, how can I stop it. ThanksGeorge
  16. george

    totally lost

    I have a calendar and an array of events. As the calendar is being written, it checks to see if the date being written is a scheduled date or a proposed date. Scheduled dates appear in one color, proposed dates in another. This works fine. I want to enable the user to click on a scheduled date and up pops a balloon providing the name of the event scheduled. This also works fine. . . but only for event scheduled. The code for the proposed and scheduled checking are identical. I can not find why one little function works, and the other does not. Further, I don’t even know if I am using the right strategy to achieve this effect for a series of events. I can get only one scheduled event, and one proposed event, to appear color coded on the calendar. Even though there is an array (2dim), if I try and step through the array in the scheduled or the proposed functions, I get an error. The calendar works, even though I spelled calendar wrong. But I can not advance past this. I can get multiple events to appear -, but not multiple events. Also, only one balloon is working. I don’t get it. I am totally confounded. Here is my complete monster, save the balloon gif. displaying the balloon with message is not a problem. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title><script type="text/javascript">/************************************************ Basic Calendar-By Brian Gosselin at http://scriptasylum.com/bgaudiodr/* Script featured on Dynamic Drive (http://www.dynamicdrive.com)* This notice must stay intact for use* Visit http://www.dynamicdrive.com/ for full source code***********************************************//* modified by George, as described. */var aAsk1 = new Array('Brandi Wine', 'recno=3', '3/10/2007 3/11/2007 3/12/2007');var aAsk2 = new Array('Cherry Wine', 'recno=1', '3/20/2007 3/21/2007 3/22/2007');var aProposed = new Array();aProposed[0] = aAsk1;aProposed[1] = aAsk2;var aTell1 = new Array('Apple Cider', 'recno=3', '4/10/2007 4/11/2007 4/12/2007');var aTell2 = new Array('Ginger Ale', 'recno=1', '4/20/2007 4/21/2007 4/22/2007');var aScheduled = new Array();aScheduled[0] = aTell1;aScheduled[1] = aTell2;var zName;function buildCal(m, y, cM, cH, cDW, cD, brdr){ var mn=['January','February','March','April','May','June','July','August','September','October','November','December']; var dim=[31,0,31,30,31,30,31,31,30,31,30,31]; var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28; var t='<div class="'+cM+'"><table class="'+cM+'" id="'+cM+'" cols="7" cellpadding="0" border="'+brdr+'" cellspacing="0" ><tr align="center">'; t+='<td colspan="7" align="center" class="'+cH+'">'+mn[m-1]+' - '+y+'</td></tr><tr align="center">'; for(s=0;s<7;s++) t+='<td class="'+cDW+'">'+"SMTWTFS".substr(s,1)+'</td>'; t+='</tr><tr align="center">'; for(i=1;i<=42;i++){ var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : ' '; t+=WhichOne(x,m,y); if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">'; } return t+='</tr></table></div>'; }function WhichOne(zDay, zMonth, zYear) { var todaydate=new Date(); var scanfortoday=(zYear==todaydate.getFullYear() && zMonth==todaydate.getMonth()+1)? todaydate.getDate() : 0; var getThis = ''; if (getThis = inproposed(zMonth, zDay, zYear)) { return "<td id='proposed' onclick='zBaloon("+getThis+",event);'>"+zDay+"</td>"; } else if (getThis = inscheduled(zMonth, zDay, zYear)) { return "<td id='scheduled' onclick='zBalloon("+getThis+",event);'>"+zDay+"</td>"; } else if (zDay == scanfortoday) { return "<td id='today'>"+zDay+"</td>"; } else if (zDay != scanfortoday) { return "<td id='anyday'>"+zDay+"</td>"; }}function inscheduled(zMonth, zDay, zYear) { zDate = zMonth + '/' + zDay + '/' + zYear; zStr = aScheduled[0][2]; Scheduled = aScheduled[0][0]; if (zStr.indexOf(zDate)>=0) { return 'Scheduled'; } else { return false; }}function inproposed(zMonth, zDay, zYear) { zDate = zMonth + '/' + zDay + '/' + zYear; zStr = aProposed[0][2]; Proposed = aProposed[0][0]; if (zStr.indexOf(zDate)>=0) { return 'Proposed'; } else { return false; }}function zBalloon(gotThis,event) {zLeft=event.clientX -50;zTop=event.clientY - 120;document.getElementById('zBalloon').style.top = zTop;document.getElementById('zBalloon').style.left = zLeft;document.getElementById('zBalloon').style.display = 'block';document.getElementById('zBalloonTalk').innerHTML = gotThis;}function zBalloonClose() {document.getElementById('zBalloon').style.display = 'none';}</script><style type="text/css">.main {width:200px;border:1px solid black;}.month {background-color:black;font:bold 12px verdana;color:white;}.daysofweek {background-color:gray;font:bold 12px verdana;color:white;}#anyday {font-size: 12px;font-family:verdana;color:black;background-color: lightyellow;padding: 2px;}#today, #proposed, #scheduled, #todayproposed, #todayscheduled {font-size: 12px;font-family:verdana;padding: 2px;}#today {color:red;background-color: lightyellow;}#proposed {font-weight: bold;color:#000000;background-color:#FFCCCC;cursor:hand;}#scheduled {font-weight: bold;color:#000000;background-color:#FFCC00;cursor:hand;}#todayproposed {font-weight: bold;color:#FF0033;background-color:#FFCCCC;cursor:hand;}#todayscheduled {font-weight: bold;color:#FF0033;background-color:#FFCC00;cursor:hand;}#zBalloon { position:absolute;background-image:url(images/myzBalloon.gif);background-repeat:no-repeat;width:300px;height:140px;display:none;}#zBalloonTalk {position:absolute;top:23px;left:30px;color:#0033FF;font-family:Arial, Helvetica, sans-serif;font-size:12px;text-decoration:underline;cursor:hand;}#zBalloonClose {position:absolute;color:#0000FF;font:"Courier New", Courier, monospace;font-size:9px;font-variant:small-caps;text-decoration:underline;top:15px;right:60px;cursor:hand;}</style></head><body><p>*</p><p>*</p><p>*</p><p>*</p><p>*</p><p>*</p><span id="zBalloon"><span id="zBalloonTalk" >Fred</span><span id="zBalloonClose" onclick="zBalloonClose();">close <img src="images/redx.gif" /></span></span><table border="0" cellspacing="0" cellpadding="3"><tr><td width="33%"><script>document.write(buildCal(3,2007, "main", "month", "daysofweek", "days", 1)); </script></td><td width="33%"><script>document.write(buildCal(4,2007, "main", "month", "daysofweek", "days", 1));</script></td><td width="34%"><script>document.write(buildCal(5,2007, "main", "month", "daysofweek", "days", 1));</script></td></tr></table><p><hr /></p><table border="0"><tr><td bgcolor="#FFCCCC"> </td><td bgcolor="#000000" style="color:#FFFFFF">Proposed event</td></tr><tr><td bgcolor="#FFCC00"> </td><td bgcolor="#000000" style="color:#FFFFFF">Scheduled event</td></tr></table></body></html>
  17. That is what my computter is telling me. and it seems to be happening in the error trapping area that tries to create the xmlHTTP object. function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp= XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp= ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp= ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }
  18. I run this, and get a xmlHttp is not an object error. I am at my witz end // JavaScript Document var xmlHttp; function startup() { var xmlHttp; xmlHttp=GetXmlHttpObject(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open('POST','bringmethedata.php',true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.send(); } function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById('letPHPdothework').innerHTML = xmlHttp.responseText; } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }
  19. george

    Is this legal?

    XML DOM Tutorial is where I need to be. Just FYI:I'm using HTML & PHP & AJAX to populate MySQL tables - recording events each with it's own list of dates. Upon update of the data, an XML file is written (or overwritten), which will be accessed by a three month running calander. The calander then displays scheduled events, and on-mouseover will give details about the particular event highlighted on the calander. Inexpensive Javascript solutions already exist for this. But I'll give myself till Monday to do it myself, then if I can't, I'll buy.
  20. george

    Is this legal?

    Perhaps I can thank you again then, boen_robot. I am attempting to access the data in my XML document. I have no problem with the tags that are not nested. It's my nested dates that are proving illusive. <?xml version="1.0" encoding="ISO-8859-1"?><eventcatalog> <event> <eventname>Jani at Trios</eventname> <instructor>Dale Tove</instructor> <dates> <month>3</month> <day>10</day> <year>2007</year> <month>3</month> <day>11</day> <year>2007</year> <month>3</month> <day>12</day> <year>2007</year> <month>3</month> <day>13</day> <year>2007</year> </dates> </event> <event> <eventname>Montgomery County Fair</eventname> <instructor>Frances Hall</instructor> <dates> <month>3</month> <day>20</day> <year>2007</year> <month>3</month> <day>21</day> <year>2007</year> <month>3</month> <day>22</day> <year>2007</year> <month>3</month> <day>23</day> <year>2007</year> </dates> </event> <event> <eventname>Alexandria Hospital Fitness Celebration</eventname> <instructor>Linda Frasher</instructor> <dates> <month>4</month> <day>10</day> <year>2007</year> <month>4</month> <day>11</day> <year>2007</year> <month>4</month> <day>12</day> <year>2007</year> <month>4</month> <day>13</day> <year>2007</year> </dates> </event></eventcatalog> From what I have learned so far, it seems there are two ways of reading the data. One using the getElementsByTagName("tagname")[0].childNodes[0].nodeValue; and another using the recordset objectBut still none of the examples I could find sowed me how to get data from dates nodes Any examples for nested tags? TIA boen_robot - george
  21. george

    Is this legal?

    Is this legal? <dates> <month>3</month> <day>10</day> <year>2007</year> <month>3</month> <day>11</day> <year>2007</year> <month>3</month> <day>12</day> <year>2007</year> <month>3</month> <day>13</day> <year>2007</year> </dates> I am trying to document a variable range of dates. TIA
  22. Jesh, you really are teaching me a lot. Thanks. - George
  23. I have a simple html with two forms each using the fieldset tag. For some reason the first frame set's width is the width of the screen. For the second form the fieldset is just wider than the fields, which is what I want. I see no obvious difference between the two forms. The javascript is in a seperate file. It works fine. It is the HTML that seems to have a mind of it's own. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><style type='text/css'>#cllist {position:absolute; display:none; left:250px; top: 10px; }</style><script type='text/javascript' src='jswxml.js'></script></head><body onload='document.getElementById("usern").focus();'><!-- getuser.php --><form action='getuser.php' method='post'> <fieldset><legend>Log in</legend> <table><tr><td><label for='usern'>Login : </label></td><td><input type='text' name='usern' id='usern' maxlength='15' size='15' /></td></tr> <tr><td><label for='passwd'>Password : </label></td><td><input type='password' name='passwd' id='passwd' maxlength='15' size='15' /></td></tr> <tr><td><input type='submit' value='Login' name='submit' id='submit'></td> <td><input type='button' value='Register' name='register' id='register' onclick='document.getElementById("cllist").style.display="block";'></td></tr> </table> </fieldset></form><div id='cllist'> <form id='myForm'> <fieldset><legend>Register</legend> <table> <tr><td><label for='usern'>Enter a Login name :</label></td><td><input type='text' name='usern' id='usern' maxlength='15' size='15' /></td></tr> <tr><td><label for='passwd1'>Enter your password :</label></td><td><input type='password' name='passwd1' id='passwd' maxlength='15' size='15' /></td></tr> <tr><td><label for='passwd2'>Re-type your password :</label></td><td><input type='password' name='passwd2' id='passwd' maxlength='15' size='15' /></td></tr> <tr><td><label for='fname'>First Name :</label></td><td><input type='text' name='fname' id='fname' maxlength='15' size='15' /></td></tr> <tr><td><label for='lname'>Last Name :</label></td><td><input type='text' name='lname' id='lname' maxlength='15' size='15' /></td></tr> <tr><td><label for='addy1'>Address 1</label></td><td><input type='text' name='addy1' id='addy1' maxlength='15' size='15' /></td></tr> <tr><td><label for='addy2'>Address 2</label></td><td><input type='text' name='addy2' id='addy2' maxlength='15' size='15' /></td></tr> <tr><td><label for='city'>City</label></td><td><input type='text' name='city' id='city' maxlength='15' size='15' /></td></tr> <tr><td><label for='state'>State</label></td><td><input type='text' name='state' id='state' maxlength='2' size='2' /></td></tr> <tr><td><label for='zip'>Zip</label></td><td><input type='text' name='zip' id='zip' maxlength='10' size='10' /></td></tr> <tr><td><label for='email'>Email</label></td><td><input type='text' name='email' id='email' maxlength='15' size='15' /></td></tr> <tr><td><label for='degree'>Degree</label></td><td><input type='text' name='degree' id='degree' maxlength='15' size='15' /></td></tr> <tr><td><label for='profes'>Profession</label></td><td><input type='text' name='profes' id='profes' maxlength='15' size='15' /></td></tr> <tr><td><label for='organ'>Organization</label></td><td><input type='text' name='organ' id='organ' maxlength='15' size='15' /></td></tr> <tr><td colspan='2'><input type='button' name='Register' id='Register' value='Register' onclick='GetMess()' /></td></tr> </table> </fieldset> </form></div></body></html> When you click register, the registration frameset opens. Ok, it over laps the first fieldset, but I am not concerned about that right now. I need to learn to make the first fieldset hug the fields like the second one does. Thanks- George
×
×
  • Create New...