jquery

use succes or complete in ajaxcall

Hello, My question is that I want to know what the difference is in the ajaxcall below If I substitute complete for success I get an empty responseText as the error says and with complete it works like it is supposed to Is it that success returns sooner then complete?? $("#formnaw").submit(function(){ var fnc = invoerFnc.attr("...

Referencing Javascript libraries with Tomcat

I am using Eclipse Ganymede and Tomcat 5.5. I would like to add some javascript and especially ajax functionality to a dynamic web project and need some help. I would like to use jquery (but I am open to other suggestions, if you tell me why another library would be better in this case, but I have chosen jquery because it is supposed to...

Using jQuery to limit the number of list elements

I have a list element containing a number of between 20-30 events. I only want to show 5 of those, and have a «More» link I can click to watch the the next five. It doesn't matter if the five next events are appended. Can't find a jQuery script that actually does this, or am I just blind? I don't want to use carousel plugins or anything...

Scrolling divs "left and right" and "up and down" using jQuery

Hi guys, I'm working on www.alwaystwisted.com. The page has 4 divs that scroll via the main links down or up depending on what div you're on. I need this to work within the div, but left or right depending on what div you're on. I can't work it out and it's frying my brain. <script type="text/javascript"> $(document).ready(function()...

Jeditable Async revert on error

Hi, I have been using the JEditable plugin for JQuery and I would like to return errors to the plugin to instruct it to revert to the previous value and also display an error to the user. I have this working using a synchronous ajax call but I would prefer to use asynchronous callback instead. The code I have to far is below. $("#edit...

How to stop html header content from being included in jquery post results?

I am using jquery's "$.post()" function to add a list entry to the mysql database, in php. $(document).ready(function(){ $(".theSubmit").click(function(){ var content = $("textarea").val(); var listn = $("input[name='list_name']").val(); var groupn = $("input[name='group_name']").val(); $.post("/sec...

jquery tablerow click function question

Hi, I have a function that allows users to edit a row in a table by opening the data in a modal. Right now the whole row will fire the modal. What I want is to isolate the last td that contains a link that fires a function that readies the data for processing. What happens is that when that last td is clicked the modal opens AND the r...

jgGrid doesn't respect my imgpath

I'm trying to use jqGrid, but it doesn't respect the imgpath, it always defaults to "\themes\default\images" I'm setting: imgpath: "..\..\Content\themes\default\images"; But it doesn't respect that and uses the default path, am I missing something? ...

jQuery XML Parsing/Traversing

Hello guys, I have the following XML- <rows> <row id="5"> <cell>Item1</cell> <attrs> <attr> <id>1</id> <type>CheckBox</type> <values> <value> <id>10</id> </value> <value> <id>11</id> </value> </values> </attr> <attr> <id>2</id> ...

How to select value of adjacent hidden input with Jquery?

When a user clicks on the img at the end of the following "li", I want to get the value of the hidden input two elements previous. <ul id="theLists"> <li> <input class="checkbox" type="checkbox" name="row"/> <input class="contentId" type="hidden" value="64" name="id"/> <div id="64" class="editable">Peanuts for me</div> ...

Jquery validation plugin and switching required field

Yup, basically, I am building a web form that need to provide different required form and validation function fallow by selected country. I am using <script type="text/javascript" src=" jquery-1.3.2.min.js" charset="utf-8"></script> <script type="text/javascript" src=" jquery.validate.js" charset="utf-8"></script> and here is my JS c...

how to group list elements using jquery

Hi all, Can somebody help me convert the following html <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> into this one <ul> <li class="li_group"> <ul> <li>1</li> <li>2</li> </ul> </li> <li class="li_group"> <ul> <li>3</li> <li>4</li> </ul> </li> </ul using jQuery? Tha...

What's the best way to include external content using php includes? (For web developers who love optimal practices)

I've checked lots of tutorials about including header, navigation and footer using php "include". But I ended up separating my html tags. For instance, my <div id="content"> is in "header.html" while it closing </div> tag is in the footer. This gives me some problem when I use jQuery and looks kinda messy. Is there a better practice to ...

Select Nth previous sibling in jQuery?

I'm trying to set up my jQuery selector but I'm not exactly sure how I need to write it. I've got a unordered list that looks something like this: <ul> <li>something</li> <li>something</li> <li>something</li> <li>something</li> <li class="last">something</li> </ul> Now I know if I want to select the last child I c...

Get current scroll position and pass it as a variable with a link?

I'll be honest, I'm way out of my depth here. I've created a pagination system where you click on a link it reloads the page and a certain number of list items are shown in an unordered list. When you click it again it'll reload the page and more items showing. Think how Twitter shows the tweets in your feed. The problem is when it relo...

Setting an XSLT variable as a javascript variable?

How would I grab an XSLT variable and use it to set a javascript variable? I'm working on a bit of AJAX and in order to make it work to the fullest I would like to be able to grab XSLT variables and use those to set the default values of some javascript variables that I'll then be manipulating with jQuery. ...

Why is a variable not being reset in my event handler?

Here's my code: $(document).ready(function () { var default_var = 2; var show_var = default_var; var total_var = 8; var increment_var = 2; var start_var = show_var+1; var end_var = show_var+increment_var; $("a[rel=more]").live("click", function(){ $("#timeshare-listings li:last").after("<li class='aj...

jquery id getting help

i want to put the id into the colorbox below this code nom works but the page with the link on it is $("#recent_activity").load("activity.php?id="+id+"&random=" +unique_requestid()); thats how it calls the page and the link is on that page. var id = $.query.get('id'); $("a[href='write_comment.php?act=write&id="+id+"']").colorbox(...

Javascript/jQuery string manipulation?

I'm trying to either grab only part of this URL or inject part of a string into it (whichever is simplest). Here's the URL: http://www.goodbuytimeshare.com/listings/min:1000/max:150000/agreements:rent,buy/properties:apartment,condo,hotel,resort/show:4/ I figure I either need to be able to tim it down to: /listings/min:1000/max:15000...

jquery insertbefore

I have a simple jQuery question. How come I can't do this? $("<div class='flora'></div>").insertBefore('</body>'); I just want to add a new div at the end of the HTML page. So I thought I'd use the .insertBefore method, but jQuery seems to not like to target the </body> tag. thoughts? Thanks! ...