javascript

Login to multiple sites from one site using javascript?

Is it possible to let an user login to multiple websites from my website using javascript? ...

Using jQuery, how can I grab value from href?

I have a bunch of links on my page, in the format: <a href="/q/10/Title">Title</a> How can I grab the "10" from this link and use it as a variable? Thanks. ...

Streaming with Node.js, or any other Comet solution.

I'm trying to build a streaming solution for an internal app, but am drawing blanks for a solution to get past a roadblock. Currently, in my working example, I'm using APE, but due to restrictions I can't have any foreign running processes on the host machine, so I can't run the APE server. I'm looking for alternatives, but everything I...

Dynamically Include JavaScript and Wait

What I'm trying to do is dynamically include one or more js files from within Javascript. I know there are a bunch of techniques for this, but I'm looking for a solution that follows these rules: 1) Not use any JS frameworks or libraries (jQuery, Prototype, etc). 2) The script should halt execution until the external js file is complet...

Do web workers terminate when the user navigates to a new page (within the same application)

For example, can i offload a task and allow the user to keep surfing my site whilst the javascript runs? It seems if I navigate away from the page, the worker terminates. ...

Page variables in content script

Hi everyone, Is there any way to retrieve a page's javascript variables from a Google Chrome Content Script? Thanks in advance! :) ...

tell the order of javascript functions that have been called

I've been using Chrome scripts to identify the order of the Javascript functions that are running. It's a bit overkill for what I'm doing right now as what I only really need is to have a log of the javascript functions that have been called. What are you guys here using for that purpose? Thanks for the feedback. ...

Why properties added via Object.definePropery are not iterable in Javascript

Consider this code: var a = { get aa() { return 'aa'; } }; Object.defineProperty( a, 'bb', { get: function() { return 'bb'; } } ); for(p in a) { sys.puts(p + ': ' + a[p]); } The output is: aa: aa However property bb is perfectly accessible and working. Why 'bb' is ...

Appending select options - IE problem/solution cause other browser issues.

I have a <select> that depending on previous options is populated by a var with a bunch of <option> values. Naturally, because IE doesn't work with innerHTML I have to append this template to the <select> which now works great in IE. HOWEVER I now need a way to clear out the select options from the previous search and in FF stop it fro...

How to make Growl notifications with Adobe Air?

Hello I just started to develop Air applications with HTML/CSS/JS. And i was wondering: What is the easiest way to make Growl notifications? Thanks in advance ...

What's an easy way to get the url in the current window minus the domain name?

My Javascript ain't so hot, so before I get into some messy string operations, I thought I'd ask: If the current url is: "http://stackoverflow.com/questions/ask" What's a good way to to just get: "/questions/ask" ? Basically I want a string that matches the Url without the domain or the "http://" ...

Need comprehensive list of all native objects

I'm getting exactly what I want when I do this console.dir(this) in Chrome. Is there a way to get that into an array some how? So I've tried to do something like this to get started: for(var o in console.dir(this)) { console.log(o); } All I get is "undefined" and it prints the list into the console again. I really just need a nam...

How to refresh the size of a div after adding elements to it.

I have an element like this: <div id="content" style="border: 2px solid black"> </div> And through JQuery I add some new stuff: $("#content").append($('<div></div>').addClass("box")); where .box { margin: 10px; padding: 10px; border: 1px solid black } But the outer div does not resize when I do this, so I get an inner box that i...

Using a UIWebView to display and watch a log.

My app is retrieving text from a web service in chunks. I am displaying the formatted text using a UIWebView. So far so good. My problem is as each chunk arrives, I need to refresh the web view with the new content. I am using KVO to observe changes in the text, and when the text changes I'm calling [self loadHTMLString:self.log.text b...

jQuery UI Autocomplete not triggering a search when entering a hitherto searched for term

Hi, I have a jQuery UI Autocomplete control that fires an Ajax request when minLength = 3. The problem is as follows: Say I enter "fic" as the initial search term - this is fine. The request fires and results are returned. I decide that I don't want to select any of the results and then re-enter the same search again (fic). This time no...

Help with regular expression

Hello, Apart from what they are, I dont know anything about regular expressions... :( I have this code in a javascript function: var foroFormatting = function (text) { var newText = text; var findreps = [ { find: /^([^\-]+) \- /g, rep: '<span class="ui-selectmenu-item-header">$1</span>' }, { find: /([^\|><]+) \...

Right way to use Prototypal Inheritance in JavaScript?

Using Crockford's method ( http://javascript.crockford.com/prototypal.html ) doesn't work when we have reference values in properties (an array in the supertype) as this is common among all the objects. So, what's really the recommended way to do object inheritance in Javascript that doesn't have problem and that visually encapsulates b...

Checkbox validator

I have a list of checkboxes and I would want to make sure that the user will check at least one before submitting the form. How can I do this? There are 3 categories then 10 items under each category with a checkbox. I'm thinking of doing this in javascript wherein I will have a hidden variable then when the user will check any of the ...

Open files from a web application with another web application?

So these days we want things to be on the cloud. In the desktop area we could use one application to create a file, then another to open that file. I wonder how you accomplish this file sharing between web applications? Eg. if I create a web application letting the user create a file, how do I share this file to another web applicatio...

Rotate an image using Javascript

First off, I am currently using JQuery so JQuery solutions viable. I want to rotate an image by a dynamic X degrees which is calculated every sec. Now I had this working perfectly using this JqueryRotate plugin The image is rotated perfectly every sec. But I am trying something a little more complicated now. I want to rotate 4 tra...