jquery

Extract href from html with jQuery

I'm trying to get the value of href from an anchor. The code looks like this var html = "<a href='http://path/to/file.pdf&#39;&gt;File&lt;/a&gt;"; alert(jQuery("a",html).attr("href")); The only output I get is 'undefined'. I'm want to get "http://path/to/file.pdf". Any help is greatly appreciated. ...

JQuery validation plugin: $("#").validate() is not a function

Hi, I am using jquery-1.4.2 library and jquery.validate.js plugin to validate a very simple form. In the head section, I have following code: <script type="text/javascript" src="scripts/jquery-1.4.2.js"></script> <script type="text/javascript" src="scripts/jquery.validate.js"></script> <link rel="stylesheet" type="text/css" href="css/u...

jQuery: load response Document into div

I get an asyc response from the server that contains an HTML that I would like to display: $( document ).ready( function () { var options = { success: showResponse, error: errorHandler, type: 'post' }; // bind to the form's submit event $('#captureForm').submit(funct...

Is it possible to use jQuery create a page transition with a div preloaded so that there is no flicker between loads?

Here's the situation: I'm working on a site where the navigation is located on the bottom of the page on the home page, but on the top of the page for all other pages. I've set up some jQuery so that when a link is clicked to any of the subpages, the navigation will slide up to the position is is located on all other pages prior to tran...

Stop window.event with Javascript window.confirm?

I am trying to have a confirm box come up when the viewer tries to close the window, that allows the user to stay on the current page (by click Cancel), or continue closing the window (by click OK). My code is as follows... <script> function confirm_exit(){ var message = window.confirm("My message."); if (messa...

In jQuery, is prepend().hide().fadeIn() not so smooth?

in jQuery, will the following be not so smooth? $('<a href= ... ><img src= ... /></a>').prependTo($('#someDiv')).hide().fadeIn() Will it actually shows the added element for a split second, and then hide it, and then fadeIn ? Then will the animation be not so smooth? Is there any better method? Or the following? $('<a style="disp...

cannot get thickbox to open / tb_show function ignored 2nd attempt

I have two links that should open up thickbox's in iframes but only one works (the one with the id of product_photo_zoom_url2). I have the following jquery code that works when this code (in first code box) s removed from the markup. This code loads a picture zoom function. See complete markup below. All that happens when the first zoom ...

does copying a div duplicate a form

I have a div on my page that acts as a shell to store other divs. The page loads and the shell is hidden & empty. On a jQuery event I show the shell and fill it with the triggered div. More often than not, the triggered div happens to be a form. if I do this: $('#lb_content').html($('#' + div_id).html()); that duplicates the form an...

why can't this javascript function be found

i have some javascript code that is supposed to run on document.ready but i keep getting an error in firebug saying the onLoad() method can't be found. here is the code (which clearly shows that method there): <script type="text/javascript"> var tl; function onLoad1() { debugger; var eventSource = new Timelin...

In jQuery, can you fadeOut() without losing the element's real estate? (invisible vs display: none)

Because I need to fadeIn() another element of the same size back in, is there a way to fadeOut() the element so that the space is kept, so that the other elements are not re-flowed for a split second and then the fadeIn() will bring back another element with the same size? ...

jQuery - click (almost!) anywhere to hide div

Hi Folks I have a search input box that appears upon rollover of a button. Rather than having its own close button I would like to be able to click anywhere on the page to re-hide the Search. If I attach a click handler to the document this works fine but the problem being is that the search itself is part oofthe document. So if you c...

Jquery WCF vs Pagemethods

I am at the early stages of developing a web site using Jquery. I am wondering whether to use Pagemethods or WCF service class. I saw in one of the SO answers which says to use WCF in all future requirements as much as possible. Highly appreciate if anyone can explain what are the deciding factors and security concers. ...

how to using "For" instead of "each" function in jquery

hi everybody! Today i'm very stack with a Work and jQ. I was get a morning for it but i can't resolve it :(. My Work here: <div class="container"> <p class="test">a</p> <div> <p class="test">a</p> </div> </div> In normal, i can using jQ with each function for select all <p class="test">a</p> EX: $(".test").each(...

How to parse a string in jQuery

I'd like to parse the following string which is a time (HH:MM:SS): 00:00:00 Does anyone know how I can get the Hour, Minute, or Seconds values? Thank you! ...

Submit Search query & get Search result without refresh

Hi, I want to submit search query form & get search result without redirecting/reloading/refreshing on the same page. My content is dynamic so can not use those "submit contact form without refreshing page which replies back on success" I am newbie, help would be appreciated. Thanks. ...

jQuery ValidationEngine and MaskedInput

Is anyone using both of these plugins? We're using ValidationEngine to do inline-validating on blur. Works great. We're using MaskedInput to mask fields. Works great. However, any field that is set to use both only handles the MaskedInput. The MaskedInput seems to interfere or override the ValidationEngine event. Anyone run into th...

Suggestion for online html code generator from richtextbox on webpage

Hello guys, do you any opensource proyect who gave me the posibility to have an very simple online richtextbox were an user can add strong, emphasis and other simple modifications to text and when user finish hit the submit button and the code generates a html result. For example, here this guys have a script who made almost all what i ...

Why is the rowIndex property of a jQuery returned element.parents("tr") row undefined?

If i get a reference to an elements parent as follows: function findParentRow(srcElement) { var curElement = srcElement; while (curElement && (curElement.tagName != "TR")) { curElement = curElement.parentElement; } return (curElement.tagName == 'TR' ? curElement : null); } I can: var parentRow = findParentRow(...

Get the selected text of a web page in google chrome extension

Hello, I am on google extension development, when a popup is clicked, the input box present in the popup.html file should contain the selected text of the current webpage. example textbox, <input id="searchBox" type="text" /> when a text is selected in a webpage, the textbox should contain the selected word. I tried with chrome.exte...

apply shadow for header <h3> tag using jquery..

Is it possible to apply shadow for header <h3> tags jquery.... Here home,Manage users,Enquiry and reports are headers and i would like to add shadow to it... I looked for jquery shadow plugin which has div samples but how to apply the same for header tags? <script type="text/javascript"> $(function(){ $("#exampleDiv").shad...