javascript

window.close is not working in IE 6

I am using window.close() for closing window by clicking on button its not working in IE 6. Is there any jquery solution ...

JavaScript new project with Visual Studio 2008

Hello, How can I work with JS in Visual Studio 2008? In example if I have only 1 JS file which I want to work with. So what project type should I create in VS to add JS file to it so VS will see how it works? Maybe someone could write a short step-by-step guide how to do so? I would be grateful! :) ...

Javascript: How to determine the screen height visible (i.e., removing the space occupied by the address bar etc)

As asked in the question, how do I find out the screen space available for the webpage through javascript? ...

web based diagramming tool with javascript

I would like to create a web diagramming(visio) tool in javascript. im new to javascript but have extensive programming experience. i would like to get some feedback on what i need and what's the best way to go about writing this. thank you ...

How to get the focus event following the blur event?

I like to know what the onFocus event is (if there will be any) when I receive an onBlur event in my (javascript) handler. How is this possible? Example: I have a group of textboxes that form one group. Only if the whole group loses focus I want to inform subscribers about the group onBlur event. So if an onBlur event occurs I only wan...

How to build an interactive Ajax Web Widget?

Hi, I am looking to create a web widget that can be easily integrated into any website using javascript and posts a form to my server, returns the data and displays the results appropriately. This will all happend in a small area of the host websites screen, like google adsense. I am aware that this is XSS and also the cross domain issu...

Reading form action property in IE6, if form has a field named "action"

Given the form below: <form id="myForm" action="index.php"> <input type="hidden" name="action" value="list" /> <input type="submit" /> </form> How can I get the value for the action property of the form (index.php) using IE6? Hint: I have tried document.getElementById('myForm').action and document.getElementById('myForm')...

Drupal Filefield won't upload javascript files?

Hiya, I've got a site where individual pages might require some javascript or CSS files hooked into their heads. I'm trying to keep everything client side when it comes to managing this process, rather than getting on the FTP and sorting everything out in the code so I need to be able to upload css and js files. I've got CCK filefield...

Cross Domain URL Access from Iframe using Javascript

Hi, I need to access the Parent Domain URL from my Iframe which is in another domain. For example: example.com is my website which is in Iframe of another parent(google.com) domain. Here i need to access the parent domain URL in my example.com. i.e I need to get the URL google.com in my example.com. Parent dom...

jQuery: Get first element of type in top UL in a nested list

Hey, I have a nested list like this: <ul class="list"> <li class="list_item_type_1"> nested list <ul class="list"> <li class="list_item_type_2">Unnested item</li> </ul> </li> <li class="list_item_type_2">Unnested item</li> </ul> With jQuery I want to add a listitem before all ".list _ item _ type _ 2" in the first ".l...

Javascript || operator

I am using a large JS library to perform certain drawing operations in canvas. Reviewing the library code (to make accommodating changes), I have ran into the '||' operator being used in a fashion which certainly should not evaluate to Boolean. Does this mean that this is a different operator or am I missing something obvious? An example...

About jQuery .each or other iteration

Hi, How to iterate through table if it has this structure: <table> <tr> <td><input class = "fire"> ... </td> <td><input class = "water"> ... </td> </tr> <tr> <td><input class = "fire"> ... </td> <td><input class = "water"> ... </td> </tr> <tr> <td><input class = "fire"> ... </td> <td><input class = "wa...

global javascript error handling

Is there any way to catch Javascript errors globally across the web application by writing some code in the master page? ...

If input2 empty copy value from input1?

Hello everyone! This is my first message here so I hope that newbies also get help :) My problem is following: let's start with code first.... javascript: $(document).ready(function(){ if ($("input#datum2").val() == "") { $().click(function(){ $("input#datum2").val($("input#datum1").val()); }); } ...

How might I find the largest number contained in a JavaScript array?

I have a simple JavaScript Array object containing a few numbers. [267, 306, 108] Is there a function that would find the largest number in this array? ...

How do you automate Javascript minification for your Java web applications?

Hello SO, I'm interested in hearing how you prefer to automate Javascript minification for your Java web apps. Here are a few aspects I'm particularly interested in: How does it integrate? Is it part of your build tool, a servlet filter, a standalone program post-processing the WAR file, or something else? Is it easy to enable and dis...

Large numbers erroneously rounded in Javascript

See this code: <html> <head> <script src="http://www.json.org/json2.js" type="text/javascript"></script> <script type="text/javascript"> var jsonString = '{"id":714341252076979033,"type":"FUZZY"}'; var jsonParsed = JSON.parse(jsonString); console.log(jsonString, jsonParsed); </script> </head> <body> </body> </html> Wh...

Detect when a specific image has finished loading

I have an image on a webpage which is being dynamically generated by a server-side CGI program. Periodically this image is refreshed by a timer and/or changed based on user input. So I have a Javascript function like // <img id="screen" src=""> is elsewhere in the page function reloadImage() { $("#screen").attr("src", make_cgi_url...

Javascript sort with function not working on iPhone

When calling sort(function) in Javascript on an iPhone it doesn't seem to sort. For example: devices.sort(function(a, b) { return a.name > b.name; }); Are there some known limitations or can someone help me how to do this on an iPhone. It seems to work fine in Chrome, IE, Firefox. ...

jQuery Validation -- Not validating

I am building my first ASP.net MVC application (not my first jQuery & jQuery Validation plugin application), and I am having a terrible time performing the client side validation with the validation plugin. Does anyone know if there is a problem using the plugin with jQuery-1.3.2.min that comes with VS 2008? My code is as follows: v...