javascript

How can I know, what local port is used by Stream?

Is it possible to specify explicitly local port that should be used by net.Stream, or to find out what local port is used for connection? According to the documentation, local port cannot be specified: stream.connect(port, host='127.0.0.1') ...

xmlHttp Request problem in IE7

Hi all, I have a bit of a strange problem. For one of my clients I've added some ajax functionality to their website. To get the context; it's a website for a travelagency and pricetables are generates by ajax-calls to reduce serverload and improve user experience. Only now I received an email where they say it is not working in IE7. ...

In javascript, what code runs at runtime and what code runs at parsetime?

I'm completely muddled up about what code runs at runtime and what code runs at parsetime. With objects especially, I don't understand what parts of the object run before initialization, what runs at initialization and what runs sometime after. Since I'm completely confused, I'm not sure how complicated this question is. If it's not ju...

How to get the id value from check box?

1 naga naga123 2 Tamil tamil123 3 vinod vinod123 4 naveen naveen123 5 jakkir jakkir123 save edit delete UserID: UserName: Password: I have check box at the end of each row. When I click the check box and select edit the values should get displayed in the text boxes corresponding to use...

How do I effectively calculate zoom scale?

I have a draggeable image contained within a box. You can zoom in and zoom out on the image in the box which will make the image larger or smaller but the box size remains the same. The box's height and width will vary as the browser is resized. The top and left values for the image will change as it is dragged around. I'm trying to kee...

How to get Capybara to see Javascript in plugin directory when creating plugins?

We're developing a plugin for rails, and I've got Cucumber working with Capybara wonderfully. BUT, when developing, I've been (erroneously, I guess) putting the Javascript files in the parent test application's public/javascript directory. So when Capybara runs, it doesn't find the javascript file. How can we get Cucumber/Capybara to see...

Using Javascript regular expression for filtering HTML

Good morning is there a clever way to use a javascript regular expression to clean up this string: var spans = "<SPAN><A href="javascript:sel.RemoveProductFromSelection('12372');"><IMG src="remove.gif" width=18> </A>Mirage - JOY</SPAN> <SPAN><A href="javascript:sel.RemoveProductFromSelection('12427');"><IMG src="remove.gif" width=18> <...

Problem with extjs

i wrote a code that really worked perfect on local host but on my production server , i was showing error that Response.Result parameter on the success event attached to the submit button was not define but everything was ok on my local server, i re-posted the main extjs package on the server , thinking some files are corrupt , the p...

Tool Roundup for Debugging JavaScript

What techniques (other than alert(message);) do you use to debug JavaScript/jQuery? Give particular attention to browser specific techniques. Tools console.log(message) - alternative to alert(message); (Nirmal) browser-safe call (soslo) jsFiddle - demonstrations (Craver) BlackBird - writing messages to the screen (Oli) FireFox F...

Javascript script to change the source of an image

Hi, I am using flexigrid for one of my projects and I need to come up with a way to change the image source depending on the value of one of the cells. For people who are used to flexigrid, I have the following code: $json .= ",'".addslashes("<span><img src='' id='flag' />" . $row['availability']. "</span>")."'"; and my javascript t...

Does an alternative to .closest() exist?

Hello everybody, this is a snippet from my code: $("#myid").append($("p:contains('text')").closest("div").clone()); I tried to get the first closest ancestor div-element of p containing 'text'. I'm looking for an alternative to .closest() because I have to use jquery version 1.2.6. Do you have got an idea what I'm looking for? I ho...

Best Way to Get All DOM Elements with jQuery

Hi! What's the best way to get all of the DOM elements on a page using jQuery? Thanks, DLiKS Edit: This is for use in a script that grayscales an entire page using grayscale.js - http://james.padolsey.com/demos/grayscale/. jQuery because I can! :P ...

Confusion regarding regex

Hi, I just found this regex in JavaScript var str=input.replace(/\0/g, "\\0"); Can you please explain me what does it mean? What is the meaning of /\0/g and \\0? ...

Get html below mouseclick via qooxdoo

Is threre a possibility to get the clicked link ( -tag) below the mouseclick via qooxdoo or plain JS? Here you can see the problem: within a html-rendered table the link does not work. http://tinyurl.com/374gzwl ...

jQuery getJSON not working

Hi guys, I am trying to get some data back from a server using jQuery $.getJSON, and the code seems to work fine, until it gets to $.getJSON, it doesn't seem to be triggering that at all, there are no console logs when I press the button, here is the code below, $(document).ready(function(){ var funk; $('#button').live('click', func...

Change the position of a jquery dialog box after it loads

I have a jquery dialog box that loads with an image and auto resizes to the image. This is what I want. However, the box is rendered at the center position, but the image isnt fully loaded yet, there is a delay in getting the image. So when the image is loaded into the dialog box the upper left corner is centered, but the whole bottom ri...

asp.net jquery loading values on page after post back

Im currently trying to use a jQuery plugin: jQuery Autocomplete Tokenizer Now after posting back the page, I want to re-load the values back into the textbox for whatever items had been entered. Now the jQuery on the page is like below: $(document).ready(function () { $("#<%=txtPeople.ClientID %>").tokenInput("Handler.ashx", { ...

jQuery .submit for autologin works in FF,Chrome... not IE

I have an internal suggestion box application where all users can have the same username and password .. so I'm doing an autologin with a jquery form submit.. this works great in FF and Chrome but in IE.. it populates the values in the user/password form fields.. does the submit.. and then just does it again over and over.. ( the appl...

Strange User Agent With Google Chrome

I was working with some javascript and found a strange user agent with my Google Chrome. I have Google Chrome 7.0.517.41 beta installed on my Ubuntu Laptop. Now AFAIK my user agent should be something close to Chrome/7.0.517.41 but it is showing me: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7...

Jetty, preflight and ajax

Having a Jetty server set up programmatically which I try to access via ajax and xmlHttpRequest. Without authorization, the call works fine but with, I get 401 Unauthorized. Any suggestions. Javascript call looks like this (shortened): var auth = base64encode('name','pwd'); try{ var xmlhttp = new XMLHttpRequest(); xmlhttp.open(...