jquery

How to print the contents of the JQuery ThickBox plugin?

I have implemented the ThickBox Plugin and I am retreiving the content from using an AJAX request. The print link is printing the page behind the Thickbox. Is there a way to print the actual content? I am using the following anchor tag and javascript link: <a onclick="PrintPage()">Print</a> javscript: function PrintPage() { ...

Sort XML nodes with jQuery and then join them

Here is the basics of the schema... there is more than this, but this gives a good idea of what I need to accomplish: <item> <name>This is some product name to sort with dictionary sort.</name> <price value="29.99">$29.99</price> </item> <item> <name>This is some product name to sort with dictionary sort.</name> <price v...

Please Help: This feature doesn't play well with jQuery

I have this feature(netwaver.com/projects/featured-content-gallery-pligg-module/) on my site but it is not working well with jQuery plugin. I was researching and reading online and it says it to change the "$". Could some please assist me with this? But the "$" symbol is inside like: {$featurify}..how would that work? All the example I ...

jQuery filter SELECT options based on Radio PRE - selected on load

So I posted the question yesterday (Link) and got the answer I needed but for the life of me I can't get this to happen if the value is selected on the body load. it only works if the user clicks the radio then it filters the options. HELP Please!!! the Function jQuery.fn.filterOn = function(radio, values) { return this.each(funct...

jquery("foo bar") vs jquery("foo").find("bar")

I'm trying to traverse an xml document. This doesn't work (zero results): jquery("foo bar") this does work: jquery("foo").find("bar") any idea why? ...

Using jQuery to copy value from image source's file name to process and paste into html?

Hi i'm trying to use jQuery/javascript to make my life easier. I'm trying to use it to auto fill in the various html elements with the name of the place and country which comes from the file name of the image. Below is a sample of some of the html i have to work with: <div class="boxgrid"> <a href="gallery/angkor - cambodia.jpg" title="...

Tab selection using jQuery in MVC

I have four tabs set in my view as follows <ul> <li><a id="#tabs-1">Case Summary</a></li> <li><a id="#tabs-2">Patient</a></li> <li><a id="#tabs-3">Physician</a></li> <li><a id="#tabs-4">Site</a></li> <li><a id="#tabs-5">Journal</a></li> </ul> What i need to do is, be able to have focus on the tag my controller acti...

Rebind a listview from a jQuery iframe

I have a listview that includes links to open an iframe with jQuery and thickbox. This new window allows the user to edit the field information with the iframe. Update button - <input type="submit" name="bUpdateDate" value="Update" onclick="self.parent.location.reload(true);self.parent.tb_remove();" id="bUpdateDate" /> This refresh...

jQuery: Parse/Manipulate HTML without executing scripts

I'm loading some HTML via Ajax with this format: <div id="div1"> ... some content ... </div> <div id="div2"> ...some content... </div> ... etc. I need to iterate over each div in the response and handle it separately. Having a separate string for the HTML content of each div mapped to the id would satisfy my requirements. However,...

What is your favorite feature of jQuery?

I just had the jQuery epiphany the other day and still feel like there is tons of power in it that I'm not utilizing. So that said, what is your favorite feature of jQuery that saves you time and/or makes your client side applications that much more cool or powerful? ...

Prevent Users from submitting form by hitting enter

Well I have a survey on a website, and there seems to be some issues with the users hitting enter (i don't know why) and accidentally submitting the survey (form) without clicking the submit button. Is there a way to prevent this? I'm using html, php 5.2.9, and jquery, on the survey. ...

How to get the index of an element without 'this'?

I have a form that looks kind of like this: <div> <div class="contact"> <h1>Person's name</h1> <!-- more stuff goes here --> <form method="post" action="myurl"> <input type="submit" value="go" /> </form> </div> <div class="contact"> <h1>Another name</h1> <!-- more s...

How to preload a div combobox in jquery

i have code as follows: $("#item_select").change(function() { var params = $("#item_select option:selected").val(); $.post('/account/ar_form.php', {idata: params}, function(data){ $("#message_display" ).html(data); }); }); This is a dropdown that uses /account/ar_form.php to display html in the div correctly. B...

Truncate width function not working when passing integer

I'm trying to create a universal function that I can call from multiple places to truncate long text recursively to fit a predefined pixel width - using jquery. Here is the code... function constrain(text, original, ideal_width){ var ideal = parseInt(ideal_width); $('span.temp_item').remove(); var temp_item = ('<span class="temp_...

Checking if there is any textNodes in body using jquery

Hi, I need to check in some fast way if there is any text nodes on page, excluding white space. Preferably, I'd like to see if there is a way to do this with jQuery, and to be cross-browser. Thanks ...

how do i block or restrict special characters from input fields with jquery?

How do I block special characters from being typed into an input field with jquery? ...

How come I can add objects using appendTo but not append in jQuery?

How come this works: var items = []; $.each([1,2,3,4], function() { items.push($('<li />').html('test' + this)); }); // clearing/appending as two seperate calls $('ul').empty(); $(items).appendTo('ul'); but this doesn't? var items = []; $.each([1,2,3,4], function() { items.push($('<li />').html('test' + this)); });...

jQuery problems

Hello guys, Below I present you some code which has completely been butchered by me. $(".gig").hover(function() { var id = $(this).attr("id"); var time = $(this).attr("title"); function () { if (time > 0) { var answer = $('<div class="roll">Are you attending? <a href="' + id + '">Yes</a></div>').hide(); } else { va...

Truncate text with jQuery based on pixel width

I'm trying to use jquery to write a fast function that calculates the pixel width of a string on a html page, then truncates the string until it reaches an ideal pixel width... However it's not working (the text doesn't truncate)... Here is the code I have: function constrain(text, original, ideal_width){ var temp_item = ('<span...

Improving Efficiency in jQuery function

The while statement in this function runs too slow (prevents page load for 4-5 seconds) in IE/firefox, but fast in safari... It's measuring pixel width of text on a page and truncating until text reaches ideal width: function constrain(text, ideal_width){ $('.temp_item').html(text); var item_width = $('span.temp_item').width(); var...