javascript

Export XML to local file using JavaScript

I have a Windows 7 Gadget that runs JavaScript locally. It sends arguments to a Perl script on the server that returns XML. The XML is just timestamps and raw data. I graph these results into a time series using Flot. The graphs are usually performance data (%CPU utilization, logical disk space, etc.) and I want to have the option to exp...

Spinner Animation

I m developing a Grade Management System. When user clicks 'Semester Result' link, some calculations occur and result is shown at next page. Hence the nxt page would load in a few seconds. I want to show user a progress bar until the result is ready and available on next page. How can i do this without AJAX ?? ...

jQuery - Counting table rows not working in IE7

Hello, I'm coding an application that adds rows to a table without refresh using javascript and jquery. In order to append to the table, I need to do a count of the rows that are currently in the table. I'm using this code... var count = $('#columns tr.FIELD').length; The code works fine in Firefox and Chrome, but I am required to bui...

Sending ampersand in GET

I have a drop box which is populated by information from a database. Some of the items have ampersands in them. When the drop box is changed, there is some ajax done, and this includes sending the info from the drop box in a GET. An ampersand in the name of the item from the drop box messes up the URL for the GET. For example, here is a...

I can send variables from flash to javascript, but unable to do the opposite

I have this in AS3 var myName:String = "David"; var result:Number = ExternalInterface.call("methodInJS", myName); trace("Result from JS call is: "+result); And in javascript function methodInJS(name) { alert("Hello to " + name); return 17; } This allows me to send to javascript. What is the method to do the opposite. I want to sen...

Can you list files in a directory with JavaScript but without ActiveX?

I wrote a script in php that allows me to get a list of files in a directory as an array, parse each one for a particular string, and then it displays all of the files that contain the search string. My IT staff won't let me install php on the server though. Can this be done with javascript without ActiveX? Everything I could find on th...

How to Implement a Search Box Process in my HTML Website

Hi, Hoping someone can assist with a means of implementing a "Search" routine/page that I can apply to my site that is purely a HTML website only. I have provided a Search box for the user but unsure what the next step is, i.e. can I insert php to perform the Search of my site. Would really appreciate any help/tutorials/links that dem...

How to Implement a Contact Us Form in my HTML Site

Hi, Hoping someone can assist with a means of implementing a "Contact Us" routine/page that I can apply to my site that is purely a HTML website only. I am assuming this will need to be a php process to send emails from a Contact Us form but unsure how to do. Would really appreciate any help/tutorials/links that demonstrate this. Tha...

Creating a JS function to send boolean to Coldfusion Filter Funtion?

Is it possible to send a javascript function to test if a form field was changed then pass a boolean (bCheckField) to a filter function that will tell it to actually perform the check or to skip over the validation and continue? If so, how should I approach this? Utilizing Coldfusion 8, MachII and Microsoft SQL. Thank you very much... ...

How can I remove standard controls in an OpenLayers-Map?

I use OpenLayers and want to create another navigation-control in the upper-left side. I know how to add Controls, but this navigation is added at default while creating the OpenLayers-Map. So I want to remove that Control, to add an own. I know already, that the default-control is an OpenLayers.Control.PanZoom. ...

Getting syntax error for quotes in a function?

I'm trying to create an action for an onclick event, while this works perfectly fine: onclick="gts('he', '', '<?=$c->email?>', function(data) {register_transaction(data,data);})" this gives me a syntax error after the register_transaction( bit: onclick="gts('he', '', '<?=$c->email?>', function(data) {register_transaction(data,'2');})...

Performance implications of using Functional style Javascript vs "procedural"

Has anybody done benchmarking, or can link to an article on this subject? Particularly interested in IE results, since usually JS performance is not a problem in other browsers. I would like to know how much slower it is to do something like: var numbers = [1, 2, 3, 4, 5, 6, 7]; var results = numbers.map(function() { // do some stuf...

convert guid tostring in javascript .net

How do I convert guid to string in javascript. I am getting guid from the querystring, and m not able to process it as is. I have tried the following ways to do it but it doesnt seem to work. var guid = {<%=Request.QueryString["Guid"]%>}.toString(); var guid = <%=Request.QueryString["Guid"]%>.toString(); var guid = (string)<%=Request.Qu...

JavaScript variable scopes

I found a bunch of other questions about this topic, but for some reason they did not solve my "problem". I have this little script I made of pure interest - and it works just fine, but something is bothering me. The script clears a text field onFocus and types "Write here" if nothing is entered onBlur. The script is as follows: <html>...

Script to Show/Hide Content Requires Two Clicks to Execute First Time

We're using the following code to show/hide content when an image is clicked: function toggle(image,list) { var listElementStyle=document.getElementById(list).style; if (listElementStyle.display=="none") { listElementStyle.display="block"; document.getElementById(image).src="images/down.png"; document.g...

Get users OS and version number.

I've spent a day on and off Googeling for this; no luck so far. How can I get the users OS and version. Mine would me Mac OS X 10.6.4, the spare PC in the office would be Windows XP SP3. You see what I'm getting at. I've seen a million and one methods to get the users platform alone, just not the version. JS would be ideal, but a serv...

javascript html editor copy/paste problem

We run some large directories where users often copy/paste content from word documents etc into our TinyMCE html editor. The problem with this is often the following text for example gets hidden there which shows up on our webpages: <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; ...

How do I call a method of a Java instance from JavaScript?

I'm using the Mozilla Rhino JavaScript emulator. It allows me to add Java methods to a context and then call them as if they were JavaScript functions. But I can't get it to work except when I use a static method. The problem is this part of the documentation: If the method is not static, the Java 'this' value will correspond to the...

Combine explicit protocol specification with relative URL

I have a page that is accessed via HTTP. This page links to another page on the same server using HTTPS. What is the most elegant way, using HTML and/or Javascript, to force a transition to HTTPS while using a relative URL? Basically, I want the opposite of a protocol-relative URL. I want to explicitly specify HTTPS WITHOUT hardcoding ...

I know what a closure is, but I still dont understand why (or when) you would use them

My understanding of closures is that they are essentially a function which uses a variable that you would assume would be out of scope. I guess heres an example I saw the other day: function closureMaker(somearg) { var local_value = 7; function funcToReturn(arg1, arg2) { return local_value + somearg + arg1 + arg2; ...