javascript

Not able to append options to select

I am not sure why this works but not when I pass in numbers <form id="form1" runat="server"> <div id="facebookPhotos-iFrameContent"> <div> <p>Log in</p> <p id="LoginButtonContainer"><input type="image" id="btnLogin" src="images/loginBtn.jpg" /></p> <p><select id="facebookAlbumDropdown" /><...

What is wrong with my jquery javascript here?

So I'm attempting to make a page in Visualforce(salesforce's page creator), and am having issues with the javascript aspect of it. Basically what should happen is that the section will generate a series of links. The javascript needs to click those links. I'm using jquery <apex:page standardcontroller="Account" extensions="maininvoice"...

jQuery Carousel jumping to the wrong item

Hello Stackoverflow, I have a perculiar problem with the :last and .before() method not inserting the code before the last element. [edited] I have come up with a new issue :/ The problem is (now that the <li>'s are in order), that the Carousel will now scroll through 4 items but them quickly jump to the next item. Code bel...

Javascript/jQuery order of operations

I'm having trouble with a line inside an if statement executing before the conditional is met. What I want to do is: Check to see if data (big old array of numbers) is already loaded. If not get it and load it into my all_data object. Plot data (or in this case alert it) Here's the code (stripped of many details to be readable var a...

Settimeout and setinterval memory usage

Hi Everyone, Does any body know the memory usage and possible memory leaks with javascript functions settimeout and setinterval? Thank you, Krishna ...

Need cursor at beginning of text in textarea

I have this in my body and it works onLoad='document.forms.post.message.focus()' but I need the cursor to be placed in the textarea at the beginning of any existing text, not at the end. This puts it at the end. Note that I know nothing about JavaScript, so be gentle. Thanks ...

What are the methods of protecting JavaScript web applications/games?

Back story: I'm planning to implement a casual game to be deployed in a webapp, but I don't want to use Flash, instead just plain Javascript. One benefit of Flash that I would want though is that it distributes a binary and not the source code so it's easier to protect your code from being reused/stolen by somebody else, or to prevent th...

Aptana Folding/Collapsing javascript code

Hi guys, I need to be able to fold/collapse various code fragments throughout my javascript, kind of like #region #endregion in C#. I can't find a way to do this, any help? ...

Moving 3d Model in google earth?

Hi Everyone! I'm using the Google Earth Web-plugin API and I've got a 3d model of a helicopter, I can create a 3d model using the following code: var placemark = ge.createPlacemark(''); placemark.setName('model'); // Placemark/Model (geometry) var model = ge.createModel('heli'); placemark.setGeometry(model); ...

Using JQgrid and sortableRows. Update table row order

Using: http://stackoverflow.com/questions/2382879/using-sortablerows-and-know-when-rows-have-been-moved I have been able to call an alert after the modification of my row order. How would I send this data to PHP/ call the editurl passing this data, similar to when adding or editing rows the editurl receives a $_POST['oper'] variable? ...

How to reload the custom javascript file after Drupal makes ajax call?

Hi, How one can reload the custom javascipt file after ajax call is completed. In my case I have a custom javacript file to manipulate the views data and filters. It works perfectly first time. But once the user sets filter and hit Apply i:e after ajax call the javascript loose its importance. Its their but not registering any event. ...

Programatically generate PNG from Raphael.JS image

I'm writing an app that lets users generate images with Raphael.JS. One of the secondary features I want is to generate a PNG of the Raphael canvas. Here's the general pipeline in my head: User inputs parameters We generate JS with Raphael calls We generate a JS wrapper that does the above and calls .innerHTML on the containing div, ...

JQuery Syntax Checker

Does anyone know of any JQuery syntax validators or checkers? The braces are killing me. ...

Scroll in-page element only, not the whole page

Ever notice that, when you're scrolling an overflowed div with a mousewheel, and you scroll that to the bottom, the whole page starts scrolling? Can that be prevented? I did a quick test of jQuery's scroll() event handler but it seems to fire way too late. Here's the test code if you want to play around. <html> <head> <script src="...

display tooltip on hover over text

How would I go about displaying a tooltip when the user hover overs some text? These text are keywords. I don't want to manually add these tooltip for each keywords. I am looking for a way to create a script of some sort to automatically do this either on the client side or server-side. When a user hovers over these keywords, and if the ...

jQuery UI Dialog - change the content of an open dialog (ajax)

I've got some links I want to have dynamically open in a jQuery UI Dialog using jQuery.load(). Once the dialog is open I want the links load inside the already open dialog. So, the site loads, you click a link, and it opens in a dialog. That's fine. You can close and open it as many times as you want. While it's open, if you click...

JavaScript compatibility libraries

Are there javascript libraries that provide forward compatibility with particular implementations? For example, such a library could provide features present in JavaScript 1.6 in a way that's portable across various browsers. It should take advantage of native support for that functionality when available. Some of the frameworks like ...

how to store an Array in localStorage?

If i didn't need localStorage, my code would look like this: var names=new Array(); names[0]=prompt("New member name?"); This works, however I need to store this variable in localStorage and its proving quite stubborn. I've tried: var localStorage[names]=new Array(); localStorage.names[0]=prompt("New member name?"); Where am I goi...

How to move HTML element

How to move HTML element to another element. Note that, I don't mean moving element's position. Consider this HTML code: <div id="target"></div> <span id="to_be_moved"></span> I want to move "to_be_moved" to "target" so "target" has child "to_be_moved" now. So the result should be like this: <div id="target"><span id="to_be_moved"></...

iFrame file upload with IE produces download dialogue

I'm developing a custom module for Drupal dealing with Document Management. At this point, the module loads, you can upload files (via a hidden iframe and some ajax requests), browse directories and set various levels of permissions. And everything works perfectly in Firefox. Issue: In IE however, I run into an issue. For some reason wh...