javascript

String based axis for jQuery Flot graphs?

How do I get non-numeric values on a Flot graph axis? For example, on the Y-axis I would like to have (excuse the crappy graph): /* A| B| _/*----------* C| _/ \ D| _/ \ E| _/ \ F| / \ G| * ...

Is CKeditor safe for letting end-users submit content?

I am about to let some users publish articles on my site. To make it easier for them, I was thinking of using a CKeditor, let them have links, images, formating, etc ... However I was thinking of javascript. Can someone inject javascript or will CKeditor clean it up? Do I need my own filtering? ...

Detect if .append is not possible?

Hello, I'm creating a modal window bookmarklet that allows you to quickly add content to my website. It all works fine and dandy except for non-html content, because then it cannot append data to the body. Instead, I'd like to do a simple location.href. Current code: if (typeof jQuery == 'undefined') { var jQ = document.createElem...

How to total radio options in javascript via a submit button

I found this code somewhere else on this site. I'm in the process of adapting it, but since I'm new to Javascript, I have no idea how to get the total sum to appear only after you click some kind of "Calculate" button. I've tried to do it myself, but the numbers calculate automatically, and I need a solution so that it doesn't do that. ...

Real time apps: Socket.io vs Pusherapp

What are the factors you would consider when choosing between Socket.io and Pusherapp? http://Socket.io http://pusherapp.com Important considerations includes: integration w existing systems like rails/django, ease of setup, ease of development ...

[Rails] Capybara doesn't recognize dynamically added DOM elements?

I seem to be having trouble testing the slick javascript things I do with jQuery when using Capybara and Selenium. The expected behavior is for a form to be dynamically generated when a user clicks on the link "add resource". Capybara will be able to click the link, but fails to recognize the new form elements (i.e. "resource[name]"). ...

javascript month and day and year check

Hi, I am trying to check for MM /DD /YYYY. currently my script fails when you enter 0 / 0 /0 or 00/00/0000. I am trying to check that the user is over 21 and must enter a valid two digit month, two digit day and 4 digit year. Any suggestions? $("#gate-box").submit(function() { var day = $("#day").val(); var month = $("#mo...

Google maps in Fancybox-wrong display on reopening

Hi, I have a problem with Google maps API. I'm using V3 API and fancybox for show up map in lightbox-like div. When I click on the link for the first time, fancybox opens and map loads as well. Everything seems to be OK, but when I close the fancybox and try to reopen, the map is loaded wrong..It loads only at about half area than it has...

Protecting JavaScript? Or use Something else?

Possible Duplicate: How can I obfuscate JavaScript? I have been working on a web app in JavaScript. Nearing complete. How do I protect me JavaScript code from someone copying it? I mean if you view my page source, it references the .js files and one could really steal these. Should I be using something else? RoR? Does Googl...

html: price listing based on email

I am building a website for a customer who may not be very computer literate. This person knows how to use email. How can I build a website (purely html, javascript) where he can email his latest prices and the website automatically updates itself. I dont think he would be literate enough to FTP file some where. Is it possible? How to b...

Loop over elements in jQuery when element is double clicked

I'm new to jQuery and Javascript. I'm trying to make a button that I can double click which then loops through all elements in the webpage with a certain class and fades them. Currently, I'm trying this: $(".fadeall").dblclick(function() { $("div.section").each(function(idx,item) { item.fadeTo(25,inactiveOpacity); }); ...

How to validate the Two Date fields on my view using jquery or javascript

Hello friends, I have two fileds in my View one is Effective data and one is Cancle date <td> Effective date: </td> <td> <%= Html.TextBoxFor( x => Model.SelectedAccountGroup.GroupEffectiveDate, new { @class="datepicker"} )%> <%= Html.ValidationMessageFor( x => x.S...

Jquery and get the eq value of my returned XML

Hi I have a simple ajax search that returns the results in a table. I can extract the XML and display it fine but what I cannot do is get the index number of the data (var Rows) . When a user clicks the returned result I believe I would need this in order to retrieve all the data in order to use IE $("name:eq(1)",data).text();. Can anyo...

window.onunload only fires when a tab is closed in firefox, not the entire browser

UPDATE So after reading both of your answers I realize there is no reliable way to determine when a browser window is closed. Originally I was planning to use this to unlock a record in the database when the page is closed. Basically when the user loads the page the record it's accessing locks and then unlocks when the page is closed....

PHP - Text fading effect?

Hey, I've been researching all over for this, basically I have a table that displays "eco'texthere';' after posting the data. How would I make the text fade in e.g. : Table ---> User Send data using submit button ---> displays back message "rotating data" ---> Now text fades in saying "sucessfully sent". (Mostly using echo in PHP). W...

JavaScript minifier (e.g. YUI) integrated to ASP.NET Webdeploy Publish

I have a javascript file that I minify using the Yahoo YUI. When I 'Publish' the web application project, I want it to only copy the .min.js file and not the original one too. I can use a pre-build event to create the minified version, but how do I prevent 'Publish' from copying the non minify file? I suppose I can 'exclude' the origina...

Tag suggestion plugin ala Stackoverflow tags

I love the way StackOverflow handles tags. Is there any jQuery plugin that would duplicate the behavior? I found this jQuery Tag Suggest but it's not near as good. Any suggestions? ...

How to embed a php/javascript photogallery in a page of an html/css website?

I have downloaded a freeware photo gallery called Minishowcase (freeware http://minishowcase.net/?main) to use in my website. The gallery works fine as its own site, but I can't figure out how to embed it in a page of my own site, which is largely css. I think I just need a line or two of code to incorporate the gallery, but I'm new to p...

Submit cross domain ajax POST request

I swear I saw an article about this at one point but can not find it... How can I perform a jQuery ajax request of type POST on another domain? Must be accomplished without a proxy. Is this possible? ...

Suggestions for dealing with `exports` in node.js

Theory: One of the things that appeals to me about node.js is using it as a command line tool. In theory, I can write libraries in Javascript and place them in my ~/.node_libraries directory, and then then I can reuse those libraries. So for instance, I have a text.js in ~/.node_libraries, and it has a bunch of text-related function...