javascript

Trying to get a json result back from method in another namespace, having issues

I have a seperate .js file and namespace for json requests. I have another .js file and namespace for the actual logic. I can't seem to get the result back in my logic layer. var jsonResult = Blah.Data.LoadAggregates(); alert(jsonResult); alert(jsonResult.d.length); alert(jsonResult.length); all of the above calls are returning unde...

Allow a div to only grow vertically for x amount of pixels then show scroll bar?

So, basically if a div reaches 50px I want to, then, turn on the scroll bar (vertcially). Any JQuery Ideas would be nice. ...

How do I programmatically determine the current zoom level of a browser window?

Hi, I want to find out the zoom level of what is being displayed in a browser window based on the javascripts' window object properties (http://www.javascriptkit.com/jsref/window.shtml) to which I have access. I just can't seem to find the right mathematical formula for the zoom based on the inner width, page offset, etc. I found a solu...

jQuery exception if element doesn't exist

I working with jQuery and I need to get anytime and anywere exception (with any operation), if I attach some event or try to perform some action with elements (got from selector) that don't exist. Is there some internal "strict" mode in jQuery for this issue? ...

Can an Ajax call complete before the DOM is loaded?

I am grabbing data through a jQuery Ajax call, and displaying it on the page. I need to wait for both the DOM to load and for the Ajax call to complete before I can use the data to display it on the page. Can an Ajax call ever complete before the DOM has loaded? I'm just trying to determine where I need to put my method that will mani...

Where to post code for open source usage?

I've been working for a few weeks now with the Google Maps API v3, and have done a good bit of development for the map I've been creating. Some of the things I've done have had to be done to add usability where there previously was not any, at least not that I could find online. Essentially, I made a list of what had to be done, sear...

Click() works in IE but not Firefox

I have code which is trivial but only works in IE not Firefox. $(document).ready(function(){ $('li#first').click(); }); I have also tried: document.getElementById('first').click(); But that doesn't work either. Is this an IE bug/feature or is click() not supported in the other browsers? Responding to comments: There is a si...

JavaScript: When does JavaScript evaluate a function, onload or when the function is called?

When does JavaScript evaluate a function? Is it on page load or when the function is called? The reason why I ask is because I have the following code: function scriptLoaded() { // one of our scripts finished loading, detect which scripts are available: var jQuery = window.jQuery; var maps = window.google && google.maps; i...

Uploading a file without a full page reload

I'd like to create a page, which uses a local file in JavaScript. I don't need to upload it to the server really and I definitely don't want the page to reload completely. What are the available options to solve it? The best I could come up with so far, is to (not perfect, but should work): execute a POST from iframe retrieve the fil...

JavaScript tags, performance and W3C

Today I was looking for website optimization content and I found an article talking about move JavaScript scripts to the bottom of the HTML page. Is this valid with W3C's recommendations? I learned that all JavaScript must be inside of head tag... Thank you. ...

Delete jqGrid rows client-side only and sending deleted rows to ASP.NET MVC on form POST

The question is likely confusing and I apologize. I wasn't sure how best to word it. I am using jqGrid in a jQueryUI dialog which is inside a form. The user will use this form to create and edit Events. Upon editing, the user can click a button to open a dialog showing a grid of saved locations for the event. I want to give them the...

How do I get Google Chrome's root bookmarks folder?

Hi, I'm trying to write a better bookmark manager in chrome extensions. The problem is there are no simple examples (that I can find) about how to actually use the bookmarks api (available here: http://code.google.com/chrome/extensions/bookmarks.html ) I've looked at the example source (when I d/led and installed it on my computer it di...

Is there a book that discusses OOP javascript to build something like gmail's frontend?

I want a book that gives a detailed account of building a rich front end interface like gmail. is there one around? There are books that go over concepts, but I need something to put it all together. Guess I am looking for more of a 'solutions' approach, rather than a reference type book. ...

Ok to implement backend/shared functionality for iPhone in JavaScript?

Is it ok to use the Webkit Javascript engine to implement cross-platform, non-GUI backend functionality on the iPhone, iPad? In my case, I was interested in re-using Javascript code that I have that works on top of SQLite. I thought I would need to re-implement the logic in Obj-C but perhaps I could just share it and expose some hooks ...

JavaScript help - compare two dates in (dd/MMM/yyyy) format

I am trying to compare two textbox values on an aspx form. Both the values represent dates. They are formatted like "dd/MMM/yyyy". How can I compare them in JavaScript to see if they are not equal and which one is greater etc.? Does JavaScript have a date constructor for strings like this? Any tips would be appreciated. ...

Compute an MD5 sum in JavaScript and access it as bits.

I have a project where I want to compute an MD5 sum in JavaScript but I want to then break it up into chunks (as it happens I want 3 bits at a time). Are there any implementation I can use that make this easy to do? (BTW I already found this MD5 implementation that returns a string.) Option I've thought of: Hack that implementation to...

JQuery: what's the non-JQuery equalavent of "$("#myDIV li").eq(1)" ?

I'm trying to de-couple my dependence on JQuery, as such - I have the following JQuery: $("#myDIV li").eq(1).html('...'); $("#myDIV li").eq(2).html('...'); $("#myDIV li").eq(3).html('...'); How do I perform the above code without using JQuery (just plain JavaScript). ...

Guide me to do This Timer Application in asp.net.

I will tell my idea. If the person enter his time of birth in this format "YYYY: MM: DD: HH:MM:SS" My application will display: Ur life timer is :"26:11:13:02:03:55" ...

asp.net mvc script and style references

I'm trying to include script and style references that will not break on deployment, however I can not even get the references to work locally. I have tried using Url.Content() and MVCContrib's <%=Html.ScriptInclude("")%>. My scripts are in a Scripts folder on the root of the site; my styles are in the usual Content/css/ folder. The s...

How to get original browser set input colors back after changing them with jQuery().css() ?

Problem with jQuery: After changing the border and background color of some input fields in a form that fail the validation i don't know how to get the previous, original colors back as i don't pre-style the inputs but use the browser settings instead. how to handle this? thanks in advance, clubnite ...