javascript

Replicate the functionality of Java's "Pattern.quote" in a JavaScript RegExp

In Java, you might try to make a regular expression that would match the URL stackoverflow.com using Pattern.compile("stackoverflow.com"). But this would be wrong because the . has special meaning in regular expressions. The easiest way to fix this is to write Pattern.compile(Pattern.quote("stackoverflow.com")) which comes out to: Patter...

Pure JavaScript/jQuery/HTML captcha

Hello everybody, can somebody sent me a link, or to provide me an example with pure Javascript/jQuery captcha. Because I can see a lots of examples with PHP/C# ... back end. But I need just Javascript . Thanks !! ...

google ajax search with jQuery - $.getJSON(). there is any response.

hi. i'm trying to make my image search with google ajax search i'm using jQuery. so below my code $.getJSON('http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=hello', function(data) { console.log(data); }); the console printed NULL and my xhr information is request URL:http://ajax.googleapis.com/ajax/services/sea...

Is there a way to detect that I'm in a Selenium Webdriver page from Javascript

I'd like to suppress the initialization of TinyMCE inside my tests and can do this easily if the Javascript can detect that I'm running inside a Selenium-automated page. So, is there some JS code that I can use to detect the Selenium driver? Alternatively, how can I extend the userAgent string to include a pattern that I can detect from...

Hyperlink to play youtube video...

Is it possible to create a hyperlink on your web page that can play an embedded youtube video on the same page.? ...

What is YQL ? Is it like jQuery ? How can i use it ?

What is YQL ? Is it like jQuery ? How can i use it ? ...

Javascript code, unterminated string literal with included javascript

This script works fine, unless the included file contains javascript, then it breaks with the "unterminated string" literal error. Removing spaces and linebreaks does not cure the problem. <script type="text/javascript"> var myArray = [ 'url', 'url2', 'url3', 'url4', 'url5', ]; var i, numDomains = myArray.length, found = false; for (i =...

GMapPanel: "a is undefined" when trying to create GPolyline's

I'm getting stuck on a piece of code, mostly because Google's API is quite unhelpful when getting errors due to the packing. I'm trying to render a circle around a marker via a click listener on my DataView. It renders the markers just fine, but when I attempt to create a GPolyline (the error occurs when I attempt to create GPolyline no...

Bicubic-ly Resize Images with Javascript

Is there a way to resize the actual image using JavaScript? I'm not talking about modifying the DOM to get the browser to resize the image. I actually want to resize the image's pixel data and then display that. Basically my problem is: Firefox completely fails at downsizing images with delicate features because it only has Nearest N...

How do you attach a click event to a jquery object created programmatically?

I'm writing some jquery to programmatically build a list of links and I'd like to attach a click() event to each link. I'm having trouble getting the click function to fire. Can anyone point me in the right direction on how to do this? This is what I have so far: <!doctype html> <html> <head> <title></title> <script type="text/javascr...

Disabling the button disables the form

I have set of controls to select the search criterias and below that there is gridview with text box. And below that there is submit button in the form. On certain condition iam disabling submit button on on blur event of the textbox inside the gridview. But it disables the form itself. When i open some other window or alt+tab enabling t...

How to get selected text from iframe (working on IE)

How to get selected text from iframe (working on IE) ...

Extracting data from a tab-delimited file with JavaScript

I'm trying to extract data from a data file that's tab-delimited (in some parts), and really seems like it's going to be a headache to work out (I reallw wish they could just have CSV-ed it). Here's the data: http://www.fededirectory.frb.org/FedACHdir.txt Here's the format description: www.fededirectory.frb.org/format_ACH.cfm I'd li...

How to get random element in jquery?

How can I return a random element in jQuery by doing something like $(.class).random.click()? So, if .class had 10 links, it would randomly click one of them. Here is what I did: var rand_num = Math.floor(Math.random()*$('.member_name_and_thumb_list a').size()); $(".member_name_and_thumb_list a").eq(rand_num).click(); ...

Flash CS4 pass variable from javascript function to actionscript and back

I want to pass the result of a js function into actionscript when the js function is called from actionscript. The js parses a url and returns the var in the url. In actionscript the functions are declared: function gup(name1:String) :void { flash.external.ExternalInterface.call("gup", name1); } function printAlert(group2:String) :voi...

Adding an AJAX call to this Combobox to read through JSON

I'm having problems adding a XHR request to query JSON to my script, I rarely work with either so it's giving me a lot of problems. I know that I will need to query a JS file, and that I will need to select from matches in an array, but I am completely stumped on how to do it. Something else I need to do is count matches each time I fir...

How similar are Python, jQuery, C syntax wise?

I'm trying to get a sense of the similarities between languages in syntax. How similar are Python, jQuery and C? I started programming in Actionscript 3 and then moved on to Javascript , then went on and learned Prototype, and then I started using jQuery and found that the syntax is very different. So is jQuery more like C and Python? ...

Calling a function in parent file from child frame?

I have a function that resizes the col width ratio of my frameset in "frame.html": <frameset id="set" cols="*,*" FRAMESPACING=0 BORDER=3 BORDERCOLOR=#eeeeee> <frame src="index.html"> <frame src="index2.html"> <noframes></noframes> </frameset> The function works fine when called from "frame.html", However i want to call ...

Styling highlighted text in incremental search JS

Hello, First StackOverflow question - woo! Quick question about styling this piece of Javascript: //Search $('#search').keydown(function(e) { setTimeout(function() { if ($('#search').val() == '') { $('#history h4').show(); $('#history li li').show(); return; } $('#hi...

How 'Sys._application' javascript error suddenly came up?

A javascript error suddenly came up throughout all files containing <asp:ScriptManager..>, error message is as below, Error: Sys.ArgumentTypeException: OBject of type 'Sys_Application' cannot be converted to type 'Sys._Application'/ Parameter name: instance I resolved the issue by adding 'ScriptMode="Release"' to ScriptMana...