javascript

How to extract string from custom characters using JavaScript?

Howdy, If I have a string between 2 square brackets that I have created on a page, how would I go about storing that value in a variable and deleting the square brackets? Example [String I want] So I'm left with var mystring = "String I want" UPDATE: It appears I can't reply to any of you. SO must be acting up. Anyway this is w...

Does HTML Hidden control have any events? Like onchange or something?

Can I attach any event handlers to HTML hidden? Basically want to run a function with a hiiden control value changes. Thanks All, ~ck in San Diego ...

In JS, how can I get the mouse coordinates inside a DIV?

In JS, how can I get the mouse coordinates inside a DIV? if I use event.pageX, it will only work if the DIV is at the top left corner of the page... otherwise, I have to know the position of the DIV in the page and subtract event.pageX from that. This is hard to do when I generate the DIVs dynamically since I have to keep track of the po...

What is the best way to repopulate a form and display errors with no-script?

I'm building an application which uses ajax calls for form validations and some others, problem is that I don't like it when those validation errors shows up on a new page with no css at all and form completely gets reset without the javascripts. I'm talking about a dozen forms so, it will be quite annoying for the user to go through fo...

get viewport position in javascript in iphone safari

Hi everyone, I'm trying to prevent element from scrolling in safari on iphone. I've tried solutions mentioned here: http://stackoverflow.com/questions/777621/iphone-safari-scroll-a-list-inside-a-html-container But my list is large and it doesn't work so smoothly. What I have in mind is to detect onscroll event and reposition the elemen...

Is there a natural language parser for date/times in javascript?

Is there a natural language parser for date/times in javascript? ...

Tag list asp.net or javascript?

Hi, I would like to add a taglist in my webapplication. I have a list of tags with an integer indicating each tag's popularity. Many web applications display the tags and their popularity using a different font-size. Because it is so broadly used, I would think that their is a plugin out there that displays this. An example of what I...

In Javascript, how do I transfer data from a text/html typed object to its parent

I have an <object id="objPage" data="source.html" type="text/html"><object> containing an HTML page, on the same domain. I am trying to send a String through Javascript from source.html to its parent, which is an aspx page. I need the child to be able to send that information. Any idea? So basically it's: [ASPX] [OBJECT] This s...

Handling Javascript radiobox state on page reload

I've been messing around with a radiobox. I'm encountering an issue that varies depending on the browser the user uses. Basically, my goal is to generate other data on the page depending on the radiobox selected. It is important that this data remain in sync with the radiobox. Normally, this is not an issue: I run the code below when...

Stopping JavaScript from closing a window

My company is required to use an application developed in ASP.NET by another company. The application needs to be open in two separate browser windows. The company that developed the application has added some JavaScript at the top of the main page to stop user from opening multiple instances of the application. The script that is placed...

howto benchmark javascript code ?

Hi all, Is there a package that helps me benchmark JS code ? Im not referring the Firebug and such tools. I need to compare 2 different JS functions that I have implemented. Im very familiar with perl's Benchmark (http://search.cpan.org/~tty/kurila-1.19_0/lib/Benchmark.pm) module and Im looking for something similar in javascript. Is ...

Understanding bitwise operations in javascript

I am currently storing data inside an XML doc as binary, 20 digits long, each representing a boolean value. <matrix> <resource type="single"> <map>10001010100011110000</map> <name>Resource Title</name> <url>http://www.yoursite.com&lt;/url&gt; </resource> </matrix> I am parsing this with jQuery and am cur...

Target an iframe with a HTML Post with Jquery

Hi, If I'm using JQuery or javascript to do a post, how can I make it target an iframe rather than the current page? jQuery.post( url, [data], [callback], [type] ) That is the format of the jquery post, it doesn't seem as though there is anywhere to specify the target like there is in the tag. Any ideas? Thanks, Matt ...

How can I pass information to an iframe via Post in ASP.NET?

Hi, I would like to pass information to an iframe via post. (Could be jquery or javascript that executes the post, it doesn't really matter). The information cannot be sent via querystring as I do not have access to change the way the page brought in by the iframe is. This data will determine the layout of the content in the iframe so...

jQuery CSS plugin that returns computed style of element to pseudo clone that element?

I'm looking for a way using jQuery to return an object of computed styles for the 1st matched element. I could then pass this object to another call of jQuery's css method. For example, with width, I can do the following to make the 2 divs have the same width: $('#div2').width($('#div1').width()); It would be nice if I could make a t...

Want to use a jquery pop up, but get the data from server side.

When somebody clicks on my google adwords link like this: http://www.myshoppingsite.com/product/rubberball.aspx?promo=promo123 I want my aspx page to read the "promo" parameter, hit the database to pull back some data, then display to the user a nice jquery type popup window over top of the product page. The user can read all about th...

Detecting if a file is already open in javascript/hta

I'm trying to fix a .hta that someone at my company created 3 or 4 years ago. Right now if you open a file that someone else already has open, you'll lose any work you've done on it and will have to manually do it over again. So I was thinking just checking to see if the file is already open and then either locking editing, or just mak...

Replace value with image using Jquery?

Hi guys... again I have a page with lots of comments. The code structure is as follows: + <li id="li-comment-65" class="comment even thread-odd thread-alt depth-1"> <div class="comment-body"> <div id="comment-65"> <div class="comment-author vcard"> <img height="30" width="30" href="" alt="" /> ...

Javascript: script needs to wait for an element to load

Background info: I have a function that when called creates select list inside a form and populates it. After that the script runs through the options in the list and looks for a certain value. If the value is there, the script 'selects' that option. Problem: Because the list is dynamically created and is some times very large, it takes...

What is val() for in jquery?

I'm trying to learn codeigniter and jquery. There is always a val() that nobody explains. What is it for? ...