jquery

Adding a class to an a element with a particular href using hash

Hi. I'm trying to add an 'active' class to a particular element based on the URL hash but it's not working as I expect. Here's my code: var hash = window.location.hash.substr(1); if(hash != false) { $('.products #copy div, #productNav li a').removeClass('active'); $('.products #copy div#'+hash+'').addClass('active'); $('...

Can $.getJSON() get PDF/Docx in Save Dialog

$.getJSON( dUrl, data:'{ a: 2, b: 3 }', function(data){alert(data);} }); Will making a $.getJSON() request be able to pop up the pdf/docx in a new window? if yes, could you please share more info on this.. I'm getting the pdf/docx file from Response stream into Fiddler. But need to find a way to push it to Save...

jQuery: Selector inconsistencies, can someone please explain what i'm doing wrong here

Why does this work: $("div.cat_rollout").mouseover(function(){ $(this ).removeClass().addClass("cat_rollover"); $(this).animate({ fontSize: "22px" }, 'fast' ); }).mouseout(function(){ $(this).removeClass().addClass("cat_rollout"); $(this).animate({ fontSize: "10px" }, 'fast' ); }); But this does not: $('.vp...

Catch clicks on file links (as opposed to page links) in jquery?

Hi all. I want to add an event to my users clicking on file links (as opposed to links to internal or external pages). Is there a simple way to just get file links with a jquery selector? Or, do you think it's better to put a class on my file links and just select on the basis of that class? thanks, max ...

Max height and width with jquery resize

Hi All I'm using the jquery resize to resize content on my webpage. It works, but I want that when the element reaches the desired height or width, it should stop resizing, how do I achieve this? Here's the code: $(window).resize(function(){ $(map).height(win.height() - 210); if($(window).height() == 300){ $(map).css(...

jQuery Load JSON

Hello, I've got a small dilemma, that should hopefully be easy to resolve. I am loading some data using jQuery/JSON/PHP-- essentially, the data being loaded are several <li> elements. The following code works correctly: function load_list() { $.getJSON('json/load.php', function(data) { $.each(data, function(k, v){ ...

Calling class methods within jQuery function

So I have some javascript class and in one method I use jQuery to bind function to click event. And within this function I need to call other methods of this class. In usual js function I did it through "this.method_name()", but here, I guess, jQuery redefines "this" pointer. ...

Flash application losing state after displaced to another div by JavaScript

Guys, I've a simple flash application that does counting on button click. I load it in a page and a javaScript code does some DOM manipulation to move it from one div tag to another. Problem: the state of the count is not preserved as the swf node is moved from one node to another. What I did: 1. I simply get the node using javascript...

jQuery click eventhandler issues.

I've build a site that has accordion sections that expand whenever someone clicks on the header section for that page, the click handler is placed on $('.section h2').click However, when a user is logged in as admin, there are 'EDIT' links applied to the header, so I only want the section to expand if the area clicked is not "a.edit-...

Suggest me a good place and an approach to get started and get good at jquery?

Possible Duplicate: Where can I find a tutorial to get started learning jQuery? What would be a good place to start with jquery ? I know javascript basics...I am really interested in learning jquery and saw a few basic tutorials online... But I wanted to know if anyone could suggest a good approach towards learning and some t...

run method using window.location with asp.net web forms

Is it possible to have a server-side click handler for a hyperlink? ...

jQuery: Detect if element exists

In my code I have the following html that gets appended to a List Item when the user clicks on a specific element. <span class="greenCheckMark"></span> Using jQuery, how would I detect if the element existed, and if so, not add another green checkmark? $('.clickedElement').live('click',function(){ //does the green check mark exist? i...

tabbing not working properly in jquery dialog

i have a jquery dialog with this configuration: $("#someForm").dialog({ modal: true, title: 'Registration', resizable: false, draggable: false }); $("#someForm").dialog( "option", "buttons", { "Sign Up": function() { doSomething(); $(this).dialog("close"); }, "Cancel": function() { ...

Text inputs with maxlength not validating with jQuery Validate

Hello I'm stuck with a problem using jQuery Validate. The thing is I have a few textboxes with their maxlength attributes set. Although they are not required, they still fail to validate when either empty or whitespace. Sample HTML: <input type="textbox" id="tbx1" maxlength="100" value="" /> Then, $('#tbx1').valid() returns false. Sh...

Cross Browser Forward/Back Event Detection

I am currently using the jQuery Address plugin and it works great for detecting when a user presses the forward/back keys. However, I don't need any other functionality from the plugin so it seems like a waste to load it. Is there another JavaScript or jQuery API call that will let you fire a function when the user presses the forward...

form action="javascript:block();" redirects to javascript:block(); url in firefox

Hi there, I have a function called block which simply return false; this is meant to stop the form being submitted so the ajax functions can capture its submit, however firefox seems to treat it as an actual url and loads the url javascript:block(); if i have action="javascript: return false;" then firefox doesnt even let the ajax fun...

Simple Jquery Slide show

I'm looking for a simple jquery slide show option that pulls photos from a directory. I'm not well versed in writing this this sort of thing myself and everything I've been able to find doesn't really do what I need (pull photos from a directory) or is over my head/lacks clear instruction. Any suggestions would be greatly appreciated. ...

Most useful jQuery native API functions

What are the top 5-10 most often used jQuery native API functions? (please do not suggest jQuery() function itself as there is no doubt this is the most often used one) If it is possible please also provide scenarious they cover. The reason to ask this question is my attempt to create a jQuery-like API to the Ample SDK JavaScript GUI Fr...

How can I unregister a handler set to jQuery.ajaxStart() function?

I tried doing $.ajaxStart(function(){}), but it does not replace it, but appended. Thank you for your help. ...

rewriting search suggest in jQuery

Hi All, First, I know that there are jQuery plugins for search suggest. The reason I'm asking this is because I wrote one for my specific needs and I am interested in learning how to make the script in jQuery (rather than just using a plugin). See code that I pasted to pastebin -- I hope that's ok. Original: http://pastebin.com/VFu...