a JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development.
2
votes
1answer
21 views
Jquery File Tree Toggle - Code Efficiency
I am making a web app that will have a "my files" area and to do so I am writing my own html and jQuery to control the opening and closing of each folder (or ul li). I want to make sure that this web ...
1
vote
3answers
76 views
How to make this code cleaner
Is there a way to write this code block cleaner and more readable?
var shareNavigate = function () {
scope.sharingActions.shareOnFacebook().done(function () {
...
3
votes
2answers
49 views
Replacing simple jQuery methods for better use
There are a few common jQuery call I find my self calling when creating my app. I need some help and maybe a better way to do all this or rewrite it.
1) Singleton Selector
If I want to select only ...
0
votes
2answers
31 views
Is there a better way of writing this code?
I have made a mini image gallery which consists of one large div which has a background image of one of the galleries images.
Underneath that there are five thumbnail images, that when clicked, ...
-1
votes
0answers
22 views
Need help optimizing this jQuery code [closed]
Below is a slider code that if used for more than one slider in the same page will not save each slide position. I need to have 8 sliders like this in the same page, so I repeat it 8 times. Would be ...
0
votes
1answer
38 views
How to make this function reusable instead of repeating it? [closed]
I'm using JavaScript and JQuery 1.8.3 to rebuild a form built by Django-filter. My purpose is to only present options that will yield a result to the user. The Django stuff all works fine and this is ...
-2
votes
0answers
50 views
Jquery File Upload (blueimp/jQuery-File-Upload) - ASP.NET MVC - How to Cancel Upload Async [closed]
created this in my github repository where I have the code of JqueryFileUploadblueimp implemented with ASP.NET MVC. Need some help about it, because I would like to know how can I cancel an UPLOAD ...
1
vote
2answers
30 views
jQuery sum outerHeight of multiple divs? Can I do this more efficiently?
I am summing the total .outerHeight() of multiple divs like this:
// How can I do this more efficiently?
var h = $('#div1').outerHeight() + $('#div2').outerHeight() + $('#div3').outerHeight() + ...
2
votes
1answer
36 views
Need suggestions to improve the code for an open source web based drafting application
My application. The repository and the file that needs review.
Here is the source code
$(function () {
var draft = function (parsed, title) {
var self = this;
var wordCount = ...
-1
votes
0answers
40 views
Why does my validation not work on all PC browsers? [closed]
The validation code below works 100% on all MAC browsers. But on all PC browsers the validation is ignored. After the user submits the form the email is validated and returns a thank you message. Is ...
2
votes
0answers
55 views
Javascript / Jquery Recursive find function
I wrote the following code as a way of plucking data from a n-depth javascript object.
It works a charm and even appends the parents of the the found item.
I was just wondering if you guys had any ...
2
votes
2answers
40 views
How to improve this jQuery code for tabs
I'm quite new to javaScript and jQuery and wrote the following function to creat some dynamic tabs. I'd be very interested to know how professional programmers would improve this code.
jsFiddle
...
0
votes
1answer
20 views
Create Custom Div with Parametric Contents [closed]
I'm new in JS area. I'm looking for a suggestion.
This is my code:
http://jsfiddle.net/bosbeles/r4Wra/2/
I want to create a method called createComment(user, comment, time) which returns a div as ...
1
vote
0answers
27 views
Help Improve this Code: Notifications Dropdown with TinyScroll
I'm relatively new to jQuery and am trying to learn best practices/design patterns with javascript. Came across this link (http://addyosmani.com/resources/essentialjsdesignpatterns/book/) and decided ...
1
vote
1answer
39 views
How can I improve my code which dynamically populates a section of a page?
My site consists of a lot of asynchronous calls, and because of this a lot of content is dynamically added to the page. For this section of code I've dynamically added tabs to a page and need to ...
1
vote
1answer
60 views
Should I use anonymous functions in my javascript program?
This question is about the best way to declare functions in Javascript. the app is a small 2 player board game I'm working on as part of a bigger web page. Basically I have a socket which receives and ...
-1
votes
0answers
16 views
Razor Jquery Error [closed]
<script>
@if (ViewBag.checkedArtikel != null)
{
foreach (int ac in ViewBag.checkedArtikel)
{
String temp = "'#addartikel" + ac + "'";
<text> ...
3
votes
1answer
50 views
JQuery code repetition and MVC
A while ago I started working on a project, which does things mostly with JQuery and PHP. I had some problems with my structure and started using CodeIgniter which uses an MVC pattern. So the PHP part ...
1
vote
1answer
35 views
my first jquery/json
This is my first use of jquery and json so would be grateful for any feedback please.
Background - this is on a job listing site and it has a Linkedin apply button plugin - this provides for a ...
0
votes
1answer
71 views
Review my first attempt at a jQuery plugin
So this is my first attempt at creating a jQuery plugin.
InstaSlider is a lightweight jQuery image slider / carousel plugin that populates content from an Instagram hashtag.
After searching for a ...
12
votes
8answers
1k views
Is there a shorter/cleaner way of writing this set of jquery .onclick functions?
I am hiding and fading in different content on the same page using jquery to hide() and fadeIn() the content depending on which link is clicked.
It works how I want it to, but the way I've written ...
3
votes
1answer
88 views
First Javascript - Geocoder - Can it be improved?
So I'm pretty excited to have coded my first javascript file which now works, and I've spent my evening trying to improve it.
It takes a location in the #loc input box and geocodes it (gets ...
1
vote
0answers
38 views
Review my Zepto / jQuery plugin base
I am looking for a starting point to code plugins, primarily for Zepto.js (with fall back for jQuery). These will provide reusable functions for Tumblr theming.
However, I can't seem to find ...
2
votes
1answer
46 views
jQuery: How to optimize this code
I am using this code for my responsive layout mobile sidebar hide show. I am not expert in jquery and just wonder if I can optimize this code with same functionalit
$(function() {
var a = ...
0
votes
1answer
33 views
Code review jQuery form preview
How can I improve my jQuery form preview implementation. Currently using the jQuery Instagram Plugin to get the hashtag from Instagram.
var timeoutReference;
var element;
var tagsa;
...
0
votes
1answer
34 views
Using jquery to prepare jQuery UI tabs, optimize?
I am looking for someone to review my solution to a jQuery DOM manipulation exercise on appendto.com: http://learn.appendto.com/lesson/dom-manipulation-101#exercise
I'm wondering if there is a way I ...
-2
votes
0answers
102 views
How to better structure my Javascript code? [closed]
The way I currently write my Javascript code is the following:
$(document).ready(function(){
// store vars
var $var1 = $('.element1');
var $var2 = $('.element2');
function doThis(){
...
2
votes
1answer
57 views
My login with AJAX and PHP
In your opinion, do I need to do all these validations. I thought to do well and stay safe but I seriously raises the question if it isn't slower.
jQuery code
$(document).ready(function () {
...
-1
votes
1answer
115 views
ASP.NET MVC 4 Shopping Cart - Cannot update shopping car items using JQuery , Ajax, jSON, jGrid [closed]
I have this code in a C# MVC 4 VS2012 project. I need to be able to update the shopping cart with jSON data using JQuery/AJAX, i'm using jqGrid to display the data and pulling the shopping cart items ...
2
votes
1answer
32 views
Condensing Navigation jQuery
I have some jquery that pretty much just runs a small drop-line navigation. Each tab size differs, so i used the same jquery line 5 times to make it look and function the way i wanted it to. I'm sure ...
1
vote
0answers
50 views
Jquery Dropdown plugin looking for OOP tips or advice!
;(function ( $, window, document, undefined ) {
if ( typeof Object.create !== 'function' ) {
Object.create = function (o) {
function F() {}
F.prototype = o;
return ...
1
vote
1answer
74 views
JQuery is working but clunky/slow
I'm coming close to finishing a site where there are a number of jQuery functions going on. They all work, but the page is just running a bit too clunky. The fading in and out is just not as smooth as ...
0
votes
0answers
65 views
jQuery highlightNavigation plugin, review request
I have written my first jQuery plugin using one of the design patterns suggested on jQuery's site: http://docs.jquery.com/Plugins/Authoring.
As listed below in the description comment, it's purpose ...
2
votes
1answer
135 views
Works, help clean up code
This JavaScript code works but I do not think it's coded cleanly, can anyone help clean it up? This code is for the back-to-top feature, when user gets to the bottom of the page, it scrolls them back ...
1
vote
1answer
63 views
How can I make jquery animations faster for mobile devices?
I recently made this campus timeline for my university. You can see it here
My question is this: When viewing the timeline on a mobile device (not a tablet), the navbar changes so that you can jump ...
3
votes
1answer
125 views
Jquery sortable style function
This is a basic sorting function written in jQuery that moves items in the DOM around to create empty spaces for a droppable(). Since there is so much going on in a droppable over event, i'd love some ...
0
votes
1answer
77 views
Tidying js files
I usually find the .js files to be quite messy and the truth is that mines are even worse than the average as, being soft, I'm not the sharpest tool neither at Jquery nor Javascript.
So I would ...
0
votes
0answers
104 views
What's wrong with this javascript programming approach?
Helllo people I'm now developing an instant messaging system but I'm a little confused : I can't decide which approach do I have to choose!
Here is a code and I want you to tell me what is good/bad ...
1
vote
0answers
76 views
Jvector Map add/remove function shorten code
I am achieving a hover state per continent through:
var continentId =""
function getID(continentId){
jQuery.each(mapObject.mapData.paths, function(i, val) {
if (val.continent == ...
1
vote
1answer
40 views
Using .hover recommended?
Is there a better way to write the JS for this? I'm asking because I read from somewhere that using .hover isn't recommended. Also, if I move the mouse in and out of the box really fast, the box fades ...
0
votes
2answers
57 views
help me optimize/simplify this jQuery function
This works as intended, but was wondering if there is a more efficient way of coding this.
if (window.location.href.indexOf('/search/') >= 0) {
switch ($.cookie("Layout")) {
case ...
1
vote
2answers
34 views
jquery checking nested input with repetitive code
I have a table with 'nested' inputs that need to be checked or unchecked when a button 'select all' is pressed. There are several levels that can be toggled with their respective 'select all' button. ...
1
vote
0answers
26 views
Exceptions for control flow
I just wrote the following javascript (jQeury loaded):
var valid, ui;
try {
$.each(this._cache, function() {
$.each(this, function() {
$.each(this, function() {
...
1
vote
1answer
52 views
autocomplete jquery -renderItem- option
$(function() {
function log( message ) {
$( "<div>" ).text( message ).prependTo( "#log" );
$( "#grille" ).scrollTop( 0 );
}
$( "#my_ac" ).autocomplete({
source: ...
2
votes
0answers
101 views
Display progress bar to show async. request status using JQuery
Instead of using ProgressBar plugin, I've below script to display the progress bar for async. requests on the page. Could anyone provide any feedback on this esp. if there will be any issues like ...
3
votes
2answers
37 views
How to refactor this jquery code without loosing the understandable factor of it?
<div id="members">
<div id="inputRow0">
<input id="input0_0" class="input" type="text" /><br/>
<input id="input0_1" class="input" type="text" ...
0
votes
0answers
86 views
D3.js zoomable map code review
I have this code http://bl.ocks.org/nkhine/3150901 and would like to have it reviewed:
function thisClient() {
"use strict"
var self = this
var width = 960,
height = 500,
centered, ...
5
votes
2answers
85 views
Do not select elements that contain data attributes
I have a selector that pulls in all anchor tags that start with the # symbol. I am trying to add a :not selector of some form for elements that have a data attribute. I know I could do the ...
1
vote
1answer
29 views
Improving my jQuery animation
I wrote the following fo create an animation which collapses a navigation bar, load new content for it and expands it again. Meanwhile, the rest of the page content fades out, loads and fades in ...
5
votes
1answer
93 views
Can I improve this jQuery based flow diagram?
I have created a proof of concept jQuery based flow diagram based upon kayen's answer to this post
click through yes/no questions from OPML one at a time
This diagram shows the flow diagram that I ...