JavaScript - Questions About Applying Into An Entry Level Computer Programming Position?
I'm writing a report for my college class about what it takes to get into the field of computer programming and i need to obtain information from someone who is in the position of hiring entry level computer programmers. it would Really! help me out if someone has time to fill out these questions. I know its asking for a lot but if anyone has the time it would be highly appreciated!
1. Tell me a little bit about the company? ( Main focus, how did it start, who are your customers, company growth,etc) 2. Where do you see the industry in 5 years? 3. What makes the company successful? 4. What are you looking for in a potential candidate? 5. When interviewing a potential employee, what questions do you expect them to ask you? 6. How could a typical day on the job be described? How much variety is there on a day-to-day basis? 7. When you look at resume, what is your main focus in terms of order and importance, reference? 8. How do you feel about networking as a tool to research potential candidates? (ex. LinkedIN, Facebook?) 9. What education, experience and qualifications are need to enter the field as entry level position? 10. What is the salary range and job responsibilities? 11. What is best liked and least liked about this field / job? 12. What is a typical interview in this field? How is it different then regular interviews? 13. Is there a demand for people in this field? 14. What special advice could you give a person entering the field? 15. What types of training do companies offer persons entering this field? 16. Which professional journals and organizations would help me learn more about this field? 17. How can a new graduate obtain experience in the field? How and where can one get internship? 18. What types of technologies and software is used in the field? 19. Would you have any more information that will be of use to me? 20. Can you suggest others who may be valuable sources of information? Similar TutorialsI have a script that needs extra variables added, but need some help on how to do it. I need a textbox to add shipping charges, and also a text box to add sales tax. Then these 2 amounts need to be added to the grand total. Any help appreciated. The link below is to the page that has the form and code: http://spectrum-enterprise.com/sm/smorder.html Hey guys, I need to create a constructor for a computer object. This object must have three properties: speed, and mem_live mem_dead. Then I need to create a new object using this constructor and then have its properties displayed on the screen. Look at what I'm up to so far: Quote: function Computer(speed, mem_live, mem_dead) { this.speed = speed; this.mem_live = mem_live; this.mem_dead = mem_dead; } var computer1 = new Computer("4.0ghz", true, false); document.write(computer1.speed + " " + computer1.mem_live + " " + computer1.mem_dead); What am I doing wrong? It always just shows : 4.0ghz, true, false I'm new to javascript and am not sure why this works in firefox and not chrome. I am trying to create a script that keeps an object fixed horizontally while bing positioned absolute vertically. if I replace the toPP variable in document.getElementById('fire').style.top = toPP; with say '50px' it will move the element down 50 pxs, but how I have it currently it doesn't do anything in chrome Code: <script type="text/javascript" > window.onscroll = function() { if( window.XMLHttpRequest ) { var x = 0 -document.documentElement.scrollTop; var toP = String(x); var toPP = toP + "px"; document.getElementById('fire').style.position = 'fixed'; document.getElementById('fire').style.top = toPP; } } </script> Hi everyone, Is it possible to determine at the startup of the page if the visitor is using a computer or a phone to access the site? I would like to make the intro process much better than a simple "click here for HTML version or click here for Flash version". I would like for it to simply redirect to the page I set it to go to depending on whether or not they're using a regular browser or a mobile browser. How would I go about this? Thank you all very much in advance. so here is my "Project http://sw.cs.wwu.edu/~strickk/Project2/project2.html and here are the directions where im stuck at, just right click view source to see the code. I believe what i am doing wrong is where i enter my variables and i dont know how to get an alert message to pop up using an if statement as well as getting the values for the distances to show up correctly directions: 8. Now we will write some JavaScript to validate the input. We don’t want the user to be able to enter the same origin and destination city when they book a ticket. So we will use an if statement to check that. If they have entered the same origin and destination city then we will tell them that by using an alert statement and make them select again. All of your code to validate the input code goes in between the single quotes of the onClick event in the Calculate Fare button. Follow these steps: a) Assign the value of the origin city to a variable called origin Note that the value that gets assigned to origin is actually 0, 60, 90, 120 or 150 (and NOT Bellingham, Everett, Seattle etc.) since the value we gave to the each element of the list was its distance from Bellingham. This will make our lives easier later when we compute the fare. b) Assign the value of the destination city to a variable called destination in a similar fashion. c) Write an if statement that will test whether origin is equal to destination and if it is then do two things. i. Issue an alert message that says Please input different origin and destination cities ii. Stop the execution of the JavaScript code in the onClick event. Use return; as the second statement inside the if statement. Remember to use curly braces to denote that two statements are contained within the if statement. Your if statement will have the following structure to it. if (<put the test you want to do here>) { alert(<put the message here>); return; } //Need a function that sees if the computer has a 2 move forced win, if so take first of those two moves. //and then see if the opponent has a 2 move forced win. if so, then blaock the first of those two moves. // The gameboard array --this holds the game status var gaBoard = [['o', 'o', 'o', 'o', 'o', 'o', 'o'], ['o', 'o', 'o', 'o', 'o', 'o', 'o'], ['o', 'o', 'o', 'o', 'o', 'o', 'o'], ['o', 'o', 'o', 'o', 'o', 'o', 'o'], ['o', 'o', 'o', 'o', 'o', 'o', 'o'], ['o', 'o', 'o', 'o', 'o', 'o', 'o']]; var gcPlayer = "r"; // current player color var gbGameOver = false; //Loading the Gameboard function vLoad() { var strTable, i, j, strID, strOver, strOut, strTitle, strHover, strPush, strArrow; strTable = "<table cellpadding='0' cellspacing='0'>"; //put a row in the table for the title for (i = 0; i < 1; i++) { strTable += "<tr>"; strTitle = "<h1 style= 'color:Orange; font-family:Broadway'>Connect Four</h1>"; //put in the title strTable += strTD(7, strTitle); strTable += "</tr>"; // Buttons area strTable += "<tr>"; strTable += strTD(4, strButton("New Game", "vReset()")); strTable += strTD(3, strButton("Computer Move", "vComputerMove()")); strTable += "</tr>"; } //Arrows Row strTable += "<tr>"; //put in the columns for (j = 0; j < 7; j++) { strID = "img" + j; strHover = "vHover(\"" + strID + "\")"; strPush = "vPush(\"" + strID + "\"," + j + ")"; strArrow = "vArrow(\"" + strID + "\")"; strTable += strTD(1, strImage("arrow.jpg", strID, strPush, strHover, strArrow)); } strTable += "</tr> <tr><td colspan='7'><hr/></td></tr>"; //put a row in the table for the gameboard for (i = 5; i >= 0; i--) { strTable += "<tr>"; //put in the columns for (j = 0; j < 7; j++) { strID = "img" + i + j; strTable += strTD(1, strImage("open.jpg", strID, "", "", "")); } strTable += "</tr>"; } //put a row in the table for the text area for (i = 0; i < 1; i++) { strTable += "<tr>"; strTable += strTD(7, strTextArea(16, 66)); strTable += "</tr>"; } strTable += "</table>"; frm1.innerHTML = strTable; } //*************************************************************************************************** //Functions for Modifying controls function vHover(strID) { document.getElementById(strID).src = "hover.jpg"; } function vArrow(strID) { document.getElementById(strID).src = "arrow.jpg"; } function vMakeRed(strID) { document.getElementById(strID).src = "red.jpg"; } function vMakeBlack(strID) { document.getElementById(strID).src = "black.jpg"; } function vMakeOpen(strID) { document.getElementById(strID).src = "open.jpg"; } function iTopSlot(iCol) { var iRow, iCol; iRow = 0; while ( (iRow < 6) && (gaBoard[iRow][iCol] != 'o')) iRow++; return iRow; } function vPush(strID, iCol) { var iRow, iCol; document.getElementById(strID).src = "push.jpg"; /* if (gbGameOver) { return 0; } */ // see if we can drop a piece into the selected column if (gaBoard[5][iCol] == 'o') { iRow = iTopSlot(iCol); gaBoard[iRow][iCol] = gcPlayer; strID = "img" + iRow + iCol; // switch players if (gcPlayer == "r") { vMakeRed(strID); if (bWinner(gcPlayer)) { alert(gcPlayer + " has won the game."); frm1.taOutput.value += gcPlayer + " has won the game."; gbGameOver = true; } gcPlayer = "b"; } else { vMakeBlack(strID); if (bWinner(gcPlayer)) { frm1.taOutput.value += gcPlayer + " has won the game."; alert(gcPlayer + " has won the game."); gbGameOver = true; } gcPlayer = "r"; } } else { frm1.taOutput.value += "That column is full - try again.\n"; } } function bWinner(cPlayer) { var iCol, iRow; //Horizontal Win for (iRow = 0; iRow < 6; iRow++) { for (iCol = 0; iCol < 4; iCol++) { if ((gaBoard[iRow][iCol] == cPlayer) && (gaBoard[iRow][iCol + 1] == cPlayer) && (gaBoard[iRow][iCol + 2] == cPlayer) && (gaBoard[iRow][iCol + 3] == cPlayer)) return true; } } //Verticle Win for (iRow = 0; iRow < 3; iRow++) { for (iCol = 0; iCol < 7; iCol++) { if ((gaBoard[iRow][iCol] == cPlayer) && (gaBoard[iRow + 1][iCol] == cPlayer) && (gaBoard[iRow + 2][iCol] == cPlayer) && (gaBoard[iRow + 3][iCol] == cPlayer)) return true; } } //diagonal win Positive Slope for (iRow = 0; iRow < 3; iRow++) { for (iCol = 0; iCol < 4; iCol++) { if ((gaBoard[iRow][iCol] == cPlayer) && (gaBoard[iRow + 1][iCol + 1] == cPlayer) && (gaBoard[iRow + 2][iCol + 2] == cPlayer) && (gaBoard[iRow + 3][iCol + 3] == cPlayer)) return true; } } //diagonal win Negative Slope for (iRow = 3; iRow < 6; iRow++) { for (iCol = 0; iCol < 4; iCol++) { if ((gaBoard[iRow][iCol] == cPlayer) && (gaBoard[iRow - 1][iCol + 1] == cPlayer) && (gaBoard[iRow - 2][iCol + 2] == cPlayer) && (gaBoard[iRow - 3][iCol + 3] == cPlayer)) return true; } } return false; } function vComputerMove(){ var iRow,iCol,iWinCol; //Try to win iWinCol = -1; iLoseCol = -1; for(iCol = 0; iCol < 7; iCol++) { iRow = iTopSlot(iCol) if(iRow < 6) { gaBoard[iRow][iCol] = gcPlayer; if(bWinner(gcPlayer)) iWinCol = iCol; gaBoard[iRow][iCol] = 'o'; } } if (iWinCol > -1) { vPush("img" + iWinCol, iWinCol); } //Try to Block if (gcPlayer == 'b') { for (iCol = 0; iCol < 7; iCol++) { iRow = iTopSlot(iCol) if (iRow < 6) { gaBoard[iRow][iCol] = 'r'; if (bWinner('r')) iLoseCol = iCol; gaBoard[iRow][iCol] = 'o'; } } } else if (gcPlayer == 'r') { for (iCol = 0; iCol < 7; iCol++) { iRow = iTopSlot(iCol) if (iRow < 6) { gaBoard[iRow][iCol] = 'b'; if (bWinner('b')) iLoseCol = iCol; gaBoard[iRow][iCol] = 'o'; } } } if (iLoseCol > -1) { vPush("img" + iLoseCol, iLoseCol); } else vRandomMove(); } function vRandomMove() { var iRandom, iRow; iRow = 6; while (iRow == 6) { iRandom = (Math.floor(Math.random() * 7)); iRow = iTopSlot(iRandom); } vPush("img" + iRandom, iRandom); } function vReset() { for (i = 5; i >= 0; i--) { for (j = 0; j < 7; j++) { gaBoard[i][j] = 'o'; strID = "img" + i + j; vMakeOpen(strID); } } frm1.taOutput.value = ""; gcPlayer = "r"; } //*************************************************************************************************** //Functions for making form controls //Button Maker function strButton(strValue, strOnclick) { return "<input type='button' value='" + strValue + "' onclick='" + strOnclick + "' />" } //Image Maker function strImage(strSource, strID, strOnclick, strMouseOver, strMouseOut) { var strReturn; strReturn = "<img src='" + strSource + "' id='" + strID + "' onclick='" + strOnclick + "' "; strReturn += "onmouseover='" + strMouseOver + "' onmouseout='" + strMouseOut + "' />" return strReturn; } //TD Maker function strTD(iColspan, strContent) { return "<td colspan='" + iColspan + "'>" + strContent + "</td>"; } //Text Area Maker function strTextArea(iRows, iCol) { var strReturn; strReturn = "<textarea id='taOutput' "; strReturn += "' rows= '" + iRows + "' cols='" + iCol + "'readonly='readonly'>"; strReturn += "</textarea>"; return strReturn; } I need to convert a position:fixed element to position:absolute when the user resize their browser window below 1000px. Right now it does nothing. The element always keeps the fixed positioning even after resizing the window. Here's what I have right now: Code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <base href="http://www.area51entertainment.co/" /> <title>Emoto <?php echo "$section"; ?></title> <meta charset="UTF-8" /> <meta name="verify-v1" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta name="author" content="Andrew McCarrick" /> <meta name="robots" content="index, follow" /> <style type="text/css"> body,html { background: #FFFFFF; /* Old browsers */ color: #000000; font-family: Verdana; margin-right:auto; margin-left:auto; max-width:1000px; padding: 0px; margin-top: 0px; margin-bottom: 0px; } </style> <link rel="stylesheet" href="emoto/style.css" media="screen" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> <link rel="apple-touch-icon" href="http://www.area51entertainment.co/TouchIcon.png" /> <link rel="apple-touch-icon-precomposed" href="http://www.area51entertainment.co/TouchIcon.png" /> <link rel="image_src" href="./logo.png" /> <script language="javascript" src="emoto/float.js"></script> </head> <body> <div class="wrapper"> <div id="header_float"> <div class="header_wrapper"> <div class="logo"> Picture </div> <div class="links"> Home | Settings | Notifications | Requests | Messages | Search Bar </div> <div class="links_right"> Profile Link/Sign-Out </div> </div> </div> <div class="content_wrapper"> Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 T est2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2Test2Test2 Test2 </div> </div> </body> </html> style.css Code: a:link {color: #FFFFFF; text-decoration: none;} a:visited {color: #FFFFFF; text-decoration: none;} a:active {color: #FFFFFF; text-decoration: none;} a:hover {color: #3399FF; text-decoration: none;} .wrapper{ min-height: 2000px; min-width: 1000px; } #header_float{ width: 100%; min-width: 1000px; height: 35px; left:0; right:0; top:0; position: fixed; background: #49963A; z-index: 1000; } .header_wrapper{ width: 1000px; height: 35px; margin-right:auto; margin-left:auto; padding: 0px; margin-top: 0px; margin-bottom: 0px; color: #FFFFFF; } .logo{ float: left; width: 150px; height: 25px; font-size: 26px; position: relative; top: -1px; left: 8px; } .links{ float: left; width: 670px; height: 25px; position: relative; top: 7px; } .links_right{ float: right; width: 180px; height: 25px; position: relative; top: 7px; } .content_wrapper{ position: relative; top: 35px; width: 995px; min-height: 450px; } img{ border: 0px; } float.js Code: if (screen.availWidth<=999) document.getElementById('header_float').style.position = 'absolute'; else document.getElementById('header_float').style.position = 'fixed'; Hi All, I have a page which i am setting up for my local football team, and the javascript part of the page which is a 'news' rotator which i need to ammend. at the moment the tabs on the right of the 'news' rotator are linked to a certain page but nothing happens when you click on them? and i dont know enough javascript to ammend my code to make it so that it send the user to the linked page here is my js file Code: /* * faded 0.3.1 - jQuery plugin * written by Nathan Searles * http://nathansearles.com/faded/ * * Copyright (c) 2009 Nathan Searles (http://nathansearles.com/) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * Built for jQuery library * http://jquery.com * Compatible with jQuery 1.3.2+ * */ if(typeof jQuery != "undefined") { jQuery(function($) { $.fn.extend({ faded: function(options) { var settings = $.extend({}, $.fn.faded.defaults, options); return this.each( function() { if($.fn.jquery < "1.3.1") {return;} var $t = $(this); var $c = $t.children(":nth-child(1)"); var o = $.metadata ? $.extend({}, settings, $t.metadata()) : settings; var total = $c.children().size(); var next = 0, prev = 0, number = 0, currentitem = 0, restart = 0, restartinterval = 0; var loaded,active,imgSrc,clicked,current; if (o.random) { $.fn.reorder = function(callback) { function randOrd() { return(Math.round(Math.random())-0.5); } return($(this).each(function() { var $this = $(this); var $children = $this.children(); var childCount = $children.length; if (childCount > 1) { $children.hide(); var indices = new Array(); for (i=0;i<childCount;i++) { indices[indices.length] = i; } indices = indices.sort(randOrd); $.each(indices,function(j,k) { var $child = $children.eq(k); var $clone = $child.clone(true); $clone.show().appendTo($this); if (callback !== undefined) { callback($child, $clone); } $child.remove(); }); } })); }; $c.reorder(); } function pause() { clearInterval(autoplay); clearTimeout(restart); restart = setTimeout(function() { autoplay = setInterval(function(){ animate("next"); },o.autoplay); },o.autorestart); } $c.css({position:"relative"}); $c.children().css({ position:"absolute", top: 0, left: 0, zIndex: 0, display:"none" }); if (o.autoheight) { $c.animate({height: $c.children(":eq(0)").outerHeight()},o.autoheight); } if (o.pagination) { if (o.autopagination) { $t.append("<ul class="+o.pagination+"></ul>"); $c.children().each(function(){ $("."+o.pagination+"",$t).append("<li><a rel="+number+" href=\"#\" >"+(number+1)+"</a></li>"); number++; }); } $("."+o.pagination+" li a:eq(0)",$t).parent().addClass("current"); $("."+o.pagination+" li a",$t).click(function(){ current = $("."+o.pagination+" li.current a",$t).attr("rel"); clicked = $(this).attr("rel"); if (current != clicked) {animate("pagination",clicked,current);} if(o.autoplay){pause();} return false; }); } if (o.sequentialloading&&$c.children()[0].tagName=="IMG") { $c.css({background:"url("+o.loadingimg+") no-repeat 50% 50%"}); imgSrc = $("img:eq(0)",$c).attr("src"); $("img:eq(0)",$c).attr("src", imgSrc).load(function() { $(this).fadeIn(o.speed,function(){ loaded = true; }); }); } else { $c.find(":eq(0)").fadeIn(o.speed,function(){ loaded = true; }); } if (o.bigtarget) { $c.css({"cursor":"pointer"}); $c.click(function(){ animate("next"); if(o.autoplay){ if (o.autorestart) { pause(); } else { clearInterval(autoplay); } } return false; }); } if (o.autoplay) { autoplay = setInterval(function(){ animate("next"); },o.autoplay); pause(); } $("."+o.nextbtn,$t).click(function(){ animate("next"); if(o.autoplay){ if (o.autorestart) { pause(); } else { clearInterval(autoplay); } } return false; }); $("."+o.prevbtn,$t).click(function(){ animate("prev"); if(o.autoplay){ if (o.autorestart) { pause(); } else { clearInterval(autoplay); } } return false; }); function animate(dir,clicked,current){ if (!active&&loaded) { active=true; switch(dir) { case "next": prev = next; next = currentitem*1+1; if (total === next) { next = 0; } break; case "prev": prev = next; next = currentitem*1-1; if (next === -1) { next = total-1; } break; case "pagination": next = clicked; prev = current; break; } if (o.pagination) { $(".pagination li.current",$t).removeClass("current"); $(".pagination li a:eq("+next+")",$t).parent().addClass("current"); } if (o.crossfade) { $c.children(":eq("+next+")").css({zIndex:10}).fadeIn(o.speed,function(){ $c.children(":eq("+prev+")").css({display:"none",zIndex:0}); $(this).css({zIndex:0}); currentitem = next; active = false; }); } else { $c.children(":eq("+prev+")").fadeOut(o.speed,function(){ if (o.autoheight) { $c.animate({height: $c.children(":eq("+next+")").outerHeight()},o.autoheight,function(){ $c.children(":eq("+next+")").fadeIn(o.speed); }); } else { $c.children(":eq("+next+")").fadeIn(o.speed); } currentitem = next; active = false; }); } } } } ); } }); $.fn.faded.defaults = { speed: 300, crossfade: false, bigtarget: false, sequentialloading: false, autoheight: false, pagination: "pagination", autopagination: true, nextbtn: "next", prevbtn: "prev", loadingimg: false, autoplay: false, autorestart: false, random: false }; }); } not sure why it wont load the url when clicked apon? can anyone please help? many thanks Luke Hi, i try to do that every char that i type in a input-type there will be a alert, but it doesnt do that, when the page loads it pop ups one time an alert and it doesnt pop up more alerts when i type something in the input-type Sorry for the bad english here is my code Code: <script type="text/javascript"> function init() { document.Form1.phone.onkeyup= alert('a'); } window.onload=init; </script> I'm designing a page that uses javascript+css for enhanced interaction. However, if javascript is disabled, I'd still like the page to be functional, albeit less fancy. Likewise, if css is disabled, it still needs to be functional. Finally, if both js+css are disabled, the page will be quite bare but still usable. For example, I use javascript to set a css style that hides certain panels of content. JS is used to toggle these and all is fine. If JS is disabled, then the css isn't applied, and all the content is visible (though not too pretty). If CSS is disabled, the inline CSS applied by the JS works fine. Finally, if both are disabled, all the content is visible. I'm wondering what's the best way to do this. Currently, I set the styles like this in the js file: Code: function initialize() { // set styles, for example: document.getElementById("panel").style.display = "none"; } var onloadFlag = false; document.onreadystatechange = function() { if (!onloadFlag) { onloadFlag = true; initialize(); } }; // for older browsers window.onload = function() { if (!onloadFlag) { onloadFlag = true; initialize(); } }; The problem that sometimes comes up is I see the "fallback" styles briefly, before the JS kicks in and applies the enhanced css. How can I avoid this? Could you please help. I came up with javascript functions that would apply a style sheet to an xml document during the runtime but i get the following error: Automation server cannot create object. Below is the code (javascript): <html> <head> <title>SORT</title> <head> <body bgcolor="#FFFFFF"> <form name="VIEW" method="post" action> <p> <input type="text"> </p> <p> <input type="radio" name="optAscending" value="radiobutton" onClick="javascript:displayAscending();">Ascending </p> <p> <input type="radio" name="optDescending" value="radiobutton" onClick="javascript:displayDescending();">Descending <p> <input type="radio" name="optReset" value="radiobutton" onClick="javascript:displayReset();">Reset </p> </form> </body> <script language="javascript"> function displayAscending() { document.VIEW.optDescending.checked=false; document.VIEW.optReset.checked=false; var xsltobj = new ActiveXObject("Msxml2.XSLTemplate.4.0"); var xsldocobj = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0"); var xslprocobj; xsldocobj.async = false; xsldocobj.load("EMP.xsl"); xsltobj.stylesheet = xsldocobj; var xmldocobj = new ActiveXObject("Msxml2.FreeThreadDOMDocument.4.0"); xmldocobj.async = false; xmldocobj.load("EMP.xml"); xslprocobj = xslt.createProcessor(); xslprocobj.input = xmldocobj; xslprocobj.Transform(); //arlet(xslProc.output); parent.FIRST.document.write(xslProc.output); } function displayDescending() { document.VIEW.optAscending.checked=false; document.VIEW.optReset.checked=false; var xsltobj = new ActiveXObject("Msxml2.XSLTemplate.4.0"); var xsldocobj = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0"); var xslprocobj; xsldocobj.async = false; xsldocobj.load("EMP.xsl"); var xmldocobj = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0"); xmldocobj.async = true; xmldocobj.load("EMP.xml"); xsltobj.stylesheet = xsldocobj; xslprocobj = xslt.createProcessor(); xslprocobj.input = xmldocobj; xslprocobj.Transform(); //arlet(xslProc.output); parent.FIRST.document.write(xslProc.output); } function displayReset() { parent.First.document.location="first.htm"; document.VIEW.optAscending.checked=false; document.VIEW.optDescending.checked=false; } </script> </html> And a style sheet that would be applied to an xml document <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <body> <table border="2" bgcolor="blue"> <tr> <th>ID</th> <th>NAME</th> <th>DESIGNATION</th> <th>ADDRESS</th> <th>DOB</th> <th>DEPARTMENTS</th> </tr> <xsl:for-each select="EMPDETAILS/EMPLOYEE"> <tr> <td><xsl:value-of select="ID"/></td> <td><xsl:value-of select="NAME"/></td> <td><xsl:value-of select="DESIGNATION"/></td> <td> <xsl:value-of select="ADDRESS/Street"/> <xsl:value-of select="ADDRESS/Apartment"/> <xsl:value-of select="ADDRESS/City"/> <xsl:value-of select="ADDRESS/State"/> <xsl:value-of select="ADDRESS/Zipcode"/> </td> <td><xsl:value-of select="DOB"/></td> <td><xsl:value-of select="DEPARTMENT"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> Hi I recently started researching about programming and was interested right away. I'm new to all this and need a place to start. Any help would be greatly appreciated and look forward to posting on this forum. I have some javascript which applies alternative row colors to a table and also gives you a highlight effect when you mouseover the rows. However, the problem I have is that it applies to every table on my page, I only want it to apply to a specific table in the html file (I'm using frontpage), not all of them How would I go about doing this? The code is below, it has a bit of styling at the top before the javascript. <style type="text/css" media="all"> table.altsrowtable { width: 90%; margin: auto; border-collapse: collapse} td { border: 1px solid black; cursorointer;text-align:center} /* row 1 */ tr td { background: #edf3fe; } tr:hover td, tr.ie td { background: #e1e1ff; } /* row 2 */ tr.bis td { background: #D9ECFF; } tr.bis:hover td, tr.bisie td { background: #e1e1ff; } /* selected row 1 */ tr.sel:hover td, tr.selie td { background: #edf3fe; } /* selected row 2 */ tr.selbis:hover td, tr.selbisie td { background: #D9ECFF; } </style> <script type="text/javascript" span="altsrowtables" div="altsrowtable" id="altsrowtable" class="altsrowtable"> var IE = false; /*@cc_on IE=true; @*/ var r; function setRows(){ r = document.getElementsByTagName('TR'); for(var i=0;i<r.length;i++) r[i].className = (i/2 != Math.round(i/2))? '':'bis'; } function selectRow(aRow,add){ var c = aRow.className; if(add) setRows(); var b = aRow.className; if(IE) aRow.className = b==''? 'selie' : b=='bis'? 'selbisie' : c=='selie'? 'ie' : c=='ie'? 'selie' : c=='bisie'? 'selbisie' : c=='selbisie'? 'bisie' : ''; else aRow.className = b==''||c==''? 'sel' : b=='bis'||c=='bis'? 'selbis' : c=='selbis'? 'bis' : ''; } // roll-over (only for IE) function roll(what) { var c = what.className; what.className = c==''? 'ie' : c=='bis'? 'bisie' : c=='bisie'? 'bis' : c=='selbis'? 'selbisie' : c=='selbisie'? 'selbis' : c=='selie'? 'sel' : c=='sel'? 'selie' : ''; } // fire on loading onload= function() { setRows(); for(var i=0;i<r.length;i++) { if(IE) { r[i].onmouseover = function(){ roll(this); } r[i].onmouseout = function(){ roll(this); } } } } </script> <style type="text/css"> table.altrowstable { font-family: calibri; font-size:11px; color:#333333; border-width: 1px; border-color: #C0C0C0; border-collapse: collapse; } table.altrowstable th { border-width: 1px; "background-image:url('QP Header.png');" border-style: solid; border-color: #C0C0C0; font-size:12px; font-style:bold; } table.altrowstable td { border-width: 1px; border-style: solid; border-color: #a9c6c9; } </style> Thanks Sean IndyNS I am trying to create a dynamic form on my webpage. What I want to do is repeat this process multiple times on the same page. I know I have to have unique id's but I am not for sure how to set them. // JavaScript Document function addRowToTable(){ var tbl = document.getElementById('Division'); var lastRow = tbl.rows.length; // if there's no header row in the table, then iteration = lastRow + 1 var iteration = lastRow; // var iteration = lastRow + 1; var row = tbl.insertRow(lastRow); // cell 0 var cell0 = row.insertCell(0); var el = document.createElement('input'); el.type = 'text'; el.NAME = 'Resource[]'; el.size = 30; cell0.appendChild(el); //cell 1 var cell1 = row.insertCell(1); var el = document.createElement("select"); cell1.innerHTML + '<option value="0">Avaliable</option>' + '<option value="1">Busy</option>' //cell 2 var cell2 = row.insertCell(2); var el = document.createElement('input'); el.type = 'text'; el.NAME = 'Comment[]'; el.size = 25; cell2.appendChild(el); } Im having a problem with my Android applet I am creating using a program called Eclipse It reads the error: 'The method onCreateOptionsMenu(Menu) in the type Activity is not applicable for the arguments (Menu)'. Here is what I have written: [code] public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater awesome = getMenuInflater(); awesome.inflate(R.menu.main_menu, menu); return true; } [code] hi every one i;m new here and i love to know programming languages and some friends adviced me to start with java script then php , and i guess i'm at the right place can you please tell how to start and where to begain i'm really don't know anything about programming
Problem: When I click the compute button, it does not do anything. It does not go to function CALCULATE and do its stuff . Please help me. This is my PHP code. Code: echo "<table border=1>"; while($row_contestant<$numrows_criteria) { $CId=mysql_result($result_contestants,$row_contestant,"CId"); $CName=mysql_result($result_contestants,$row_contestant,"CName"); echo "<tr><td width = '10'>$CId</td><td>$CName</td>"; for($start2 = 1;$start2 <= $counter;$start2++) { echo "<td><input type = 'text' name = 'cr[]' value = ''></td>"; } $row_contestant++; echo "<td><input type = 'text' name = 'rating' value = ''></td><td><input type = 'Button' name = 'getAvg' value = 'compute' onClick = calculate()></td></tr>"; } echo "</table> <p>"; } This is my Javascript calculate function code Code: function calculate() { sum = 0; for(i = 0;i<=Number(document.frmOne.counter.value);i++) { sum = sum + Number(document.frmOne.cr[i].value) } document.frmOne.rating.value = sum } The output: Any help would be highly appreciated. God Bless. Hi so i am using onClick="myPopup(); on a button and when someone clicks on the button, it pops up an advertisement in a new tab. But is there a way to make the users stay on the page where the button is located instead of forcing the browser to automatically switch to the advertisement tab when a button is clicked? |