a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.

learn more… | top users | synonyms

-5
votes
0answers
20 views

Need to modify javascript that displays list from another SharePoint site collection so that items open in a modal dialog [on hold]

Here is the code I'm using. Keep in mind that I know practically nothing about javascript and borrowed the code from someone else. He hasn't had time to look at it yet. I'm just trying to modify it to ...
1
vote
1answer
29 views

Filter on HTML table using jQuery

I am adding some check box filters on a HTML table, based on whether a check box is checked or not, and I am toggling rows. Is there anyway I could improve this code? There is no issue with it at ...
1
vote
0answers
37 views

Is there any disadvantage of using MVC Razor Syntax codes inside a NoScript tag?

I've a ASP.NET MVC Website that display blogs from database by AJAX. The problem is - I have limit the results to only 10 by default and add a Load More button to display 10 more result each time ...
18
votes
7answers
4k views

Better way to code these deeply nested / multiple if/else statements

I have coded this mess of JavaScript and a bit of jQuery. Everything here works perfect as intended, however it is a real mess. What would be the best way to clean this up with best practices and ...
7
votes
1answer
94 views

Incrementing letter-spacing of one line of text

I was asked to create a script which will increment the letter-spacing of one line of text, until its width matches that of the first line; for use in headline/subheadline text to maintain a block ...
2
votes
1answer
35 views

Google Map, SVG Graph and ruler

I would like to get feedback on the code. It is working and can be seen here. I welcome any kind of feedback, since I am just starting to use JavaScript. Epecially in the case of performance, there ...
2
votes
0answers
41 views

Detail view, edit field: create input, buttons

I have a detail view for my object. There is only one field available for editing. When I click on the Edit button I want to hide text for field and show input with the OK and Cancel button. ...
5
votes
1answer
62 views

Manipulate HTML document loaded into WebBrowser control

I have developed my custom solution for this. It happened that the first solution is using XPath queries and the second, a conceptually similar to the first one, is using CSS queries processed by ...
-1
votes
0answers
17 views

Create dynamic list using jquery [on hold]

I've below code using plain javascript. Can someone convert this into using jquery syntax? I'm new to jquery and don't know how to do it as of now. The json array is the input. ...
-2
votes
1answer
43 views

Loading data from SQL server to webpage takes too long

There's a div in my webpage which will load data from an SQL server when the user clicks the button loadresource. Here's the JavaScript for button click: ...
8
votes
1answer
63 views

Interactive API documentation page of a RESTful dictionary API using Backbone.js

I'm working on the interactive API documentation of a RESTful dictionary service. The page should let testers try the different API calls, by playing with the parameters using a simple web form. ...
10
votes
2answers
99 views

Tritium website

I am working on my Tritium website (hosted on Github: feel free to fork and send pull requests), and now am looking for a review of it. If you are looking to critique the design of the website, ...
3
votes
1answer
47 views

Random select in two MySQL tables

I wrote a simple AJAX request that performs a random select in two MySQL tables. The thing is, my current script involves connecting to the database and creating a new PDO every time the ...
4
votes
2answers
46 views

GameLoop with requestAnimationFrame

I am creating a HTML game where you fight monsters and stuff and this is part of the game loop for dealing damage: ...
3
votes
1answer
58 views

Refactor three state button

I have a button (or icon) which can have three states. On hover, it changes state and on click, the new state gets transferred to another state. This state is kept until you click again for which it ...
-1
votes
0answers
22 views

Form Preview in Form Builder better code for Preview [closed]

I am trying to produce a form builder I found a bootstrap version which works quite well except for the part where it renders the form for preview does anyone recommend a approach to the following. ...
4
votes
1answer
150 views

A method for events callback with the correct “this”

What do you think of the following "utility" : ...
3
votes
2answers
50 views

Compact jQuery tool tip code, without jQueryUI

I have this tooltip code that I came up with, using jQuery: ...
5
votes
2answers
94 views

Locking viewport to the top element on window resize

On a responsive website where elements may shrink/expand according to the size of your viewport, the elements that was at the top of your viewport at the time may get pushed down/up as the elements ...
2
votes
1answer
70 views

Parity Bit Generator Webpage

JavaScript concerns Is this the best way in jQuery to handle a button being pressed without making an HTTP req? ...
3
votes
1answer
39 views

Implementing an “Add Company” section in a project

I'm working on avoiding JavaScript that either directly modifies the DOM a ton, contains a ton of anonymous functions, or is encapsulated in giant ...
1
vote
1answer
54 views

Generator and calculator for League of Legends content

I'm working on a project of mine, and I've had to write out a fair bit of jQuery. This is a generator and a calculator for some League of Legends related content. I was wondering if you could see ...
1
vote
2answers
55 views

Basic product builder

I'm developing a very basic product builder. Part of the builder has a basic text editor including some text color presets. As it stands, the presets remove a class that defines the text color and add ...
8
votes
3answers
106 views

Switching font and background color on button click

