javascript

javascript detect browser close tab/close browser

any cross browser javascript/jquery to detect if browser is closing tab or closed browser ? and should not activate event when go to other link? ...

Edit returned results before appending on screen.

I have the following script which I need to combine together somehow. Each function works individually at the moment. // Check if file exists clientside function FileExists(path) { var fso = new ActiveXObject("Scripting.FileSystemObject"); FileExist = fso.FileExists(path); if (FileExist == true){ return true }...

JQuery Cross-Domain .load() (self-constructing widget)

I'm creating a widget for people to use on their websites, however to keep the widget future-proof, i want it to be self constructing using an external javascript. So the widget code i would ask people to put on their websites would be something like: <div id="my_widget"></div> <script type="text/javascript" src="http://www.external-do...

How to implement an "Auto Save" or "Save Draft" feature in ASP.NET?

I have a registration form in ASP.NET 2.0. I want to save my registration form fields either by clicking on submit button or they should be saved every five seconds. For example I have three fields in my registration page: UID PWD Name The user has entered UID and PWD and whilst he is entering Name the previous values should...

JavaScript question

It is possible not to show html page in user browser until some JavaScript(built-in or in separate file) will be loaded and executed(for page DOM manipulation)? ...

ImageFlow + HighSlide dimmingOpacity option

I use Imageflow carousel combined with HighSlide image thumbnail viewer. I joined them together as it's described in the documentation here. It looks like everything works well. The only thing I can't figure out how to make work is dimmingOpacity option. It fills all the background with the color I set when the image pops up with HighSli...

Is javascript supported for most smartphone nowadays?

I've always been thinking it's not supported until yesterday I login to gmail in my phone. I can see hints in red if I forget to input password. If javascript is not supported,how's that implemented? ...

window onload event fails in Chrome (with demo)

I'm adding some <script/> tags from javascript to load some libraries (e.g., jquery). When all libraries are loaded, I execute main code. To wait until everything's ready, I use solution similar to the one in this answer (found it on the web). Now, the story: http://jsfiddle.net/EH84z/ It works fine in Firefox, but quite often fails in ...

Call COM port from webpage

I'm looking for a way to call a COM port from a webpage. I was thinking abut running a Java WebStart (or Flash?) program that opens a local web server that allows to interact with the COM port using JSONP. Are there any show stopping security restrictions on the way that I don't know of? This should be possible: use native libraries ...

IE6 displays JavaScript error for below given function and error is also mentioned below..

I have a function function setbid(catid) { if(catid == 30) { document.getElementById('bannerid').value = 1; } else if(catid == 31){ document.getElementById('bannerid').value = 2; } else if(catid == 32){ document.getElementById('bannerid').value = 6; } } this function is being called onchange event of select box. now when the value...

DD_belatedPNG and DD_roundies having conflict with Cufon in Opera

I am facing strange problem in opera while using cufon with dd_belatedPNG and dd_roundies. every thing works fine in every browser execept opera. Once I remove below two lines it cufon works with opera as well. but I need dd_roundies and png fix as well. <script type="text/javascript" src="/js/DD_belatedPNG_0.0.8a-min.js"></script> ...

google maps v3 "How to create a mark clicking in the map"

I need to create mark clicking in the map, thanks :) google.maps.event.addListener(map, 'click', function() { alert('click'); }); ...

load jquery dynamicly in a widget and enable noConflict mode

Hi. I am building a javascript widget and i plan to use JQuery so i need to load it dynamicly and set it to no conflict mode. I am using a Object Oriented approach in my js following the example of GetSatatisfaction.com widget (http://s3.amazonaws.com/getsatisfaction.com/javascripts/feedback-v2.js) I have also found this tutorial about ...

What is the difference between “this”, “$this” and “$(this)”?

What is the difference between these three forms: this $this $(this) ...

JavaScript wrapper for Google Gears / HTML5

Are there any JavaScript wrapper scripts available that can use HTML5 JavaScript features if they are available (e.g. locaStorage / Web Storage / anything in common between Google Gears and HTML5), falling back to Google Gears if the browser is not capable (e.g. IE6 or IE7) While it would be ideal that IE7/6 users all move to IE8 (or Ch...

onkeyup event JavaScript

Hello. Here is my code : function search_buddy() { $.post("num.php",function (ret){ num=ret; }); $("#Layer7").html(num); } </script> <div id="Layer8"> Find a buddy : <input type="text" id="search" onkeyup="search_buddy()"/>&nbsp;: </div> Now,when i enter one character into the text box with i...

Trying to edit results before displaying them on screen.

The following does not seem to be working properly. success: function(results) { var $results = $(results); $results.find('a[href$=".exe"]').each(function(){ if (FileExists(this.href) == false) { $(this).parent().remove(); } }); $("#divSearchResults")....

IE: how to trigger body's vertical scrollbar recalculation

I have a problem with a vertical scrollbar on a custom SharePoint list form in IE. After navigating to the add attachment window and returning back the vertical scrollbar goes over the lower edge of the window so that one cannot scroll to the very bottom of the form. Resizing the window fixes this problem so probably if I could to someh...

get div current (rendered) width with javascript.

Hey, Ive got an php script dragging some images from a database and displaying them using float:left; so they go left to right. However unless in the css i define i width for the container they jump down onto a 2nd line. So the question IS! How for the life of me could I get it to figure out the width of the content and then set the w...

Javascript Conflict with 2 scripts - Need Help!

Hi there, If someone could help with a jscript issue I'd be very grateful! I have two scripts for different sections of the page which I'm placing in the head, but are in conflict on the same page and just can't seem to get them to work together. Both are as follows: <script type="text/javascript"> jQuery.noConflict(); function update...