JavaScript - Batch File Issue
I'm trying to code something in batch and i need some help...
I need to change the batch files dir to the only folder in the next folder IE: move from folder 1 to folder 2 contents of folder 1: folder 2 however i don't know the real name of folder 2 so I need batch file to like pick the folder by its number or something.... is there a solution(i would like to code this in batch) Similar TutorialsThis code is supposed to batch transfer options between selects. It works flawlessly for single values, but when I select multiple options, all of them get deleted, but only one transferred. Any help is greatly appreciated! Thank you. Code: <html> <head> <title></title> <script type="text/javascript"> function removeOptionSelected(b,j) { var elRem = document.getElementById(b); var elAdd = document.getElementById(j); var elOptNew = document.createElement('option'); var i; for (i = elRem.length - 1; i>=0; i--) { if (elRem.options[i].selected) { //alert(elRem.options[i].text+' '+elRem.options[i].value+' deleted!') elOptNew.text = elRem.options[i].text; elOptNew.value = elRem.options[i].value; try { elAdd.add(elOptNew, null); // standards compliant; doesn't work in IE } catch(ex) { elAdd.add(elOptNew); // IE only } elRem.remove(i); } } } </script> <style type="text/css"> div { float: left; /*border: 1px solid black;*/ } div.contain { width: 536px; height: 500px; border: none; } div.side { width: 215px; height: 500px; } div.middle { width: 100px; height: 300px; padding-top: 200px; } select { width: 200px; height: 500px; } input { width: 82px; margin-bottom: 10px; } </style> </head> <body> <div class="contain"> <div class="side"> <form name="left"> <select id="left" class="left" multiple name="out"> <option value="apple">apple</option> <option value="banana">banana</option> <option value="orange">orange</option> <option value="tangerine">tangerine</option> <option value="pineapple">pineapple</option> <option value="carrot">carrot</option> <option value="grapefruit">grapefruit</option> <option value="plum">plum</option> <option value="blueberry">blueberry</option> <option value="strawberry">strawberry</option> <option value="cashews">cashews</option> <option value="peanuts">peanuts</option> </select> </form> </div> <div class="middle"> <input type="button" value="Add-->" onClick="removeOptionSelected('left','right');" /> <input type="button" value="<--Remove" onClick="removeOptionSelected('right','left')" /> </div> <div class="side"> <form name="right"> <select id="right" class="right" multiple name="out"> <option value="greenbeans">greenbeans</option> <option value="walnuts">walnuts</option> </select> </form> </div> </div> </body> </html> Hello Everyone... I'm VERY new to JS and trying to learn using a program that creates menus with Flash and JS. With the below code, my flash menu works when the files are in the same directory as the code, however, I cannot figure out how to make it work when I have the XML,Flash,JS files located in another directory. Could someone give me idea what I must first look at. I believe I have tried the obvious areas in the code, but they have not worked. Thanks ! <script type="text/javascript" src="stfmenu.js"></script> <p><a href="http://www.menu-flash.com" style="display:none;visibility:hidden;"> Flash Menu</a></p> <script type="text/javascript"> <!-- st_siteroot="" st_swfpath="menu.swf"; o={} o.position="static"; o.clear ="both"; o.width ="1"; o.height = "1"; o.left = "1"; o.top = "1"; o.id = "Adin"; if(!window.location.href.indexOf("file:") && st_swfpath.charAt(0)=="/") o.src = st_siteroot+st_swfpath; else o.src = st_swfpath; o.vars="flashid=Adin&menuId=0&dirPath=&siteRoot="; document.write(SFMGetFlashHTML(o)); //--> </script> I have an Extjs web app that's running on a spring/rest backend & I'm having a really strange caching issue with my web app's javascript files & no-one seems to be able to tell what it is. The issue is that I have deleted a section of code in the JS file, yet it's still appearing in the browser, both IE and FF. I have tried a number of solutions but nothing has worked. if anyone has any suggestions as to what the issue would be, I would appreciate it. What I have tried: Manually remove & re-add the file Rollback the file to a previous version Remove the file from the index.html and re-add it Clear all cache in FF & IE Disable firebug Check the script is updated by manually accessing the file via the application URL & Firebug Script tab Renaming the JS file Renaming the index.html file Cleaning/rebuilding/removing the project Restarting the server & eclipse Pointing the server to a different location Rebooting Removing & re-adding the Tomcat server Ctrl + F5 Checking the URL path/classpath in Eclipse is correct Removing all Temp Internet Files (including when all associated apps were closed) Adding Pragma no-cache metadata tag to the index.html I'm at a loss as to what could be causing it. Hi everyone so ive been doing some searching on how to save textarea content as a file and found ... Code: http://www.codingforums.com/showthread.php?t=32077 Saving works ok but the issue I have is that when you enter some text and hit the submit button the content of the page becomes the content within the the file your saving check demo so you can see for yourself: Code: http://6d8.info/demo.html So what I need is for the page to stay the same ie always demo.html with textarea and submit button and not the saving file content Any help is appretiated and as normal thank you in advance ... Hi, I'm trying to call a Js function from a test.js located in a HTML file. I'm getting error message "Object has no method..." in Chrome. But no issues are seen in Firefox. Can any one please let me know how i can fix this. <html> <head> .... .... .... <div> <html> <head> <script src="test.js"></script> <script> function aFunc() { alert ("Inside aFunc"); } </script> </head> <body> </html> .... .... .... </div> </head> </html> test.js function bFunc () { aFunc (); } I can get this code to take two separate sections of a file which are not beside each other and write them into another file. It always comes up as a single full line of the code instead of the sections I want. The code includes the student number first name last name and three results of assignments. I want the code to write the student number and three results of all the students into a file and then work out the average of the student results. Can you help? Code: try{ while (in.hasNextLine()) { String line = in.nextLine(); out.println( line); int i=0; if(!Character.isDigit(line.charAt(i))) { i++; } studentStringNumber = line.substring(0, i); String stringResult = line.substring(i); studentStringNumber = studentStringNumber.trim(); stringResults = stringResults.trim(); double stringResultsValue = Double.parseDouble(stringResults.trim()); stringResults = in.nextLine(); studentStringNumber = in.nextLine(); studentNumber = Integer.parseInt(studentStringNumber); if(in.hasNextInt()) { int value = in.nextInt(); } results = Double.parseDouble(stringResults); if(in.hasNextDouble()) { double value = in.nextDouble(); } Scanner lineScanner = new Scanner(line); studentStringNumber = lineScanner.next(); while(!lineScanner.hasNextDouble()) { studentStringNumber = studentStringNumber+ " " +lineScanner.next(); } stringResultsValue = lineScanner.nextDouble(); } } Hi, Can someone tell me what I am doing wrong. Script works on the first attachment but not the other two? Code: <script type="text/javascript" language="JavaScript"><!-- function ExtensionsOkay() { var extension = new Array(); var fieldvalue = new Array(); fieldvalue[0] = document.customApp.attachment_1.value; fieldvalue[1] = document.customApp.attachment_2.value; fieldvalue[2] = document.customApp.attachment_3.value; extension[0] = ".doc"; extension[1] = ".docx"; extension[2] = ".txt"; extension[3] = ".pdf"; // No other customization needed. for(var f = 0; f < fieldvalue.length; f++) { var thisext = fieldvalue[f].substr(fieldvalue[f].lastIndexOf('.')); for(var i = 0; i < extension.length; i++) { if(thisext == extension[i]) { return true; } } alert("Your upload field " + f + " contains an unapproved file name."); return false; } } //--></script> Hello all, I am new here and have a question about a AP Div I am using as a dropin. It drops in when the page loads and I would like it to only drop in if a visitor clicks a link I designate as the dropin link. Can someone please tell me how to accomplish this? I am pasting in the js file and I will also need to know how to set up the "a href" link to call the dropin! Thanks is advance for any help you may give! Code: // JavaScript Document var ie=document.all var dom=document.getElementById var ns4=document.layers var calunits=document.layers? "" : "px" var bouncelimit=32 //(must be divisible by 8) var direction="up" function initbox(){ if (!dom&&!ie&&!ns4) return crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin scroll_top=(ie)? truebody().scrollTop : window.pageYOffset crossobj.top=scroll_top-250+calunits crossobj.visibility=(dom||ie)? "visible" : "show" dropstart=setInterval("dropin()",50) } function dropin(){ scroll_top=(ie)? truebody().scrollTop : window.pageYOffset if (parseInt(crossobj.top)<100+scroll_top) crossobj.top=parseInt(crossobj.top)+40+calunits else{ clearInterval(dropstart) bouncestart=setInterval("bouncein()",50) } } function bouncein(){ crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits if (bouncelimit<0) bouncelimit+=8 bouncelimit=bouncelimit*-1 if (bouncelimit==0){ clearInterval(bouncestart) } } function dismissbox(){ if (window.bouncestart) clearInterval(bouncestart) crossobj.visibility="hidden" } function truebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } window.onload=window.setTimeout(initbox,5000); Hi i am using javascript for the first time and i have a problem .I have 2 files html and javascript file in seperate but i donot know how to make them work .the code is down below .Thanks in advance for help. HTML <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <meta name="description" content="Instagram API - usage" /> <meta charset=utf-8 /> <title></title> </head> <body> <input id="lat_input" type="number" value="60.221374"/> <input id="lng_input" type="number" value="24.805391"/> <button id="search_location">Search</button><br/> <button id="get_popular">Get popular</button> <div id="images"></div> </body> </html> Javascript file // API DOCUMENTATION: // Instagram Developer Documentation var clientId = 'e7538f47e197479d8d32a63ae3ae4cd2'; $('#search_location').click(function () { getMediaByLocation($('#lat_input').val(), $('#lng_input').val()); }); $('#get_popular').click(function () { getPopularImages(); }); function getMediaByLocation(lat, lng) { var o = { lat: lat, lng: lng, client_id: clientId }; $.getJSON('https://api.instagram.com/v1/media/search?callback=?', o, function (response) { processImages(response.data); }); } function getPopularImages() { var o = { client_id: clientId }; $.getJSON('https://api.instagram.com/v1/media/popular?callback=?', o, function (response) { processImages(response.data); }); } function processImages(array) { $('#images').empty(); $.each(array, function (index, element) { var fs = $('<fieldset>').appendTo('#images'); $('<img>').attr('src', element.images.low_resolution.url).appendTo(fs); if (element.caption) { $('<pre>').text(element.caption.text).appendTo(fs); } $.each(element.comments.data, function (index, comment) { $('<pre>').text('Comment from ' + comment.from.full_name + ': ' + comment.text).appendTo(fs); }); }); } Does anyone know how to accomplish this? I got the html file to show but none of the text in the file will show.
All -- I have a JavaScript config file called gameSetting.js which contains a bunch of variables which configures a particular game. I also have a shared JavaScript library which uses the variables in gameSetting.js, which I include like so: <script type="text/javascript" src="gameSetting.js" ></script> <script type="text/javascript" src="gameLibrary.js" ></script> In gameSetting.js I have: $(document).ready(function() { // call some functions / classes in gameLibrary.js } in Firefox, Safari, and Chrome, this works fine. However, in IE, when it's parsing gameSetting.js, it complains that the functions that live in gameLibrary.js aren't defined. When it gets to parsing gameLibrary.js, the variables in gameSetting.js are reported as not being defined. I've tried dynamically bootstrapping the gameLibrary file using this function in document.ready for dynamic load... $.getScript("gameLibrary.js"); However, the same problem still happens in IE, where when it parses the files individually it's not taking into context the file/variables that came before, so it's not an out of load order problem. My options a 1) collapsing all the functions in gameLibrary.js and variables in gameSetting.js into one file. However, this is not practical because this is dealing with literally hundreds of games, and having a gameLibrary.js in ONE location for ONE update is what makes most logical sense. 2) figure out a way to get this to work where variables in file1 are accessible to file2 in IE (as it seems they are in other browsers). jQuery seems to be able to have multiple plugins that all refer to the based jQuery-1.3.2.js, so I know there is a way to get this to work. Help appreciated. Nero help me! im have 2 file .js file 1.js code: document.write("<script src=2.js></script>") document.write(f) file 2.js code: var f="hello" im want run 1.js get variable of file 2.js by 3.html but don't run! code 3.html <script src=1.js></script> I tried to follow directions here http://www.javascriptkit.com/javatut...ernalphp.shtml and here http://codingforums.com/showpost.php...91&postcount=4 without any luck. Data is looked up from a MySQL database via .php file and then I want javascript inserted into the .js file which includes the data from the query lookup in the .php file. If I load the .php file - everything looks good. But nothing shows in the .js file. Below is the contents of the .php file which is located at http://blackburnseminars.com/wp-cont...is_prices.php: Code: <?php //PHP SCRIPT: get_regis_prices.php header('Content-type: application/x-javascript'); //connect to database mysql_connect("localhost","username","password"); //(host, username, password) //specify database mysql_select_db("dbname") or die("Unable to select database"); //select which database we're using $str="\r"; //CRLF $result = mysql_query("select * from table_name"); while ($row = mysql_fetch_object($result)) { echo "document.write(var fee = \"\";)".$str; echo "document.write(if (studentTypeAbbrev == \"A\"))".$str; echo "document.write({)".$str; echo "document.write(if (creditHours==1) fee =" . $row->atty_crs1.";)".$str; echo "document.write(if (creditHours==3) fee =" . $row->atty_crs3.";)".$str; echo "document.write(document.write(if (creditHours==6) fee =".$row->atty_crs6.";)".$str; echo "document.write(})".$str; echo "document.write(else if (studentTypeAbbrev == \"P\"))".$str; echo "document.write({)".$str; echo "document.write(if (creditHours==3) fee =" . $row->para_crs3.";)".$str; echo "document.write(if (creditHours==6) fee =" . $row->para_crs6.";)".$str; echo "document.write(})".$str; echo "document.write(else if (studentTypeAbbrev == \"J\"))".$str; echo "document.write({)".$str; echo "document.write(fee =" . $row->judge.";)".$str; echo "document.write(})".$str; } ?> The .js file has this line inserted where I want the javascript from the .php file to go: Code: <script type="application/x-javascript" src="http://blackburnseminars.com/wp-content/themes/blackburn/get_regis_prices.php"></script> ...but the code from the .php file doesn't show when I load the .js file. Can anyone tell me what I am doing wrong? Also, do I need to enclose the lines inside document.write()? - (I'm not clear on that) Thanks much Tom Esker I have the following sample html file (attached). I am trying to display the calculated field using javascript and I created a function (I am a newbie) to do so. However, it persistently shows NaN instead of the required number. I have tried my best over a coupla hours racking my brains and the internet as to why it shows as not a number. I will appreciate any help. Thanks, Freaking IE. Must die. Really it must. Unfortunately, I have to code for it, and I can't figure out what went wrong he http://wyqued-design.com/dev/skyview/index.html The navigation, and layout, breaks in IE 7. Any ideas? -Emilie In the development of our website, we are experiencing issues with a few images when the browser is not at 100% zoom (shake, odd spacing, irregular) on webkit browsers. These images are animated using jquery. We have heard this could be due to the functionalities of webkit browsers. I was curious if anyone else has experienced a similar problem, and if so, identified any work around solutions.
So I have the following code in javascript that creates an iframe: Code: var iframe = document.createElement("iframe"); iframe.id = 'offerframe'; iframe.name = 'offerframe'; iframe.width = '975'; iframe.height = '650'; iframe.align = 'center'; iframe.src = 'http://example.com'; document.getElementById("offer-frame-div").appendChild(iframe); It works fine in Firefox and Safari but in IE8 it generates the iframe name attribute to "submitName" Code: <iframe width="975" height="650" align="center" id="offerframe" submitName="offerframe" src="http://example.com"> Notice how it sets all the other attributes fine, however the name attribute is now called "submitName". This issue only happens in IE. This there any alternatives to setting my iframe name dynamically with javascript. So I'm working on an autofill program for a site. What it does is it takes info from a form thats on MY site then it places that info into a form on another site. So my problem is that it won't to any of that. I know the autofill by itself works because I've tested it. I think that maybe my form doesn't know where in the autofill to place the info... My form: Code: <form name="logindetails" method="post"> <input type="text" name="email" value="Email Address" /> <input type="password" name="combination" value="Combination" /> <input type="submit" value="Submit" onclick="logindetails()"> Autofill script: Code: <script type="text/javascript"> function logindetails() { var values = ["email", "password", "password"]; $("input").each(function(i){ $(this).val(values[i]); }); document.getElementById("recaptcha_response_field" ).focus(); } </script> I am attempting to remove all HTML tags with nothing in the middle. For example, I want to remove this Code: <b><i><u> </u></i></b> I've written an expression that does that, but there's an issue with it. Here's my regex: Code: messageVal = messageVal.replace(/(<[^\/>]*>)+[\s]*(<\/[^>]*>)+/g,''); The issue is that I only want to delete as many end tags as I found open tags. An example that my regex doesn't work on is... Code: <b> hello <u><i> </i></u></b> The current regex will output: Code: <b> hello I need it to return: Code: <b> hello </b> Any ideas? |