javascript

Sending a variable to javascrpt in Drupal

Hello, I have set theme handler for a form in Drupal and this handler has a template file. What is the easiest way to send a value from PHP to Javascript in that include file? Thank you. ...

Google Maps Info Box - Can it exist outside the map container?

I've got a Google map, standard fare really. It's quite small though and the popup info windows on the markers are quite big, so my question is, is it possible for these popup windows to spill out the edge of the map and on to the actual website? (See dodgy photoshop job for an example). Thanks! ...

HTML Button's jQuery function is having trouble with MVC FileResult

I intended for this function to call my MVC action method that returns a CSV report. $(function() { $('#exportButton').click(function() { $.get('/curReport/GetCSVReport'); }); }); If I make a button like the code below then, when it is clicked, I'm given the "Open with/Save File" window. <input type="button" value="Ex...

Jquery getting list of values of hidden inputs within a div

I am trying to get a list of values within a div that I will format later using the .each() method. They are input values which are hidden my html and jquery call looks like this. <div id="container_0"> <input type="hidden" id="check_data" value=10> <input type="hidden" id="check_data" value=20> </div> Jquery: var list = $('#c...

jQuery: Self Executing Plugin?

I am working on expansion of my jQuery plug-in authoring knowledge, just playing around with my own ideas for learning benefits. So i was wondering how you guys tackle the need of plugin executing without any user specific input. So I have a need for plug-in that executes right away after document is ready, without any user's specific i...

How get DOM elements with a regular expresion in javascript?

For example, I want all the elements with an ID "hide_" + a value. This function must to return "hide_1" and "hide_30", etc, depending of the elements of the page. ...

From a language design perspective, if Javascript objects are simply associative arrays, then why have objects?

I was reading about objects in O'Reilly Javascript Pocket Reference and the book made the following statement. An object is a compound data type that contains any number of properties. Javascript objects are associative arrays: they associate arbitrary data values with arbitrary names. From a language design perspective, if obje...

request parameter using jquery/javascript

is it possible to stop the submission of a form,after submit button has been clicked and get the action attribute and the request parameters of the submission using javascript(preferably jQuery) ? I want to get the action and the parameter so that the it can be submitted to an alternate location ,what i am tryin to do is try writing a pr...

How to know when a download has finished?

Hello, Is there a way to tell if when a download has finished? That is, we allow users to download a report in PDF format. It takes about 3 - 5 seconds to start downloading and in this time, from click to end of download, show a wait state icon so that the user doesn't click multiple times. Thanks! Eric ...

Refresh Div with Jquery at fixed time

I've got a php script that tells me when the next bus is due, and at the moment I'm refreshing this into a div, using jquery, every minute or so. Now, because I know the time at which the data will change (after the bus has come), I want it to refresh the div at this time (or just after, doesn't really matter). I should point out that I...

javascript canvas rescaling and drawing on image

Hi all. How can I use the Canvas to draw over images downloaded by users, while scaling it. for example: 1. user uploaded image 2. began to draw on it 3. zoom out and continued to draw more and all changes are applied to the original image. p.s ssory for my engilsh:( ...

jquery ui 1.7 autocomplete show dialog on select

Hello, I am using an autocomplete widget, and would like a dialog to show when an item is selected. The dialog does show up, but I want a field in the dialog to receive focus when it opens. Here is what I have tried so far: //HTML <form action="#"> <p><input id="busca" /></p> </form> <div id="agregar" title="Agregar Parte"> <label ...

jQuery: shorten string length to fit a set width.

Hello there, I have a table, and in each cell I want to place strings, but they are much wider than the cell width. To prevent line break, I would like to shorten the strings to fit the cell, and append '...' at end to indicate that the string is much longer. The table has about 40 rows and has to be done to each cell, so its important...

javascript on twitter to prevent embedding the html page.

This is the javascript that you can find in www.twitter.com (just click to see the source code) I have just reformatted it for clarity: if (window.top !== window.self) { document.write = ""; window.top.location = window.self.location; setTimeout(function() { document.body.innerHTML = ''; }, 1); window.self.onload = functi...

Cached Jquery selector behavior that I do not understand

Given the following code why am I getting different values for a and b? I would have thought they would return the same thing: (function() { var a = $('#foo'); var Test = function(){ console.log(a); //outputs 'jQuery()' var b = $('#foo'); console.log(b); //outputs 'jQuery(select#foo)' which is what I want }; })(...

CKEditor adds unwanted newline to '<p>'

If I load up a set of paragraphs then the editor replaces my <p> with <p>&#x9; It means <p>paragraph 1</p> <p>paragraph 2</p> <p>paragraph 3</p> ends up like <p> paragraph 1</p> <p> paragraph 2</p> <p> paragraph 3</p> Has anyone come across this and know how to fix? It seems to be an issue but no response on their forum...

Deriving an HTMLElement Object from jQuery Object

I'm doing a fairly exhaustive series of DOM manipulations where a few elements (specifically form elements) have some events. I am dynamically creating (actually cloning from a source element) several <select> boxes and assigning a change() event to them. The change event executes, and within the context of the event, "this" is the HTM...

A simple question about Javascript functions, differences in invocation/definition.

Can someone please explain the difference between the following function definitions? var alertMessage = function alertMessage(message) { alert(message); } var alertMessage = function(message) { alert(message); } What are the implications of each? Thanks! ...

Must have JavaScript pro developer tools, libs, utilities and workshop configuration.

This is a followup question to the Pro JavaScript programmer interview questions (with answers). What is considered professional and industrial standard for a professional browser side Java Script developer when it comes to his workshop configuration, and maybe from-concept-to-shipment process? What are the most popular IDE's, utiliti...

jquery, Regexp, make dynamic url

Hi , I need a regexp help, because for me it will take a lot of time , for you some minutes:) I have youtube a URL : http://www.youtube.com/watch?v=9_Hd8hXhg7o&amp;feature=youtube_gdata I can't add this in embed object , for embed I have to change in this URL : http://www.youtube.com/v/9_Hd8hXhg7o&amp;hl=en_US&amp;fs=1&amp; It...