javascript

Can't show/hide table rows like the divs for some reason

Hi guys, I've used animatedcollapse for my div sliders with no flaws. However, I now need to use a table row slider and it isn't performing the same at all. Here is a portion of the table I am using so you get an idea. <table> Reply to post... </div> <script type="text/javascript"> ...

javascript and json

I'm using javascript with a json library and running into a little trouble. Here's my json output: { "artist": { "username": "myname", "password": "password", "portfolioName": "My Portfolio", "birthday": "2010-07-12 17:24:36.104 EDT", "firstName": "John", "lastName": "Smith", ...

How to generate webfont dynamically from webfont service?

Is there a way to style text font dynamically base on selected font in a list? For example, we can see this in Microsoft Word, where you can highlight some text and then change the font style by selecting a font style from the font dropdown box. I am trying to create a component similar to this in the browser. Current I am using the webf...

javascript JSON and Array elements, help me understand the rule about quotes

When using a returned value to determine the number of an element in an array, does javascript throw quotes around it? Example : This tallys the number of times unique characters are used. var uniques = {}; function charFreq(s) { for(var i = 0; i < s.length; i++) { if(isNaN(uniques[s.charAt(i)])) uniques[s.charAt(i)] ...

Javascript still not working

I still can not get my coding to run. When I try to run the coding, a blank page shows up. Specifically, what do I need to do in order to get this simple coding to function? All I need is someone to look this over or test it and tell me what I need to get my coding to work. <html> <body> <script language="JavaScript"> <!-- var classCtr;...

Is there a way to mitigate downloading of resources (images/css and js files) with javascript?

I have a html page on my localhost - get_description.html. The snippet below is part of the code: <input type="text" id="url"/> <button id="get_description_button">Get description</button> <iframe id="description_container" src="#"/> When the button is clicked the src of the iframe is set to the url entered in the textbox. The pages...

Javascript global variable problem

I have a script tag with 'A' variable and has been initialised as 16 but when I use alert on IE under onclick event, I received undefine rather than 16. Is this the problem in IE 6? e.g. var A =16; undefine ...

bitshift equivalent of math.round

(Math.round(var/var1)*var1) What would be the syntax for JavaScripts bitshift equivalent for the above? Thank you ...

jQuery UI Dialog with an embedded video problem in IE

I have a link which when clicked opens up a jQuery UI dialog, the data is loaded in the dialog through ajax which is an embedded flash video(using flowplayer). The probelm in ie is that when i click on the link the dialog opens and the videos starts to play and when i close the dialog, the video still continues to play. If i click on the...

HTML5 File Upload Progress - Client Side Only

I have noticed that the new XMLHttpRequest object supports an 'onprogress' event in firefox. Is it possible to utilize part of the new HTML5 File api's to get an upload progress bar without any server-side modifications required? ...

Why is this returning -1 in JavaScript

d.getTime().toString().search(/Wed/i) I don't get it... typeof returns string, and if i copy and paste "Wed Jul 14 2010 15:35:53 GMT-0700 (PST)" and save it to the var str and do str.search(/Wed/i) it returns 0 but when i do it like above i always get -1, even tho, as i said, it returns a string typeof. Any ideas how to check if Wed i...

Disable Google Anayltics cookie from being sent to cookie less domain

To optimize my site i have set up a static subdomain for content such as images, css and javascript. How do i stop the google analytics tracking cookie from being sent to my static subdomain, but still to both example.com and www.example.com? Have already looked through some of the documentation with no luck ...

What is the best way to add content to a template?

I am trying to find a way to add content to a div that is defined in my application.html.haml file from individual view files. The reason I want to do this is because I have a sidebar that is always present and is defined in the template, but I would like to have content specific to each page included in the sidebar. Would this be done b...

File Upload Form Field Validation

This is a trivial question, but for some reason I am having trouble with it. I have HTML for uploading a file such as the following. <input type="file" name="settings"> And all I need to do is check when the form is submitted that a value has been selected. I dont need help with the code for the form submission, I just need help si...

Rewrite parts of a URL in Greasemonkey and FireFox

A friend of mine uploaded about 20 or so galleries of nature shots she's done over the past year or so onto webshots.com, however, I just purchased a paid flickr account for her as a birthday gift, and I want to download all of her photos from webshots and have them ready for her to upload to flickr once she gets the email about her acco...

how to use "{% include 'a.html '%}" in a javascript expression on google-app-engine

this is my code: $('.left').html("{% include 'foot.html' %}") it will show error , so how to make it running. thanks ...

JavaScript error, "object doesn't support this property or method"?

Why? This is driving me nuts??? <script type="text/javascript"> $(document).ready(function () { $('#slides1').bxSlider({ prev_image: '/Public/Images/btn-arrow-left.jpg', next_image: '/Public/Images/btn-arrow-right.jpg', wrapper_class: 'slides1_wrap', margin: 0, auto...

Creating a site badge or widget in rails: Problem calling the second script

Hi all, I'm doing my best to create a site badge or widget for my site, which is a rails site. Essentially it's a site where users post content that they've created and other who like that content can make a donation to express their appreciation for it. I asked a similar question a while back about how to create a widget, but that wa...

Managing jQuery Plugins

Often, when working with jQuery, the need arises to include multiple plugins. This can quickly become messy work, especially when some plugins require additional components (images and CSS files). What are some of the "recommended" ways to: a. Manage the required files/components (.js, .css and images) in a way that is easy to maintai...

Window resize event problem for Chrome

I'm trying to handle stuff on my site when the window is resized and I have ran into an issue with Chrome that I can't figure out. Here is the code, very simplified: <script language="javascript" type="text/javascript"> window.onresize = function() { alert(1); alert(2); alert(3); ...