javascript

Resize Flash player problem on Internet Explorer

When i want to make my flasplayer( flowplayer ) resize to bigger or smaller with jquery , it does not work properly on internet explorer when i make it smaller i use this function ////Make player smaller function createSmallPlayer() { flowplayer("player").hide().pause(); // get handle to the embed element ...

Calling Multiple functions simultaneously

I'm trying to call two different functions for two different HTML elements at the same time, but the second function isn't being read at all. I'm also trying to use the id to specify which corresponding elements to grab data from. Here's what I have: function changeImage(id) { var s = document.getElementById('showcase'); var simg...

How to disable a YUI MenuBarItem from markup

I prefer creating my nav menus from markup (rather than Javascript), like in this example. Is it possible to create menus and/or menu items from markup which are disabled? I see how to use Javascript to do this (use the disabled config property), but I'm looking for some way to encode this information in markup - perhaps there's a CSS cl...

Javascript endWith()

Hi all I'm having trouble getting the following to work if(str.endsWith('+') { alert("ends in plus sign") } How do I escape the plus sign, I've tried /\ +/ but it doesn't work. Thanks in advance Ruth ...

Fixing javascript Array functions in Internet Explorer (indexOf, forEach, etc)

As detailed elsewhere, and otherwise apparently well-known, Internet Explorer (definitely 7, and in some instances, 8) do not implement key functions, in particular on Array (such as forEach, indexOf, etc). There are a number of workarounds here and there, but I'd like to fold a proper, canonical set of implementations into our site rat...

Javascript Namespacing. Does it increase JS/Browser performance ?

SO i totally understand why we should namespace in javascript, but is it mainly for organizational purposes and to keep the global namespace uncluttered?. Does namepacing actually help in performance of the browser/JS engine. Just wondering what your thoughts were. Thanks ...

Generate and download a text file in javascript

All my research so far suggests this can't be done, but I'm hoping someone here has some cunning ideas. I have a form on a website which allows users to bulk upload lots of URLs to add to a list on the server. There's quite a lot of server-side processing to do on each URL, so to avoid timeouts and to display progress, I've implemented ...

how do I disable the submit button when the form gets submitted without any errors

Hello everyone, I want to disable the submit button when a user submits the form so that he may not click the submit button twice. So I coded the following javascript in my page $(document).ready(function(){ $("form").submit(function(){ $("form").find('input[type=submit]').attr('disabled', 'disabled'); }); }) This ...

problem parsing JSON Strings

var records = JSON.parse(JsonString); for(var x=0;x<records.result.length;x++) { var record = records.result[x]; ht_text+="<b><p>"+(x+1)+" " +record.EMPID+" " +record.LOCNAME+" " +record.DEPTNAME+" " +record.CUSTNAME +"<br/><br/><div class='slide'>" +record.REPORT +"</div></p></b><br/>"; } The above co...

Show elements depending on html value of a tag

I would like to accomplish the following with jquery : When I click on this link <a href="#">Cars</a> I would like all divs like those <div class="product"> <div class="category">Cars</div> </div> to do something. You get the idea, I have a menu with a list of categories, and a list of products, each containing a div with ...

Free audio players for website streaming

Are there any free audio players that I can use in my website? Are they customizable? I've heard of Soundmanager 2. It's a flash based player with a javascript front-end. Are there any other free players like that? ...

Hovering a div shows hidden div - jquery to prototype conversion

I may get killed for this but I have been trying for a few days using Prototype to show a hidden div when hovering over another div. I have this working fine in jquery but I could use some help porting it over to prototype. The code sample: <script type="text/javascript"> $(document).ready(function(){ $(".recent-question").hover(func...

Orientation change event in Browser on Palm webOS

I'm working on a web application where I'm trying to capture when the user rotates the screen. Fundamentally, I want to know if the user is browsing in portrait mode or landscape mode. The iPhone/iPad and Android browsers send a resize event when the screen orientation changes. Unfortunately, the browser in webOS doesn't seem to send t...

validation in javascript - remove the error msg on focus

i'm not very well-versed with javascript, so please bear with me. i've a form in which i validate the controls with javascript. the error is displayed when the fields are empty via a div, but when i focus and type something in the textbox, the div should go away. but the error div doesn't and even if i type something valid, it still di...

Allow only certain characters

I'd like to block all characters from being inputed except 0-9,a-z,A-Z range only alphanumeric characters. So when someone types ! for examplee nothing is written into input. How can I do that? ...

Loading jQuery with Tapestry 5

Okay, so I'm not a Java guy, but I work with loads of them. We generally load Prototype with Tapestry 5, as Tapestry was built on this javascript library. As a UI/front end developer/engineer, I know the awesomeness of jQuery and the lack of prototype therein. (Feel free to debate that elsewhere -- this ticket doesn't concern that que...

FB.Data.query with better performance

I'm using this code for take user's events from facebook: var query = FB.Data.query("select eid,name,start_time,location,venue,pic_small,pic_big,description from event WHERE eid IN (SELECT eid FROM event_member WHERE uid={0}) AND start_time >= now() ORDER BY start_time LIMIT 10", uid); query.w...

Cart coding help

I've made a simple Javascript code for a shopping basket but now I have realised that I have made a error with making it and don't know how to fix it. What I have is a HTML file with the Javascript, but in the Javascript I have included the images source and fields that would normally only be in the HTML file but What I am trying to do n...

Hover/Fadeto/Toggle Multiple Class Changing

So my problem is rather simple and complex at the same time. I am trying to create links that fade in when you mouseover them and fade out when you mouseout of them. At the same time that you are going over them I would like a pic to slide from the left. This is the easy part, I have every thing working. The image fades and another image...

Fix for iframe calling location.href

I'm trying to embed a mapquest direction page such as http://www.mapquest.com/maps?1c=Ann+Arbor&amp;1s=MI&amp;1a=1440+Hubbard+St&amp;1z=48109-2083&amp;1y=US&amp;1l=42.293437&amp;1g=-83.724491&amp;1v=ADDRESS&amp;2c=Ann+Arbor&amp;2s=MI&amp;2a=930+N+University+Ave&amp;2z=48109-1055&amp;2y=US&amp;2l=42.278558&amp;2g=-83.737969&amp;2v=ADDRESS...