jquery

(simple) Jquery ajax not returning data

The alert box will display nothing, and not return any data from any URL when it should be showing the google page! Any ideas? I'm using POST because I'm trying to get it to send querystring data as well. $.ajax({ type: "POST", url: "http://www.google.com", success: function(msg) { alert("Data S...

How do I use a JS variable within JSON?

I'm attempting to create a postcode lookup JQuery script that'll be able to be used multiple times on a page, without having to duplicate the script for every address on the page. The Find button has the class "postcodeLookup" and the attribute "address" which is how I intended to get the script to populate the right address (it uses JQu...

upload file with jquery

i need to upload file with jquery. i now about uploadify plugin, but i don't want to use such a big plugin for it. i have an idea, how can i do it, could you tell me will it work? if i pass the <input type="value"> input's value as javascript variable to some.php file via ajax, and then make upload there, will it work? Thanks? ...

link jquery animations

I want to link several jquery animations one after the other but I'm having some issues. Let's presume this example: <h1 class="first">This is the first paragraph</h1> <h1 class="second">This is the second paragraph</h1> I want to turn the first one red then back to black then pass on and animate the second one the problem is i do...

How to randomise and mimic a rollover in jquery?

Hi, I have a JQuery script which acts as a simple image rollover with a nice fade effect. Here is a test version of the current script in action - http://fi-testing.co.uk/SO/rubix-cube.html As you can see, there are 9 blocks, the client wishes for the rollovers to occur randomly (without a hover) to kind of create a ripple/pulsating e...

Caching of jQuery references

Is it always best practice to use: var $this = $(this); Or is $(this) cached and therefore the above line is just for saving two characters? ...

jquery auto appending text

my aim is that there is a textbox , 1)In the textbox the domain is already written. 2) When i enter some text in the textbox the domain should append to it like domain=abc.com text written = c://inetpub/cms/ the textbox should have c://inetpub/cms/abc.com with abc.com auto appended. abc.com should not be editable ...

How to debug an IE bug

Hi, The following code works in Google Chrome and Firefox, but don't work in IE8. I don't know why, it's a tooltip and uses jQuery. It's not my code. When you run on Chrome or Firefox, hover over the element, the tooltip shows. In IE the tooltip doesn't, seems like a problem with the hover statement. I tried step by step debugging but j...

Using jquery, how do you reorder rows in a table based on a TR attribute?

I have a table with rows similar to the following. These rows get updated from time to time via jquery calls. Using jquery, how would I construct a function that reorders these table rows based on the myAttribute value putting the highest myAttribute value rows at the top and the lowest myAttribute value rows at the bottom? There could b...

jQuery next (ish) selector

Hi Guys. I've been banging my head against a wall with this code all morning and finaly decided to come here for some help. I have the following markup. <h3 class="element-title">Summary <span class="cs">THIS IS AN IMAGE</span></h3> <textarea class="edit-mode" id="summary-<?php echo($randomId); ?>"><?php echo(br2nl($erow['summary']))...

setting focus on text-box

I am using jquery accordion effect when the clicks on a particular div the content of div appears ,i need the focus on a text-box inside the div? ...

jQuery mouse out and not hiding a particular element

Hello there, Let's say I've got two elements: an anchor which causes an occurence of a particular div. In that single case I'm not able to wrap these two into a parent container, thus the whole markup has to be as following: <a href="#" class="trigger">click me</a> <div class="info">info displayed on trigger hover</a> The very basic q...

how to calculate height of elements inside a div in jquery ?

I have a div which contains number of elements which user can drag and drop to rearrange inside. Also, he can add new elements from tool bar. I want to increase height of outer div to wrap all those elements. Now they overlap on footer. The challenges I fighting with are - 1. How to find elements which are placed below other. All the el...

How to display all images when a link is clicked by using JQuery, PHP & MySQL?

I have this script that displays ten images or less by default but when a user clicks the <a> tag link it displays all the users images. Is there a way I can display all the users images by having them slide down when a user clicks on the link <a> link instead of refreshing the page using JQuery or PHP? Here is the php code. if(isset...

jQuery dynamic tabs - animating borderTopColor breaks css

I am using jQuery dynamic tabs. I have the following set up for hover and selected effects: /* normal tab */ .ui-tabs .ui-tabs-nav li { border-top-style: solid; border-top-width: 3px; border-top-color: #fff; } /* hover tab */ .ui-tabs .ui-tabs-nav li:hover { border-top-color: #f00; } /* selected tab */ .ui-tabs .ui-t...

jQuery tooltip clickable?

Hi, I'm using this tooltip plugin: http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ Is there any way I can make the tooltip clickable? I don't want the tooltip to disappear when I try to mouse-over it. If not, what other jQuery plugin do you recommend that will allow clickable tooltips? One feature I NEED is the ability to ...

Javascript Draw line with jQuery

Please see my code here http://jsbin.com/ijoxa3/edit var drawHorizondalLine = function(x1,y1,x2,y2, color) { var width = Math.abs(x1 - x2); var posX = (x1 > x2) ? x1 : x2; var id ='c_'+new Date().getTime() var line = "<div id='"+id+"'class='line'>&nbsp;</div>"; $('body').append(line);...

how to toggle addClass and removeClass?

my code: <a href=# onclick="obj.addClass('fliph'); return false;">toggle</a> i want click toggle to obj.addClass('fliph'),then click again run obj.removeClass('fliph'). how to fix my code? thanks all! :) ...

Drupal: Loading AJAX content in Drupal

hi, I've recently been told to use Panels to dynamically load content into different sections with Drupal. However, I've just realized that there is an easy way to do it, I've added this jQuery code to all menu items: $('.menu a').click(function(){ $('#content').load($(this).attr('href') + " #content"); return false; //to avoid...

JS popup element to dim surrounding site

I'm not really sure how to describe what I want to do, but I'm sure I've seen it on many sites before. Basically, when someone clicks a link, it should show an element which contains some text and dims down the rest of the site so that the users focus is directed towards the element. It shouldn't let users click in the dimmed area eithe...