javascript

Some software for IIS/.NET similar to JAWR (consolidate and minify Javascript)

Is there any software package/library that will produce a consolidated, minified JavaScript file for a production environment, while leaving the original files/references as-is in a development environment (so developers can work independently)? JAWR does this (and more) for a Java/Groovy environment, but I haven't seen anything like it...

What to do when there are different input arrays in JavaScript?

I'm learning JavaScript right now, quite a task being new to both the syntax and DOM manipulation. Right now I'm not really using jQuery(or any other library). I've used it before but not interested at the moment since I want to get the hang of it then move to a library. I'm looking for plain JavaScript examples that do not involve lib...

Javascript question

(myVar && foo()) what does the above code mean? what is it equivalent to? this is an inline code i think it runs on a single line ...

Is it possible to use an existing Facebook Connect session with Facebooker?

Update: Working as designed once I cleared my cookies. Doh! I'm working on an app that for various reasons uses the Facebook Javascript API to initiate a Facebook connect session. I'd like to be able to use that session in a few rails methods using Facebooker. The basic workflow is like this: User goes to non-rails page and logs in t...

Supporting multiple JavaScript libraries in one script.

I'm working on a new project in JavaScript that I want to release later. Besides other functionality, this script requires a little DOM manipulation. To make this XB (Cross-Browser) and not inventing the wheel again, I need help of a existing JavaScript library. Because of the large number of great libraries I don't want to force one lib...

positioning of date picker in extjs

I'm using the date picker but I am a little confused about where it decides to place the date picker on the screen. On one screen it's fine but on another it gets stuck hiding behind a flash object. Can I force it to attach to the bottom right corner of the place where the datebutton is clicked? I was looking in firebug and it seems to j...

Property based searches in Javascript

While looking for the best way to search an array of objects in Javascript (there doesn't seem to be a iterate + compare function for that) I came across this post which seems like are really elegant way of doing this. However I have some questions: Javascript doesn't have associative arrays. These seems like one. What gives? This see...

Setting Focus to an iFrame in IE

There is a tree menu in my application and on click of the menu items, it loads a url in a iFrame. I like to set the focus in an element of the page loaded in the iFrame. I'm using this code, and it works perfectly in all the browsers except IE: var myIFrame = $("#iframeName"); myIFrame.focus(); myIFrame.contents().find('#inputName').f...

jQuery Duplicated object

Hey guys, I'm a little new to jQuery so bare with me! What im trying to do is when im within a div container (#links) I want to be able to hover over the links then perform an action (to be implimented later). When I exit the div box (#links) I want a different action to take place. The problem: Hovering into the div container (#links)...

How do you limit options selected in a html select box?

I'm using a select tag in a form i'm making that allows multiple selections, but i want to make the maximum amount of selections 10. is this possible using javascript or jquery? Thanks in advance! ...

Javascript Regular Expression replace() problem.

Hi, i'm trying to validate an input field and store it using AJAX My js code is : <script type='text/javascript'> function addICValidate() { var invalidString=/[^a-zA-Z\s]/; // Alphabets with spaces only var searchQuery=document.getElementById('addICName').value; var validQuery=searchQuery.replace(invalidString,"")...

What can webkit do?

Since there are more and more apps going the web way (like Phonegap, Appcelerator over the mobile and desktop apps development and the ones that I don't know yet), I am wondering what kind of role the web engine (seems the famous engine is webkit) is playing now and in the future? A web engine is capable of rendering HTML and CSS(for in...

Automatically re-check a checkbox when I decheck another one

As a student, I am trying to learn some JQuery tricks. Here my HTML <div id="EngineGroup" class="OptionGroupStyle"> <div id="GS300"><input id="GS300Check" name="GS300Check" type="checkbox" disabled="disabled" checked="checked"/>V6 250ch</div> <div id="GS300Price">53.000 €</div> <div id="GS430"><input id="GS430Check" name="GS...

Pushing javascript too hard with Script# and javascript?

So I have been playing around with a home project that includes a lot of js. I having been using Script# to write my own library etc. Personally I wouldn't write a lot of js if I didn't have a tool like Script# or GWT to help maintain it. So far it includes these external libraries: – ASP.NET AJAX – ExtJS – Google Maps – Google Visuli...

javascript textarea scrollTop

I'm trying to enable checkbox once the user reads all the agreement. Yet, well, I've tried googling with no avail and also confused. I'm trying to get the "real" end of scrollTop, but due to different rendering engines (gecko, webkit, blah blah? ) a fixed value won't work. This is part of my learning so please avoid posting solutions w...

do things with the return value of smarty function?

We have this Smarty function that returns HTML code for templates. However it is also possible that the function returns a null string, which we now wish to identify. Our system has been running stably for years, so I am looking for the least invasive possible solution. Is it possible to assign the return value to a smarty variable? I h...

Removing duplicates in a comma-separated list with a regex?

I'm trying to figure out how to filter out duplicates in a string with a regular expression, where the string is comma separated. I'd like to do this in javascript, but I'm getting caught up with how to use the back-references. For example: 1,1,1,2,2,3,3,3,3,4,4,4,5 Becomes: 1,2,3,4,5 Or: a,b,b,said,said, t, u, ugly, ugly Becom...

Call JavaScript function in opener

I need to to trigger a JavaScript function in an opener window by clicking a button in the child. I thought the following would work, but it is not. window.opener.MyFunction() ...

Can events fired from an iframe be handled by elements in its parent?

Suppose I have a page located at www.example.com/foo, and it contains an iframe with src="http://www.example.com/bar". I want to be able to fire an event from /bar and have it be heard by /foo. Using the Prototype library, I've tried doing the following without success: Element.fire(parent, 'ns:frob'); When I do this, in ff 3.5, I ...

Is is possible to spoof a session with JavaScript + Cookies?

Suppose you have a webapp that gives users their own site on a subdomain (eg: awesome.super-cms.com) and that you let them edit HTML. Further assume that you're setting the SessionID in a wildcard subdomain cookie ("*.super-cms.com") The user who manages evil.super-cms.com could easily write a JavaScript that grabs the SessionID from o...