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'>File</a>";
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.
...
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...
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...
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...
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, 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...
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 ...
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...
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...
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?
...
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...
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.
...
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(...
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!
...
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.
...
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...
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 ...
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(...
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...
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...