jquery

sort combination of <li> and <div> using jquery

Hi, I am new in Jquery. I want to use sortableUI to my datalist. Each row in datalist contains text with serial number. I have used sortable ui successfully. But now I want move the text not the serial number while sorting. Here is my Example Code. The div displays the serial number at the top-left corner of each li. Now If I try to st...

How to access specific div child of certain class?

In my div i have a child div of class "someClass". I want to access that child by classname, not id. EDIT: Only in this particular div, not all the other divs with same classname ...

jQuery- Please explain to me Closure, variable context

Ok so I don't understand why Firefox is saying that the $("#canvas")[0].getContext('2d'); is undefined. I put it out of the function so that all of the function can access it but here the ctx is still undefined. (function($) { // Undefined var ctx = $('#canvas')[0].getContext("2d"); var x = 150; var y = 150; ...

How to return a JsonResult in ASP.NET MVC.

Hi folks, i have the following data as a string in my Action method: string json = "[[1,2],[3,4],[5,6]]"; Simple. When I call the Json view, it encapsulates the result in two double quotes. This stops the client side javascript from loading this result into a javascript object. eg. return Json(json); result => "[[1,2],[3,4],[5,6]...

having Jquery UI framework in TWebBrowser in Delphi

Hi: I am working on an application, lots of the UI elements will be in a TWebBrowser. So I thought I add a JQUERY UI to make it easy for me. I was able to insert JQuery and UI javascript file thanks to http://www.jasontpenny.com/blog/2008/11/21/jquery-in-a-twebbrowser-in-a-self-contained-delphi-app/ I am stuck at stylesheets, I did ...

how do call different css for corresponding browsers like using jquery

This is already asked http://stackoverflow.com/questions/848227/how-do-call-specific-css-for-specific-browser-using-jquery I want to use one css file for safari and other for Mozilla and other for IE ...

jquery and RegExp‬

I build a function thar replace a keyword in the HTML to a link. The problem is that when the keyword is in a link then it will replaced it. $(document).ready( function () { $("#content").highlight( "example", "<a href=\"http://www.example.com\"&gt;$1&lt;/a&gt;" );}); jQuery.fn.highlight = function (text, o) { return this.each( functi...

Store form data in MySQL with jQuery.ajax

Edit: I found the soluton for getting the correct URL. Se the solution in this thread. Hi, I'm having problems prosessing a form so that I can save it's data in my MySQL database. I'm using Wordpress as CMS. I've used this example: http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form I'm pretty sure that the source of my p...

adding jQuery click events to dynamically added content

I have a table with multiple rows and columns populated by php and mySQL. For some of the td's I'm adding jQuery click-events in the document.ready function to let the user change the content. But I also have an option for adding rows to the table and populating them manually. But since the rows I'm adding aren't there on the document r...

Perform JavaScript .replace in JQuery

How would I perform the following in JQuery? var elmOperator = document.getElementById(elm.id.replace('Include', 'Operator')); The ID that is being manipulated would look something like Criteria[0].Include. I am trying to create a variable for a related ID which is Criteria[0].Operator. Thanks in advance! ...

clientside localisation

I have a colleague who thinks this alert('<asp:Localize ID="ErrorAddingComponent" runat="server" Text="There was an error adding component: " meta:resourcekey="ErrorAddingComponent"/>' + errortext); is a good idea if we get an error from an AJAX call, the errortext is the parameter of the function called on error from a jquery ajax, ...

Getting element name based on position in DOM

Hello. I want to find the name or ID of a element where I got top and left position. I know how to use jquery to find the position of an element (Hovering over the div will trigger that position text will appear on screen): $(".item").hover(function () { var eleoffset = $(this).offset(); $("#mouse").text("Mouse - Top: ...

How to assign null value to Hidden variable in javascript?

I have a hidden input variable called str. I am assigning "abc" value to it. Then I try to assign null value or let's say null reference to it. But I couldn't. Edit part of code. Hidden Field... <input id="str" name="str" type="hidden" value="" /> I also use jQuery. if ($(str).val() == "abc") { $("#str").val(null); ...

Adding history support to ASP.NET / jquery web page

Hi, I've implemented a web page that loads content dynamically from the server via the jQuery.form plugin (for form POST requests) and via the standard jQuery load method (for all other requests). Now I'd like to add history support, to properly support the back / forward browser buttons. I've managed to do this for simple links, but ...

How to show popup message like in Stackoverflow

Exact Duplicate: http://stackoverflow.com/questions/659199/how-to-show-popup-message-like-in-stackoverflow or http://stackoverflow.com/questions/758906/how-would-i-implement-stackoverflows-hovering-dialogs I am trying to build this type of information box when user click on some link with the help of jquery. Please help. ...

Load Google Analytics from jQuery document ready?

The problem is that GA sometimes takes a little while to load, and my jQuery ready() functions don't run until it's done. I'd like to move the GA code itself to the end of the ready() function. I'm not looking for extra click tracking integration - I just want my ready() scripts to run first. My questions are: 1) Will moving the GA cod...

JQuery datepicker init the selector/field

Hi, is it possible to fill the input field with a date which uses the same format as i would select it with the datepicker? For example i have a value (e.g. new Date()) in my input field before i select a date with the datepicker and i want it to have the same format as i would select it. thx kukudas ...

jQuery XML parsing with namespaces

I'm new to jQuery and would like to parse an xml document. I'm able to parse regular XML with the default namespaces but with xml such as: <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"> <s:Schema id="Ro...

jQuery: More elegant if/else with selectors

I spit out this type of code frequently: if ($(this).val() == 'X') { $('#something').show(); } else { $('#something').hide(); } I'm not crazy about having $('#something') appear twice. Is there a more elegant way of expressing this? [Update] I phrased the question badly - I'm looking for a general solution, not ...

jQuery / Javascript replace <space> in anchor link with %20

I'm new to jQuery and i'm trying to write some code to go through the page and rewrite anchor links href attribute so that spaces are removed and replaced with %20. so far i have: $(".row a").each(function(){ $(this).attr("href").replace(/\s/g,"%20"); }); I've tried a few variations of this with no luck. ...