javascript

Can't match any of this subject with preg_match

I am trying to match some of the Javascript on a Youtube video page. The pattern thats the same for every video is like this: <param name=\"flashvars\" value=\"somethingsomethingsomething\"> I need to get out everything in value, in this case somethingsomethingsomething. It is commented out because this is embedded in Javascript. This...

Where Should I Place my Javascript File in a Flex 3 project?

Hi, I've got a javascript file that I need to load into my Flex 3 project. I access it in the HTML wrapper like so: <script src="myJSFile.js" type="text/javascript"></script> I use Google Code's library to access JQuery. Is it okay to put the javascript file in the html-template folder? The idea being that it would be included in th...

Does Google Closure support multiple "packages" of Javascript files?

Say I had 1 MB of compressed Javascript, all combined into one file using Google Closure. Now 500 KB of it is only needed for one section of the site. So I want to combine & compress the Javascript, but separate it into two packages: Package A - 500 KB - used across the site Package B - 500 KB - used only in one section of the site ...

My js lightbox feature is canceling out my hidden checkbox toggle div

First off sorry i had to add -- to my links because of spam prevention;) Here is the file with the hidden div "yes" checkbox toggle working perfectly>> --http://myvirtualltciguy.com/help/Checkbox_Toggle.html This is the .js file that makes it work>> --http://myvirtualltciguy.com/jquery/check3.js Here is the file with the lightbox fe...

What is the behavior of typing {a:1} giving 1, and {a:1, b:2} giving an error in a Javascript console?

The following will show in Firebug or in jsconsole.com or in other Javascript interactive console: >>> foo = { a : 1, b : 2.2 } Object { a=1, more...} >>> foo.a 1 >>> foo.b 2.2 >>> { a : 1, b : 2.2 } SyntaxError: invalid label { message="invalid label", more...} >>> { a : 1 } 1 why is the 1 returning for {a : 1} and why is {a : 1,...

Is there a good "email this" solution?

I like the functionality of Share This, but I only need the "email this" option using my own custom icon. Is there a sensible way to do this? Thanks! ...

Adding rows in HTML table using javascript

I am trying to insert rows into an html table with javascript. I have the table created and can add rows successfully with the click of a button. However, I want to be able to populate the rows with elements from several arrays on load. The button is just to make sure the rows are being added. <html> <input type="button" value="Add ro...

Flex 3 What Does this Error Mean, in General?

Hi, I'm running into this error, but I don't understand what it means. Has anyone else run into a similar error? Error: Unable to load ''. at mx.controls::SWFLoader/loadContent()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\SWFLoader.as:1617] at mx.controls::SWFLoader/load()[C:\autobuild\3.2.0\frameworks\pro...

JavaScript redirect (location.href) breaks the Back button unless setTimeout() is used

I just came across some odd behavior in Firefox 3.6/Mac. I suspect that it's general Firefox behavior, though. I created two dead-simple test pages that change the window.location.href property to navigate to new URL: http://troy.onespot.com/static/stack_overflow/redirect.html http://troy.onespot.com/static/stack_overflow/redirect_tim...

People could use your javascript code with Sproutcore/Cappuccino?

If you use either Sproutcore or Cappuccino for your frontend, doesn't it mean that everyone could see your javascript and copy it? If so, they'll have your whole frontend code. Am I right or wrong? ...

Click event not processed when using prototype (with lowpro)

I have JS code that uses lowpro (prototype extension) to reorder a set of dynamically generated questions. So when I click a.move-up I want to move that element's parent up. And a.move-down suppose to move it down. I'm using lowpro since the elements are generated after dom:loaded. http://www.danwebb.net/2006/9/3/low-pro-unobtrusive-scr...

Is there a way to compare 2 colors in JS, like 'If Color A is darker than #202020'

The background color for one of my pages is set pulled from the background color the users set as their twitter background color. I have a page that has a rounded box with a black border. The border doesnt look good if the background color is dark, so i'd like to remove the border of the background is darker than an arbitrary hex color...

Jquery/javascript Library for avatar creation?

Is anyone aware of a javascript or jQuery library that enables the creation of Pixelart avatars? I'm hoping for something with a mr potatohead style face creation using components and resulting in a gif. If not I guess I'll need to make one myself. Thanks! ...

Facebook Connect - Single Sign On Causes Infinite Loop :(

Hi Guys, I have a Facebook Connect (FBML) web application that has been live for a while now. All is working well, however user's are reporting issues with the single sign on (and i have seen the issue on their computer, but have not been able to replicate locally). With FBC, there is a "event" you can hook into to automatically dete...

How do you get the hue of a #xxxxxx colour?

How do you extract the hue component of a color given as '#rrggbb'? ...

How to embed object reference in HTML?

I created some HTML code based on a javascript var. I want to update these HTML code when I update the source var. Because I have object reference in the HTML, I know which HTML section to update. How do I accomplish such thing? Thank you. ...

How to include an external plugin inside of another jQuery plugin being authored.

I am building a custom jQuery plugin for a project I am working on. I want to return an object that is custom to another jQuery plugin...rather than having to make sure that each page that uses my plugin also has this other plugin, is it possible to include it in the actual plugin itself? Rather than type the following on each page tha...

Most efficient way to generate a really long string (tens of megabytes) in JS

I find myself needing to synthesize a ridiculously long string (like, tens of megabytes long) in JavaScript. (This is to slow down a CSS selector-matching operation to the point where it takes a measurable amount of time.) The best way I've found to do this is var really_long_string = (new Array(10*1024*1024)).join("x"); but I'm won...

how can i get the geo_pt on another Model using google app engine(python)

this is my code: class Marker_latlng(db.Model): geo_pt = db.GeoPtProperty() class Marker_info(db.Model): info = db.StringProperty() marker_latlng =db.ReferenceProperty(Marker_latlng) class BaseRequestHandler(webapp.RequestHandler): def render_template(self, filename, template_values={}): values={ } ...

Why can I not return responseText from an Ajax function?

Here is part of my Ajax function. For some reason that I cannot figure out, I am able to alert() responseText but not able to return responseText. Can anybody help? I need that value to be used in another function. http.onreadystatechange = function(){ if( http.readyState == 4 && http.status == 200 ){ return http.responseTe...