javascript

Pop-up window or modal box?

I'm designing a mission-critical web application and I was wondering if it is best to have users enter in data via browser pop-up windows or javascript modal boxes? The absolutely critical aspect is that data must save correctly through HTML forms. ...

How can I catch the back button event?

Is it possible to catch the JavaScript event when a user hits the back button in the browser or if history.back() is triggered? Best solution would be with mootools. I know there is window.onbeforeunload but this is triggered also when a form is submitted or a link is clicked... ...

Get Adobe Reader version using Javascript

Hi, What is the best way to get the adobe reader version in Javascript. Thanks Sp ...

page jumping around on click after javascript execution

I have a javascript (jquery) snippet that is link to a href="#" to toggle the click.. everything is fine exept when i click around the page is going back all scrooled up... i prefer the page to stay where it is... return false done nothing... here is the code : <script type="text/javascript"> jQuery(document).ready(function(){ jQu...

How Do I Parse JSON without jQuery

Some information - I'm creating an autocomplete which gets the data from a json feed. The JSON part works fine and the result is valid. When I'm obtaining it, I'm using json2.js and running JSON.parse. When I try and output it tells me that it (the object containing the parsed JSON text) is actually undefined. If I run an alert on the...

Easiest Way To Make A Form Submit Without Refresh

I have been trying to create a simple calculator. Using PHP I managed to get the values from input fields and jump menus from the POST, but of course the form refreshes upon submit. Using Javascript i tried using function changeText(){ document.getElementById('result').innerHTML = '<?php echo "$result";?>' but this would keep giving ...

Mobile Sarai - "touchend" event not firing when last touch is removed?

The "gesture" I'm trying to capture is a tap when but only when an element (other or same) already has a touch on it. So, touch (1) presses the button down while touch (2) taps to selected options, touch (1) releases and button is depressed. The problem I'm having is with the last bit. The "touchend" event is not being fired when I rel...

Is it better to minify javascript into a single bundle for the whole site, or a specific-to-each-page bundle?

When minifying JavaScripts together in web-development, is it better from the user-loading-time point of view to: make one single big bundle of JavaScript containing all the script, and include this on each page - so each page will probably not need all of it, but once the user has it cached, they don't need to get any further scripts ...

Overlay Canvas Pixel Data

How do I blend these two sets of pixelData? The maskArray specifies the pixels to use from the OverlayData. These need to be merged with the backgroundData, and inserted back into the main canvas as newBackgroundData, and as offsetX changes update as needed. update I think I have found a solution: simply create another hidden canvas, a...

Getting an irregular area in a web page (much like a Java GeneralPath or Polygon)

Is it possible to create an arbitrary shape on a web page so we can detect mouse overs/outs on it? It's much like an area map for an image but corresponds to a page (or a div etc) rather than an image. This might be a non starter altogether as I haven't found any information in this area. Thought I'll just ask here to see if there is a...

Getting firebug console to display different line numbers

I have wrapped calls to firebugs console.log in a logging function (that checks for existance of console along with other flags) for example: Log(string) { if (console && DEBUG) console.log(string); } my issue is that the firebug console shows the line number of the console.log function call rather then the Log function call. Is th...

Is there a jquery plugin that columnizes list items horizontally rather than vertically?

I'm looking for a jquery plugin or javascript that will columnize a list. I've seen Columizer, which is great and the configuration options are just what I need, except that it doesn't columnize data in the direction I need. My list: 1. 2. 3. 4. 5. 6. 7. 8. 9. Columizer behavior I want: 1. 2. 3. 4. 5. 6. 7. 8. 9. Columizer behav...

how to parse xml file using google map api

I have the following code the searchUrl gives xml output but i am not able to display output on map with markers. var searchUrl = "http://localhost:1894/blockseek8-9-2010/Block3.xml"; GDownloadUrl(searchUrl, function(data) { var xml = GXml.parse(data); var markers = xml.documentElement.getEle...

jQuery Slow in IE to do a mouseover on a TR

Hello When the mouse hovers over the TR, we want to show a hidden DIV. We could bind this function to the TR with jQuery but this is just done at the server side: <tr onmouseover="displayDIV('0123456789');" onmouseout="hideDIV('0123456789');" ... function displayDIV(rowID) { $('#options'+rowID).css('visibility','visible'); } f...

getElementById for XML Documents, Mozilla extensions

Is document.getElementById method supported on DOM parsed from XML strings using the DOMParser method in Mozilla ? I am making a mozilla extension that reads an xmlfile and uses DOM Parser to convert the xml into a DOM element, and tries getting elements by Id. The method getElementsByTagName works but not getElementById. It always retur...

MisAlignment of page controls when page zoom out is performed

Hi all, When i perform page zoom out the controls in that page are misaligned.... *This is the Screenshot-1*This is the original page This is when i perform page zoom out: Can any one pls help me solve this problem by providing some ideas or samples This is my .ASPX page code <label> ...

how can i retrieving text from input field as its entered in JavaScript? ?

Hi How can i retrieve the contents of an input field as they are entered with JavaScript? i know .onChange only works after the focus is changed from the input field? thanks ...

How to get iframe contentWindow height in cross domain

i want to auto adjust my iframe height according to their content but in same domain it's work properly with contentWindow.height but in case of cross domain its permission denied for accessing iframe dom. ...

javascript file doesnot load in smarty

{literal} <SCRIPT LANGUAGE="JavaScript" SRC="../calendar/weeklycalendar.js"> </script> <script> // call the function to build the calendar // function's param specify the first day of week // 0=Sunday, 1 = Monday, ..., 6=Saturday alert("before"); buildWeeklyCalendar(1); alert("afetr"); </scrip...

AlphaImageLoader fix for PNG's works online but not locally

I use the AlphaImageLoader fix called supersleight with the following code: var supersleight = function() { var root = false; var applyPositioning = true; // Path to a transparent GIF image var shim = 'images/empty.gif'; // RegExp to match above GIF image name //var shim_pattern = /x\.gif$/i; var fnLoadPngs = function(...