javascript

ExtJS TabPanel missing scroll bar in ViewPort

I have a ViewPort that I want to open a number of tabs. One of my tabs is really long and should scoll off the bottom of the page. However, the scrollbar is missing from the side. Here's my Viewport setup: var viewport = new Ext.Viewport({ layout:'border', enableTabScroll:true, deferredRender:true, items:[ new...

IE 8 misbehaving when using $().append() of Jquery

I have this hidden span in the source code of my page: <span id="var-form" class="hidden"> <div class="{cls}"> <div class="{cls}-area"> <div class="gray-font16" style="color:#82BD0F;">{num}.</div> <div class="ad-form-field">Title: <img src="images/zero.gif" width="40" height="1" alt="" /> ...

Error using Jquery's $.get I dont get.

Its simple: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <script src="jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $.get...

What is the difference between the onFocus and onMouseEnter event?

What is the difference between the onFocus and onMouseEnter event? ...

AJAX ModalPopup triggered by dropdownlist

If "delete" item in dropdownlist is selected i want to display a confirmation dialog via AJAX ModalPopup. If OK button is clicked (inside the confirmation dialog) the delete method should be called. Because ModalPopup's OnOkScript property requires a JavaScript method, there is obviously no direct way to call server side method. What ...

Get height of entire document with JavaScript

Some documents I can't get the height of the document (to position something absolutely at the very bottom). Additionally, a padding-bottom on seems to do nothing on these pages, but do on the pages where height will return. Case(s) in point: http://fandango.com http://paperbackswap.com On Fandango jQuery's $(document).height(); retur...

Can autocapitalize be turned off with javascript in mobile safari?

Mobile safari supports an attribute on input elements called autocapitalize [documented here], which when set to 'off' will stop the iPhone capitalizing the text input into that field, which is useful for url or email fields. <input type="text" class="email" autocapitalize="off" /> But this attribute is not valid in html 5 (or another...

How to find out which javascript library owns $

I am new with javascript still, but I would like to know how to check if a library is supposed to be using $ and then do an if statement off of it. Sorry if I have a hard time asking this! ...

TextMate equivalent to gVim Ctrl+P

To auto complete a previously written string. Is it possible? EDIT I'm editing javascript/java if that matters. ...

How do you select more than one element by id?

Hi, I have two identical click events for two different elements that do not share a class, as such: $("#element_1").click(function(){ alert("hello world"); }); $("#element_2").click(function(){ alert("hello world"); }); I am looking for a way to assign that same click function to both of them without externalizing the function ...

Updating nested documents in mongodb

Say I have a data structure something like this: { 'name': 'test', 'anotherdoc': { 'something': 'someval', 'somenum': 1 } } Now, say I wanted to set something. Initially, I though it would be done like so: collection.update({'_id': myid}, {$set: {'anotherdoc.something': 'somenewval'}); This, however, see...

Using JSMin in a batch file

I'm trying to create a batch file that will run Doug Cockford's JSMin against all the .js files in a directory. Here's what i've got: for /f %%a IN ('dir /b /s *.js') do jsmin <%%a >%%~da%%~pamin\%%~na.min%%~xa The problem is that the angle brackets (<>) cause the batch file to interpret it as 0< and 1>. Event running just: jsmin <s...

Javascript String Library

I'm using Jquery for DOM manipulation, and I'm finding it invaluable. Is there a similar library for strings? I find myself needing to do manipulations and running selectors on parts of strings, and I just wish I can apply jquery syntax to it. Anyone know of anything like that? Ideally I would use a syntax like this: var select = $(...

Ajax Control Toolkit TAB Component - Javascript breaks it?

Hello all, I've finally figured out how to make all my millions of tabs (not that many really) wrap properly. Now, I want to fire a server side event whenever someone clicks on a tab. After some thorough Google searching, I thought I had struck pure gold with this: This stuff is in the header of my aspx page: <script type="text/javasc...

Problem sending JSON object succesfully to asp.net WebMethod, using jQuery

Hello, I've been working on this for 3 hours and have given up. i am simply trying to send data to an asp.net web method, using jQuery. The data is basically a bunch of key/value pairs. so i've tried to create an array and adding the pairs to that array. My WebMethod(aspx.cs) looks like this (this may be wrong for what i'm building in ...

Using JavaScript to model 3D polyhedra

Is there a JavaScript library that models 3D polyhedra using the canvas tag or SVG? Say I wanted to produce renderings of the Platonic solids, how would I best achieve this? FWIW, I'm only concerned with WebKit-based web browsers such as Safari and Chrome. I've seen this cool demo of how to render 3D triangles, but how might I extend it...

Compare javascript dates.

I'm comparing dates with something like this: var dt = new Date(); dt.setDate("17"); dt.setMonth(06); dt.setYear("2009"); var date = new Date(); console.log("dt(%s) == date(%s) == (%s)", dt, date, (dt == date) ); if( now == dt ) { .... } The string values are dynamic of course. In the logs I see: dt(Fri Jul 17 2009 18...

How to select an element that must have more than one css class?

I have an element that has two classes at all times: <p class="general_description laptop"> <p class="images laptop"> <p class="specs laptop"> One class describes the item (laptop) and the other (general_description, images, specs) describes the state that the page needs to be in to present one of three types of information about the ...

What't the common idiom to avoid IE throw: Error: 'console' is undefined.

I install firebug and I'm done with my logs. I test it in IE and of course I've got "undefined" error. What's the common idiom to avoid this. I don't really feel like commenting all the console.log statements in my file nor to mock it. Well I'm not sure what to do. ...

What unusual characters in addition to $ are allowed in JavaScript identifiers?

I want a variable like $ that is sort of special, but I'm already using jQuery, so $ is taken. ...