jquery

jQuery plugin to scroll page, change background and fade back on anchor click?

My nav looks like this: <a href="index.html" class="nav">Home</a> <a href="about.html" class="nav">About</a> <a href="#" class="nav">Services</a> <a href="contact.html" class="nav">Contact</a> On index.html I briefly mention the two services offered and include a "read more" link for each one. It looks like this: <div style="width:46...

Sending a GET request to another domain using jQuery, http response not required.

I need to send a GET request to another domain preferably using jQuery. This isn't a same origin policy bypass because I don't need to get a response. For instance using JavaScript I know I can do this: document.write('<img src="http://somedomain.com/someapp.php?data='+data+'&gt;') Is there a better way using jQuery? ...

How to detect the 2nd link on a page using jQuery?

The first one below works, that is a:first detects the 1st link, but a:second doesn't. How can I detect the 2nd link on a page using jQuery? <script type="text/javascript"> $(document).ready(function() { $('a:first').click(function() { alert('you clicked 1st link'); }); $('a:second').click(funct...

$.ajax always returns success, even with errors

I'm currently trying to solve an odd problem. I always worked with ajax, json, etc but have no idea why that simple code below is not working. Below is the full javascript and html code: <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt...

Is there a better way to convert a JSON packet into a query string?

I have an input string that will either be a JSON packet, ala: {"PHONE":"555-513-4318","FIRSTNAME":"Austin","ARTISTID":"2","LASTNAME":"Weber"} or a query string, ala: phone=555-513-4318&firstname=Austin&artistid=2&lastname=Weber For my purposes, I need to always use the latter format; so when it is JSON data, I need to convert it t...

filling DDL with JSON return an error but fill the DDL, what am i missing?

Hello all, Here is my code: $("#ddlTableType").live( 'change', function() { $('#ddlTableCode').html(''); var TypeID = $("#ddlTableType > option[selected]").attr("value"); $.getJSON('LoadTableCodes.ashx?ObjectType=' + TypeID, function(TableCodes) { ...

Vertically centering element (jQuery)

HTML: <ul> <li><a href="#"><img src="image1.jpg" /></a></li> <li><a href="#"><img src="image2.jpg" /></a></li> </ul> LI is (60px x 60px) but the images inside have different heights. I think they can be centered if the margin is set dynamically: margin-top = height-of-li - height-of-img / 2 How do I do that with jQuery. Ma...

jQuery Address - Deep linking - Support for LIVE, content insert after Page Load

Hello, i'm building a web app which has a navigation that loads after doc ready which contains a bunch of links... I want these links to be deep linked and am trying to use jQuery Address however it doesn't seem to work with content that isn't hard coded on the page... Has anyone got jQuery address or another jQuery deep linking soluti...

How do I use jQuery UI's Datepicker not in a form, but to set the parameter for a link?

I have a link to a page on my site that has a data parameter in it. I want to use jQuery UI's Datepicker to set the parameter for the link. I've used Datapicker before, but only in forms. Is there a way to use it to set a URL parameter in the link? Thanks for reading. ...

Why is this simple jQuery not working?

I am trying to send the user to either google or yahoo depending on which link they clicked, if they clicked the 1st one they will be taken to google, and if they clicked the seond they will be taken to yahoo. So for the window.location function I am using a variable called website which I'm defining based on which link the user clicked...

Trouble figuring out correct selector

This is a little complicated so I will try and explain as best as I can. In the following code the goal is to find a td with the text "(Backordered)" and replace it with a link with the following URL /Email_Me_When_Back_In_Stock.asp?ProductCode=H210-10 The "H210-10" needs to be extracted from the 1st sibling td, in this case <td cla...

Posting the value of a textarea with jquery

Hi. I am looking for a (correct) way to read and write to a linux text file with javascript, jQuery and php. Specifically, I want to take the value of a (#taFile) with jQuery ($("#taFile").val();) and $.post it to a php script, which in turn writes the posted value to a text file. While my code mostly works, I have run into a snag: w...

konami.js function on load of div

I'm trying to do something stupid with the konami.js function, but having an issue. $('#page1').load('service.html', function(){ konami = new Konami(); konami.code = function() { func(); } konami.load(); }); func() is just a $.show() that I have defined in the main script.js that is sourced...

window.location.hash not working?

I have a link (index.html#services) and a <div id="services> that I'm trying to change the background color of when the link is clicked and then fade back. I'm using the latest jQuery and jQuery Color plugin, and: $(document).ready(function(){ if(window.location.hash === '#services') { var service = $('#services'); ...

Evenly spaced and justified horizontal list menu

I searched and found no solution to spacing out a series of lis for a list style menu. I realized CSS alone can't do it so I added some javascript (jQuery). I didn't want the same widths for each LI, I wanted even padding with no leftover space. If anyone can take this concept and simplify my awful javascript or offer alternatives please...

what is the best way to store data for UI

Hi , I am doing an application where there will be multiple items displayed on a page. for each item there will be lot of info. The data is completly generated in the code behind .aspx.cs and displayed in the ui. When the user mouseover particular item , apart from visible elements i need some other info from the code behind to grab f...

How to read userData in jqgrid?

I need to pass userData to jqgrid, but can't find any examples of how to do this. Here's my attempt: Sent from the server: { total: 25, page: currentpage, userData: {foo: 'bar'}, rows: myRows } and in jqgrid: var data = jQuery("#grid").getGridParam('userData'); How can I send userData and read it from jqgrid? EDIT: I know ...

getting a value from a php return in javascript.

I'm using jquery's $.get() to find out how many entries are in a table. I want the returned value to be an Int but it seems to be something else. How do I work with this? this is the code I have. I'm sure I'm just going about this wrong. My background is many java. var num = checksize(); function checksize(){ $.get("../php/checktablez...

how to enable some keyboard's key on non editable field

i have a input tag which is non editable, but some times i need to remove the text inside that by pressing delete or back space keys. how can i do that? ...

jquery Ui Dialog can't fadeout twice

i have a strange problem with jquery i have this div that shows messages for ajaxified actions and i want the message to go away when after 5 seconds .. it works for the first time.. but when i trigger the action again in the same page the dialog appears but and never get fade out no matter what unless i close it by press the X button ....