Questions for javascript


9199

Increasing performance of loops

I'm currently working on a script that helps to manage connections to phone numbers with different things like contacts, text messages, etc. The big problem with phone numbers in our data is that a...
6922

How to pass array from Asp.net server side to Javascript function on client side

How do I pass an array I have created on the server side onto the client side for manipulation by Javascript?
4148

Increase element ID by one after every click?

I am trying to clone multiple divs on my page by using the jQuery .clone() method. The problem is, as soon as a div is cloned, it needs to have a unique ID. The cloned ID has to be there too. I was
5691

This is ugly and there has to be a better way to write it in jQuery

$(this).parent().parent().parent().parent().find('[name=reply_to_id]');
4452

Replace Components.classesByID with document.implementation.createDocument

I am not the author of this code, but it is no longer maintained. So I am trying to fix it, but I have very little experience in javascript.
8389

Scriptmanager Asp.Net Mvc

I'd like to have some of the scriptmanager features in the new Asp.net MVC model
7644

Is it safe to compare JavaScript's getTime() across different systems?

JavaScript's getTime() returns "the number of milliseconds since 1 January 1970 00:00:00 UTC".
3236

Canvas Script Not Working

I'm using this script on Wordpress and it works fine. However, I've decided to switch to Blogger instead. Now when I include it in the Blogger template, it doesn't work and I get this error in the ...
5505

ExtJS TreeGrid's Node mouseover event

I have googled and didn't find anything for extjs TreeGrid's mouseover event example. I tried
9266

Timeout doesn't work

function updateimage(){
2941

How can i combine this codes?

As the title says, I think this code can be simplified in less lines. Could someone help me with this?
6933

how to hide a div that is empty and another div associated with it which may or maynot be empty?

I have a speech bubble called philosophy bubble which is just a div styled to look like a quote bubble and the sharepoint control is what fills up the content of the bubble but sometimes the bubble...
1371

JavaScript error: NS_ERROR_XPC_BAD_CONVERT_JS

I am getting this JavaScript error, doing some research people are saying something about instantiating an object.
4138

processing.js rect() different border colors

I'm drawing a game grid with rect() and I'd like some borders of my rectangle have different colors.
4306

Javascript: Radio button and displaying images based on a vaule

I am currently working with displaying images based on the value chosen from a radio button. But I am currently running into a wall with making the code as short and efficient as possible. I have s...
8304

getElementById not returning proper value (maybe syntax issue?)

I am using XSL to write this page, and when I hit a checkbox it sends the information to my javascript function. This all works in IE, but Chrome it does not. The problem is, after I hit the chec...
4882

How to use jsonp to get javascript based ad calls onto a page, asyncronously

I am trying to use jsonp to solve a page performance problem I've been having. On my site I usually display ads by writing out a script tag like this document.write("<scr" + "ipt
9469

Dynamically populate two dropdown menus

I'm not (as I am certain you'll notice below) a programmer or coder. I write network documentation manuals.
1447

javascript “include” strategies

Duplicate of: http://stackoverflow.com/questions/203113/use-javascript-to-inject-script-references-as-needed
8377

Setting variable name based on loop iteration

I hope I'm not overlooking an extremely easy solution when I ask this question.
4367

UTC clock based on server time?

I have a JavaScript clock that gets the time in UTC, it currently works, but the time is based off the client's computer. What could I do to base the time off of the server instead? I am using PHP ...
7129

Changing the stylesheet of a nested page at runtime

First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS and JavaScript.
2903

Why is character encoding important for URLs?

I'm currently learning JavaScript, and I don't understand why it is important to encode URLs.
977

Fix :hover issues on iOS devices, universally with jQuery

At the moment I'm having a following issue, when I first tap on something the :hover state gets triggered and I than need to tap second time in order to actually click an element. Fixes I found were
8352

How to store temporary data at the client-side and then send it to the server

I need to store data temporarily at the client-side to allow users to add, edit or delete items without having to query the server for each of these actions; just when the user finishes adding item...
9893

How to substitute the “0” with “i” in the below line inside for loop in javascript?

How to substitute the "0" with "i" in the below line inside for loop in javascript?
2874

Javascript Date Object from string in form 'HH-MM'

Hey, just wondering how to convert an HH:MM string into a javascript Date object. I have tried new Date(string); and myDate.setTime() but to no avail.
4785

jquery to get next input element

I have a number of checkboxes. Each of them is associated with one input field. When the checkbox is checked, I would like to set the input field is editable, i.e. disabled attribute as false. Othe...
9670
9936

Mapping an array of objects to key/value pairs in CoffeeScript

I have an array of elements that I would like to apply a mapping to to convert it into key value pairs on a single object (to mimic an associative array).
1083

Is it possible to use disproportionate intervals in jqplot?

I am using jqplot for a bar graph that has 1 very high number around 7 million and 2 very low numbers, less than 100,000 when they are charted on a bar graph the two low numbers are only a couple of
6951

React to 303 status code in jquery ( Prevent from redirecting)

when I send requests to a certain server, a 303 response will come, followed by the requested response in combination with a 200 status code.
4108

How can an HTML page extract parameters passed through a form?

My question is should I convert two html pages to php pages, so the called page can access its POSTed parameters, or is there a way for a called html (.html extension) page to access posted paramet...
1969

Alternative Web file explorer/Navigator

I've found this online file explorer called enCode eXplorer. It was just what I was looking for; a simple, clean, free, easy-to-edit system, completely made up of one php file. The only problem I h...
1497

Encapsulating ajax call fails probably because of object visibility

I have this piece of code that is supposed to work on Firefox 3.6 . The problem is that the variable this.xmlhttp that should be defined to STEP2 and used on STEP3 acts as if the code on STEP2 and ...
9899

Update and remove operation on Jaydata

I'm trying to write a simple CRUD functionality in Jaydata, I had written this simple code for update operation:
1546

Trying to enable a disabled button when a textfield is not empty

So im just trying to enable a button when 3 text fields are not empty,and disable the button again if they become empty.Right now I was only trying it with one field just to get it working first bu...
9817

Regex to pluck portion of URL returning array with “undefined”

I'm making a bookmarklet for use on Google Plus. I'm a little light on my regex, but the following test almost works.
7157

$.ajax() success called, but will not run method

This is really puzzling me. Any idea why this would be happening?
4500

how to remove google maps control

i am implementing google maps on my website, but i want to remove satellite and map options from my maps which is shown on right top, also pan controls.this is my code,
843

TCPDF not formatting

I'm using an ajax call to print a pdf and email it to user, but the problem is that the data in the pdf is not formatted.
9342

JQuery iterate through current SELECT values

how do you iterate through just the current values of all selects, not the options?
4582

Yahoo maps api, version 3.8 doesn't display custom image?

I used the following code to display custom marker on Yahoo Maps :