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
ADVERTISEMENT
Jun 17, 2009
i am making website, every thing is great i even learned php and sql, But i made input info validation in javascript, and i have a lot of same pages, i know in php i can use include("***.php"); and echo sprintf("%'09s", $***); to launch a php code from other file, can i do it in javascript and how? i want to save my javascript function in html or php file and call it in other php aplications, is it possible?
View 2 Replies
View Related
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
Jun 19, 2010
I'm using the .html() function to update information in a div whenever a button is clicked, like this:
$("#myPic").click(function() {
$("#myDiv").html("//new content for div goes here
However, for some of these new sections, the html is QUITE lengthy. can i store it on a separate file in the same directory and somehow import it?? Is there a better way?
View 1 Replies
View Related
Jan 18, 2010
I've been using jquery for some time, and was very excited about the improvements in jquery 1.4 I have found however, that in one particular instance, jquery 1.4 seems to be performing slower than 1.3x, to the point that it has forced me to downgrade the script. I use jquery heavily throughout my web application; in this particular case, when a very large block of html consisting of a bunch of <tr>s is .appended (or .htmled, tried both) to a table, jquery 1.4 in firefox will give the "unresponsive script" error, prompting the user to stop, debug, or continue. The same block of html works perfectly fine in jquery 1.32 (and quite fast too). I haven't had time to do too much experimentation, as this is in a production environment, and thus downgrading was necessary as it was breaking the page, but I would love to figure out why this is happening so that I may optimize the code sometime in the near future. Have the improvements to .html resulted in code that causes higher cpu usage, or that would have a much higher overhead on longer strings? I've commented much of the code around the call, so that it pretty much consists of an ajax call that returns a chunk of html, which is inserted to a table (that I first empty). I thought it might be something with event bindings that occur after the insertion, but removal of these event bindings does not resolve the unresponsive script error. It seems the .html or .append is doing it. Note that this code, as is, works perfectly in jquery 1.3, even with event bindings, etc.
Does anyone have any ideas? My next step was going to be to try returning the entire table including the <table> tags, and doing a replace instead of an append, but if anyone has other suggestions to try, please let me know. Also, just as an aside, what do you guys consider the 'best practice' to be when returning dynamic data for a table (server side sorting, filtering etc from a db) ? Do you return just the data in json, and repeatedly clone a row element, replacing the values in each row (thus decreasing the size of the ajax call, but increasing the client side processing), or return the full html, and replace the innerHTML of the table?
View 2 Replies
View Related
Jul 17, 2009
My code that centers html elements fails when the html element is large. For example, I have a list of 443 items, which I break into 3 columns within a div. Therefore there are 148 lines in the div. When I use the code below to center the div, the top part of the div is beyond the top of the window screen.
function centerPopup(){
// Get data for centering
var windowWidth = document.documentElement.clientWidth;
var windowHeight = document.documentElement.clientHeight;
var popupHeight = $(".popupArea").height();
var popupWidth = $(".popupArea").width();
//centering
$(".popupArea").css({ "position": "absolute", "top": Math.floor(windowHeight/2)-Math.floor(popupHeight/2), "left": Math.floor(windowWidth/2)-Math.floor(popupWidth/2) });
//only need force for IE6
$(".popupBackground").css({ "height": windowHeight });
}
View 2 Replies
View Related
Mar 3, 2009
I want to know the list of applications which is installed in my local system using scripting language.
View 14 Replies
View Related
May 2, 2001
I'm building some client side JavaScript applications, one of these is a missing piece puzzle. There is one bug that I am aware of, where one piece may move over another, but this doesn't happen untill you have been playing for ages.
I'm trying to test the win condition, but haven't yet managed to complete it
Anyone with some spare time, or just some boredom, wanna have a go? Code:
View 3 Replies
View Related
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
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
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
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
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
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
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
View Related
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
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
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
Aug 5, 2010
I have a simple question regarding toggling large elements. When I use toggle to show/hide large elements I often get a "clunky" sort of effect. This is because the browser window has to re-size along with the page. I threw together a quick example of what I mean, it can be viewed HERE . You can sort of see it in the example if you scroll down before you hit the checkbox to hide the fieldset. This is even more noticeable the more elements that are displayed. Here is the simple code I threw together to illistrate the problem:
[Code]...
View 2 Replies
View Related
Dec 2, 2011
Warning: Complete newbie! I am trying to installthis simple slideshow as a header on my site. It is working fine, but there is an incredibly large gap after the header (see photo below) that is not supposed to be there. Here is the code I am using:
<script language="javascript" type="text/javascript" src="http://www.logfinish.com/logfindesign/pop-up.js"></script> <table width="1004" border="0" align="center" cellpadding="0" cellspacing="0">
tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<style>
[Code]...
View 1 Replies
View Related
Feb 21, 2011
I cannot believe this is NOT possible but thus far, I've scoured the web for hours looking for an easy way to make a radio button about 10 times larger than it normally is, and make it use custom colors. For example, I'd like to use custom images for the "selected" "unselected" and forgo the normal radio button entirely. However, I'm hoping to keep the radio button as an input method in the HTML, since jQuery has some super useful tools to manipulate input via radiobutton (or other selectors).
View 3 Replies
View Related
Mar 26, 2010
I've a large array of nearly 5000 entries and trying to populate those entries into a dropdown list of my webpage. By doing that so, it is taking so much time ( nearly 30 seconds ) and is freezing the page.
Is there any way to load such a big array into dropdown in efficient manner...
var handles = [ ... around 5000 entries .... ];
function populateHandles(){
objSub = document.getElementById('listBox');
for(x=0; x < handles.length; x++){
[Code]....
View 8 Replies
View Related
Mar 26, 2010
I have a element when click, it will trigger some other elements to be selected. and those elements will trigger elements in next level.
It is a three levels hierarchy so to speak. but each element will send an ajax request when selected. Those requests will become out of control especially when I repeatedly click the root element.
Can I queue those XHR request in a queue and send them one by one? or maybe add a delay before send so that they can collect their information into one batch request and send one request after that.
View 2 Replies
View Related
May 19, 2010
I'm working on a project that involves a page with a large amount of images (sometimes 400+). What's the best way to handle this? Should I track the loading-state of all of them, or is it save to assume I can do stuff as soon as the last image is loaded? So.
[Code]...
View 3 Replies
View Related
Oct 13, 2009
I'm requesting a very large JSON dataset for a table via AJAX and I'm building it on the fly with JQuery. What would be the most efficient way to build it?
View 2 Replies
View Related
Aug 6, 2010
[div id="WhateverHolder"]
[div class="item"][/div]
[div class="item"][/div]
[div class="item"][/div]
[code]....
I have looked for a plugin that can do this but to no avail what is the easiest way to do this in jQuery
View 1 Replies
View Related