javascript

How do I make sure that the user can't open more than one popup at any time?

I have a page that lists uploaded attachments and an icon next to each attachment that opens a popup window (when clicked) to allow the user to edit assorted attachment information for each attachment. My questions are: How do I ensure that the user is allowed to open only one popup window at any one time When the user tries to open a...

How to avoid the mailto annoyance?

I am working on a website and would like for my users to be able to give feedback as easily as possible. I know one way but I've always hated it: <a href="mailto:[email protected]">Click Here to be annoyed!</a> Is there a way in JavaScript or HTML to allow my users to email me without having to go through a lot of trouble? ...

Browser-native JSON support (window.JSON)

I have seen references to some browsers natively supporting JSON parsing/serialization of objects safely and efficiently via the window.JSON Object, but details are hard to come by. Can anyone point in the right direction? What are the methods this Object exposes? What browsers is it supported under? ...

How to pass a javascript object array to php using POST

Lets say I have an array of javascript objects, and I am trying to pass those objects to a php page to save them into a database. I have no problems passing a variable to the php and using $_POST["entries"] on that variable but I can't figure out how to pass an entire array of objects, so I can access my objects.entryId and .mediaType va...

How can I get a jquery css container to pop up letting the user know data was successfully entered?

When a user inserts data into a form and then submits it, it goes to my php script and inserts the data. The script will return a value letting the user know if the data was inserted or not. Since I am using JQuery, I have no idea how to do this. Can someone please point me in the right direction? All I'm after here is a nice, neat littl...

How to control ASP.NET Validator Controls Client Side validation from JavaScript?

How to control ASP.NET Validator Controls Client Side validation from JavaScript? ...

How can I disable Text Selection temporarily using JavaScript?

Hi there all, this is a bit of a specific question so I'll get right to the point. I'm working on a short and simple drag and drop routine for part of a web application, and although the dragging and dropping bit works fine, the site goes all ugly-tastic during the operation because the browser still does the default operation and works...

How should I emulate a mouseenter event using jquery's live functionality?

I want to use jQuery's great live functionality for a mouseenter event, but it's currently unsupported. Below is my first go at a solution, but it doesn't seem optimal. Suggestions? Improvements? // mouseenter emulation jQuery('.selector').live('mouseover',function (e) { // live sees all mouseover events within the selector // o...

JSF Richfaces frontend performance tuning

I've developed a web application using MyFaces 1.2.6 and Richfaces 3.3.1GA (just upgrated). Despite the ease of use, I found out that Richfaces components are very slow. I also found out that they didn't really take advantage of the browser caching mechanism, they keep sending some lousy JS file every request and other things. I really ...

javascript to jquery

How do I write the following line which is in javascript in jQuery? var variablename = new functionname('some variable'); This is my js code: var rt = new ResizeableTextbox('myRT'); I need to use this in the following code segment: if($(this).text() =='String') { $("<label id=labelstr"+stringinc+" >"+label+"</label>").ap...

Extjs Training

Our company is starting a major re factor of its front end Javascript code. We have decided to use Extjs as a framework and would like to invest in some training for several of our employees. We are mostly looking for Extjs specific material, but some advanced architecture wouldn't hurt. We are happy to fly our employees on location.The ...

Proper way of binding events with jQuery

I am somewhat new to Javascript but even more green with jQuery. I've already come across something that's got me scratching my head. What is the difference between: $('.foo').click(function(){ //blah }); and $('.foo').onclick = function(){ //blah } I prefer the second way but it doesn't seem to work. Am I doing something wrong? ...

how can i get links on page that have a certain word in them with javascript

I am trying to get the link that contains a word on a page and refresh them to another page, in a bookmarklet. Here is the code I am not getting to work for a bookmarklet: javascript: for (i=0; i < document.links.length; i++) { if(document.links[i].href.match('exampleword')) { location.href = 'http://google.com/exam...

Javascript regex - why is it not working as expected on IE?

After loosing much sleep I still cannot figure this out: The code below (its a simplification from larger code that shows only the problem) Identifies Item1 and Item2 on FF but does not on IE7. I'm clueless. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <htm...

JavaScript: Adding an onClick handler without overwriting the existing one

I'm trying to modify all links on a page so they perform some additional work when they are clicked. A trivial approach might be something like this: function adaptLinks() { var links = document.getElementsByTagName('a'); for(i = 0; i != links.length; i++) { links[i].onclick = function (e) { <do some work> return true; }...

javascript to jquery

This function call ResizeableTextbox('myRT'); works well inside javascript(produces a resizeable text box) but doesn't work inside jQuery code.Why? This produces the resizeable textbox. <script type="text/javascript"> ResizeableTextbox('myRT'); </script> But if I give it like this in the jquery code,I dont get the resizeable textbox...

How does google analytics collect its data?

Yes, I know you have to embed the google analytics javascript into your page. But how is the collected information submitted to the google analytics server? For example an AJAX request will not be possible because of the browsers security settings (cross domain scripting). Maybe someone had already a look at the confusing google javas...

Advantage of COMET over long request polling?

I've been wondering if there is a real advantage to using COMET / push-technologies over the much simpler polling with long requests where the server will wait a certain maximum time for new events to happen before telling the clients that nothing happened. Both technologies have similar client latencies and while common wisdom is that ...

Is there a built-in javascript function to process time string?

To make time like "2009-05-02 00:00:00" to "2009-05-02" I know I can achieve this by regular expression, but would be better if there is a built-in function that can do this. ...

How to hide elements which has no next elements with a certain class?

i have the following html , and i want to hide all lsHeader which has no next elements with class contact using jquery. <div id="B" class="lsHeader">B</div> <div id="contact_1" class="contact"> B.Contact1</b/> <div id="contact_2" class="contact"> B.Contact2</b/> <div id="contact_3" class="contact"> B.Contact3</b/> <div id="conta...