javascript

how to change class of <a> tags in jquery

I have a table structure, something similar to <table style="width: 100%;"> <tr> <td> <a href="#" class="xx">one</a> </td> <td> </tr> <tr> <td> <a href="#" class="xx">Two</a> </td> <td> </tr> <tr> <td> <a href="#" class="xx">T...

Intended URL redirect + default redirect after login?

Hello, When a user tries to access our website via a link (for instance going to www.website.com/privatepage) they are redirected to a login page. Once they login, we want to redirect them to that intended URL - how do you do this? Also we have a use case where a user logs in from the homepage, or goes directly to the login page with ...

how to make my code only alert 'gggg' , can not delete the first Statement using jquery

this is my code : <input type="button" value="edit" id="edit"/> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"> $('input').click(function(){ alert('sss') }) $('input').click(function(){ alert('gggg') }) </script> and when i click the button,...

Javascript to make the page jump to a specific location

I there a way in javascript to make the page jump to a specific location on the page, such as <span id='jump_to_this_location'></span> I do not want to re=load page, ...

Jquery. Execute code only when all iframes are loaded

Hello. $(document).ready(handler) call to handler when page is loaded not paying attention to whether iframes' content is loaded or not. I want code to be executed only when content of all iframes loaded. Is there any way to achieve this? ...

Parsing JSON string with jQuery.parseJSON()

So, this should be simple in my mind... I have a valid JSON string being returned through an Ajax post: {"success":true,"message":"Thank you! We value your feedback."} And I'm simply trying to alert my "message" value onto my resulting post return: success: function (result) { alert(result); var obj = $.parseJSON(result); a...

How to get the computed width of an element's border?

How can I get the computed border width of a HTML element in Javascript? (Independent of where and how the border is specified.) ...

Close FancyBox after action?

I've got some links on my page that when clicked, open a fancybox. Inside the fancybox there are some action buttons (like "close item", "delete item"). When those buttons are clicked, I want it to submit the form as usual, and then close the fancybox. How can I rig it up to do that without interfering with the POST? Note: I'm not using...

Is there a way in javascript to make the page jump to a specific location

Possible Duplicate: Javascript to make the page jump to a specific location Is there a way in javascript to make the page jump to a specific location on the page, such as <span id='jump_to_this_location'></span> must be javascript or jquery, I don't want to reload the page. ...

javascript div closing problem

Hello, I have a div that opens when user clicks link. And the div sort hovers over the link (its a more info box/div) and the div has a links and text. Now what I want is that when user cliks outside of the div it closes/disappears. But I want the links inside of div to work. Atm the javascript for that closin is like this: $('html').c...

Onblur event mistakenly fires in IE when parts of popup document are clicked

I have a bunch of small pop-up pages that are designed to self-close when they lose focus- i.e. the user clicks on the parent document. Unfortunately in IE8, the blur also occurs when the user starts to fill out an input form inside the pop-up page. Indeed clicking ANYWHERE inside the form causes this, or even when the user accidentall...

get location +20px?

$(document).ready(function() { //select all the a tag with name equal to modal $('a[name=popup]').click(function(e) { //Cancel the link behavior e.preventDefault(); //Get the A tag var id = $(this).attr('href'); //Set the popup window to center $(id).css('top', winH/2-$(id).height()/2); $(...

question about correctly structuring javascript, css, and svg

i have a index.html file which includes svg and CSS file and 2 javascripts file and has a javascript function inside of it for some reason i cannot get the javascript function to run. is the strucutre supposed to be different>? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-tra...

Handling events using Prototype

So I have the small code snippet below, which I would ideally like to call the function to alert me with hello when the #results_more element is clicked... $('results_more').observe('click', function(evt) { alert('hello'); }); However, I think I'm doing something terribly wrong if something this easy doesn't work. Anything I may b...

Cannot get JS to trigger As3 function in swf

Hi Desperately need help and would be gretaful if someone could see if they can find what is wrong. I am trying to trigger a swf movie embedded in web page by using a js function. This is a dry run using sample code I have found, i eventually just want the movie to play and stop via js instructions, when clicking an a href. Website is ht...

Get the absolute position of a div relative to the window.

This question is quite similar to what I want I'm looking for, but my situation is different enough, I think, to merit a new question. I have several divs positioned absolutely inside of a parent div (position: relative). I want to get the position of the children divs relative to the window. The jquery offset() method doesn't seem to ...

Sys.Extender.UI comes NULL after Facebook API connects user to account.

I have a asp.net page that is using microsoft ajax. I am using the MaskedEditTextBox control. The thing is that it works perfectly fine if the user does not connect to his facebook account using Open Graph API. As soon as he does that, i get these two javascript errors and my MaskedEditTextBox stops working completely. Has anybody gone...

Matching single character word with Scriptaculous Autocompleter

I'm using the Scriptaculous Autocompleter to search a set of film titles but it's not matching single character titles such as "M" even though it starts searching after one character has been entered. Any help would be really appreciated, thanks! ...

How do I create a content area (image gallery) that scrolls on mouseOver

Hi folks, I was looking to create an image gallery in my blog. However, I was wondering how possible it would be for the gallery to scroll through my images on mouseOver. Basically, when the user moves his/her mouse up or down the image gallery, the images scroll up or down accordingly. I have seen a few examples where it has been done...

MS Ajax IE window load event not firing

I've read countless articles on ways to implement a window load event handler and tried everyone. I can get this to work perfectly in every browser except IE (7 & 8). Can anyone see what might be the problem here? 1. $addHandlers(window, { "load": this._StandardsMasterWindowLoadHandler, "resize": this._StandardsMasterWi...