javascript

Why are some jQuery UI operations unsuccessful on disembodied DOM elements?

I tried creating a disembodied DOM element with jQuery (I avoid ever touching the DOM directly w/o going through jQuery, so I do treat their wrapped sets and the DOM elements underneath somewhat equivalently) and applying .tabs() to it, and only later adding the element into the DOM. The tabs kind of worked and kind of didn't. It seemed ...

Get Jquery modal box to appear on page load

I need to get this Jquery box to appear on page load. Right now it only appears when the user clicks a link. Here is the trigger: <script type="text/javascript"> $(document).ready(function() { //select all the a tag with name equal to modal $('a[name=modal]').click(function(e) { //Cancel the link behavior ...

Google Visualization Table: event on right click?

In a Google Visualization Table, there's an event on "select". Is there a way to know if the user used the right (as opposed to left) mouse button? I'd like to display a menu when the right button is pressed in a row. Thanks! ...

fire javascript event on object creation

Is there any way to fire an event when an object of a certain type is created? I have an <div> element with editableContent="true" and when the user presses enter within the <div>, a new <div> is created that takes up just that line. Is it possible to have an event fire whenever a <div> object is created within my original <div> object?...

Link to Specific Tab from Another Page by Name (Not Tab Order Number)

Hello. I have two levels of Spry tabbed panels that I'm linking to from other pages. I currently have it set up so that I link to the panels that are on the registration page like this: <a href="registrations.html?sport=1&clinic=0"> The registration page includes the following script: <script type="text/javascript"> <!-- var params =...

jquery reconstructing a selector from a string

I am taking the value of a select element and trying to modify it so that I can have access to the onscreen preview element that the select item represents. Here is the first part of the code... $("#single_area_select").change(function(){ var $element = '#preview_' + $("#single_area_select").val().toLowerCase(); elementC...

How to grant permissions to a java applet being called by JavaScript via the java.policy file

I have a single sign on application for our intranet which is supposed to read a file off the local computer as well as get the users SID and verify that the user is valid. I have a jar that is embeded in the page and called by javascript. Inside the jar I have used doPrivileged() to allow the code to be called from javascript. The prob...

Is there any possibility of two asynchronous Javascript function instances executing two blocks of code at the same time?

I understand that Javascript doesn't have multiple threads, but I'd like to know if the following code has any chance of breaking. My understanding is that unless an asynchronous function is called, such as setTimeout or an AJAX call, that once a block of code starts executing there's no way for it to pause until it completes or does ca...

What would this raw javascript selector be in JQuery?

Here is the piece of javascript that correctly identifies a UL element: $(this.parentNode.nextSibling.nextSibling.children[0]); The html it looks over is: (with 'this' referring to the .cs_previousArrow as the initial selector) <div id="cs_furlBar1"> <p class="cs_furlHeaderClosed">INVESTOR SERVICES</p> <p class="cs_se...

Passing Class Variables to Class Method in Prototype via addEventListener

I have the following class file that I'm attempting to build. I'd like to pass multiple variables to the method by way of an eventListener but the code I have below doesn't work, probably due to scoping. NOt sure what I should change though. Any advice would be much appreciated. var MyClass= new Class.create(); MyClass.prototype = { ...

Performing GET request before leaving page - Javascript

Hi folks, if a GET request is made as follows $(window).bind('beforeunload', function() { // GET request }); and the page is abandoned before the GET request is completed, will the destination server still process the request? Or will it somehow vanish? I would like to send a server data on "beforeunload" firing, but without ...

How is this positioned?

you probably notice that some web sites have feedback feature created with http://uservoice.com. it display's badge on left or right of your screen. but, how is that badge positioned? it looks like its position depends on height of the browser... can you help me how to create some sort of badge like this, with functionality to redirec...

Using remote JavaScript in Chrome Extensions

Is there any way to get remote JS file to chrome extension? My manifest.json looks like this: { "name": "My Extension", "version": "0.1", "content_scripts": [ { "matches": ["http://*/*"], "js": ["jquery.js", "main.js"], "run_at": "document_end", "all_frames": true } ] } I want u...

Help with JQuery conditional statement

I am trying to run some JQuery script on a particular page but only if a certain page loads. The Scenario: We have one page that loads (i.e., webpage.aspx) and it loads different content based on the referring click. (i.e., webpage.aspx?contentId=1, webpage.aspx?contentId=2, webpage.aspx?contentId=3, etc). Here is my problem. I need ...

including a captured image in a web form post, is there a better way

Following the Saving Snapshots to PNG in Silverlight 4 and the WebCam sample code, I have a silverlight app that I can place on my html form to capture an image from a web cam. I would now like to include the image in a html form post to my MVC controller/action. At this stange in the project I'm restricted from moving the whole data e...

Can I use JavaScript on one page to fill out a form on another server?

Sorry if this is a newbie question, but I've spent several hours on this without success. I've got a PHP script that generates some text I want to submit to an external Web site's form. Is it possible to use JavaScript code on one page to open a page on another server and then add text to that second page's html form from the code on the...

Greasemonkey & global variables

Hello everyone! I'm noob with JavaScript and Greasemonkey and I'd like to write a simple script. I know that Greasemonkey wraps your code with an anonymous function so your variables won't exist after leaving the current page. However, I need a global variable. I tried to use the unsafeWindow and window objects something like this: i...

Color code from color name

I have an array of colors, I am to write a javascript function to translate them to their color code in hex, for example start with the colors array and output the codes array var colors = ["red", "green", "blue"]; var codes = ["#f00", "#0f0", "#00f"]; Please someone help me out how easily it can be made done. Thanks ...

$.ajax JSON not passing values on complete

Hello, I'm having an annoying issue, on complete i get undefined when trying to make simple url validation. success working fine. i get a valid json response: {"error":"some error"} and this is my jQuery $("#myform").submit(function(){ dataString = $("#myform").serialize(); $.ajax({ type: ...

How to retrieve facebook user info

Hi, I am using facebook's graph api to retrieve user's information. First I retrieved the access_token. Then, I tried using jquery.getJSON() method to retrieve user's id and name. <div id="result"></div> <script>$.getJSON("https://graph.facebook.com/me/?access_token=111978178853984|2.lg65A3c0atficNsFcf7Rog__.3600.1279922400-100001XX...