javascript

JavaScript Build Tools?

I'd like a tool that will: a) roll a bunch of separate js files into one b) minify my js Any ideas? ...

Maintaining focus on ajax update panel after updating form

I've have a formview that is designed to update it's datasource each time a text_changed event or dropdown list has been changed. On every text_changed event and equivalent for other controls I call the formView.UpdateItem method and this causes the form to lose focus from the control I have tabbed down to. I've tried to implement this ...

xml to json mapping challenge

At first glance, I thought using xml data in javascript would be as simple as finding an xml-to-json library and turning my xml into a javascript object tree. Now, however, I'm realizing that it's possible to create structures in xml that don't map directly to json. Specifically, this: <parentNode> <fooNode>data1</fooNode> <ba...

jQuery / Javascript replace <space> in anchor link with %20

I'm new to jQuery and i'm trying to write some code to go through the page and rewrite anchor links href attribute so that spaces are removed and replaced with %20. so far i have: $(".row a").each(function(){ $(this).attr("href").replace(/\s/g,"%20"); }); I've tried a few variations of this with no luck. ...

Calculating Javascript Library Load Times

I am trying to compare the performance of several Javascript libraries. Although measuring transaction times helps to determine the working performance of a library, it doesn't account for the time required to download and initiate the individual libraries. I'm looking for suggestions for the best method of determining the load time ot...

web application development with j2me

The main reason I'd like to use j2me is that one of its main advantages is that it can access the phone's resources through its various APIs. However, due to newer phones having web browsers like Safari, Opera, and Windows IE, it would be advantageous to build a web application so a user wouldn't have to download some software onto their...

howto insert an image from client side into an editor?

like an "insert" menu,by which to insert an image into the editor, using javascript,I've no idea what's the solution at all, should be in 2 steps: 1.let user choose image(this should be doable by a "input type=file") 2.insert the chosen image into editing context(don't know how to implement) ...

Replacing a document body on the iPhone

I need to be able to replace the entire document content with a response obtained from an ajax request. I have tried assigning to document.body.innerHTML and also tried using document.write(). While both of these are functional on desktop Safari, I need a solution for the iPhone/iPod Touch. Attempting to modify document.body.innerHTML p...

Jquery Autocomplete Chained Requests

Hi, I have a page with two input fields City and Venue. I have the autocomplete plugin from Devbridge working great for the city field. I now want to get it working on the venue field. The javascript I have so far is: <script type="text/javascript"> $(document).ready(function() { $('#Event_City').autocomplete({ ...

Making overlay <div> that stays in position after zoom-resize using HTML-CSS only

Hello! I my working on the site that will have image gallery. Designer idea was to make buttons that switch photos be above the photos a bit. Like this Currently I've made a javascript solution to this - it gets position of photo and applies absolute positioning to the button divs. There are some drawbacks - it works unstable in Ope...

document.getElementById() VS. getElementById()

It is common for me to register javascript functions for certain events by doing something like: myBtn.Attributes.Add("onClick", "Validate(getElementById('" + txtFirstName.ClientID + "'));"); I've always used getElementById by itself, or in other words, sans document being prepended to it. But I'm having pages break on me lately when ...

Javascript Object Confusion...

I've confused myself nicely here. My scenario is as follows. function DesignPad() { function EditBar() { ... this.removeHandler = function() { **// how do I call Dragger.removeAsset** } } function Dragger(){ ... this.removeAsset = function() {} } this.init = function() { this.editBar = new...

Firefox Firebug Extension - Freeze Javascript Feature?

How can I freeze Javascript in firebug so that i can inspect the changes made by it in the html? If for example i have a jQuery rollover effect and i want to inspect the html code in that point in time. I believe Dreamweaver CS4 has this feature titled freeze javascript and live code. Is there a free equivalent either in Firebug or anot...

How does this js know $get is function(id) { return document.getElementById(id); }

So I've been looking at a blog post with some javascript in it and there is something I'm looking at which I don't quite follow: function pageLoadedHandler(sender, args) { if (typeof(lastFocusedControlId) !== "undefined" && lastFocusedControlId != "") { var newFocused = $get(lastFocusedControlId); ...

OnClick without jQuery

How to make OnClick without jQuery, with no extra code in html, such as: <a href="#" onclick="tramtramtram"> just using an extrnal js file? <script type="text/javascript" src="functions.js"></script> Need to replace this code: $("a.scroll-up, a.scroll-down").click(function(){SNavigate($(this).attr("href").substr(7));return fals...

having javascript force a Selenium test to fail

Is there a way for js code to force Selenium testing to fail? For (a probably bad) example, if I had the following: return document.getElementById('foo').innerHTML == 'hello' is there a way I could make the 'runScript' command fail depending on if the js code returned true or false? (I know that example could be used by other Selenium...

how to get 1 hidden field among several within div

i have 3 hidden fields in 1 div. when I have reference to this div, how to get 1 of the hidden fields in this div. ...

Does putting scripts on the bottom of a web page speed up page load?

Yahoo best practices states that putting js files on bottom might make your pages load faster. Have anyone tried this? What are side-effects, if any? ...

What is the best way to profile javascript execution?

Is there a good profiler for javascript? I know that firebug has some support for profiling code. But I want to determine stats on a longer scale. Imagine you are building a lot of javascript code and you want to determine what are actually the bottlenecks in the code. At first I want to see profile stats of every javascript function an...

Raise "onChange" event when Input Element changed by JavaScript from Popup Window

I have a webpage with a form element and a popup window (opened by window.open). Both have jQuery available. The popup window has a javascript that can change the form element in the opener window. That works perfectly by doing... $(opener.document.formelement).val(vals[0]); However by doing that the onChange event will not fire. Th...