JQuery :: Optimizing Large Quantity Of DOM Manipulations?

Mar 16, 2010

I have a website using jQuery that for the most part works fine, but it contains a very large form with a lot of fields. I have an option to save the settings from the form and to load and retrieve them from the server. The problem I'm running into is that the loading settings involves changing so much in the DOM (the form is huge and contains a lot of fields) that it seems to be freezing up on some browsers or timing out. I can't reproduce this on my computer (although it does take awhile to finish processing) but I've gotten enough reports of the problem that I'm looking for some advice as to how I can speed it up some.

The site is [URL] I've tried to speed it up by caching a good chunk of the selectors I'm interacting with and I'm using IDs to access the fields in most circumstances. But I'm not sure what else I can do to really optimize the loading. how I can go about improving on the load speed?

View 9 Replies


ADVERTISEMENT

JQuery :: Optimizing Large Dynamic <select>

May 29, 2009

I'm building on-the-fly <select> lists from JSON data fetched from the server. Some of then include a large number of items (>20,000).

The SQL and HTML parts are working fine. The AJAX script fetches data fairly quickly (around 1 second) and large selects are not a problem once they're built (the browser handles them nicely, even IE). The bottleneck is in the process of picking the JSON data and building the <option> tags. That can take a full minute.

What's the recommended (i.e. fastest) method to generate a large <select> list?

My current approach is this:

// Fetch data (GET method allows me to use browser cache)
$.get(url, get, function(jsonValues, txtStatus){
that.values = jsonValues;
}, "json");

[Code].....

View 5 Replies View Related

Very Large Lists - Optimizing Performance?

Jul 28, 2010

I am working on a list which displays a large number of contacts (400 to 500 for a typical user). Currently, I am using Dojo (customized widgit) which is created 400 times (once for each contact).This of course is resulting in alot of rendering delay. What is the best approach to display large lists in HTML/javascript? Each list item needs to have an image.

View 2 Replies View Related

Add A Spin Control To Quantity Field Before Add The Ordered Quantity To A Shop Cart Array

Mar 19, 2011

