jquery

Better way or reusable code to populate an HTML element or create a select after a jQuery AJAX call

I find myself doing 2 things quite often in JS, at the moment using jQuery: The first is the populating of an HTML element, which might look like: $.get('http://www.example.com/get_result.php', { id: 1 }, function (data) { $('#elementId').html(data); }); The second is populating a select element with a JSON result, such as: $.ge...

Howto rotate image using jquery rotate plugin?

How do you rotate an image using jquery (www.jquery.com) rotate plugin (http://code.google.com/p/jquery-rotate/)? I have tried the following and it doesn't seem to work: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>View Photo</title> <script type="text/javascript" src="scripts/jquery.j...

How to find first element that is hidden by JQuery

hi, I want to show first element that is hidden by jquery. my html code is: <ol> <li>1</li> <li style="display:none">2</li> <li style="display:none">3</li> <li style="display:none">4</li> <li style="display:none">5</li> <li><a class="add">Add More ...</a></li> </ol> I want to show first hidden LI, each time tha...

jEditable - Activate edit of X by clicking on Y

I'm trying to use jEditable as an inline editing solution. The default behavior (click on the element to edit it) works quite well, but I would like to activate an element by clicking on another element. For example clicking on a.activateEdit will activate the next div.edit (obviously should be done using jQuery selectors). I've look...

jQuery Dialog Box

Hi Guys, Im trying to do a dialog box with jquery. In this dialog box Im going to have terms and conditions. The problem is that the dialog box is only displayed for the FIRST TIME. This is the code. JavaScript: function showTOC() { $("#TOC").dialog({ modal: true, overlay: { opacity: 0.7, ...

jQuery UI Dialog Box - Close Function

Hi Guys, I have a problem with the jquery-ui dialog box. The problem is that when I close the dialog box and then I click on the link that triggers it, it does not pop-up again unless I refresh the page. How can I call the dialog box back without refreshing the actual page. Have a look: $(document).ready(function() { $('#showTerms'...

jQuery: Easiest way to animate background image sliding left?

What's the best way to animate a background image sliding to the left, and looping it? Say I've got a progress bar with a background I want to animate when it's active (like in Gnome or OS X). I've been playing with the $(...).animate() function and trying to to modify the relevant CSS property, but I keep hitting a brick wall when tryi...

Jquery: My class does not function during second call.

I am new to jQuery.just learn and use it for 3 weeks until now. I have written a class to organize stuff. I call my method with more than 2 events,but the event does not work during my trigger of the second event. there's nothing wrong with the selector. I think there's something missing in my class. I don't know. please help! here's the...

jQuery And Drupal page load

Hi I would like to execute the jQuery $(document).ready() in a drupal site. While i know that i can just stick it in the index page , this is really messy and a hack. What i want to know is where is the correct location to put this, it would also need to be theme specific as i dont want all themes to use it. Thanks in advance for the ...

Prevent caching of AJAX call

It looks like that if I load dynamic content using $.get(), the result is cached in browser. Adding some random string in QueryString seem to solve this issue (I use new Date().toString()), but this feels like a hack. Is there any other way to achieve this? Or, if unique string is the only way to achieve this, any suggestions other tha...

JQuery AJAX Return Link Not Working

I have a problem in integrating PHP and JQuery: My main file is MyFile.html and the AJAX call file is ajax.php. The ajax.php function returns links to myFile.html as <a href Link.php?action=Function ></a> (i.e echo " <a href Link.php?action=Delete";) When I click the returned link from MyFile.html it's performing as expected. I nee...

jquery show()/hide() problem in Internet Explorer?

The following html code works in Firefox, but for some reason fails in IE (Label2 is not shown). Is that a bug or I miss something? Any help would be appreciated. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html> <head> <meta http-equiv="Content-Type" content="text/html; ch...

jQuery How do I get the div in this code?

Hi, How do I get the div from within this (the last) list item? Currently I have this, which is just plain ugly...any suggestions on a cleaner selector/ solution? var div = ul.append("<li><div></div></li>").contents("li:last-child")[0].children[0]; Thanks! ...

JQuery table sorter problem

I learned that by trying to use the tablesorter plug in from jquery the table needs to use the < thead> and < tbody> tags. I am using an html table, and I use the runat="server" attribute because I need to bind data to the table on the server side. but by using the runat= server attribute the code is rendered in a different way..instead...

jQuery delete all table rows except first

Using jQuery, how do I delete all rows in a table except the first? This is my first attempt at using index selectors. If I understand the examples correctly, the following should work: $(some table selector).remove("tr:gt(0)"); which I would read as "Wrap some table in a jQuery object, then remove all 'tr' elements (rows) where the...

Passing parameters to a JQuery function.

Hello, ive a problem using JQuery.. Im creating a HTML with a loop and it has a column for Action, that column is a HyperLink that when the user click the link call a JavaScript function and pass the parameters... example: <a href="#" OnClick="DoAction(1,'Jose');" > Click </a> <a href="#" OnClick="DoAction(2,'Juan');" > Click </a> <a ...

How to use jQuery

I have written jQuery Main.html, ajax.php. The ajax.php returns the link of images to Main.html Now In Main.html, I have Image1, Image2, Image3, etc. My Main.html <html> ... # ajax.php Call ... # Return Fields From Ajax.php </html> My ajax.php echo "<a href='src1'><img src='src_path1' id='fid1' alt='Name1' /></a>Click To View i...

How Load a PHP page in Same Window in JQuery

Dear All, I have Test.php and it has two functions: <?php echo displayInfo(); echo displayDetails(); ?> Javascript: <html> ... <script type="text/javascript"> $.ajax({ type:'POST', url: 'display.php', data:'id='+id , success: function(data){ $("#response").html(data); } ...

jquery UI Dialog and __DoPostback

Hi All I have a problem with the jquery-ui dialog in ASP.NET form, $("#pnlReceiverDialog").dialog({ autoOpen:false, modal: true, height:220, width:500, resizable :false, overlay: { opacity: 0.5,background: "black" }, buttons: { "Cancel": function() { $(this).dialog("close"); }, "Ok": function() { ...

Looking for a workaround for IE 6/7 "Unspecified Error" bug when accessing offsetParent; using ASP.NET AJAX and jQuery

I'm using jQuery UI's draggable and droppable libraries in a simple ASP.NET proof of concept application. This page uses the ASP.NET AJAX UpdatePanel to do partial page updates. The page allows a user to drop an item into a trashcan div, which will invoke a postback that deletes a record from the database, then rebinds the list (and othe...