I'm trying to execute a bat file on the server in javascript. The javascript sits on the server as well. I'm currently using:
document.location.href='testme.bat'
However the only thing it does is just opens up the bat file and shows my bat code in the browser. How can I execute the batch file instead of opening it and viewing it in the browser?
I am using an ASP.NET AJAX control (ValidatorCallout) that requires client-side validation to work with a custom validator I added. This is an example of some code that works:
ClientValidationFunction="CheckPrime" ControlToValidate="PartNumberText" ErrorMessage="b><br />A Part Number is required."></asp:CustomValidator> <script language="JavaScript"> <!-- function CheckPrime(sender, args) { var iPrime = parseInt(args.Value); var iSqrt = parseInt(Math.sqrt(iPrime));
for (var iLoop=2; iLoop<=iSqrt; iLoop++) if (iPrime % iLoop == 0) { args.IsValid = false; return; }
args.IsValid = true; }
This is code I borrowed from another site to test this method - and it works. My problem is that I need the JS to execute a VB function in my project and I don't know how to do that. I want to do something like:
function CheckValue(sender, args) { var sPartnumber = String(args.Value); if FindExistingPN(sPartNumber) { args.IsValid = false; return; } args.IsValid = true; }
....where FindExistingPN is a funciton in my VB class. I have seen some other posts about this, but none of them really gave me any sample code that I could run. As I mentioned earlier, my JS skills are lacking, so I am unable to create this myself.
For some god-forsaken reason (which I can't find out either) MSIE stopped executing any JavaScripts. In any page which contains JavaScript code, that code won't be executed. There are no error messages, no warnings, nothing. It simply does'nt work. I'm pretty sure this could be caused by some stupid installation of another program that messed up some IE settings.
Security settings for IE are all lowered down. Everything is activated (Scripts, ActiveX, automatic download of anything, anytime)... so we ran out of ideas of what could be the problem. And yes, we have also tried to reinstall IE.
The only clue we have is that a local Administrator user can change IT security settings for himself and (go figure) things work fine! The problem occurs with users that have limted access to the computer and I am pretty sure this shouldn't happen. If you are wondering... yes... the local administrator has already tried to change the settings for limited user account..
I have a select dropdown and 5 text fields. based on the option selected (which are the units - cm/mm/inches/ft/yard etc), i change the values in the text fields using javascript to the corresponding units.
my problem is that when the options are selected very quickly(for eg using the keyboard's up/down keys) then quickly, the text field values lose their connection with the select box and the values become illegal.
I suspect that the javascript function is being called even before the earlier execution has not terminated. I tried using a global variable and using it as a lock, but still no success.
Is there some way from preventing the JavaScript code in a document loaded into an iframe from executing? I don't have access to the pages being loaded into the i-frame so I can't modify then. They are being loaded from a server.
What I am trying to do is dynamically update an image and image map on a page. I'd like the update to happen as quickly as possible and be done without refreshing the page. The catch is that the image map uses the wz_tooltip.js (http://www.walterzorn.com/tooltip/tooltip_e.htm) library to display a JavaScript tooltip containing detailed information about different areas of the image. So, when I pass the required <script> tags via .innerHTML, the browser treats it as text and does not interpret the JavaScript and execute the code.
Basically, I have a page that I load with 10 input fields. If users have JS enabled I want to hide 5 of these fields so as to reduce clutter. If the user needs these extra fields an "Add" button can be used to display the hidden fields one by one.
Once the fields a filled in the user submits them for validation and if there are any error They can "Go back" to make some changes. The whole process works great in FF & Opera but IE lets me down because if you use the Browser "Back" button the Javavscript gets executed even though it should be loaded out of cache.
I got an [object error] from IE 7.0.5730.11 when moving the <script src="..." type="text/javascript" /tag from the <headpart to the <bodysection of a HTML file.
Is not possibile to include Javascript code via <script src="..." type="text/javascript" /from the <bodysection, instead from the <headone? If yes, anyone has any idea of which the problem could be? If not, how can I programmatically include a javascript external file inside the <bodypart of a HTML file, for example, using Javascript to some particular native functions?
Is it possible to use javascript to call css, as in having css related things in a js file, and have it being loaded at the same time as the script is running?A friend of mine was asking me and I told him I would check on it because I wasn't sure if you could have any css in a javascript file.
I am developing a series of web pages that use JS, and they are all fairly similar except for some very small changes. What I am hoping to do is create one page that accepts a parameter from location.search and then uses that to include a JS file with the appropriate parts that are different from the main page. I am aware that I could do this the other way round (ie. several different pages that include a set of core functions etc.), but that will not work for this project.
I'm looking for a way to include javascript files from within a ".js" file. This would allow me to only need to link to one ".js" file, and yet still organize my functions into non gargantuan files for easy editing. I'm hoping there is some sort of include or import directive that I could use. Or if no such directive exists, I'm wondering if anyone has written one which I could use.
I need to do this without any server side scripting. For now at least, the html is being used locally with local files. Code:
I noticed that some sites use <script src='fineName.js?ver=XXX'></script(even google) Someone told me that it's for script changes, means - if the file in server has been changed than the new XXX will demand to load the new file. I find it hard to believe that it's true.
does javascript can parse text-based files, same as vbscript do? I want do a sorting of large massive of eml files stored in folder: just to arrange(sort) eml files inside that folder by recipent email ("To:" field) (there is different data in "To:" field due different senders) Just want that script parse eml files, looked for specified emails address or name in 'To' field and arrange this emails at the top. This probably will require ActiveX.
I would like to include text from an external file in my html file. This is normally done with <object> or <iframe> but in this case the style sheet and internal links (like <a href="#positiononpage">) do not work. So I thought of writing a little script which does the following
- open the file http://something.com/textfile.htm - put the content of that file in variable "var" - document.write(var)
Is this possible? (also without using activeX objects)
I there any possible way to set this up so the menu is in a separate javascript file? This way I could just link to the menu on the pages I need it to show up.
I'm looking for one of those scripts with you can add another browse for file box to upload files. Eg: as u see in attachments on webmail sites. Do any of u have a simple script like this or can link me to one?
What i need in the script is to be able to: -Set the maximum number of browse for files boxes that appear -Check if the same file is added more than once -have a link next to each file to remove a selected file
Kind of like this: Add a file -> Click on this to get
File name - <selectbox> - <browse button> - <remove file>
<remove file> removes the file next to it so another can be added upto the limit set.
What I want to do is create a HTML form that allows the user to enter data into about 10 fields, and then based on the entered data, writes out data strings to a text file. I am attempting to create a form for entering simple rectangle CAD data via a HTML form, which will be written to a text file, and then imported into a CAD program.
The form would contain prompt boxes for things like length, width, radius size, step/repeat, etc. When the user hits the "SUBMIT" button, the data strings would be written out to the filename the user specified. Below is an example of data strings to be ouputted. Variables are &L, &W, &R, &STEPX, &STEPY, &XN, &YN.