JavaScript - Ms Access To Xml Search And Display
Hello, I am trying to set up this Javascript to work with my XML exported from Microsoft Access for support on an Intranet page. I borrowed from a tutorial code but I cant seem to figure out how to get the Javascript to recognize my values in the xml file. I believe my issue is related to the formatting of the xml file. The example is formatted like
Code: <index> <name><![CDATA[ Paul ]]></name> <age><![CDATA[ 26 ]]></age> <height><![CDATA[ 6'0" ]]></height> </index> While my access file exports a little messy... Sadly, unless this can be changed.. I would love to just enter the code myself for each entry.. but I need it to be exportable and immediately updated to the Javascript search. Access exports like this. Code: <Employee_x0020_Database> <Employee_x0020_Number>200786</Employee_x0020_Number> <First_x0020_Name>Stacey</First_x0020_Name> <Middle_x0020_Name>Leanne</Middle_x0020_Name> <Last_x0020_Name>Evans</Last_x0020_Name> <Gender>F</Gender> <Date_x0020_of_x0020_Hire>2005-04-07T00:00:00</Date_x0020_of_x0020_Hire> <Position>Cashier</Position> </Employee_x0020_Database> Any advice on how I can get Javascript to recognize the values without a CDdata tag? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Search</title> <script type="text/javascript"> window.onload = loadIndex; function loadIndex() { // load indexfile // most current browsers support document.implementation if (document.implementation && document.implementation.createDocument) { xmlDoc = document.implementation.createDocument("", "", null); xmlDoc.load("index.xml"); } // MSIE uses ActiveX else if (window.ActiveXObject) { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = "false"; xmlDoc.load("index.xml"); } } function searchIndex() { // search the index (duh!) if (!xmlDoc) { loadIndex(); } // get the search term from a form field with id 'searchme' var searchterm = document.getElementById("searchme").value; var allitems = xmlDoc.getElementsByTagName("item"); results = new Array; if (searchterm.length < 3) { alert("Enter at least three characters"); } else { for (var i=0;i<allitems.length;i++) { // see if the XML entry matches the search term, // and (if so) store it in an array var name = allitems[i].lastChild.nodeValue; var exp = new RegExp(searchterm,"i"); if ( name.match(exp) != null) { results.push(allitems[i]); } } // send the results to another function that displays them to the user showResults(results, searchterm); } } // Write search results to a table function showResults(results, searchterm) { if (results.length > 0) { // if there are any results, write them to a table document.write('<div><a href="search.html">New Search</a></div>You searched for <b><i>'+searchterm+'</i></b><br><br>'); document.write('<table border="1" style="width: 100%;">'); document.write('<tr><th>NAME</th><th>AGE</th><th>HEIGHT</th><th>WEIGHT</th></tr>'); for(var i=0; i<results.length; i++) { document.write('<tr>'); document.write('<td>' + results[i].getAttribute("name") + '</td>'); document.write('<td>' + results[i].getAttribute("age") + '</td>'); document.write('<td>' + results[i].getAttribute("height") + '</td>'); document.write('<td>' + results[i].getAttribute("weight") + '</td>'); document.write('</tr>'); } document.write('<table>'); document.close(); } else { // else tell the user no matches were found var notfound = alert('No results found for '+searchterm+'!'); } } </script> </head><body> <form action=""><b>Search: </b><input id="searchme" type="text" size="20"> <input value="Submit" onClick="searchIndex(); return false;" type="submit"></form> </body></html> Thanks for helping me with this... Totally way over my head on this one. Delvok Similar TutorialsThis is a follow up to my older thread, about tables and finding images within them. So after getting some help from "Krupski" I found myself stuck again. I'm trying to go at this rather from an other point of view, instead of getting the cell information I am now trying to get the alt text value. from within the image tag. but being a novice at this well ive hit a wall. My code so far. searches though the table finding the sad images then i want it to display the Alt-text or an other value table_id or similar. also is there a fast way of putting in Alt text like A1,2,3 B1,2,3 etc like an automated loop. (might work on this after the main problem is dealt with) Code: <html> <head> <script type="text/javascript"> var findImg = function(name) { var e = document.getElementsByTagName('img'); var i = e.length; // how many img elements total var str = ''; while (i--) { if (e[i].src.indexOf(name) != -1) // if match... str += e[i].src + '\n'; //...copy to str with a newline } alert(str); // display all matches } function searchFor(){ findImg('smiley%20sad%20Icon.jpg'); // call the function with the name to be matched } </script> </head> <body> <table width="200" border="1"> <tr Id="A"> <td Id="1"><img src="http://www.hencam.co.uk/hencam_forum//extensions/Smile/tango/face-smile.png" Alt="A1"> </td> <td Id="2"><img src="http://www.hencam.co.uk/hencam_forum//extensions/Smile/tango/face-smile.png" Alt="A2"> </td> <td Id="3"><img src="http://www.iconeasy.com/icon/thumbnails/System/Icons%20for%20Developers/smiley%20sad%20Icon.jpg" Alt="A3"></td> </tr> <tr Id="B"> <td Id="1"><img src="http://www.hencam.co.uk/hencam_forum//extensions/Smile/tango/face-smile.png" Alt="B1"></td> <td Id="2"><img src="http://www.iconeasy.com/icon/thumbnails/System/Icons%20for%20Developers/smiley%20sad%20Icon.jpg" Alt="B2"></td> <td Id="3"><img src="http://www.hencam.co.uk/hencam_forum//extensions/Smile/tango/face-smile.png" Alt="B3"></td> </tr> <tr Id="C"> <td Id="1"><img src="http://www.hencam.co.uk/hencam_forum//extensions/Smile/tango/face-smile.png" Alt="C1"></td> <td Id="2"><img src="http://www.hencam.co.uk/hencam_forum//extensions/Smile/tango/face-smile.png" Alt="C2"></td> <td Id="3"><img src="http://www.hencam.co.uk/hencam_forum//extensions/Smile/tango/face-smile.png" Alt="C3"></td> </tr> </table> <br> <input type="button" value="Search" id="Search" onClick="searchFor();"/> </body> </html> Thanks in advance anyone who can help. ~Mark j Hi there, I have a search function on my website. When a user types something, options (including his characters) are displayed in a box (layer) as hyperlinks using Ajax, a very common feature these days. My problem is that if the user clicks somewhere else in page the links display stays on screen. I tried to fix the issue by adding an onBlur event to the search box (different id that the "display" div): Code: document.getElementById('livesearch').style.display = 'none'; where livesearch is the id of the hyperlinks displaying div. Job done but...the hyperlink "box" dissapear and the problem now is that the links are not working (if you click on one, the div dissapear first (I SUPPOSE) and no redirection to link is made....) I tried a couple of if else tricks I could think of with no success. No need to say that I am not a javascript wizz....hope you like the js1 username Any help will be appreciated. Thank you in advance, Julian hi, im fairly new to javascript but i know the basics. im just wondering is there a possibility to make a search that will connect to my databse with a product list in it, and then display any matches to what the user searched for? help is always helpful Hello all, hope all is well. I have a search function that displays hidden divs based on what the user has searched for. I would like the "search results" to be opened onto a new page; I have a feeling the results page would contain all the hidden divs and a form of JS would need to be used to "pass" the search data to the new page and thus perform the search and display the corresponding div. - Any help is appreciated here code and demo site below. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <LINK rel="stylesheet" type="text/css" href="<?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/php/fleet/includes/website.php"; include_once($path); ?>/php/font.css"></style> </head> <body> <script type="text/javascript"> var showndiv=false; function show() { document.getElementById('fleet1').innerHTML=""; if (showndiv){document.getElementById(showndiv).style.display = 'none'; } theval=Number(document.getElementById('tb').value); switch (theval){ case 120: showndiv='fleet2' break; case 121: showndiv='fleet3' break; case 122: showndiv='fleet4' break; default: document.getElementById('fleet1').innerHTML="Sorry, nothing found" return; } document.getElementById(showndiv).style.display = 'block'; } </script> <script type="text/javascript"> ///////////////////////////////////////////////////// // Between the quotation marks, list the id values of each div. var IDvaluesOfEachDiv = "fleet2 fleet3 fleet4"; ///////////////////////////////////////////////////// IDvaluesOfEachDiv = IDvaluesOfEachDiv.replace(/[,\s"']/g," "); IDvaluesOfEachDiv = IDvaluesOfEachDiv.replace(/^\s*/,""); IDvaluesOfEachDiv = IDvaluesOfEachDiv.replace(/\s*$/,""); IDvaluesOfEachDiv = IDvaluesOfEachDiv.replace(/ +/g," "); var IDlist = IDvaluesOfEachDiv.split(" "); function ShowAllDivs() { for(var i=0; i<IDlist.length; i++) { document.getElementById(IDlist[i]).style.display = ""; } } function HideAllDivs() { for(var i=0; i<IDlist.length; i++) { document.getElementById(IDlist[i]).style.display = "none"; } } </script> <form name="myForm"> <input type="text" id="tb"> <input type="button" value="Search" onclick="show()"> </form> <div id="fleet1" style="display:block"> </div> <div id="fleet2" style="display:none" class="fleetdiv"> <br> <table valign="top" align="center" border="0" width="690" style="border-collapse: collapse" cellpadding="0" cellspacing="0" bgcolor="#336699"> <TR border="0" bordercolor="#FFFFFF"> <TD valign="top"> <TR> <TD> <TABLE cellpadding="4" cellspacing="1" border="0" width="100%" class="sortable"> <TR> <TH class="titlebg" bgcolor="#336699" width="16%"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Fleet</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="17%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Registration</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="19%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Chassis</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="19%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Body</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="13%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Seating</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="15%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Brand</B></FONT> </TH> </TR> <TR> <TD align="left" width="14%" bgcolor="#FFFFFF"> <FONT class="font">120<a href="http://www.nctfleetlist.co.uk/photos/search.php?keywords=120"> <img src="http://www.nctfleetlist.co.uk/images/camera.png" border="0"></a></FONT></TD> <TD valign="middle" align="center" width="16%" bgcolor="#FFFFFF"> <FONT class="font">W599 PTO</FONT> </TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <FONT class="font">M920</TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <FONT class="font">OPTARE</font> </TD> <TD valign="middle" align="center" width="12%" bgcolor="#FFFFFF"> <FONT class="font">B33F</font> </TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <font class="font"><a href="http://www.nctfleetlist.co.uk/main/netgreen.php"><font color="#348017">Network Green</a></a></font> </TD> </tr></table> </td> </tr> </table> <table align="right"> <TR> <TD> <a href="javascript:HideAllDivs()" class="font"><nobr>X Close</nobr></a></div></td></tr> </table> <div id="fleet3" style="display:none"> <br> <table valign="top" align="center" border="0" width="690" style="border-collapse: collapse" cellpadding="0" cellspacing="0" bgcolor="#336699"> <TR border="0" bordercolor="#FFFFFF"> <TD valign="top"> <TR> <TD> <TABLE cellpadding="4" cellspacing="1" border="0" width="100%" class="sortable"> <TR> <TH class="titlebg" bgcolor="#336699" width="16%"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Fleet</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="17%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Registration</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="19%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Chassis</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="19%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Body</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="13%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Seating</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="15%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Brand</B></FONT> </TH> </TR> <TR> <TD align="left" width="14%" bgcolor="#FFFFFF"> <FONT class="font">121<a href="http://www.nctfleetlist.co.uk/photos/search.php?keywords=121"> <img src="http://www.nctfleetlist.co.uk/images/camera.png" border="0"></a></FONT></TD> <TD valign="middle" align="center" width="16%" bgcolor="#FFFFFF"> <FONT class="font">W601 PTO</FONT> </TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <FONT class="font">M920</TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <FONT class="font">OPTARE</font> </TD> <TD valign="middle" align="center" width="12%" bgcolor="#FFFFFF"> <FONT class="font">B33F</font> </TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <font class="font"><a href="/main/netgreen.php"><font color="#348017">Network Green</a></a></font> </TD> </tr></table> </td> </tr> </table></div> <div id="fleet4" style="display:none"> <br> <table valign="top" align="center" border="0" width="690" style="border-collapse: collapse" cellpadding="0" cellspacing="0" bgcolor="#336699"> <TR border="0" bordercolor="#FFFFFF"> <TD valign="top"> <TR> <TD> <TABLE cellpadding="4" cellspacing="1" border="0" width="100%" class="sortable"> <TR> <TH class="titlebg" bgcolor="#336699" width="16%"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Fleet</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="17%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Registration</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="19%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Chassis</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="19%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Body</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="13%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Seating</B></FONT> </TH> <TH class="titlebg" bgcolor="#336699" width="15%" align="center"> <FONT size="2" class="tabletop" color="#FFFFFF"><B>Brand</B></FONT> </TH> </TR> <TR> <TD align="left" width="14%" bgcolor="#FFFFFF"> <FONT class="font">122</FONT></TD> <TD valign="middle" align="center" width="16%" bgcolor="#FFFFFF"> <FONT class="font">W602 PTO</FONT> </TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <FONT class="font">M920</TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <FONT class="font">OPTARE</font> </TD> <TD valign="middle" align="center" width="12%" bgcolor="#FFFFFF"> <FONT class="font">B33F</font> </TD> <TD valign="middle" align="center" width="19%" bgcolor="#FFFFFF"> <font class="font"><a href="/main/netgreen.php"><font color="#348017">Network Green</a></a></font> </TD> </tr></table> </td> </tr> </table></div> </body> </html> http://nctfleetlist.co.uk/div3.php In this case, Let's take Google Search as example: The code is JScript .NET, which is basically a .NET version of Javascript. Regardless of language, Anyone with appending type of skill can answer my question. This code is used in Fiddler(It's a Man-in-the-middle proxy) Code: if (oSession.uriContains("&q=")) // oSession is a Fiddler object session // uriContains() function, checks for case-insensitive string from the URI { var str = oSession.fullUrl; var sAppend = "test1+test2+test3"; if (!oSession.uriContains(sAppend)) { oSession.fullUrl = str.replace( "&q=","&q="+sAppend); } } For those who are confused, It says, If &q= is present in the URI, replace/append &q= with &q=test1+test2+test3 Problem: It appends test1+test2+test3 instantly, when it sees &q= in the URL. Basically, how do I make it wait until I click the submit/search button Thank you. Update: I heard about Onsubmit() event, but not really familiar with it. How do I use it? like, should I go to google source page and edit the form id? Also, Any other methods besides Onsubmit()? Hi experts, is it possible via Javascript to search certain websites with certain keywords without having to use specific search engines? example search only the following: 1. www.yyy.com 2. www.aaa.com 3. www.zzz.com for the keyword "Laminat" and open the sites accordingly. thx Hi Everyone! I have a website that I'm designing where I have the need to search multiple sites at specific times. By this I mean that In some cases, we would want to search only the internet using google, or only search the site that I've created (which currently uses the jse_search.js solution), or only our company's website. I currently have four different search boxes that will search either the internet, the internal site, a separate internal site, or a third-party website, which all working fine. The problem is that the search boxes take up quite a bit of space, and the layout is becoming cumbersome. Is there a way in Javascript I could use a single search box and a drop-down list to select which method to use? The code I'm currently using is below. With the exception of the Google search function, I've modified some of the site names to general site names and paths to preserve the company's anonymity: Code in the <head> tag: Code: <script language="JavaScript1.3" type="text/javascript" src="jse_form.js"> </script> Code in the <body> tag: Code: <!--Begin Internal Site Search 1!--> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td><form name="jse_Form" onsubmit="search_form(jse_Form);return false"> <input type="text" name="d" size="30"> </tr></td> <tr><td> <input type="button" value="Internal Site Search 1" onclick="search_form(jse_Form)"> </form> </tr></td> </table> <!--End Internal Site Search 1!--> <!--Begin Internal Site Search 2!--> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td> <!--webbot bot="Search" S-Index="all" S-Fields S-Text="Search for:" I-Size="20" S-Submit="Start Search" S-Clear="Reset" S-TimestampFormat="%m/%d/%Y" TAG="BODY" b-useindexserver="1" startspan --> <form action="http://sitesearch2.idq" method="POST"><input type="text" name="UserRestriction" size="30" value> </tr></td> <tr><td style="text-align: center;"> <input type="submit" value="Internal Site Search 2"></form> </form> <!--webbot bot="Search" i-checksum="4210" endspan --> </td></tr> </table> </div> <!--End Internal Site Search!--> <!--Begin Google Search!--> <form method="get" action="http://www.google.com/search"> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td> <input type="text" name="q" size="30" maxlength="233" value="" /> </tr></td> <tr><td align="center"> <input type="submit" value="Google Search" /></td></tr> </table> </div> </form> <!--End Google Search!--> <!--Begin Third Party Search!--> <form id="keywordSearchForm" method="get" action="http://www.site3.html"> <div> <p style="text-align: center;"> <table border="0" cellpadding="0"> <tr><td> <input class="input" type="text" name="keyword" size="30" /> </tr></td> <tr><td align="center"> <input type="hidden" name="origin" value="keywordsearch" /><input id="go" class="button" tabindex="0" type="submit" value="Third Party Search" /> </td></tr> </table> </div> </form> <!--End Third Party Site Search!--> Hello people. I'm looking to create a simple search engine capable of searching multiple search engines simultaneously together (e.g. Google, Bing, Yahoo, etc.) and then displaying the results below for all sites on the same page. I don't want each search engine results page opening up in individual windows or anything, nor do I want people to have to manually select the search engine to search with. Just a single page where a user types in something, pressed [Enter] and then presented with all results from multiple sites on one page (without duplicates). I'm also looking to do this with image and torrent sites, etc. How would I go about doing this? Thanks a million guys. You have bigger brains than me. Sup gents. Excuse my tenaciously novice questions, but dont disparage just yet, im beginning to grasp how the mechanism behind the code words, in due part to your helpful suggestions Im in the last stages of the code. In this section i have added three methods, whose function is to direct access control over the ciphers i will be adding shortly. I firstly need for the methods to be working. What they do is, categorize the set of values inside the first array and give a set of names privileges. The three methods that deal with the access control are link(), secondgroup() and third group. Ive assigned that the first three names( link() ) can access all the ciphers, ie administrators, the next three names ( secondgroup() ) can only access the shift, permutation and vigenere ciphers and the rest ( thirdgroup() ) can access the other remaining ciphers. But ive added so much code at once that i overwhelmed myself and i now i cant figure out where ive gone wrong, be it in the syntax or the logic Code: <html> <head> <script type ="text/JavaScript"> var counter = 0; var counter2 = 0; var arraynumb = 0; var arraynumb2 = 0; var global; var array = ['Mohamad', 'Karim', 'Anthony', 'Rami', 'Natalia', 'Sarah', 'Samer', 'Violette', 'Plume', 'Sharshabil']; var array2 = ["1000", "1001", "1002", "1003", "1004", "1005", "1006", "1007", "1008", "1009"]; function pass(){ var searchKey = document.searchform.inputVal.value; for (var i = 0, len = array.length; i < len; i++){ if (array[i] == searchKey){ counter = 1; arraynumb = i; } } } function pass1(){ var searchKey2 = document.searchform.inputVal2.value; for (var i = 0, len = array2.length; i < len; i++){ if (array2[i] == searchKey2){ counter2 = 1; arraynumb2 = i; } } } function access() { if (counter == 1 && counter2 == 1 && arraynumb == arraynumb2) { window.alert("You may access the website"); global = 1; } else{ window.alert("You may not access the website"); global = 0; } } function link() { var searchKey3 = document.searchform.inputVal.value; if (global == 1 && (searchkey3 == array[0] || searchkey3 == array[1] || searchkey3 == array[2] )) { window.alert("You are an administrator, you may use all the ciphers"); } else window.alert("you are not signed in, please do so"); } function secondgroup() { var searchKey4 = document.searchform.inputVal.value; if (global == 1 && (searchkey4 == array[3] || searchkey4 == array[4] || searchkey4 == array[5] )) { window.alert("You are an ordinary user of class A, you may proceed to access the Shift, Vigenere and Permutation ciphers"); } else window.alert("You may not access this cipher"); } fucntion thirdgroup() { var searchKey5 = document.searchform.inputVal.value; if (global == 1 && (searchkey5 == array[6] || searchkey5 == array[7] || searchkey5 == array[8] || searchkey5 == array[9] )) { window.alert("You are an ordinary user of class B, you may proceed to access the Hill, Affine, Substitution and DES ciphers"); } else window.alert("You may not access this cipher"); } </script> </head> <body> <form name = "searchform" action = ""> <p>Enter username<br/> <input name = "inputVal" type = "text" size = "30"/> <input name = "search2" type = "button" value = "Search" onclick = "pass()"/> </p> <p>Enter password<br/> <input name = "inputVal2" type = "password" size = "30"/> <input name = "search" type = "button" value = "Search" onclick = "pass1()"/> <input name = "Access site" type = "button" value = "Access" onclick = "access()"/> <br/> <br/> <input name = "link to" type = "button" value = "Shift" onclick = "link();return secondgroup();" enabled=""/> <input name = "link to" type = "button" value = "Vigenere" onclick = "link();return secondgroup();" enabled=""/> <input name = "link to" type = "button" value = "Permutation" onclick = "link();return secondgroup();" enabled=""/> <input name = "link to" type = "button" value = "Hill" onclick = "link();return thirdgroup();" enabled=""/> <input name = "link to" type = "button" value = "Affine" onclick = "link();return thirdgroup();" enabled=""/> <input name = "link to" type = "button" value = "Substitution" onclick = "link();return thirdgroup();" enabled=""/> <input name = "link to" type = "button" value = "Des" onclick = "link();return thirdgroup();" enabled=""/> <br/> </p> <br/> <p></p> </form> </body> </html> Hi this is what I want to do. I have an online store and a need get fixed the machines from where my clients use my web site. what I'm doing right now is using an activeX to retrieve theirs OS code, HD serial number and other stuff and is working fine but since I'm using an ActiveX they are forced to use Internet Explorer and that's the big problem. my clients agree for me doing this check on their computers, actually they allow the activex to run, but they are requesting the posibility of using for example mozilla. thanks in advance and sorry about my english I'm just learning it is said that the 'form' node can be accessed by document.forms.certainName but it fails on my browser(IE8) however for images, it works, that is, document.images.certainName returns a Node. is there bugs only on 'form' tag? btw, document.forms[0] works ... quite quirky... i noticed today that if i type in my js file name in the url i get a download box, i have an htaccess on my site so this should not be happening, thats another issue.. my question is, is there a trick to creating a js file that cant be accessed in this manner, i was thinking about adding a php define statement as it comes from one source only, but i wanted to ask first to see if there was something on the js side i could do or is that strictly a htaccess or server side issue.. hi, i want to make an ftp access page using javascript i know it's possible using "ftp://" , but when i use this, the browser loads a window with the ftp folder i want a javascript to get ftp access and to give the commands itself any1 who knows how to get ftp access and ability to give file send/receive/... commands with javascript? How would you access information about various attributes of an element with javascript?
Hi all, Have problem from getting data of JavaScript Object ie. Associative Array. Code: var a, table1 a = new ActiveXObject("MyProgID"); a.GetDataFromExcel("C:\\Users\\myFolder\\Desktop\\test.xls","Sheet1") a.Generate() table1 = a.writeInTable(); Here writeInTable function returns a 2D Object array from DLL written in VB.Net. So I got the Object to table1. But from table1, I can't access the values but its there. table1 shows values as in this image(Image Attached.) Actually, I tried many ways like tab(0)(0) tab[0][0] tab["0"] tab.(0).(0) tab.[0].[0] Also with toArray(), (new VBArray(tab)).toArray().... I don't know what I am wrong..Can anyone help me on this? Thanks... Shanmugavel.C First post! Hey all! So I've been having trouble figuring out how to make this page work. The page I'm working on has 3 frames: top/main/title frame, left frame, and right frame. What the page is supposed to be is like a shopping page. The left frame has all the items that you can select, while the right page has the "receipt" of your selected items. Now here's the problem: The left frame has an "Update Order" button on the bottom that updates the receipt on the right frame. However, I can't get the button to work. I'm not exactly sure how to write the code for the receipt frame (if there is any javascript code needed for that frame) or how to have the left frame send all that information to the right frame. I hope this all makes sense. Thanks for taking the time to read all that! I'm trying to get the value of a radio button when clicked. I'm dynamically creating these radio buttons while populating a table like this: Code: var rad for(blah blah blah){ insert array data into table... insert array data into table... insert array data into table... rad = document.createElement('input'); rad.setAttribute('type', 'radio'); rad.setAttribute('name', 'options'); rad.setAttribute('value', id); rad.onclick = function() { doSomething() }; cell.appendChild(rad); } If I'm in the doSomething function, how do I access the value or ID of the radio button? Thanks! I'm trying to write a little Greasemonkey script (in Firefox) to manipulate the top bar Google Translate produces when translating a site. For example: http://translate.google.com/translat.../www.google.de. Google has employed traditional HTML frames. According to many websites, I can use something like window.frames[0].contentDocument to access the first frame. However, this is refusing to work! I have been debugging this for hours. I have verified that I am indeed running the script from the top-level window (window.parent === window.top), and I am able to manipulate the frames themselves without a problem. When I try something like window.frames[0].contentDocument.URL, it returns as about:blank (I also get this with the other frame, i.e., frames[1]). I have tried several different methods of getting at that frame, including getElementsByTagName("frame")[0] (which works for manipulating the frame itself, but not for editing the frame's content through contentDocument). Here's my little script so far. I've included the first part so you can see for yourself that I'm definitely in the top-level window and using the right @include because it works. In this example, the URL returned is "about:blank" (again, I'm in Firefox). Code: // ==UserScript== // @name GTranslate // @include /^https?://translate\.google\.com/translate\?.*/ // ==/UserScript== // change how the frame is displayed var bar = document.getElementsByTagName("frame")[0]; bar.removeAttribute("noresize"); // manipulate the content inside the frame var gt = bar.contentDocument; alert(bar.URL); Hi someone please let me know the way to access a smarty value with javascript? my smarty value is = {$value.url} i want to access it like Code: <script type="text/javascript"> function load() { document.location = '{$value.url}'; } </script> i tried with wrapping code with {literal} {/literal} but it isnt working. can some one correct this please sorry for bad english Thanks Hi, I'm a retired social worker with beginner skills in scripting a web page and need some suggestions. I create eLearning materials which are given away as a communty service to help people improve their health. A typical eLearning project has a few educational screens (using a Learner Management System-LMS-template) and an interactive exercise (on an external web page-htm or html-usually accessed by button which navigates to the exercise's URL). The interactive exercise should only be accessed from inside the eLearning lesson using the button, because it requires understanding of the way it works plus important cautions to assure proper use. I need to prevent the use of the URL outside of taking the lesson (for example, someone taking the lesson acquires the exercise's URL from their browser history and then may give this to others who access the exercise directly-without necessary knowledge and cautions). I tried document.referrer, using JavaScript. Using the referrer URL from inside the lesson and adding the JavaScript to the exercise's htm code worked OK in FF, but not in IE 8. In FF, if the referrer was not the correct single URL from inside the lesson, then it redirected; if the correct URL, the exercise appears. The JS code follows: Code: <script language="JavaScript" type="text/javascript"> <!-- var oksite = "http://www.mysite.com/xyz/courseidxxxxx/yyyy/zzz.html"; var redirect = "http://mysite.com/error.html"; if (document.referrer != oksite) { location.replace(redirect); } //--> </script> In IE 8, I was not able to get it to work. Using an alert, I noticed that the referrer in IE 8 was blank. My web hosting (GoDaddy) is a shared Windows hosting. I would have to upgrade from IIS6 to IIS7 to use PHP. Bigger challenge: I've never used PHP. If possible, I would prefer to use JS. But, I am open to any suggestion that will help. I am also wondering if part of the IE 8 issue is that I am using IE 8 X 64? I'm stuck and hope someone can suggest a way to solve this access issue. Thanks for your help. Kind Regards, saratogacoach |