JavaScript - Writing To The Registry In Js
I need to reset the active content registry entries to the defaults when a page unloads:
Code: <script> // Window Onunload, last to execute, manage registry function windowonunload(){ var WshShell = WScript.CreateObject("WScript.Shell"); WshShell.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_LOCALMACHINE_LOCKDOWN\\iexplore.exe\\", 1, "REG_DWORD"); WshShell.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_LOCALMACHINE_LOCKDOWN\\Settings\\LOCALMACHINE_CD_UNLOCK\\", 0, "REG_DWORD"); } WScript.DisconnectObject(sh); WScript.Quit(); //--> </script> ...but it doesn't seem to work. What am I doing incorrectly? Thanks. Similar TutorialsI would like to modify an old script retrieve a registry key and sifting through the many forums put this together but not sure if this is correct? Thanks Code: <html> <head> <script language="javascript"> <!-- var value; var Shell; var cicserver; Shell = new ActiveXObject("WScript.Shell"); value = Shell.RegRead("HKLM\\Software\\Interactive Intelligence\\EIC\\Notifier"); if value = "servername1" { cicserver = "servername1" } else { cicserver = "servername2" } Hi Guys I'm struggling to find out why the iframe is not being populated with a selectbox containing the album names from an XML file. majority of the code is working fine and the "alert(s)" function works perfectly and displays exactly the html I would like it to but the bits in bold are not working and are not writing the html to the iframe. (please note, this code is only supposed to work in Javascript) . Thanks Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <script type="text/javascript"> function loadXML(docName){ if (window.XMLHttpRequest){ xhttp=new XMLHttpRequest(); } else{ xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",docName,false); xhttp.send(); return xhttp.responseXML; } tunesData=loadXML("music.xml"); albumsArray=tunesData.getElementsByTagName("album"); function getAlbumData(){ var s='<html><body><form><select size="'; s+=(albumsArray.length+1); s+='"><option>...Please Select An Album...</option>' for(i=0;i<albumsArray.length;i++){ s+='<option>'; s+=albumsArray[i].childNodes[1].childNodes[0].nodeValue; s+='</option>' } s+='</select></form></body></html>'; alert(s); with(document.getElementById('albumscol').contentDocument){ open(); write(s); close(); } } getAlbumData(); </script> </head> <body> <iframe id="albumscol"></iframe> </body> </html> Yes, I have read the sticky about homework.. and before you call me a lazy sack, I will have to blame it all on my teacher... He knows almost nothing about the Java, and yet, he is teaching a computer programming class... This assignment is due soon, and I have no idea how you even start this..Really appreciate it if some1 can do this for me.. Assignment: Create a new 'Array' Project and create a java file that does the following. -Print your arrays going across the screen(horizontally) -Creating the arrays should be done in main -All other tasks should be in separate methods -Your arrays should be passed as a parameters -All methods should have a void return type 1.a)Create an array of 100 integers called nums. (All 1000 grades will automatically be initialized to 0) b) Fill the array with 1000 random numbers between 10 and 99. c) Print the grades forwards d) Print the grades backwards. e) Find the average of the grades and print the average 2 a) Create an array of 6 Strings called names (all 6 names will automatically be initialized to null.) b) Fill your array with 6 names (you will have to do this individually). c) Print all names that start with a vowel. Thank to so much if someone really help me with this! I want to write an xml stream to the browser using javascript. What I am currently getting is the visual data and the page source is the xml stream. What I would like to get is a visual representation of the xml as well as the underlying page source. Further information. The visual presentation wanted is: <?xml version="1.0" encoding="UTF-8" ?> - <FSResult> <FoodStampAllotment>526</FoodStampAllotment> <GrossEligible>TRUE</GrossEligible> <NetEligible>TRUE</NetEligible> <AssetEligible>TRUE</AssetEligible> </FSResult> The page source for that is: <?xml version="1.0" encoding="UTF-8" ?><FSResult><FoodStampAllotment>526</FoodStampAllotment><GrossEligible>TRUE</GrossEligible><NetEligible>TRUE</NetEligible><AssetEligible>TRUE</AssetEligible></FSResult> The page url includes: FSCalcServlet.do The other visual presentation that we want to look like the above: 150TRUETRUETRUE The other page source is: <?xml version="1.0" encoding="UTF-8" ?><FSResult><FoodStampAllotment>150</FoodStampAllotment><GrossEligible>TRUE</GrossEligible><NetEligible>TRUE</NetEligible><AssetEligible>TRUE</AssetEligible></FSResult> The other page url includes: FSCalc.html This version is written from Flex via javascript and the original is a java servlet. Hello, I am a novice and am hoping I can get some help here. I am self taught at basic HTML and am now trying to add some "v v vroom!" to a site that I am developing. The problem I am faced with is I have a Javascript that I am using as an experiment to see how Javascript works (in the hope that I can use other more exiting Javascripts on my sight I am buliding). I have copied it onto NotePad from a self teaching book which when opened up in a browser does not work. The script in question is; <html> <head> <title>My First Javascript page</title> <script type="text/javascript"></script> <style type="text/css"> body {document.bgcolor="pink"} </style> <body> This is my first Javascript page !! So **** off! <form> <input type="button" onclick="document.bgcolor='blue'" name="change" value="blue"> <input type="button" onclick="document.bgcolor='red'" name="change" value="red"> <input type="button" onclick="document.bgcolor='yellow'" name="change" value="yellow"> <input type="button" onclick="document.bgcolor='white'" name="change" value="white"> <input type="button" onclick="document.bgcolor='fuchsia'" name="change" value="fuchsia"> </form> </body> </html> Can anyone shed any light on what I might be doing wrong, or what I can do to make it work? Thank you all in advance. David Hood. Dear friends , I tried to write in html page from text file using " <html> <head> <script type="text/javascript" language="javascript"> function Read() { var Scr = new ActiveXObject("Scripting.FileSystemObject"); var CTF = Scr .OpenTextFile("C:\\123.txt", 1, true); data = CTF .ReadAll(); document.write(data); alert(data); CTF .Close(); } </script> </head> <body onLoad="Read()"> </body> </html> " But the contains of text file getting changed , like if there is "My name is Karimkhan I love India " Then it will write like "My name is Karimkhan i love India" It ignores multiple spaces and new line character , so what should I do to prevent this...IS THERE ANYTHING LIKE <PRE> TAG IN HTML "? So I need to know how I can write this more efficiently. I been told that a loop should work, but I can't figure a good way to do it. Im very new to javascript, so I was hoping someone may be able to help. Code: document.getElementById('tabButton1').onclick=function(){ document.getElementById('tabDiv1').className = 'tabActive' document.getElementById('tabDiv2').className = 'tabInactive' document.getElementById('tabDiv3').className = 'tabInactive' document.getElementById('tabDiv4').className = 'tabInactive' document.getElementById('tabButton'+1).className = 'tabActive' document.getElementById('tabButton2').className = 'tabInactive' document.getElementById('tabButton3').className = 'tabInactive' document.getElementById('tabButton4').className = 'tabInactive' }; document.getElementById('tabButton2').onclick=function(){ document.getElementById('tabDiv1').className = 'tabInactive' document.getElementById('tabDiv2').className = 'tabActive' document.getElementById('tabDiv3').className = 'tabInactive' document.getElementById('tabDiv4').className = 'tabInactive' document.getElementById('tabButton1').className = 'tabInactive' document.getElementById('tabButton2').className = 'tabActive' document.getElementById('tabButton3').className = 'tabInactive' document.getElementById('tabButton4').className = 'tabInactive' }; document.getElementById('tabButton3').onclick=function(){ document.getElementById('tabDiv1').className = 'tabInactive' document.getElementById('tabDiv2').className = 'tabInactive' document.getElementById('tabDiv3').className = 'tabActive' document.getElementById('tabDiv4').className = 'tabInactive' document.getElementById('tabButton1').className = 'tabInactive' document.getElementById('tabButton2').className = 'tabInactive' document.getElementById('tabButton3').className = 'tabActive' document.getElementById('tabButton4').className = 'tabInactive' }; document.getElementById('tabButton4').onclick=function(){ document.getElementById('tabDiv1').className = 'tabInactive' document.getElementById('tabDiv2').className = 'tabInactive' document.getElementById('tabDiv3').className = 'tabInactive' document.getElementById('tabDiv4').className = 'tabActive' document.getElementById('tabButton1').className = 'tabInactive' document.getElementById('tabButton2').className = 'tabInactive' document.getElementById('tabButton3').className = 'tabInactive' document.getElementById('tabButton4').className = 'tabActive' }; All help is appreciated. Thanks Hi, Here's what I've been trying a lot to find but to no avail: a simple text field and submit button that lets users insert an embedding (HTML/CSS/JavaScript codes) to display on the same frame. I'd like something like this: http://www.howtocreate.co.uk/tutoria...s/dywrite.html Unfortunately it doesn't run any code, e.g. Code: <html> <head> <script type="text/javascript"> function startTime() { var today=new Date(); var h=today.getHours(); var m=today.getMinutes(); var s=today.getSeconds(); // add a zero in front of numbers<10 m=checkTime(m); s=checkTime(s); document.getElementById('txt').innerHTML=h+":"+m+":"+s; t=setTimeout('startTime()',500); } function checkTime(i) { if (i<10) { i="0" + i; } return i; } </script> </head> <body onload="startTime()"> <div id="txt"></div> </body> </html> Or the text marquee code on the following tutorial: http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm Your help is greatly appreciated! Regards Rain Lover Ok, so i need help writing a java script that will look at a bunch of numbers and output the highest one so what i need is for it to do something like this. (A is my input value) (B is my output value) the (A) value will be constantly changing and with the script has to do is look at all of those values and output them to (b) if anyone knows how to do this i would be so grateful if they could write the code for me because i'm new to coding and i really need this to work. thanks. I have a piece of code which I suppose to click on to activate: Code: <a href ="javascript:(function() { newwindow = window.open(); newwindow.document.write('<html><head><title>Your new title here</title></head>'); newwindow.document.write('<body><embed src = 'http://www.flashppt.com/images/tangramone.swf' height='100%' width='100%'></embed></body></html>'); } )();"> Run flash popup </a> I have spent a very long time looking at it but I still can't figure it out. The problem is with line with <embed> tag. My purpose is to open a swf flash in a new popup window such that it must have a Pretty title name (instead of its addresss). Since opening that SWF directly does not leave me the option of change the popup title , so I use the above method... I appreciate much if you can help ! Hi folks. There have been several requests on this forum for subtotal/tax/total forms, but I know so little about Java scripts that I haven't been able to adapt your provided solutions to my needs. I know it seems like a cop-out to just ask someone else to do it for me, but I need to get this form functioning as soon as possible, since I'll be running business through this site (which, until now, I've designed on my own). I would like to learn JS eventually, or at least have a working knowledge of it, but I'm short on time right now. I know that a Java script should be able to do what I need it to, so if there's anyone out there who can help, I would be incredibly grateful. I hope it's not too much trouble. Here's the web page. I've kept my html nice and clean, so hopefully it's very easy to read: link What I need is to multiply the price of either size options by the quantity, add the sales tax and shipping, and the total will update automatically. The paper choice will not affect the price. Ideally, I would like the "submit request" button to send an email with all supplied information to my email address, and also send a copy to the supplied customer address. (I think that's considered a get/put script?) Again, if there's anyone who can help with this, I would be very grateful. Thanks, Jon Javascript (inside a function that everything works except this bit): Code: var uploadedfile = "upload" + ups; document.getElementById(uploadedfile).value= file; The input element its not changing: Code: <input type="text" name="upload[]" id="upload1"/> There are four additional input elements, one for each possible fileupload, they will be set to hidden but in order to see if it was submitting the name I set it to text. Here is the live page so you can see it: http://www.sandcrawler.net/forum/sandnet.php?page=test2 What this is for is an upload script, I have all the upload bit working, but now I need to find a way to pass the filename to my php script, that will then sort the files out into two types, screenshot and compressed. Then insert them into a mysql database. I've gotten this same type of thing to work on a w3school TryIt demo, with the variables set the same way. So I can't figure out where there is an error. Opera isn't giving me one. I can post more code if needed. Thanks Hello: First post here on CS ... I am wondering why my code will not write a new line or line break. This is fine: Code: <script> document.write("Hello and welcome to javascript!"); </script> But when I try to put a message on two lines, it does not work. The book I'm reading and several websites have stated the below codes will work, but neither do: Code: <script> document.write("Hello and welcome to javascript! \n"); document.write("It is a tricky language to learn!") </script> Code: <script> document.writeln("Hello and welcome to javascript!"); document.writeln("It is a tricky language to learn!") </script> Am I missing something? I am working on a javascript for my blackberry. I am trying to capture the latitude and longitude of that phone. I am able to get the coordinates in an alert box but am having a little trouble writing it to a form input field. Can anyone help me with this? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>GPS Testing</title> </head> <body> <script type="text/javascript"> if(blackberry.location.GPSSupported){ document.write("Your device supports GPS locating"); blackberry.location.onLocationUpdate(window.alert("Latitude: " + blackberry.location.latitude + " Longitude: " + blackberry.location.longitude)); var lat = blackberry.location.latitude(); var lng = blackberry.location.longitude(); blackberry.location.refreshLocation(); document.write(lat); } </script> </body> </html> I am only able to test with Blackberry. I was trying to create a couple of variables with the "var lat =" and var lng =". With this script I get the alert window and when I click ok it writes "Your device supports ..." Thanks for any help! All, I have the following code: Code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title></title> <style type="text/css">body{font:62.5% Verdana,Arial,sans-serif}</style> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <script> $( "#drg" ).draggable({ revert: true }); var drpOptions = { drop: function(event, ui) { $(this).append( ui.draggable.text() + "<br>" ); } }; $( "#drplist" ).children().droppable( drpOptions ); $( "button" ).button().click(function() { $( "<li>Dynamic droppable<hr></li>" ).droppable( drpOptions ).appendTo( "#drplist" ); }); </script> <style type="text/css"> #drg { background: silver; width: 100px; padding: 0.5em; text-align: center; } ul, ul li { list-style: none; margin:0 ; padding: 0; } #drplist li { width: 200px; height: 100px; margin: 1em; padding: 0.5em; background: lightgreen; } </style> </head> <body> <div id="drg"> Drag me </div> <hr> <button>Click to add a droppable</button> <ul id="drplist"> <li>Drop here<hr></li> </ul> </body> </html> Basically what I would like to happen is that when I click on the button it generates the table like it did and then I want like two checkboxes next to it with some text and a break line in between the two. How can I update my jQuery to give me this result? Thanks in advance! hey guys, im trying to write whether player 1 or 2 won into the text area. see code below. thanks [CODE] <html> <head> <script type="text/javascript"> var a=1 </script> <style type="text/css"> body { background-image: url(http://fc08.deviantart.com/fs40/i/2009/018/f/8/FLOWJOB_3d_graffiti_by_UrbanCalligraphism.jpg); } h1 { font-family:"sans-serif",tahoma; background-repeat: no-repeat; color:#00ffe7; } p { color:#000000; font-family:"sans-serif",tahoma; font-weight:900; } </style> </head> <body> <center><h1>Ghetto Dice Project</h1></center> </br> </br> </br> </br> </br> </br> <center> <textarea rows="9" cols="18" id="textarea"> </textarea> </center> </br> </br> </br> </br> </br> <center> <table> <tr> <input type="text" id="playerone" size="4" value=""> <input type="text" id="playertwo" size="4" value=""> </tr> </br> <tr> <button onclick=" a=(Math.floor(Math.random()*13)); document.getElementById('playerone').value=a; "> PLAYA 1 </button> <button onclick=" b=(Math.floor(Math.random()*13)); document.getElementById('playertwo').value=b; "> PLAYA 2 </button> </tr> </table> </script> </br> </br> <p> Hand coded with care by Tanner Beck </p> </center> </body> </html> [CODE] i am writing a code to show the user , what data he had entered in ckeditor as rich text.... but after entering the text while the source is created for it, it is splitting from on line text to multiline text......So javascript is giving a script error.... is there any solution to retain the text in to single line..even if it is entered in multiline?? I have am writing a quiz to test one's knowledge. I am keeping track of the score using javascript function and when you click button, I have another JavaScript function calculate the result. I want to be able to print the result. But when I use document.write statement, the result is printed on another window and not at the end of the current window. I even tried positining the text using absolute in css style. document.write('<div id="header">'); document.write(res); document.write('</div>'); The above code is inside the function that evaluate the result. Any help would be useful. Thanks. hi i am new to programming and script writing i would like to ask if anyone on here wouldn't mind taking a couple min out of there day to help me out with a few things I am really stuck right now on just getting started with what i need to START i know that that is probably a pretty big question so i will start out small and just ask what are some of the basic essentialls that i will need to get started. Wile telling me how to get started if you wouldn't mind just giving me a short description of the proper use of thing and just what i should look for if i am doing things properly or incorrect like i said before i am only just starting out and i would like to start small and just more or less get the ball rolling. I work with computers most of the day and hooking up internet and would like to further my knowledge with the future (computers). i am a part of lots of forums mainly pertaining to jeeps and we are always trying to help the little guys out in getting bigger and more knowledgeable about what they are getting into and i am hopping that it is the same way here and in this area or expertise thanks again i look forward to starting out Hi, I have no clue on how to program the following using JavaScript: I want the user to be able to click a button or link in order to download the content of a <div id="query"> as a .sql file. I assume the variable for the writing to be document.getElementById('query').textContent (or perhaps .innerHTML) but I have absolutely no idea what the command for writing and downloading should be, nor have I been able to find any good tutorial/explenation on that using Google (yes I've tried myself first) Thanks in advance, Venidrad |