jquery

what does jQuery data() function do

I have not found what is the use of jquery function data(). Can anyone give me some example of how it can be used? ...

Need help with jQuery to JavaScript

I want to rewrite this line as vanilla JS so it is applied quicker (and before the downloading of the jQuery library). The line is $(document).ready(function() { $('body').addClass('javascript'); }); If I added it to the html element instead, would I be able to leave off the DOM ready part? One problem with this though is the validato...

how to exit from setInterval in Jquery

i need to exit from a running interval if the conditions are correct: var refreshId = setInterval(function() { var properID = CheckReload(); if (properID > 0) { <--- exit from the loop---> } }, 10000); ...

disable click event for all links except the links inside a div

I have a page with some links inside a div and some outside that div. <div id="navigation"> <ul> <li> <a href="/Home/Index">Home</a></li> <li> <a href="/Home/contactus">Contact Us</a></li> </ul> </div> <a href="/User/SignIn">Sign In</a>...... I need to disable the click event for the all th...

Creating object to get expected Json

Hi. I am working in GWT. Currently my requirement is simple. I want a JSON in following format: {":question" : { ":id":"123", ":question_text":"some text", ":nodes":["123","111"]}} I need to create an object in GWT code such that when I use jquery's json plugin to parse that object; I should get above listed json. This json needs to ...

jQuery-How to improve this code

Hi All, I have one jQuery code and need some help from u guys to improve performance. HTML: <div class="mydiv"> <div class="indiv"> <span> myspan </span> <a href="#"> a1 </a> <a href="#"> ...

set/change value to drop down using jquery

how to set or change value to drop down. I'm having a drop down list which is initially not selected a value. How can i select a value using jquery ...

Triggering onclick event using middle click

I am using the onclick event of a hashed link to open a div as a pop up. But the middle click does not trigger the onclick event but only takes the href attribute value of the link and loads the url in a new page. How can I use middle click to open the div as a pop up. ...

Use of $.data(li, "ac_data", data[i]) from function fillList() of jquery-autocomplete

I'm using the jquery-autocomplete plugin of Jörn Zaefferer and I can't understand the use of this line in the fillList() function: $.data(li, "ac_data", data[i]); Please help me. Thanks. ...

Jquery form validation - available options

I am using form validation from http://docs.jquery.com/Plugins/Validation. Here you set the form validation declaratively by setting the class on the form element. I cant find the full list of all the classnames which fire validation and would like to get them. ...

Strange jquery post problem, wrong post url is used

I have a form I wish to submit via ajax usind the jQuery $.post command. The form looks like this: <form action="/wine/merlot/reviews" class="new_review" id="new_review" method="post"> And the jquery call is: $(document).ready(function() { $('#new_review').submit(function() { $.post($(this).attr('action'), $(this).serialize(),...

Can I wrap a javascript event in a jQuery event?

I have this code: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; <script type="text/javascript"> $(function(){ $('a.one').click(function(event){ event.preventDefault(); }); }); function test(event){ even...

Problem updating sortables in jquery

I have a page where i have a sortable list of items (a div with class 'sortable'), which can initially have some items in it or be empty. The items are in another list on the page, and have an 'add' button. When add is clicked, they go into the sortable list. When the page loads with some items in the list already, the sorting works...

Calculating difference between username and email in javascript

Hi, for security reasons i want the users on my website not to be able to register a username that resembles their email adress. Someone with email adress [email protected] cant register as user or us.er, etc For example i want this not to be possible: tester -> [email protected] (wrong) tes.ter -> [email protected] (wrong) etc. But...

Zend framework forms and jQuery selectors - how to select by... ID?

So I've got this issue with forms generated by Zend Framework. As we know Zend is using this format for ID of HTML elements, i.e: contactDetails[name],contactDetails[email] etc. First of all, why Zend is using invalid HTML to generate forms? There should be no brackets [] inside ids, according to W3C: ID and NAME tokens must begin ...

Jquery Fadeout fadein with li elements problem

Hi, i have the following unordered list: <ul id="#lastcompanieslist"> <li style="display: none;" page="0">whatever 1</li> <li style="display: none;" page="0">whatever 2</li> <li style="display: none;" page="0">whatever 2</li> <li style="display: none;" page="0">whatever 3</li> <li style="display: none;" page="0">whatever 4</li> <li st...

How to access the content of an iframe with jQuery?

Disclaimer I struggled to find the answer yesterday, so I thought I'd post the answer here for everyone. How can I access the content of an iframe with jQuery? I tried doing this, but it wouldn't work: iframe content: <div id="myContent"></div> jQuery: $("#myiframe").find("#myContent") How can access myContent? Similar...

how to make an ajax search

I'm trying to make an ajax search for a website, HTML : <form id="search" method="post" action="search.php"> <input type="text" name="search" /> <input type="image" name="submit" alt="search" src="images/buttons/search.gif" /> </form> $(function() { var search_text = ''; $('form#search input[name=subm...

jQuery draggable droppable compatibility issue with firefox and ie

Hi, ok bear with me, this is one of those long ones. I have a table of values which stores ID and Field. <asp:DataGrid runat="server" ID="dgFields" AutoGenerateColumns="false"> <Columns> <asp:BoundColumn DataField="ID" Visible="true" HeaderText="ID"></asp:BoundColumn> <asp:BoundColumn ItemStyle-CssClass="draggable...

JQuery $.get or $.ajax call PHP script on server that requires 2 parameters

Good morning all - new to Jquery $.get and $.ajax and your help is appreciated. I have created a PHP script functionexchangeRate($exchangeFrom, $exchangeTo) that uses uses two parameters. I am trying to call this PHP script with Jquery's $.get function but I can not figure out how to send the two parameters (I feel like a turkey - pu...