jquery

i want to get the attribute value to the same element

i used this line of code but it didn't work $("a#link").attr("href",$(this).attr('tempref').val()); ...

Jquery CustomSelect Plugin problem - missing something basic

Hello all, I was thinking of using this customselect plugin here: link text for one of my projects. I just want to retrieve the value of the element on an event - preferably a click event. The select box made by the plugin is basically just a jquery object. So, it is being assigned an "id" dynamically. <script> var ddlObj1=$("#testdiv...

Add a row on top of table generated by javascript

Hello all, I made a mis calculation in a table structure. The code beneath is for a lotto game (a known piece of code I think ;)) Is there a way to add a row on top of the table filled with a numbers? I really don't know how to do this. http://www.coldcharlie.nl/lotto/ <script type="text/javascript"> (function() { var players = { ...

DRI in jquery? - n00b question

can someone tell me how to make and call my own jquery functions? (im an absolute front end noob) take this example code :- <script> $(document).ready(function(){ $.getJSON("http://127.0.0.1:8000/json/storylist/", function(data){ $.each(data.stories, function(i,item){ $row = item.title; $('#sto...

JQuery Selector for target element

I have a bit of JS using JQuery function removeTag() { $('{...}').doSomething(); } $(document).ready(function() { $('.RemoveTag').click(removeTag); }); Is there anything I can replace {...} with to give me the element that was clicked? Kindness, Dan ...

find last names in url after # - jquery/ javascript

Hey Is there a way to get the last names after # in the url in jquery/ javascript I want to find the names #prices and make an if statment if( the_last_name == 'prices' ) // do something I need js/jquery to find a way to get urls last name ( and check it on the if statment /the_last_name) ...

jquery set html from select value not working

I have not used jquery much yet and not very familiar with it. Trying to do the below: // JavaScript Document $(document).ready(function() { $('#day').change (function () { //next to lines work here but not if placed after $.get var day = $('#day').val() ; $("#test").html(day); $.get('http://www.sharingizcari...

Issue with jQuery $.get() in IE

Hi! I am working on a small chat application that uses jQuery to get some info from a PHP file. The output of the file is a whole bunch of HTML data. The script works just fine in FF but not in Internet (f***ing) Explorer, lol. The code looks like this: $.get("index.php", {p: "chatData", type: "regular"}, function(data){ startPoin...

More efficient jQuery

I have the following code that controls the presentation of an interdependent group. The current code works, I'm wondering if there is a way to streamline the code so less is duplicated. $('div.locUpd').hide(); $('div.locDel').hide(); $('div.addLocation').hide(); $('a.edit').click(function(){ $(this).parent().nextAll('div.locUpd'...

jQuery: animate text color for input field?

I've got this really simple piece of code that I thought was the correct way to get jQuery to animate the text color for a given input field. $('input').animate({color: '#f00'}, 500); But it won't work. However, I can change the text color: $('input').css('color', '#f00'); I've tried this in both Safari 4 and Firefox 3.5 with the ...

Using JQuery to activate a popup using image name.

Hey guys, I am trying to use JQuery to manage some popups. This page I am building will have 15 projects, each which is a thumbnail contained within a DIV. Each DIV has a Name attribute so I would like to have JQuery find the name of the DIV and activate the hidden popup with the same name that is contained within the ID… Currently I ha...

JQuery performance with many plugins?

I've been using JQuery for a while, but primarily without plugins - I'm now looking to do a project which could take advantage of a bunch of plugins - Are there any performance penalty to using a lot of plugins in a project - Lets say something in the order of 10-20 plugins? And how will the performance be affected if JQuery and it's pl...

How to move the textbox viewport when gaining focus?

Hi, I have a textbox that may contain strings larger than the textbox size. When I'm typing, the textbox "viewport" always moves to show the last character I typed (for example when you write a very large title in a SO question). a The problem is that if the texbox loses focus, when it is focused again the viewport always is set at th...

JQUERY combine 2 sloppy lines into one - with some type of JQUERY Evaluate?

I have the following 2 lines of code: var minusID = settingID + '-minus'; $('#' + minusID).removeClass("selected"); How can I efficiently combine this into one line? Thanks ...

Display tag only when page is scrolled at top

How do I detect if a user scrolls downwards with jQuery? I want a fixed div to show only when the browser is within 300px of the top. When the user scrolls down past the 300px mark, it should disappear. When the user scrolls back to the top, it should hide. How do I do this? ...

jQuery next page

Hai all i need to know how i can make next page in jQuery. i am crating a wall, and here i have a page limit on 10, after 10 wall msg, the user shot be anable to go to the next 10 wall msg. i have only one problem here, if i use $.getJSON the msg's load in a div tag, and when Google index my pages it only look page 1 in this wall. i ...

JavaScript loading image freezes while making ajax call

Hi, I've built a page using jQuery that uses an async Ajax call. I'm trying to display a loading gif but for the life of me I can't get it to work. The gif never displays. Any ideas? function updateCityList(state) { $("#city-loading").empty().html('<img src="/Images/loading.gif" />'); $.ajax( { ...

Is HTML 5 supported by all the main browsers?

I am looking at the custom attributes feature of html 5 here at this link http://ejohn.org/blog/html-5-data-attributes/ This look like the perfect thing for when I am using jquery/javascript. My question, Is HTML 5 supported by all the main browsers? example <li class="user" data-name="John Resig" data-city="Boston" data-la...

target images with a certain class with jQuery?

When I click a button, I want to apply some jQuery (let's say fadeOut) to the first image with the class my-image. When I click that button again, I want to do the same thing to the next occurrence in the markup of an image with the class my-image. The images all appear in various places throughout the markup and are not necessaril...

Best way to do a menu like this

Below is an image from a site that hase user photo's, they link to a profile but on the image you will see a + sign, this part links to add a friend. I am wanting to do something similar but instead of just having the plus sign part be a link, I am wanting to click the plus sign and have a couple of links appear, kind of like a dropdo...