I am currently building a web app where I need to randomly switch the font and color of a title (inside the #content div) and the background of the page every time ...
7
votes
1answer
124 views

Shortening/refactoring jQuery animation code

I know this is a mess! How can I write this code better? ...
0
votes
1answer
56 views

Switching between tabs inside of a web application

I'm making a web application for the administration of a restaurant kind of type. The purpose of this application is to make customers, and the orders of those customers, which has products in it, ...
2
votes
0answers
41 views

Logo animation code

I want to know if there is a better way to write this code. I'm struggling a little bit with best practices in jQuery. ...
3
votes
2answers
59 views

Acceptable way of using jQuery methods in Angular directives

Here is my plunker example of what I am doing. jQuery is a great way to use slide transitions and seem to work well with angular as long as you are only using the methods on the element object inside ...
2
votes
2answers
147 views

Cleaning up a rotating image gallery

I have created a nice little image gallery for the web. I set out wanting 3 things. 1. The whole gallery had a basic level responsiveness to it. 2. The gallery would take images of any size, and ...
3
votes
1answer
50 views

jQuery collapse/expand plugin

This is my first plugin for JavaScript. It originated from a need for a similar feature at work and I decided to make it a bit more generic in case I needed it again. I was just wanting some criticism ...
4
votes
3answers
116 views

Object-oriented widget for reuse

I have been using a pattern similar to this basic structure below. Can anyone please let me know if this is a correct way to code an object-oriented widget for reuse? I am looking to make code than ...
0
votes
0answers
30 views

Optimize code for better performance FB Login Ajax

Can someone modify the code for better performance, its working fine but sometimes hangs the browser for a second, also not displaying the success data. When browser refreshes it shows then. Maybe I ...
3
votes
2answers
45 views

Avoiding code duplication for attribute-removal code

I need to use the same code in different jQuery attributes. Is it possible to put this if in a external function and call it inside a change event? I would like avoid duplicating code. ...
0
votes
1answer
38 views

jQuery Dialog Settings

The goal of the code is to initialize a Dialog with settings make sure the object is reusable Setup the options to reuse the code I'm not quite sure if this is overkill, or I am going about ...
1
vote
1answer
27 views
3
votes
1answer
102 views

Web page based on a sample from a book

I've created a web page based on a sample from a book. It works fine, but seems to have become too complicated. ...
4
votes
1answer
40 views

Using/storing server-side data on the client side

I've a slot booking script which is as follows: My Current Algorithm A calendar is shown to the user The user clicks on a date I make an ajax call to determine if at least 1 slot is booked on the ...
2
votes
2answers
74 views

Creating an interactive tour for a website [closed]

I'm using grumble to create an interactive tour for a website I'm working on (I'm aware there is a plugin called crumble that does this but I want to have full control of the functionality). ...
1
vote
1answer
41 views

Optimization of recursive jQuery images swap function

There's this website I'm working on that needs to swap images every few seconds, like a slideshow or image fade swap in a way, except that you need to target 5 IMG tag elements. I was able to make a ...
2
votes
1answer
69 views

Checking if switch is checked and doing something with the data

How can I optimize this code? ...
4
votes
3answers
130 views

Tic-Tac-Toe Game

I want recommendations on how to improve this code. JSFiddle for you to play in (It's laggy, so it would be better if you download the images and try it in your own PC). ...
12
votes
2answers
510 views

Checking conditions before allowing a play button to become visible

I have this code to check a couple conditions before allowing a play button to become visible. Is there anything to do to consolidate this code, possibly shrink it down some? ...
2
votes
2answers
163 views

Efficient way to iterate over elements of array for matching contents of another array

Using jQuery I'm trying to find an efficient way to iterate through an array excludeMe and check if elements from another array ...
7
votes
2answers
270 views

Improving nested for loops for sub menu creation

I have a nested loop which creates a drop down with 3 levels. Works fine on modern browsers but on IE8 it hangs and takes several seconds when there's even a moderate volume of data. It creates a ...
0
votes
0answers
28 views

Reading values from JSON

I would like to improve my code performance. Can you review my code? I am using Backbone Marionette plugin and it's reading the values from JSON. ...
4
votes
1answer
78 views

Optimizing display of various famous quotes

If it is possible, I'd like to be able to mash all of my arrays into one array, but still have the same functionality within my function (pick quote, pick creator, set padding). Pastebin ...
5
votes
1answer
69 views

Cover letter generator: guides writing a template and autofills information

This is my first public web-application. I'm a beginner to JavaScript and this is my first time using jQuery. It's not complete, but I'd love some feedback on the programming and the functionality. As ...
1
vote
2answers
87 views

How can I simplify similar functions using a hover state with different div content?

Updated: I need some help simplifying the code below. It works just fine, but maybe there is an easier way. What I'm trying to achieve: Hover over the img then use Greensock Tweenmax on hover to ...
6
votes
2answers
112 views

Wrapping my head around these wrappers

I've been developing a page that is designed like this: ______________ | | | | | | | | | -------------- Everything is wrapped in a ...
3
votes
1answer
60 views

Idea of 'parser' to make the writing of asynchronous functions chains easier

Why this thing : I work on a project where I need to call many asynchronous functions to get data, chain them, execute them if conditions are met,.. and I ended up having unreadable code. At some ...