javascript

Is Javascript parsed/interpreted on load? (IE)

I Know, for instance, that when Chrome downloads a Javascript file, it is interpreted and JITed. My question is, when IE6,7,8, first download a Javascript file, is the entire thing parsed and interpreted? My understanding was that only top level function signatures and anything executed in the global scope was parsed on load. And then ...

performance loading js files

Hi I was wondering what would be best. I have different JS functions, for instance I have the accordion plugin, a script for the contact page. But I only use each script on one page e.g. 'the faq page'uses the accordion JS but not the contact JS obviously. This along with many other examples (my js dir is 460kb big in total, seperated ...

what is the difference in variable delaration here?

I am picking up maintenance of a project and reading code: I see two methods of variable declaration. Can someone explain what the difference between the first and second line means? To me, I am reading that in javascript, the var keyword is optional. in the first line, they have declared two new variables and initialized them. In ...

Store javascript variables in array

I am sure someone has gone over this but I have had no luck finding some results. I want to know what is the fastest way to maintain a proper variable scope. Here is some example jquery code I wrote this morning. var oSignup = { nTopMargin: null, oBody: $("div#body"), oSignup: $("div#newsletter_signup"), oSignupBtn: $("d...

Breakpoints in Ruby IDE?

Hey there, I currently use TextMate for Ruby/Javascript/Actionscript development and it is amazing. But one thing I would really love to use are breakpoints so I could stop code execution and examine the state of the variables and walk through the code. Something like what Flex Builder does. Does TextMate have this capability? Or wh...

gadgets.Prefs in type url Google Gadget

Is it possible to access gadgets.Prefs in content of type="url"? <Content type="url" href="remote address"></Content> gadgets.Prefs is set in content of configuration <Content type="html" view="configuration"> ...

How does this flash movie advance the slides in the flash slidedeck?

Take a video on infoq.com (like this one: http://www.infoq.com/presentations/nutter-jruby-duby-juby). If you play the movie linked above, you'll see the slide deck advance as the appropriate part in the movie is hit. If you advance it forward and back with the slider, you'll see that it triggers to the appropriate location in the slide d...

javascript library/plugin to display button/dropdown menu with checkbox?

I'm looking for a library that implements the following widget: Dropdown (similar-ish to <select>) where you pick 1 value, onchange fires but the visible "value" is really the label, like a prompt. So it's more like a button when clicked shows a list of values, but otherwise acts like the HTML SELECT. In addition, the width of the wid...

unique() for arrays in javascript

As everybody knows there's no built-in function to remove the duplicates from an array in javascript. I've noticed this is also lacking in jQuery (which has a unique function for DOM selections only), and the most common snippet I found checks the entire array and a subset of it for each element (not very efficient I think), like: for (...

How do I get the URL for Google Map embedded on my website?

I am displaying a map on a website using the Google Map API. I want to include a link on that same page to take them directly to the map on Google Maps. Is there an API call I can make to the map to retrieve the URL of either the current location/zoom level or the starting location/zoom level? ...

need a mapping service like google maps - but for my intranet

i have built a solution around google maps api but realized that it doesn't work when i deploy it to my intranet. after reading it seems like you need the premier service for this. Is there any other similar maps api tools that you can use free on your intranet website? EDIT: from what i have read it seems like Yahoo allows you to u...

JQuery - Group Checkboxes

Hi, I have the following code which expands and collapses a subcategory when the arrow image is clicked. <html> <head> <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script> google.load("jquery", "1.3.2"); google.load("jqueryui", "1.7.2"); </script> <script language="JavaScript"> function toggleTableRows() { $(...

Can I get the ASP.NET RangeValidator an onblur/onfocus events to play nice with each other?

I have a textbox for entering a currency amount, with a RangeValidator control making sure the value entered is between 1 and 99999999.99. The field also has an “onblur” event that fires off some JavaScript to format the input with commas and a decimal point (e.g. 12455 -> 12,455.00). There's also a "onfocus" event that reverses the "on...

How do I get this if-statement with jQuery .css to work?

In my code jQuery code (I know the if statement isn't jQuery), the css property "right" for the class "slider" does NOT equal 30, yet "container" is still fading out on mousedown.. What am I doing wrong? I want it to be: if the class of slider has a "right" css property equal to 30px, then fadeout the container. $(document).ready(functi...

Datepicker for web page that can allow only specific dates to be clicked

Is there a Javascript or some library that would create a datepicker for a webpage (similar to Jquery UI DatePicker that would only allow certain dates to be clickable and highlighted. For example on server side, I could specify a array of days to enable to be selected. ...

Javascript library for drawing Graphs over Timelines (zoomable and selectable)

Is there a javascript library that allows for drawing histograms/graphs over timelines, allow zooming, as well as selecting regions. Something similar to Google's Financial Data Graphs (allows for scrolling, zooming in, as well as selecting ranges) Google Financial Data Thanks. ...

Is there a library which implements new Javascript/Ecmascript 5 methods for older versions?

Although Ecmascript 5 introduces some completely new features, it also adds some new methods (bind, trim, map, etc.) which should be perfectly possible to implement (albeit slower) in current versions. Does a library exist which implements these backwards compatible features (and no more, excluding Prototype et. al.) ...

Handling errors in jQuery(document).ready

I'm developing JS that is used in a web framework, and is frequently mixed in with other developers' (often error-prone) jQuery code. Unfortunately errors in their jQuery(document).ready blocks prevent mine from executing. Take the following simple sample: <script type="text/javascript"> jQuery(document).ready(function() { n...

IE has empty document.referrer after a location.replace

I've got a site that does a complex search and has a "loading" page. On the loading page we use: <body onload="window.location.replace('results_page.php');" > Or: <body onload="window.location = 'results_page.php';" > The only difference between the two option above are that location.replace() ignores the page in the browser's histo...

What does /.*=/ mean in jquery/javascript?

What does /.*=/ mean in the following jquery? var id=this.href.replace(/.*=/,''); this.id='delete_link_'+id; ...