I am trying to add a spin control to my quantity field before i add the ordered quantity to a shop cart array. The way its set up at the moment if you click the deincrement arrow it actually goes into negative numbers. (no good coz people cant order a negative number eh#$@#$@) This the

<head> Code
<!---sPIN BUTTONS TO UP QUANTITY--->
<script type="text/javascript">
function changeVal(n) {
document.forms[0].quantity.value =parseInt(document.forms[0].quantity.value) + n;
}
</script>
[Code]

View 1 Replies View Related

JQuery :: Combine Two Manipulations On Same Element?

Nov 10, 2011

I have something similar to;

$("a").wrap('<div class="mapwrap" />');
$("a").after('<div class="mapover" >A</div>');

how can I combine this to a single line with one reference to $("a")

View 2 Replies View Related

JQuery :: Apply Effects/manipulations On A Just Ajax-retrieved Element

Nov 15, 2010

I'm stuck with a "problem" on a website development. The basic structure ofthe websiteis that:

- There's only one main .php page

- There's a large div in it, initially blank

- Clickin on a link the div is filled with a portion of html code from another .php page, using load() functionplus # selector.

Now, teorically, my main page contains "more html elements", and initially I wrote some rows that changes the color oftexts when the mouse in on it:

$(document).ready(function()
{
$('ul li:first-child').hover(function ()
{

[Code]....

Simple. The problem is that the effect works on elements already written in the main page, but not onthe elements that come from the asynchronized html! How can I apply the effect on the "new" code too?

View 1 Replies View Related

Optimizing Rollovers Script

May 18, 2003

i have the following javascript code:

<!-- hide from browsers that dont support js
if(document.images)
{
about_over = new Image
about_over.src = "images/btn_about_r.gif"
about_out = new Image
about_out.src = "images/btn_about.gif"

success_over = new Image
success_over.src = "images/btn_success_r.gif"
success_out = new Image
success_out.src = "images/btn_success.gif"
}
// -->

and i am using it from within the html code in a standard way:

<a href="about.php" onMouseOver="document.about.src='images/btn_about_r.gif'" onMouseOut="document.about.src='images/btn_about.gif'"><img src="images/btn_about.gif" name="about" width="56" height="23" alt=""></a></td>

question: i don't know much about javascript. i know that the script above preloads the images but i don't understand why the images reference names ( "about_over", "about_out", etc) do not get utilized within html code. it seems to me that they should be used.

View 3 Replies View Related

Optimizing String Shortening Algorithm?

Aug 16, 2010

I've written a function that "condenses" a string if it is too long.

function shortenMsg(msg,maxLen){
if (msg.length > maxLen){
var over = msg.length - maxLen, // amount that needs to be trimmed

[Code]....

Each of the methods 1-3 is the amount that that specific method can trim from the string. I'd like to be able to trim as little as possible.

For example, if the string needs 5 characters to be trimmed, and method1 can trim 8 characters, but method3 can trim 6, then method3 should be used. If none of the methods can individually trim the string enough, then I'd like the optimal combination of the methods that will get the job done.

I can't figure out what sort of code structure I need for this (besides a ton of if/else statements). Maybe an array that contains each of the methods, arranged in increasing order....?

View 10 Replies View Related

JQuery :: Ajax Call - How To Check Quantity Field

Dec 23, 2010

I have a shopping cart with a quantity field. I also have an update button that updates the totals. Myquestion is how can I use jQuery to check the quantity field when it loses focus, to check the value against the database and the Instock field. If gt then display a tooltip (or something) and not allow the form to be submitted. The problem is the field is called sel_qty for each product.

View 1 Replies View Related

Validating Quantity

Jul 23, 2005

I have a function like this

function checkquantitiy(quantitiy){

if(quantitiy.value != parseInt(quantitiy.value)) {
alert(quantitiy.value+" sorry not integer quantitiy");
}

} //End of function

This check if quantitiy is integer. In the form I have following

<input name="buyquantitiy" type="hidden" id="buyquantitiy" value="<?php echo
$buyquantitiy; ?>" size="1" maxlength="3">
<input name="quantitiy" type="text" id="quantitiy" value="1" size="1"
maxlength="3" onchange="javascript:return checkquantitiy(this);">

The problem is when i will calculate if quantitiy/buyquantitiy is an
integer. The reason is that some products can only be seld as 4 items, and
if you press 3 wou should get a message that says
"Sorry a quantity of 3 are not aviable because there are 4 items in
package". Can transfer 2 varibales into the function? Or have anyone any
suggestion how to solve this.

View 3 Replies View Related

Function To Check If Quantity Ordered Is Valid

Nov 18, 2009

I have an online shopping cart and some of the products are sold in boxes of 6. So I am trying to write some code that will alert the customer if they have entered a quantity that isn't some multiple of six.

I've tried using the modulus operator as well as dividing by 6 and then checking to see if the result is a whole number but inevitably the alert box pops up no matter what I enter.

This is what I'm trying to use now:

Is there a better way to check if the entered quantity is a multiple of 6?

View 4 Replies View Related

Calculating Shopping Total With A Quantity Textbox?

Sep 27, 2011

I've been given this ridiculous assignment where I have to create a shopping web page.finding the javascript codes that will allow the user to update their total as they enter the quantities of the different products in the assigned text boxes.I don't even know where to start because we were never taught how to do this in class!

View 3 Replies View Related

Script To Validate Multi Quantity Orders?

Aug 17, 2010

I am looking for JavaScript code to validate the orders that comes with multiple quantities. Example let's say I place an order "JavaScript is so cool" book ISBN 99878347834309 and quantity purchased is 3 and another book "JavaScript is Great" ISBN 7978394908034 and purchased 2 quantity.

In my warehouse application on initial load of the page I want to display all the items purchased for that orderID(1234) 1 line at a time and in red color and as soon item is scanned I want to turn the item to green color.[code]...

This is how the management wants to display and as soon as item is scanned then the title will turn to green. When there are no more items then it should request for new order. Some validations that needed on this order are 1. Avoid duplicates (ie someone trying to ship more than the required quantity) then some pop up some valid message 2. If the ISBN doesn't belong to this order then pop up some valid message.

View 3 Replies View Related

JQuery :: EasyUI - Add A Small "Delete One Quantity" Button With Each Row?

Nov 3, 2011

I have a drag-drop shopping system, which adds the entrys to a table, as you drag them to the "cart-part". But i seriously can't figure out, how to add a small "Delete one quantity" button, with each row?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="jquery,ui,easy,easyui,web">
<meta name="description" content="easyui help you build your web page easily!">
[Code]....

View 1 Replies View Related

Multiplying And Addition - Allow Users To Check One Or More Of The Checkboxes And Multiply It By A Quantity

Jan 30, 2009

I am having trouble making a website for a vacation rental I pieced this javascript code and form together with a simple goal in mind: -to have 3 checkboxes each with its unique variable

weeks: 2,000
weekends: 325
weekdays: 275

-to allow users to check one or more of the checkboxes, and multiply it by a quantity they choose (ie "I'd like to stay for two weeks (2 x 2,000=6,000) and one weekday (1 x 275=275)

-finally, to add up the totals at the end (6,000 + 275=6,275)

[Code]...

View 1 Replies View Related

Multiple The Quantity Ordered By The Kind Of Shipping Selected In My <select> List?

Mar 4, 2009

What I want to do it multiple the quantity ordered by the kind of shipping selected in my <select> list.

I'm pretty sure that what I've got to do is establishe a quantity ordered variable like this var qty = form["Q" + i].value And then multiply that qty variable by the ShippingCost. But no mater where I stick this var statement it always either stops the script cold or comes up as a black or undefined value.

<script type="text/javascript">
/* <![CDATA[ */
var ListCount = 5[code].....

View 2 Replies View Related

JQuery :: Autocomplete And Large Data Set?

Oct 29, 2010

I have a coldfusion data component that receives two arguments and runs a stored procedure and returns a large data set. I want to use a textbox with autocomplete its data is that result set. I do not want to convert the result set to an array for performance.

View 1 Replies View Related

JQuery :: Autocomplete With A Large Database?

Feb 17, 2011

I am new to jQuery and I am trying to create an autocomplete textbox. When I use a small test database, it works fine but when I use my production database with over 3000 records, it slows to a crawl. It take >20 seconds to load the page and with each letter I type (even though I set minChars to 3), the browser times out asking if I want to continue running the script. My feeling is I need to use AJAX but I have never done that and don't know how to. I code in classic ASP with an Access database. Can anyone provide some sample code how to do this. Unfortunately I am under a time pressure to complete this project.

View 2 Replies View Related

JQuery :: Parsing A Very Large Xml File?

Jun 2, 2009

I have a xml file about 2MB. When i try to parse it my browser stops responding.. parsing large xml files with jquery?

View 6 Replies View Related

JQuery :: Large Table On The Fly And Add It To The Dom Using Html(val)

May 26, 2009

I am constructing a large table on the fly and add it to the dom using html(val). It takes about 6 seconds. I am wondering if there's any practice that would speed up this process?

View 2 Replies View Related

JQuery :: Large Applications And HTML Ids?

Nov 21, 2011

'm coming from the Java/Flex world and trying to get my mind around jQuery/HTML5 to evaluate how you would build a large scale application using them. One issue that I can't quite grasp is how to deal with HTML element IDs. My understanding is that jQuery allows you to manipulate HTML elements by referencing them by ID (there are other ways but those seem to require grabbing a list of elements and sorting through them to find the right one) In a large application with namespaced code how do you deal with dynamically created elements and the IDs the elements may contain?

For example, lets say you have a dashboard app that can contain a number of reports, each report is basically a div with the report content (a chart or table) and some associated views that can edit the report's data model. How can I assure that IDs for the report's subcomponents don't collide with IDs elsewhere in the application? I can envision some programmer working on a large project in a team naming a custom widget 'MyWidget' and then some other programmer naming their widget 'MyWidget' effectively causing two 'MyWidget' IDs to be assigned to different elements.

In the OOP world this isn't an issue because programmer one's widget is really something like MyForm.MyDiv.MyWidget and programmer two's widget is MyForm.MyOtherDiv.MyWidget allowing them to have unique names.

This could just be a fundamental misunderstanding of how things work in HTML but from what I've done every ID assignment is basically a global variable.

View 3 Replies View Related

JQuery :: Best Grid For Large Amount Of Data

Dec 5, 2010

I was looking for JQuery Grid which will help me more than 1000 - 2000 records. I mainly need search and paging .

View 1 Replies View Related

JQuery :: Best Table Plugin For Large Tables?

Aug 17, 2009

I have approximately a 400-500 row table (2 of them) each with 12 columns of formatted content such as currency, percentage, name.

I tried this with [url] but it can't seem to handle that much data.

Does anyone have a good plugin for large data on the page? (and no not interested in paginating it really)

View 3 Replies View Related

JQuery :: Large Image Scroll Effect?

Mar 26, 2011

I'm a graphic designer with some experience in Actionscript/HTML/CSS. I'm now trying my hand on jQuery.

My goal is to achieve an effect to scroll a large image, something like this Flash example:

[URL]

Below my result so far. It kind of works but nowhere near as smooth as i want it to be.

<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>slide scroll</title>

[Code]......

View 1 Replies View Related

JQuery :: Non-smooth Animation With Large Images?

Nov 21, 2010

I'm using animate() on images with sizes like 1100x1600 px. In Chrome and Firefox the animation isn't that bad (although not at all smooth) and in Safari even worse. Is it impossible for jquery to smoothen the animation with such big images? Are there any js libraries which do this better?[URL]..

View 2 Replies View Related

JQuery :: Row Highlighting Slow On Large Tables?

May 26, 2011

I am pulling data from a database and putting it into a table, i'm using the following statement to add row hightlighting to make it easy to read. Everthing works fine with short tables, but for larger tables the highlighting lags severely, aside from manually adding the mouseover/mouseout directly in the output, is there any way to make this faster?

$("#totalcalldata tr").mouseover(function(){$(this).addClass("rowHilight");}).mouseout(function(){$(this).removeClass("rowHilight");});

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved