javascript

Using Optimized CSS and JS by Drupal for other files outside Drupal

Hi! I think my question would be better laid if I write here the scenario of our current set up and the things I want to achieve. We have a Drupal 6 site and freemarker files that are using the same theme as Drupal. Now I have to optimize the loading and reduce the file dependencies of the freemarker files to CSS and JS. I was told to us...

ajaxfilemanager selecting image by doubleclick problem

Hello, I am using ajaxfilemanager and when I select an image by doubleclicking on it, the selectFile function from form.js is called twice. My selectFile function is: function selectFile(url) { url = url.replace(window.location.protocol + "//" + window.location.hostname +"/", ""); window.opener.addImageToList(elementId, url);...

Why is this jQuery ajax call to C# web method not working

Here is my JS: function declassifyAjax(e) { var items = getSelected(); var docIds = new Array(); items.each(get); //get ids of QcItem/docId we are dealing with function get(count, el) { docIds[count] = $(el).parent().attr('id'); } var dataObj = new Object(); dataObj.batchId = batchId; dataO...

Multiple assignment in javascript?

For a project a developer sent us a .js file with code similar to this: var myList = [1,2,3]; var a,b,c; [a,b,c] = myList; It works in Opera 10.30, Firefox 3.6.x but it's not ok for Opera 10.60 and Chrome. It's just curiosity, do you have any reference or link that says this code is compliant to JS/ECMA standard or not? What do yo...

call javascript alert from java class

How to call javascript alert from java class ...

Link social networks to website account/registration

I would like for users to login to my website using a verification with their social network. But along with verifying their login, I need them to also select a username, avatar, PayPal and various other custom options that need to be stored in my database. Is there a way to display a typical registration, (without password field) and t...

Firefox JSON "not well formed" errror on valid JSON

I'm receiving the following error message in Firefox: Error: not well-formed Source File: http://school/courses.booking.add.php?1287657494723 Line: 1, Column: 1 Source Code: {"type":"error","message":"You have already booked this course."} As you can see, the output is valid JSON (it's created by PHP's json_encode() function). And it'...

jqgrid: get value from json data

hi, how can I get return value from json string? how can I parse and read the variable searchxx? from php: $responce->page = $page; $responce->total = $total_pages; $responce->records = $BC->tot_count; $responce->searchxx = $sSchWhere; $responce->order = $sOrder; while ($data) ...... echo json_encode($responce); fro...

Pure JQuery based range slider which doesn't use jQuery UI

Does anyone know a good, independent jQuery range slider plugin that doesn't rely on jQuery UI? ...

How to block alert box through jquery

I want to block alert box if it is present in code. Im using an api that tells me the search result of my website and if any user enter <script>alert('Just teasing')</script> then it shows an alert box on my page how can i stop this alert? ...

how to make flash in iframe appear under my popup window.

if i would place flash in a usual way, i could use wmode transparent. but I place flash on page with iframe (because it loads external files, with relative URLs, from another server) Also on a page I have JS popup window. But when opened, it's under flash in iframe. I need above. ...

Is there a limit to the base to which numbers can be associated to?

This may be very convoluted and twisted idea. Got it while learning some JavaScript. It piqued my mind. Hoping there may be someone else who would have thought about it before or might enlighten me :-) var n = 17; binary_string = n.toString(2); // Evaluates to "10001" octal_string = "0" + n.toString(8); // Evaluates to "021" h...

How to install eclipse for java developer,c/c++ developer, php developer at the same time?

Now I am trying to install eclipse on my computer under Windows 7. The problem is how to install the eclipse for java,c/c++,php,javascript concurrently? Would donwloading the four zip files and then unziping them all into one directly say d:\eclipse works? Is there any good tutorials for installation/configuration of eclipse? ...

Regex to check a substring is having all numeric or not (in Java script).

Hi, I am using following code to check first four characters are alphabate or not. var pattern = new RegExp('^[A-Z]{4}'); if (enteredID.match(pattern)) isValidAlphabates = true; else { isValidAlphabates = false; This is working fine; Now I need to check the next 6 characters (of the entered text) need to be only numeric (0 to ...

javascript equivalent of php $$ dollar dollar

Hi, I have declared a local variable named cont in a function named validate. I am calling a function process from inside validate. I am sending the string 'cont' as argument to validate function. In the process function using the string 'cont' i want to access the javascript local variable's value like window['cont']. But i get undefi...

Bundle jQuery with widget

Let's say I want to provide a widget like Youtube does to embed their player in an external page. For this widget, I rely on a certain version of jQuery. How can I bundle jQuery with my widget so that it is available to my widget JS code, but that it doesn't interfer with other jQuery versions included in the external page? Do you have ...

How do I prevent a line of JavaScript from running in IE (but let it run in other browsers)?

I am looking for something similar to CSS's <!--[if IE]> decaration for JavaScript. I don't have time to find out why a line of code is not working in IE, and commenting it out doesn't break the page, so I am thinking "stuff IE" and looking for a way to comment the line out only for IE. Any ideas? ...

Searching, sorting and paginating large datasets on the client

Hi, I have been using the DataTables plugin for jQuery (http://www.datatables.net) to search, sort and paginate tabular data on the client. The simplicity of implementation and smooth user experience have been a huge win. Now I have a requirement to implement the same functionality (search, sort, paginate) over a larger set of data, ma...

Extending div's height beyond its max height from javascript

I have a div in an user control, whose max height is set to 400px in css. This user control is used in many of aspx pages in my application. I am trying to increase the div height to 500px dynamically in JavaScript for only one page, but it doesn't work. The div in user control always takes only the 400px (max height set in css) and not...

Can the jquery flot graph project handle discontinuous points

Hi I have a requirement for a multiple series line graph. I am looking at pure javascript solutions and feel flot looks like a good option. However the points along the line may not be continuous but I want the line to be joined. ie y [Jan Feb Mar Apr May Jun] Series 1 [4 4 5 6 7] Series 2 [5 6 7 8 9 ...