javascript

Problem in algorithm with jquery.ajax in cycle

Hello everybody. I want to make some ajax requests in cycle with jquery.ajax method. And I must handle the link request id(some information passed to server) -> server response after all requests done. And so on I have not any information about request id in server response. How could I handle this? May be handle request data in callbac...

Given an Index, Return a range of Values from an Array

First, apologies,this should be simple but I've had too much coffee and cannot wrap my tired brain around this (at least not without making it way more complicated than I know it should be). Lets say I have a simple Javascript array with a number of items in it: var items = ["Hello", "This", "is", "an", "array", "with", "...

Disable default browser behavior to move curser right or left when pressing arrow keys in input field

I am using Firefox to do this but it works in IE6 ... go figure. Basically I have code written to traverse a grid of input elements using arrow keys. All of that is working just fine. I can move freely to any field using the arrow keys. When I use up or down arrows the select function seems to work correctly by selecting all text in the...

Sub Pixel CSS positioning

If I set the CSS position attributes of an image element to floating points via javascript, Firefox renders it nicely, but other browsers do not. Can I get sub pixel positioning to work with other browsers? I like to seamlessly zoom in on an image, without jittering due to my values getting rounded off. For example, it seems like 2.217px...

can a javascript get the value of the div width from a css file

hi, can a javascript get the value of the div width from a css file, if yes, then please tell me how :) ...

getting values from an array (JS / jQuery)

I'm passing an array to a function I want to be able to show or hide columns in a table depending on what's passed. So, if I pass 1,3,4 columns 1 3 and 4 should show - column 2 should not. I can handle the show/hide bit. I'm just not sure how to grab the values from the array ...

Remove cookie from XMLHttpRequest object

I am making an ajax call with jquery like: $.ajax({ url: "path/to/webservice.asmx" beforeSend: function(xmlHTTPRequest) { //modify headers here //remove cookies } success: function() { //do stuff } } What I would like to do in the beforeSend function is take the incoming xmlHTTPRequest varia...

jQuery: identify that the DOM has changed

edit: changing .ready() call per Matt's suggestion. I use jQuery to configure some stuff like so: $(function () { $('.myThing').each(function() { ... configure it ... }); }); My problem is when a new element gets added to the DOM after .ready() has been called. The configuration is not performed on those elements...

Selectbox Options List dynamic width.

I have a Datagrid Layout with 5 Columns. Each column head Contains a Selectedbox, as a Sort options. And Each Column has a fixed width of 160px. Now my Problem is, If option Text is too Long e.g "Doppelzimmer/Bad/WC/Balkon oder Terrasse" in FF the options list will expanded, but in IE, the text will be Cut after 160px in Options list. ...

How to add an HTML form element dynamically using javascript

I'm trying to add a text field to a form dynamically using javascript. From what I can tell, my code should work. function change() { textField = document.createElement("text"); textField.id="sub"+count; textField.name="sub"+count; textField.value="Enter a name for another new subcategory"; textField.size="35"; textField.onchange="javas...

Get the values of a cell in a selected row of a RadGrid on client Side

Hey there everyone, I'm hoping there is a simple fix for this, but I would accept a complicated one after messing around with it for the last day and a half! I am putting together a module that will drop into a DotNetNuke portal and I'm populating a Telerik RadGrid with data. I have followed every tutorial and example I can find, but th...

When should $(document).ready be used?

I've noticed that $(document).ready(..) causes a noticable delay in applying javascript effects. However I also understand that just having the effect in a <script> can not always work because the DOM may not be ready. When should you always put your code in $(document).ready and when is it ok to bring it out into a global <script> tag...

Place variable in div id

I want to use an incremental div id, so that all my id are unique, therefore I can use jquery effects to modify them independently. I hope my question makes sense. If i need to elaborate please let me know. div id ="name_$id" ...

Which solution of CSS3 Box radius emulation for IE is Quickest in rendering ?

There are many JavaScript, .htc, jQuery solution available to make round corner in IE 6,7,8. http://www.dillerdesign.com/experiment/DD_roundies/ (It does not work in IE 8) http://www.htmlremix.com/css/curved-corner-border-radius-cross-browser http://alt-web.com/DEMOS/CSS-Rounded-Corners.shtml http://blue-anvil.com/jquerycurvycorners/...

jquery variable in selector

I want something like: var user_name = $(".hidden_user_name").text(); $("a[name="+ user_name +"]").doStuff()... This works: $("a[name=joe123]").doStuff()... EDIT: The problem is clearly in that the user_name variable isn't set when the selector fires. How can I fix that? ...

script doesn't work as chrome plugin

I have a simple JavaScript script: <style> body { min-width:357px; overflow-x:hidden; } img { margin:5px; border:2px solid black; vertical-align:middle; width:75px; height:75px; } </style> <script> function dynamicTag() { var request = "http://localhost:8000/iStatus/add/12345;dfsdfsd;dsfsdfsd;1"; var head = ...

How to keep the Parent menu hovered while the mouse in child menu in a Dropdown Menu

I am trying to create a dropdown menu. It working well. I want the top menu when hovered truns into white color. when moving down to the submenus, the top menu should stay in white color. But the top menu turns into its normal original color. How to keep the parent menu hovered while moving mouse in the submenus. The code is here: HT...

PHP MYSQL upload file and store as blob

I am trying to create the functionality to upload a file in PHP and store it in my mysql database as a BLOB. I have run into a few issues that I need some help on. The first issue is how can I do this without using forms? I am currently using the codeigniter framework and I do not want have the form do anything on the action, I would p...

Converting HTML string into DOM elements?

Hi, Is there a way to convert HTML like: <div> <a href="#"></a> <span></span> </div> or any other HTML string into DOM element? (So that I could use appendChild()). I know that I can do .innerHTML and .innerText, but that is not what I want -- I literally want to be capable of converting a dynamic HTML string into a DOM element so th...

Getting data from iframe with JavaScript

Greetings, js masters. I have a simple page with iframe. In this frame there are a three input fields, which user fill in. How to get this data in every input field with js? Here is js: <script type="text/javascript"> var ticket = window.frames[0].document.getElementById('ticket').ticket; alert(ticket); </script> And i have inside f...