JavaScript - Help! Making Web Application Viewable/usable To Machines On Local Network
Hi Everyone,
Here is the question: How do I make my website viewable and usable by everyone on my network (in other words, locally)? See below for details. I'm working on a web-application (primarily Javascript and html) that will be located in a folder that everyone has access to at my company. This page is a fairly basic (a person signs-in, their name appears in a table below....the table is constantly growing). My goal is to make everyone able to dynamically add to this table. They need to be able to refresh the table and see it in its current state, and add their names to and continue growing the table. Of course, if I just place my basic web application in the folder everyone has access to, they open it to its original state. I appreciate any response. I'm VERY new to JavaScript and html, though I'm pretty well versed in a few other programming languages (VBA and MATLAB particularly), so I apologize if this is a very basic question. I'll copy in my working code so far, if that helps give a better visualization of what I mean. Code: <html> <STYLE TYPE="text/css"> body{margin: 0; padding: 0} tr.headerT { font-family: Calibri; font-size: 16pt; color: white; text-align: center } input.entryname{width: 150px;} select.optionitem{width: 150px;} .odd{background-color: white; height: 25px;} .even{background-color: E1E1E1; height: 25px;} .sidebar{background-color: AFD7E7;} </STYLE> <script language="JavaScript"> function getDate() { var TimeArray = new Date(); var o_Month = TimeArray.getMonth() + 1; var o_Day = TimeArray.getDate(); var o_Year = TimeArray.getFullYear(); o_Date = o_Month + "/" + o_Day + "/" + o_Year return o_Date } function getTime() { var TimeArray = new Date(); var o_Hours = TimeArray.getHours(); var o_Minutes = TimeArray.getMinutes(); var o_Seconds = TimeArray.getSeconds(); if (o_Hours < 10) {o_Hours = "0" + o_Hours} if (o_Minutes < 10) {o_Minutes = "0" + o_Minutes} if (o_Seconds < 10) {o_Seconds = "0" + o_Seconds} o_Time = o_Hours + ":" + o_Minutes + ":" + o_Seconds return o_Time } function Test2(tableID, selectID, inputID, selectID2) { var table = document.getElementById(tableID); var rowCount = table.rows.length; var row =table.insertRow(rowCount-1); var RowStyle = table.getElementsByTagName("tr"); var Cell1 = row.insertCell(0); var Cell2 = row.insertCell(1); var Cell3 = row.insertCell(2); var Cell4 = row.insertCell(3); var Cell5 = row.insertCell(4); var Cell6 = row.insertCell(5); var Cell7 = row.insertCell(6); var Cell8 = row.insertCell(7); var Cell9 = row.insertCell(8); var entered_name = document.getElementById(inputID).value; var selected_index = document.getElementById(selectID).selectedIndex; var selected_value = document.getElementById(selectID).options[selected_index].value; var index2 = document.getElementById(selectID2); index2.options[index2.options.length] = new Option(entered_name); index2.options[(index2.options.length)-1].value = entered_name; Cell1.className = "sidebar"; Cell2.innerHTML = getDate(); Cell2.align = "center"; Cell3.innerHTML = getTime(); Cell3.align = "center"; Cell4.innerHTML = selected_value; Cell4.align = "center"; Cell5.innerHTML = entered_name; Cell5.align = "center"; Cell9.className = "sidebar"; if((rowCount-1)%2==0){ RowStyle[rowCount-1].className = "even"; }else{ RowStyle[rowCount-1].className = "odd"; } } function Test3(tableID, selectID_rep, selectID_mem) { var dat_table = document.getElementById(tableID); var rowCount = dat_table.rows.length; var mem_select = document.getElementById(selectID_mem); var mem_index = mem_select.selectedIndex; var mem_value = mem_select.options[mem_index].value; var rep_select = document.getElementById(selectID_rep); var rep_index = rep_select.selectedIndex; var rep_value = rep_select.options[rep_index].value; for (i = 0; i<(rowCount-1); i++) { if(dat_table.rows[i].cells[4].innerHTML==mem_value) { if(dat_table.rows[i].cells[5].innerHTML=="") { dat_table.rows[i].cells[5].innerHTML = rep_value; dat_table.rows[i].cells[5].align = "center"; dat_table.rows[i].cells[6].innerHTML = getTime(); dat_table.rows[i].cells[6].align = "center"; } else if(dat_table.rows[i].cells[5].innerHTML==rep_value) { dat_table.rows[i].cells[7].innerHTML = getTime(); dat_table.rows[i].cells[7].align = "center"; mem_select.removeChild(mem_select.options[mem_index]); } } } } </script> <head> <form> <table width = 100% height = 120 border = "0" cellspacing = "0" cellpadding = "0" bgcolor = "white" id="shell" align ="center"> <tr align ="right"> <td rowspan="5" align="left" valign="top"> <IMG SRC="Logo.jpg"> </td> <td rowspan="2" colspan="2"> <IMG SRC="Title_SignIn.jpg"> </td> <td colspan="2" > <IMG SRC="Title_Staff.jpg"> </td> <td width = "10%">   </td> </tr> <tr align ="right" valign = "top" style = "height: 30px"> <td width = "30%"> Select Member:  </td> <td width = "10%"> <select name = "select_member" style = "width: 200px"> </select> </td> <td> </td> </tr> <tr align ="right" valign = "top" style = "height: 30px"> <td width = "10%"> Name:   </td> <td width = "10%"> <input type="text" name="full_name" class="entryname"> </td> <td> Representative:   </td> <td> <select name = "select_rep" style = "width: 200px"> <option value="Rep A">RV Watson</option> <option value="Rep B">Daisy Bauer</option> <option value="Rep C">Mike Andrews</option> </select> </td> </tr> <tr align ="right" valign = "top" style "hieght: 30px"> <td> Reason:   </td> <td> <select name = "reason" class = "optionitem"> <option value="Eligibility">Eligibility</option> <option value="Sick Leave">Sick Leave</option> <option value="Claims">Claims</option> <option value="Pension">Pension</option> </select></td> <td> Password:   </td> <td> Password Box </td> </tr> <tr align ="right" style = "height: 30px"> <td>   </td> <td> <input type="button" value="Sign In" name="btnSignIn" onClick="Test2('thetable', 'reason', 'full_name', 'select_member')"> </td> <td>   </td> <td> <input type="button" value="Sign Member In / Out" name="btnStaff" onClick="Test3('thetable', 'select_rep', 'select_member')"> </td> </tr> </form> </head> <table id ="thetable" width = "100%" height = "100%" border="0" valign="center" cellspacing="0" cellpadding="0" bgcolor="white" id="shell" align="center"> <tr class = "headerT" bgcolor="gray" height = "40"> <td style = "width = 50px"> </td> <td style = "width = 100px">DATE</td> <td style = "width = 150px">TIME</td> <td style = "width = 100px">REASON</td> <td style = "width = 200px">NAME</td> <td style = "width = 200px">REPRESENTATIVE</td> <td style = "width = 150px">START TIME</td> <td style = "width = 150px">END TIME</td> <td> </td> </tr> <tr> <td colspan="1" bgcolor = "AFD7E7"> </td> <td colspan="7" ></td> <td colspan="1" bgcolor = "AFD7E7"> </td> </tr> </table> </body> </html> Similar TutorialsHello there, Problem: I was able to see problem only in IE6 Form input fields not clickable and not accepting inputs + Can't even select text or perform most right-click functions. URL: http://www.webhostingkit.com/a/cgi/p...usercontactall Was wondering if anyone can help me out with this weird problem. Not sure why, but none of the input form fields are able to accept values or even clickon them. Site displays just fine in IE, however anywhere on the site, when user tries to input, it just won't show happen, any idea on what is wrong or how to fix this? Thanks again. ** Edit ** If anyone has IE6 installed can you please test it, cuz I am thinking it might be just the standalone version of IE I have might be having the issue, as in that IE, some major sites (including yahoo.com) are having the same issues. Hello, I would like to know how to make a website (in this case, a parent div) viewable only if JavaScript is enabled? I tried to develop a code that can do this, but could not find the solution. Code: <html> <head> <script type="text/javascript"> window.onload=function() var="true" if(JavaScript.enabled) { document.getElementById('true') } OnClick() {document.getElementById('toggle').onclick=function() {document.getElementById('jahava').style.display=(document.getElementById('jahava').style.display!='none')?'none':'';}} </script> </head> <body> <noscript>You must have JavaScript enabled to view the website.</noscript> <div id="jahava">Contents Here</div> </body> </html> Hello everyone I am new to JS and it has been years since I worked with JAVA or HTML but I'm getting back into it for a pet project of mine and could really use some help getting past this small problem in front of me. ok so here is my issue: I have an HTML page that will read information from Cells in an MS Excel spreadsheet then will write them to the screen. This works if I run it localy and use the direct path like C:\MyFolder\ExcelFile.xls BUT if I try and access the MS Excel spreadsheet from a shared network drive like \\TheComputerName\MyFolder\ExcelFile.xls the JS will not read the file. SO... I tried to leave the HTML file and the Excel file localy and then tried to open teh HTML file from a shared computer like \\TheComputerName\MyFolder\MyWebFile.html but that wouldn't work ether. NOW my question to you guys is how can I get my HTML file to read the Excel file from a Network Shared location... ....AND.... ....How do open the HTML file from a Shared computer (while still correctly reading the Excel Spreadsheet) Please help (and use small words and code for my little brain) and thank you. PS I was wondering if this could even be done in JS, I was wondering if I need to do this in PHP instead which I have NO idea at all. Hi, I am creating a Search functionality program, which searches a file mentioned by the user on a folder present in a Network folder through File Scripting Object. The code works fine but the problem is that, when it searches the file on the Network folder the entire HTML page gets hanged and nothing is displayed till the code has finished searching. I want to update the user with the status of the search process as which folder is it currently searching just the way we have it in the Windows Serach functionality, where the progress is shown on the left side of the window and the files found is shown on the right. I have tried the solution with having two different frames where the first frame will have the HTML and the JavaScript code to search the file and it will also write the results in notepad file as soon as it gets a matching file name and then proceeds ahead. The other Frame will read that notepad file and display the data and it will also refresh itself in every 2 seconds. But the page still hangs up since the first frame is not responding. I have tried the same solution by having two separate HTML pages instead of two frames but no luck. The new HTML page and the previous page both hangs up. Any Ideas?? Hello, I need your help, I have the following code below, and its giving me an error saying: "The system cannot find the file specified". Code: <html> <script language="javascript" type="text/javascript"> function start_ccm(){ var wsh = new ActiveXObject('WScript.Shell'); wsh.exec("C:\Program Files\WorkDynamics Technologies\ccmApplications\ccmMercury.exe") } </script> </head> <body> <input id="Button1" onclick="start_ccm()" type="button" value="START" /> </body> </html> There is nothing wrong with the location, but my best guess are the spaces in the file path. Any help with this is greatly appreciated. Cheers, J hello... I'm sorry, i did read the advises, and i've been through the forum, trying to figure out where to look... but i dont know where to find it... so, i'm sorry if my help request will sound silly,,, i'm only looking for someone that will want to point me in the right direction... and i'll try to do my best on my own ... we want to offer personalized tshirts... so we do need a way for the customer to choose size, color, subject and text and check all this in real time... someone that is doing something that we want is http://www.vistaprint.com/embroidere...aspx?xnav=top# in your opininion, is that vistaprint application a java? pls, could you point me in the right direction to understand that? thanks to anyone that will want to help me How would you Integrate 2 or more Software/Applications via API to build a New Membership Site Software? Also use FB, Twitter & G+ Authentication in addition to Registration via Email Address What is the Process like? What to look out for and how to Document the Workflow? If I want to launch an application in DOS it is START notepad.exe How do I launch the application in Javascript? thanks Hi, We are having a website which shows the HTML5 video once click on the Video link it display the video in the same page where the innerhtml of the div accept it. document.getElementById("video_div").innerHTML = QT_WritePoster_XHTML('Click to Play', tabs[currentTab].articles[currentArticle].video+'-poster.jpg',tabs[currentTab].articles[currentArticle].video+'.mov',536, 256, '','controller', 'true','autoplay', 'true','bgcolor', 'black','scale', 'aspect'); It display the video in all the browser accept Safari and in IPhone. Once this QT_WritePoster_XHTML line is encountered while clicking on the Video link of the application it opens the video mentioned in the QT_WritePoster_XHTML on the new blank video but not in the innerhtml with the Application. Please let us know what to do to support this code with the application. Please note that this problem is coming only for Safari Apple. Thanks in advance. Ok so I am building a quiz application that I want to let people hit continue and it would save through MySQL database what radio buttons have been selected. IE: What is your username? (o) No Answer [hidden] () Randy () Randy3 () Randy53215 () Randy2 This is just an example of how we would like it setup and if nothing is selected (as shown above) it would calculate that no answer was selected and save all the results of which were selected. So it would see that No Answer was selected and it would skip it and check all the rest. (Generally we have 4 answers). So it would save something like this... () No Answer [hidden] () Randy () Randy3 (o) Randy53215 () Randy2 Does anyone have any idea on how to go about this? Have a link to a page or some personal Javascript source that could do this? My javascript abilities are close to nothing. I can manipulate a bit to get it to work but that's about it. Any help would be greatly appreciated. Can someone explain how to deploy an application in red5 webapps directory? On a remote server? Or is this something I'd have to hire a consultant for? Thanks Hello all, I want to screen scrape a citrix application using server side java script. Currently I am making use of WScript.Shell ActiveXObject and try the following : var objShell =new ActiveXObject("WScript.Shell"); objShell.AppActivate("Metaframe Presentation Server"); // this is the title of the citrix dialog that opens up once the application gets launched. objShell.SendKeys ("{ENTER}") Using AppActivate, the focus is transferred to the dialog mentioned above, but then the SendKeys do not work. Do I need to do it differently? Please provide your valuable help. Hi, Can anyone tell me How to send values from application resources.properties file to a java script function in a jsp Thanks in Advance, John Ven Hello, Wondering if any users could point me in the right direction on this one. Newbie question, how do I call up a local Var within a function? As you can see I have both a global and a local. but the doc.write will only show the global var. Code: <html> <head> <script type="text/javascript"> var p=0; function test(){ p=p+5; window.alert(p); } </script> </head> <body> <h1>test: <script type="text/javascript"> document.write(p); </script> </h1> <br> <input type="Button" value="Add" onclick="test()" /> </body> </html> Thanks in advance if anyone can help. Hello, I am working on a project using HTML and javascript to allow the user to choose a vehicle from a drop down menu, then load a new page showing some information about this vehicle. The information is stored in an Excel file. I posted regarding this issue a while back and got an excellent response from Old Pedant (thanks again!) about using ActiveX - which has thus far worked perfectly. My initial condition was that I would only be using IE7+. However, my next idea was to be able to use it on an IPad (which I unfortunately do not own yet, making any kind of testing difficult) which I am fairly certain ActiveX won't work on. So, I was looking for any other method which would be similar. Important note: this will not use the internet at all, all of these files will be available locally. There is a lot of material on running queries to servers, but I didn't think that would really apply here. It seems pretty clear that JS has difficulty accessing files client side (which I understand why completely), but I was hoping to find something that worked for the gray zone I'm currently working in since I'm not using servers at all. I know that this is not really the intended use of HTML/JS, but I was hoping that by writing it as an HTML file, it'd be accessible to anyone with a browser. Some of my target computers have odd limitations (such as not being to download .exe files). The code I based my original off of is shown below: Code: <script type="text/javascript"> var conn = new ActiveXObject("ADODB.Connection") conn.Open ( 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\full\path\to\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";)'; var sql = "SELECT * FROM [nameOfSheet$]"; var rs = conn.execute( sql ) while ( ! rs.eof ) { // just an example of dumping everything from the sheet out to the browser: for ( var f = 0; f < rs.fields.count; ++f ) { document.write( rs.fields(f).value + "," ); } document.write("<br>\n"); rs.moveNext(); } rs.close(); conn.close(); </script><script type="text/javascript"> var conn = new ActiveXObject("ADODB.Connection") conn.Open ( 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\full\path\to\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";)'; var sql = "SELECT * FROM [nameOfSheet$]"; var rs = conn.execute( sql ) while ( ! rs.eof ) { // just an example of dumping everything from the sheet out to the browser: for ( var f = 0; f < rs.fields.count; ++f ) { document.write( rs.fields(f).value + "," ); } document.write("<br>\n"); rs.moveNext(); } rs.close(); conn.close(); </script> Thank you, klarosa Hi all. I have text area that includes the full path for a local file on our company network. The files are usually excel sheets or docs. How can I have it so when they clicks the file it opens the local file?
Hello, I am reading a block of code online and I don't understand why the output i in "Checking the value of: i " is always 5. Code: var someArray = [1,2,3,4,5], len = someArray.length, i = 0; var count = 0; for ( ; i < len; i++ ) { setTimeout(function() { console.log( count++ === i, 'Checking the value of: ' + i ); }, i * 300); } This will produce output below in console.log: Code: false Checking the value of: 5 false Checking the value of: 5 false Checking the value of: 5 false Checking the value of: 5 false Checking the value of: 5 The tutorial says the code will only render the final value in the sequence: 5 but not 1, 2, 3, 4, 5 as I would expect in the for loop. Could someone explain this to me. Thanks very much. Is there a best practice to get a lastmodified in local time vs. GMT? Here's the code: Code: var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "parks.xml", true); xmlhttp.send(); xmlhttp.onreadystatechange = function() { if(this.readyState == 2) { var updated = (xmlhttp.getResponseHeader("Last-Modified")); //alert(updated); document.getElementById('xml_modified').innerHTML = updated; } } Code: and <li id ="bottom_menu"><a href="parks.xml" target = "_blank">XML</a> Updated: <div id = "xml_modified"></li> Thanks for any help, S .... [Edit] I have moved this thread to resolved since it cannot work the way I want it to (couldn't find a delete button). The variable in question is overwritten each time the function is called and there is no way to cache it globally. I will have to figure something else out for this one. Thank you to those that took a look anyway..... Ok, here is what I have. I am trying to fix up a calculator script that I found online to add a bit more intuitive function to it. I want to use this script but it irritates me the way it is. It's a simple enough script, which is why I want to use it, but I want to be able to use keyboard keys with it (instead of clicking buttons. Here's the HTML: Code: <FORM NAME="Calc"> <TABLE BORDER=4> <TR> <TD> <INPUT TYPE="text" NAME="Input" id="Input" Size="26"> <br> </TD> </TR> <TR> <TD> <INPUT TYPE="button" NAME="one" VALUE=" 1 " OnClick="Calc.Input.value += '1'"> <INPUT TYPE="button" NAME="two" VALUE=" 2 " OnCLick="Calc.Input.value += '2'"> <INPUT TYPE="button" NAME="three" VALUE=" 3 " OnClick="Calc.Input.value += '3'"> <INPUT TYPE="button" NAME="plus" VALUE=" + " OnClick="Calc.Input.value += ' + '"> <br> <INPUT TYPE="button" NAME="four" VALUE=" 4 " OnClick="Calc.Input.value += '4'"> <INPUT TYPE="button" NAME="five" VALUE=" 5 " OnCLick="Calc.Input.value += '5'"> <INPUT TYPE="button" NAME="six" VALUE=" 6 " OnClick="Calc.Input.value += '6'"> <INPUT TYPE="button" NAME="minus" VALUE=" - " OnClick="Calc.Input.value += ' - '"> <br> <INPUT TYPE="button" NAME="seven" VALUE=" 7 " OnClick="Calc.Input.value += '7'"> <INPUT TYPE="button" NAME="eight" VALUE=" 8 " OnCLick="Calc.Input.value += '8'"> <INPUT TYPE="button" NAME="nine" VALUE=" 9 " OnClick="Calc.Input.value += '9'"> <INPUT TYPE="button" NAME="times" VALUE=" x " OnClick="Calc.Input.value += ' * '"> <br> <INPUT TYPE="button" NAME="clear" VALUE=" C " OnClick="Calc.Input.value = ''"> <INPUT TYPE="button" NAME="zero" VALUE=" 0 " OnClick="Calc.Input.value += '0'"> <INPUT TYPE="button" NAME="DoIt" VALUE=" = " OnClick="Calc.Input.value = eval(Calc.Input.value)"> <INPUT TYPE="button" NAME="div" VALUE=" / " OnClick="Calc.Input.value += ' / '"> <br> </TD> </TR> </TABLE> </FORM> Now, what I am trying to fix is the fact that the enter key does not "emulate" the "=" sign button. I did some research and got the following KeyCode script: Code: document.onkeyup = KeyCheck; function KeyCheck(e) { if (document.Calc.Input.value != "") { var formVal = document.Calc.Input.value; } var KeyID = (window.event) ? event.keyCode : e.keyCode; if (KeyID == 13) { alert (formVal); document.getElementById("Input").value = eval(formVal); } } The only key I am concerned with is the enter key (code 13) so i figured I could just fire a statement when that key was detected, however my "formVal" variable seems to disappear after the first if statement. The reason for the first if statement is to keep the "fromVal" variable from being overwritten when the enter key is pressed. As it stands now, the alert box and the form input box display "undefined" when the enter key is pressed. What am I missing here? |