javascript

Width, padding giving auto in IE7

Hi all, I am trying to coding for padding, width based on previousSibbling Div id. Based On Prev Div id's Width, Padding, I will calculate current width,padding. It is working in Mozilla. But IE PrevSibbling Div's Width, padding coming as "auto" and i tried to add 10px to width. But it is not working. Div functionality working as...

What is the expected order of an array submitted in an HTML form?

I'm wondering if there is any sort of guarantee on the order of POST variables I will see on the server side. My use case is I have a form that a user will fill out to enter a list of names and emails. I'm using a table rows, each of which has two inputs: <table> <tr> <td><input type='text' name='name[]' /></td> <td><input type='text' ...

How to match up to second letter using regex?

How would I match "22A00" in the following string: "22A00B20A" using a regular expression? ...

Simple question about initializator

This is a basic question. Sorry. I have the following code: $extend(ImageCrop, Options.prototype); Swiff.Uploader = new Class({ Extends: Swiff, Implements: Events, options: { path: "Swiff.Uploader.swf", target: null, zIndex: 9999, height: 30, width: 100, callBacks: null, ...

anchor tag click listner in Safari

I've posted a question of how Safari behaves for the anchor tag click event here on Apple's Forum. It has not gotten any answers as of posting here. http://discussions.apple.com/thread.jspa?threadID=2581038&amp;tstart=0 I'm asking developers here at Stackoverflow to take a look and provide their intelligent comment how to circumvent th...

Django admin - Autoselect field with javascript

class Zipcode(models.Model): city = models.CharField(max_length=100) zipcode = models.CharField(max_length=6) class Meta: ordering = ('zipcode',) verbose_name = 'Zipcode' verbose_name_plural = 'Zipcodes' def __unicode__(self): return self.zipcode + ' ' +self.city class Area(models.Model)...

iPhone UIAutomation button tap does not fire

I am trying to use UIAutomation in Instruments with the iPhone Simulator and the latest iOS SDK 4.1. Here is the snippet of javascript that is having a problem: // there are sufficient delays here to make sure the view is loaded UIATarget.localTarget().frontMostApp().logElementTree(); main.buttons()["theButton"].tap(); UIALogger.logMes...

Sencha sqlite example

I would like to see a decent example of a mobile web app using the Sencha framework with a client side DB accessed with SQLite. I'm currently digesting JqTouch and kinda get the binding method used there from reading Jonathon Stark's "iPhone apps" book, but cant find any examples of accessing Senchas features ie listed elements with SQLi...

Is there a good alternative to having JavaScript code as string literals in my ASP.net code?

Working on an ASP.net web application, I've been wondering if there is a good way to avoid writing JavaScript code in string literals in my ASP.net code. See here: http://www.4guysfromrolla.com/articles/030202-1.aspx. In the linked example, I see code that looks like: Private Sub Calendar1_SelectionChanged(sender As Object, e As Ev...

running a javascript function from a file included by another file

Hello, We are including a javascript file from within another javascript file using document.write. Within the first javascript file is a call to a function in the second javascript file. As a result, we are getting an error message: 'gMunchkin' is undefined when I debug the code. What am I doing wrong, and how can 'gMunchkin' be called...

Avoid opening the same page twice

Hello everybody, I'm trying to find a solution to this problem: I have a page on a php application that can't be opened more than once to avoid session overwrite. I'm spending a lot of time without finding any solution! The last one I tried is to use the jquery "load" and "unload" events on the window. It works fine if I open the same p...

File Uploading - Limit File Types in "File Upload" Window

Hi, I have a question regarding file uploading, I need to limit file types, but I like to do it in the “File Upload” window, so the user can’t even see files that are not allowed for uploading, I like to do it in js or jquery. I know it’s possible for example, uploadify plugin does this, but I don’t want to use it for a number of reason...

Javascript Invalid quantifier in regex

The regex is constructed on the fly, but I've output it to firebug: (.{1,38})(+|$\n?) the error is invalid quantifier +|$\n?) I don't even know what invalid quantifier means! I really feel like I'm going to get the "Show us something relevant" answer, but I'm not sure where to start. The actual code is: var re = top.RegExp; var ...

JSONP for cross-site bookmarklet guidance

I'm looking to build a cross-site bookmarklet that gets a highlighted word, passes it to a CodeIgniter method (domain.com/controller/method), and returns the definition via a dictionary API. I've got a skeleton working well on a single domain, but I'm looking to expand it to use JSONP cross-domain. But I feel unclear. I know I need to l...

Javascript server side file browser/manager

I am using openCart for a project that I am putting together and am trying to figure out what jquery tool they are using for their image manager. I couldn't find a reference to it in their forums and thought that perhaps one of you might know what it is. Opening the image viewer brings up this window: where you can then explore the ...

How to make a Constantly updating Page?

Hi There, I'm trying to create a page on my website that shows newly uploaded items in real-time. I was thinking that calling an Ajax Script every 3 seconds would be the best way to approach this, however my website does not get a new uploaded item that often. It is so variable too, anywhere between 30 seconds and 1 hour! In addition,...

Weird IE8 problem when using .animate({'height':'toggle'})

Check out http://wouter.howafarms.com/faq The goal is to have answers be expanded on click. As you'll see this works perfectly in all browsers except for ie8. I've tried various animation effects .slideDown(), .toggle() to no avail. They always work in Firefox, Chrome and even IE7, but never in IE8. What in the heck might be causing...

Jquery UI: Button on dynamically created elements.

Hello, I would like to add jQuery UI button to all my input submits. $('input:submit').button(); That works great for normal buttons but it doesn't work for buttons I create dynamically. Anybody know how to do this? ...

How to run jquery script if html page is the home page... ?

Hello All, I'm working with an external team with our website and they recently added one of my scripts to the .NET MasterPage of the site... well it did finally get my script running but now... it loads Banners on 'every' page on the site. How can I write an 'if' statement that basically says... if this is the home page... run this sc...

parsing out in javascript

I want to check a string and if it has no <br /> starting then I don't wanna do any thing for example mysqtinr = 23435-acs as you can see no <br /> starting but if the string has the following then I wanna parse it out myString = <br /> some text goes here <b> Some other things </b>: just more test <b> http://website/index.php </b> on...