javascript

Safari, JavaScript and Copying to the System Clipboard

I'm doing a Safari extension and would like it to copy something to the users clipboard. Unfortunately all the sources I find talk about cross-platform solutions with Flash or have vague references to execCommand. Is there a way to do it in Safari with JavaScript? ...

$.get not working ?

Hi, I used this method to load page ... function remoteCall(sUrl, sQueryStr, sCalledBy) { var str = " { "; $.post(sUrl,sQueryStr, function(data){ sResponse[sCalledBy] = data; //alert(data); eval(" "+sCalledBy+"()"); }); } but when i changed $.post to $.get it doesn't work actually i need ...

How to make textarea fill the width of its parent width?

Given that we don't know the div's width beforehand? My idea: Calculate the div 's width with JS, find a way to convert it to cols and the apply the css to the textarea onthe fly. But perhaps there 's no need to reinvent the wheel? Thank you. ...

Rails 3: RJS vs JavaScript

Hi, I've recently started learning Ruby on Rails, based on RoR3 beta/RC. I had earlier been developing applications using other frameworks (like Django), where the JavaScript had been written completely on my own. When developing application using RoR, I get confused by the two possible ways of implementing JavaScript: the "pure" one (w...

turn javascript array into c# array

Hey. I have this javascript file that I'm getting off the web and it consists of basically several large javascript arrays. Since I'm a .net developer I'd like for this array to be accessible through c# so I'm wondering if there are any codeplex contributions or any other methods that I could use to turn the javascript array into a c# ar...

CloudMade Marker Overlays - Can The Z-Index Be Controlled?

Does the CloudMade API have the ability to control the z-order or z-index of the marker overlays (e.g.icons)? I have used this before in Google Maps to make certain icons with more importance draw over the top of other icons with lesser importance (especially in some zoom levels where they may bunch together). The Google Maps GMarker ...

Save Google map to jpeg using PHP?

Is it even possible? I am implementing an export to pdf functionality for a pile of data, one of which is a Google map with a marker. Thank you. ...

Firefox says this is not a function. Must be a simple bug, but I can not see it.

All the other browsers operate just fine with this, but firefox says 'share is not a function'. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=utf...

Javascript difference between IE and Firefox

Hello I have the following lines of Javascript: var button = document.getElementById("scriptsubmit"); button.setAttribute("class", "remove"); In Firefox this works perfectly and in Internet explorer it doesn't. I am aware that Internet Explorer expects class to be className, but I'm uncertain how to detect which to use as object d...

"xmlns:xmpp" & "xmpp:xmlns" What is the Difference ?

This one works Ok. curl -H 'Content-Type: application/xml' -d " <body rid='2965554435' xmlns='http://jabber.o=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh' /> " https://dashboard.onsip.com/http-bind this one was returning an empty response curl -H 'Content-Type: application/xml' -d " <body rid='2965554435' xmlns='...

Which PHP-template to load depends on javascript support

I have the following scenario: A multiple step registration procedure. Let's say it's 4 steps, and each step depends on previous input. This could be solved with or without Javascript. Without JS: A "proceed"-button is attached to each step With JS: The next part is automatically revealed to the user when previous step is done. (No "pr...

Where should I put a JavaScript routine needed only on one page?

Hi, I have the following prototype JavaScript code Event.observe( window, 'load', function() { Event.observe( 'agreement', 'click', function() { alert("It works") }); }); It is used on only one page of my site, what is the best way to organise it? I suppose I could put it in its own file, and include it only on that page. Or I c...

Need help with Javascript Regular Expressions - Splitting text

I have a string that represents a list of tags separated by space. It may look like this: Australia 2010 David November Family If a tag contains at least one space, it must be quoted. So the string can be: "Best Friends" "My Pictures" Wow "Very Nice Photo" University Quotes are also allowed for single words. For example: "Good One...

Fire a jquery loop to iterate before animation callback is complete?

I am trying to make a sequential animation, where a loop iterates through a list of elements .post's and fades them in slow. The difficult part is having it so that the next iteration begins fading in before the last one has finished fading. All I have so far is a simple sequential animator that fades them in one after the other. $(".po...

jquery animated menu: how to get active state

Hi, please can you help a jquery beginner out? I don't really know how to go ahead... I did a jquery animated menu: look at this. the content loads with ajax, so there's not really a page load. now i have to do the active item part. to give a clicked item a class "on", I did this: $navig.click(function() { $(this).addClass("on"); ...

Stop duplicate mouse over detection

I have a popup that is executed on mouseover with jquery. Within that function I have a second delay before the popup displays using settimeout Problem is if in that second they mouse over multiple times then multiple popups are triggered. $('#div').mouseover(function() {setTimeout("popup()",1000);}); What I need to do is disable th...

Generating gradients from a hexcode or RGB in PHP/jQuery?

Hello, I'm trying to figure out how to write a function that programmatically retrieves a background-color css attribute and creates two outputs (one slightly darker than the background-color, one slightly lighter). The idea is being able to generate a very basic linear gradient from a single color selection. Anyone have any ideas? ...

JS doesn't work in IE. The background image seems to repeat imperfectly.

Hello! I have a JS module called "Cloud Zoom." It works quite nicely except in Internet Explorer. But the example on Cloud Zoom's page works in all browsers! What am I doing so terribly wrong? My example. Works in all except for IE ...

Markdown parser in Javascript

Does anyone know a markdown parser in Javascript ? PS : Actually, I do this with request to server to parse it, but a client side parser would be better :) . Edit : If there is no one, I will use HTML (with WYSIWYG editor). ...

My site has been tagged as Malware by Chrome! What now??

I'm completing the development of a site I didn't build (I designed it, but another has built it so far) and recently when I visit the site in Chrome I get a "Malware Detected!" Warning box. The site is http://kenbrook.org/ It's for a summer camp, and it's a basic brochure type site with your average marketing content. It was built on t...