I have writting all of my paging logic in javascript.
It works pretty fine. Basically, I have created a
gridview with full paging in javascript. Now, given
a certain need, I am being advised to do my paging
on the server.
My question: is there a performance cost by doing
all my paging server-side (and cost benefit by keeping
it on the client). Or, does it matter?
I work for a financial company. I am planning to give a presentation to rest of the development team (15 people) here on moving server side logic to client-side javascript for an internal intranet application rewrite. This approach will definitely stir up hot debate from hardcore server-side Java folks who wants to do UI stuff even on the server!. Since I am pretty much known as the JS or UI Guy of the group, my Boss wants to hear the broad spectrum of PROs/CONs from each proponent.
Personally, I think Javascript/Ruby is a more productive language than Java.
My idea is simple. It is to convert most business logic to client- side javascript and have calls to server-side code restricted to user roles with data validation. Thats as simple as it gets.
Here are my list of arguments
1. True separation of UI logic from server-side data processing code (no more server code spitting out client-side code) 2. Better user experience with faster response 3. The whole web 2.0 thing (no page refresh) :) 4. Offload client processing from server therefore reducing network traffic (not really a strong argument is this?)
Keep in mind this is an internal app. Even if someone figures out the JS logic behind the page and try to hack the app by posting to Servlets, they will be restricted by their login role, and data validation will take care of any bogus data being submitted.
MY PROBLEM IS I AM ENTERING DATA IN 3 ROWS after that CLICKING NEXT BUTTON AND GOING TO 2ND PAGE THEN IN THE 2ND PAGE I AM CLICKING PREVIOUS BUTTON TO SEE THE FIRST PAGE DATA ;I AM ABLE TO SEE THE 1ST PAGE DATA BUT I WANT TO DISPLAY DATA IN MY JSP PAGE I AM WRITING CONDITION LIKE THIS
If(formData != null) IAM CALLING addRow('myTable') FUNCTION
I AM GETTING EXCEPTION PAGE NOT FOUND
why i am calling like this because
as u can see the addRow(id) function
for every dynamic row i am putting the remove button at the left side(user can have choice of deleting the row)
i want to call this Javascript function addRow() for satisfying IN both Add and Modify operations and also it will satisfy in Next and Previous modes; Code:
my site is a flash site but it also has alot of javascript functions it utulizes as well. in IE my flash site runs fine but in FF i get some major lags...since flash is crossBroswer i figured it wasnt the flash file but the actual javasript so i viewd just the flash file form FF and it runs fine with no lag. so there is something in my page thats causing it to lag.
if you view my page vs just the .swf you will see the lag difference, so im sure its something in the javascript, but im unsure what is causing it...can anyone tell me what it is...or any ideas on what it could be?
i am doing a project and now i am try to work on paging, however i am stuck. I want to put in a list of links of website in the itemfilereadstore. So when show, i want to be able to click on any one of the link in the page, which will bring you to the selected website
The variable that stores the number of elements of the search results array is called contentLenght.Let's say that contentLenght equals 9. Then I need a div showing 6 elements an another sowing 3 elements.If contentLenght equals 7, I need a div showing 6 elements an another showing one element.If the value of contentLenght is 18, then I need three divs containing 6 elements each.. and so on.Now the paging itself: if I have just one div there's no need for paging, but if I have two of more I have to show the page's numbers.Then when a number is clicked the present div must hide and the div containing the elements for the page number should show.
I was about to paste some code but the only way I've come out with the six to six paging is with a long if else structure, and I'm sure there's a smarter way of doing it.
I'm using a .csv file as the basis for a spry dataset in Dreamweaver. I've got it working and the data is getting inserted into a table dynamically. Since there'll be quite a lot of rows in the table, I need some sort of paging controls so the user can see about 10 rows at a time and then page through the rest of the rows.[code]When I test though, I get the following error:"Failed to retrieve data set (dsHospPrivate) for spry:repeat".I wondered if someone could tell me where I'm going wrong? My javascript coding is really limited so I may have copied the wrong code blocks from the example in the abovementioned url.Also, I'm noticing that when the data comes in from the .csv file, any text that has an apostrophe in it, eg. children's - the apostrophe is not being rendered correctly in the browser, ie. it's being represented as a question mark in a triangle.
I'm working for a company that is using version 1.4.4. But Ive acquired the need to paging tabs.In the example though, It uses 1.3.2. Is this the only version of the library that i can use. or can I use my existing library?
I have the basic functionality of the jquery cycle plugin working. I have set up a test page at here but was wondering what would I need to change in order for the paging to resemble page.
I'm using a .csv file as the basis for a spry dataset. I've got it working and the data is getting inserted into a table dynamically. Since there'll be quite a lot of rows in the table, I'm trying to implement some paging controls so the user can see about 20 rows at a time and then page through the rest of the rows.[code]When I test, The first 20 rows appear but then these 20 rows are repeated another 20 times, so the first 20 rows are duplicated 20 times on the one page, i.e 400 rows are being displayed (if you know what I mean). The paging is also working via the buttons but each of the 20 rows (20 x 20) are being paged simultaneously, and I only want one set of 20 rows to appear at any one time.[code]
I want to create an image gallery like imageflow, but having tough time to figure out the way top, left, height and width are computed for each animation call.
I have been working on a paging and it all works fine , the codeit's based on the code from this page [URL]
I have tried to recreate thenavigationto work before and after the table I can put the data there but it does not worksimultaneously the before and after navigation
I have tried several solutions but I can't get it to worksimultaneously
Putting some javascript into a pdf file and can't get this to work out right.
Basic setup:
Field X = checkbox; Field Y = numeric input field;
Here's what should happen (increment is toggled):
Y has a value. When X is checked, Y is increased by 5. When X is unchecked, Y goes back to its original, unmodified value.
Here's what really happens (increment is subtracted):
Y has a value. When X is checked, Y is reduced by 5. When X is unchecked, Y is reduced by 5 again. Anytime X is clicked on, Y is reduced by 5 yet again.
How to create a function that would allow me to add to or subtract from a maxvalue, and thankfully I got help regarding that. However, something's got me stumped for the past few weeks that I still can't resolve...
This is the relevant code:
As it stands, it works as long as the total value is less than or equal to the limit (for advantages it's 15, for disadvantages it's 10). However, the moment it goes past the limit -- for instance, if you change Antisocial's value from 2 to 7, or if you add several additional checkboxes with any values -- the whole thing starts going crazy; specifically, maxvalue doesn't revert to 40 when the all the checkboxes are unchecked.
What I'd want to happen is that the user cannot select or apply advantages or disadvantages if the maximum advantage is greater than 15 or the maximum disadvantages is greater than 10.
I'm thinking that a button for adding disadvantage points to/subtracting advantage points from the maxvalue (that becomes disabled if the user goes past his limit on advantages/disadvantages) is useful at this point, but I'm really stumped on the implementation of the idea. An alternate idea of mine is that all other advantage/disadvantage checkboxes would become disabled if their value is greater than the remaining number of points, but I don't know how that is possible either.
The default behaviour for a class selector is: "An element can have multiple classes; only one of them must match." Is there a class selector where you can use multiple classes and all of them have to match?
was wondering if it made sense to optimize the comparison order inside an if() statement if one of the comparison targets is a function call eg:
var a = true, b = function() {return false;}; if (b() || a) {...} if (a || b()) {...}
would the second statement run faster because it would theoretically never need to call b() in this situation? can the eval order be relied on? does this depend on the js engine/internal optimizations?
there's a line in my Javascript program that makes a change in the appearance of an area of the screen. it is a game program, so there are a cascade of changes after the user makes a move. these are carefully sequenced and timed in a loop which contains the "action" statement
document.images[k].src = offGIF[currNode];
unfortunately, the *actual* screen updating appears to be 1) asynchronous and 2) faulty!
_asynchronou_s in that things change in the wrong order, as if each has its own thread and they run at random.
_faulty_ in that occasionally an area that would change from, say, picture1.gif to picture2.gif and back again (according to game logic) lands up showing picture2.gif. even though the internal game logic has it recorded (and i assume document.images[k].src would be correct, even though the screen is not) as picture1. so.
is there a way to wait or surrender control to the system until the program statement's intent has actually been rendered to the screen? something i can test to see if the unerlying system mechanism has caught up with all changes to document.images?
I've got this code to add bbcode into a wysiwyg rich text editor. Everything's working fine except when I want to add an image. The first time the script is run everything is ok, but the second time I get two image inserts, third time I get three and so on.
Here's the code: Code: $('#uploads tr').click(function(){ var filename = $(this).text(); var insert = '[img="'+filename+'"]'; textarea.value = textarea.value+insert; $('#images').hide(); textarea.focus(); });
So first time I click on '#uploads tr', I get [img="filename"], then if I type some more stuff and then add another image, I get [img="filename"] 'Some more stuff' [img="filename2"][img="filename2"], then I'll get three image tags, then four and so on. I can see that it's something to do with the line I've highlighted, but I can't see why, or how to change it.
I am building a jurisdiction calculator for issues on/off Indian reservations. I'd like the user to select 3 variables (radio buttons would also work) - whether the victim is Indian/Non, the perpetrator is Indian/Non, and whether the crime occurred On/Off a reservation and have a div that displays the possible jurisdiction outcomes based on the selections.For instance, if the user selects Victim: Non-Indian, Perp: Indian, Location: On reservation, the possible jurisdiction results would appear.
For some security reasons I would like to show an email field in a form ONLY if the 4 checkbox are checked.I don't want to use server side coding so I need to use javascript.I have this code, showing an alert if the 4 checkboxes are checked:
<html> <head><script> var conta=0; function ctr(quale)
[code]...
It works but I nedd to ask for an email instead of showing an alert.
I am new to jQuery, and learning more about Js by doing. I can hand-code HTML and CSS very well and understand OOP effectively. However, troubleshooting complex Javascript code combined with jQuery is a challenge to me, but I really want to learn. I am using Windows XP Professional and IE 8, FF 3.6.
It should open a modal everytime a link of a given class is clicked. But... it does not.
Code JavaScript: //get the url of the link clicked var url; $('a.edit').livequery('click',function(){ url= $(this).attr('href'); }); [Code]....
When a link of class .edit is clicked, the overlay covers the page for an instant, then a redirect occurs to the page that should be loaded in the modal box (instead of the page being loaded in the modal). It's probably a small mistake as I can get it working the way I want using jqm 'trigger:a.edit'. The problem with this approach is that I lose the livequery power (links from ajax loaded content won't fire jqm).