jquery

difference between $("#id").load and $.ajax?

hello, does anyone know what is the difference between $("#id").load and $.ajax? ...

import text file into mysql using jquery

i want to import .txt file values into mysql using php and jquery/Ajax without page refresh. with following format. for example text file is : user@emaill;user name;gender user1@emaill;user name;gender user2@emaill;user name;gender user select file and press Process Button. once it start processing JQUERY/AJAX s...

Why does $('#id') return true if id doesn't exist?

I always wondered why jQuery returns true if I'm trying to find elements by id selector that doesnt exist in the DOM structure. Like this: <div id="one">one</div> <script> console.log( !!$('#one') ) // prints true console.log( !!$('#two') ) // is also true! (empty jQuery object) console.log( !!document.getElementById('two'...

jQuery scroll to target from current position not top

I'm looking for away to scroll the window to a specified position from the window's current position, NOT from the top of the window. From the bit of playing around I've done I can't find a way to do this. I've also tried messing around with the scrollTo plugin and it exhibits the same behavior. They all reset the window's position to t...

How to show more list using jquery

I pull out messages and display with PHP/MySQL. Now I want to show only 10 lists. And I want to add button. When I click this button it slides down smoothly and shows another 10, total 20 messages. And if I click the button it again slide down and shows total 30 messages. Could anyone teache me how to do it with jquery please? Thank...

why does jquery ui dialog break asp.net mvc's default model binding . .

i just took the demo jquery UI dialog (model dialog) sample and tried to include it in my asp.net mvc project and i have observed something weird. If you have content inside a jquery ui dialog div tag, the default model binder doesn't pick it up during posting to the server as it if removed these elements from the form the full view...

How to locate Jquery issues affecting internet explorer

Hi, I've just started trying to learn javascript and jQuery so excuse my simpleness, please!... I've created a webpage which works perfectly well in most browsers apart from Internet Explorer... The page loads and displays perfectly well, but seems a little unresponsive compared to Firefox, for example. The page is rather large as ...

Posting screen width using jQuery

Using this code var sw = window.screen.width; $.post("http://www.example.com/track.php", {result: sw }, "html"); and $_SERVER['result']; in the server I'm trying to get the sreen width but it does not work. It is something wrong with the "result". I'm new in Javascript and jQuery... http://api.jquery.com/jQuery.post/ ...

Jquery Tablesorter header

Hi I am using tablesorter and would like to make a slight amendment to how it works. Currently tablesorter sorts a column whenever a user clicks on any part of the cell. Eg. <th>One</th> <th>Two</th> <th>Three</th> I don't particularly like the default styling of the sorter, so what I have done is made some css buttons and placed th...

jQuery 1.3 vs 1.4 (Performance)

jQuery 1.4 released recently and the new website shows some performance charts where 1.4 is clearly better, but has someone already done an analysis of overall performance improvement of 1.4 vs 1.3? If not, how do I profile both on my sites/pages, are there any tools? Can't wait to find out how fast is 1.4 compared to the previous versi...

Greasemonkey @require jQuery not working "Component not available"

I've seen the other question on here about loading jQuery in a Greasemonkey. Having tried that method, with this require statement inside my ==UserScript== tags: // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js I still get the following error message in Firefox's error console: Error: Component is not availa...

Tracking outgoing links with Javascript and PHP

I have tryed it using jQuery but it is not working. <script> $("a").click(function () { $.post("http://www.example.com/trackol.php", {result: "click" }, "html"); }); </script> <a href="http://www.google.com"&gt;out&lt;/a&gt; ...

Will this kind of code always work?

$('#container').append('<div id="theonly">tests</div>').find('#theonly'); and $('#container').html('<div id="theonly">tests</div>').find('#theonly'); I'm worried sometimes the dynamically generated elements is not available at once,am I wrong or not? If I'm not wrong,what's the solution to cover all cases? EDIT Can someone come u...

two jquery issues with animation and data

Ok so I am basically working on a photo gallery. The first issue I have is with $.data. When I am setting up the images through my plugin I do this: $('.img').each(function(){ $(this).data('original', { width:$(this).width(), height:$(this).height() }); }); Then when I want to animate the image to its full size i do this: $(this).a...

How to empty the message in a text area with jquery?

--UPDATED-- I want to empty message in a textarea in callback. Can anyone tell me how to empty it please? I tried $("#message").empty(), but it does not empty it. Thanks in advance. <form method="post" id="form" action="index.php/admin/messages/insertShoutBox"> <input name="user" id="nick" value="admin" type="hidden"> <p c...

Make div appear with jQuery

Hello, I have a div that is hidden and being declared this way: <div id="divLogin" style="visibility:hidden;"> My idea is to use jquery to make it slide in so I created this code: $("btEnviarAcesso").click(function () { $("divLogin").slideToggle("slow"); }); but it is not working... Does someone have any ideia why?? ...

How can i pass $.ajax object to another function?

This function will be using in general ajax calss: function f_AjaxFunction(_param) { var objectWillReturn; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: 'WS/wsGenral.asmx/f_QueryAndGetResultAsJson', data: "{_sParam:'" + _param + "'}", dataType: "json", ...

getting time remaing from file upload with php

i want to upload a file in a way that user can see how many time is remaining from upload...with php and jquery $.ajax(); ...

jQuery attr is not working

I have image in container and I have set width and height attributes for this image in CSS. But I need to add loading image and it is smaller than actual pictures that will be shown in container, so I need to change size of image while it is loading. But when I set width and height attributes, image is shown in size that is set in CSS. ...

check if file exist in javascript?

i have to display auto-generated images from a folder in html. how can i check if file exist in javascript/jquery so i can do a for-loop and display them all. they will be numbered 1.jpg, 2.jpg and so on. ...