jquery

JQuery xml/xhtml processing

Using JQuery I am sending an Ajax GET to a web server. The web server is replying with an xml block like this; <?xml version="1.0" encoding="ISO-8859-1"?> <ajax-response> <response> some response here </response> <response> some response here </response> </ajax-response> The jQuery get looks like this; jQuery.get(...

jQuery - .each() returning only the first element attributes, need to store each element attribute and use in each child element

I'm having headaches trying to make this work: I have a <a> element with a background-image defined with style="" attribute and I have put a function to append inside the <a> element a <span> handling different background-positions for :hover effects with opacity changes. The thing is, I need to get the same style attribute from each <a>...

Why is it a bad practice to return generated HTML instead of JSON? Or is it?

It is quite easy to load HTML content from your custom URLs/Web services using JQuery or any other similar framework. I've used this approach many times and till now and found the performance satisfactory. But all the books, all the experts are trying to get me to use JSON instead of generated HTML. How's it much more superior than HTML...

Loading AJAX with Jquery Issue

I have this ajax call for loading a selection of data in xml. I am not getting any JS errors, it does the before, the complete is not working, I guess I am not calling the data correctly. Any thoughts on what I am doing wrong in the complete function loop? $.ajax({ type: "GET", url: "xml/classes.xml", dataType: "XML", before...

jQuery: submit disabled fields

I know the defined behavior for web forms is to not submit disabled fields... but that's not the definition I want. I want to use ajax to post the form and I want it to get all fields, even if they are disabled. I don't want to build a workaround where I make the field "look disabled"... or have to hack it where I enable the fields -> ...

Multiple XML with data linking?

I am not sure if this is possible, I am working on a website that I do not have access to any kind of MYSQL or database. Nor any PHP. Cheap Client Regardless I have 3 XML files with different parts of data, I have placed a "key" that matches each other. I believe a simple IF statement will do the matching. However what is the best way...

jQueryGrid not calling the URL in ASP.Net MVC

I've been trying to implement jQuery's grid function in my Asp.Net MVC app. I'm testing everything out on XP right now, so I've enabled the mvc extension (since I'm using IIS 5) I've run into 2 problems. My jquery grid doesn't seem to be getting called. I referenced all the jquery & grid files using the URL.Content() method Here's my...

Facebook-like anchor scroll

Facebook has a nice scroll effect which I would like to replicate with jQuery. When you load a page it starts at the top then scrolls to the selected anchor. I've tried doing this (page.html#anchor) and using the scrolling plugin for jQuery however it just goes straight to that anchor without using the scroll effect. So can I delay the...

Sessions and uploadify

I'm using uploadify, and i can't set sessions in my php files, my script looks like this: $("#uploadify").uploadify({ 'uploader' : '/extra/flash/uploadify.swf', 'script' : '/admin/uploads/artistsphotos', 'scriptData' : {'PHPSESSID' : '<?= session_id(); ?>'}, 'cancelImg' : '/imag...

jquery ui datepicker in ajax loaded page

Hi, i've got a problem, im loading into a div a page with form, that have date. I want to get there datepicker, but when the page is loaded with ajax, jquery doesn't see mine input. I tried something like this: $('#birthdate').live('click', function() { $(this).datepicker({showOn:'focus'}).focus(); }); well it worked but the whole da...

on click submit problem

Using jquery, I want to post data to from one of my pages to another one. By looking at examples, I coded something. Problem here, I get the following error. Error: $(document.getElementsByName("signup")).Click is not a function Source File: http://sabahtan.com/ak/ Line: 18 $(document).ready(function() { $(document.getElem...

Designing a website for both javascript script support and not support

Okay i know that it's important for your website to work fine with javascript disabled. In my opinion one way to start thinking about how to design such websites is to detect javascript at the homepage and if it's not enabled redirect to another version of website that does not javascript code and works with pure html (like gmail) Anot...

control image loading in javascript/jquery?

I am creating an Image gallery and i want a few images to load when the next button is clicked..... for example, $("#next").css({cursor:"pointer"}).click(function(){ //load image1,image2,image3 }); HTML <img src="image1.jpg"><img src="image2.jpg"><img src="image3.jpg"> i don't want to append them to a division, these image tag...

Executing a javascript function client side with Jquery ASP.Net and C#

I want to pull some data from a page containing a javascript function taking parameters including the this paramter ex: displayNav('11512010', 'J88903', 'itna', this, 'detailSpec','false','true'); My first issue is that I am not sure what I should do with the this object. I want to execute the script and get back the result somehow. I a...

Read :hover pseudo class with javascript

I made a function that overwrite the the :hover of some elements on a page. It fades between the normal and the :hover effect. That for i had to create a .hover class in my CSS file. I think this is a little unclean. How could i read the the :hover pseudo class contents? ...

YUI DataTable Sorting

Hello, I'm using a YUI datatable to create some basic client side sorting for some stats, returned via a web service I've created. Didn't quite want to figure out YUI's ajax datasource stuff, so I'm loading the data in via jquery and addRow()'ing the data. The problem is, all the data is not sorting properly. The string field seems to b...

How to speed up sequential JQuery load() requests to the Same div.

i have two links <a href="page1.html">page 1</a> <a href="page2.html">page 2</a> <div id="content">&nbsp;</div> 1. I use JQuery to load them into a Div when the links are clicked. $('#content').load('page1.html'); 2. When the second link is clicked I empty the div $('#content').html(''); 3. and load the second file in; $('#co...

Jquery/AJAX response - Works in FF/Safari but not IE parseFloat(html) problem?

I have a JQuery/Ajax update. It correctly updates in all major browsers, however, dealing with error responses does not work in any version of IE. Heres the ajax submit code: $('.ajax_multi_submit').click(function(event){ // if javascript is enabled, stop default post event.preventDefault(); // get the id assigned to this form....

How to ensure images are loaded inside a JQuery plugin?

While creating a JQuery plugin that required image dimensions, I discovered that webkit browsers like Chrome often return 0 size for images because they're loaded in parallel. My quick and dirty solution was to wrap the code that calls my plugin in a $(window).load() event: $(document).ready(function() { $(window).load(function() {...

JQuery help - animate background color

Hi Using JQuery, what I want to do is create a function that when I call the function, it will fade the background color of my "#page" DIV from the CSS defined background color to yellow then back to the original CSS background color for #page. Any ideas on how I can do this with JQuery? I know JQuery has both an "animate" and "highli...