Is there a JQuery plugin with string utils on par with ActiveSupport's Inflector?
I have found this Prototype utils port, but it's missing some of them.
this is mootools code:
var myString = "{subject} is {property_1} and {property_2}.";
var myObject = {subject: 'Jack Bauer', property_1: 'our lord', property_2: 'savior'};
myString.substitute(myObject);
and does jquery has this mothod? or like this method ?
I am currently applying a simple simple to my validated forms (red background and border) although jQuery validator appends some label with : Field is required.
I just dont want any text to appear.
Thankyou!
Hi guys, I keep getting duplicate entries in my database because of impatient users clicking the submit button multiple times.
I googled and googled and found a few scripts, but none of them seem to be sufficient.
How can I prevent these duplicate entries from occurring using javascript or preferably jQuery?
Thanx in advance!
Hi all, my problem has to do with the SimpleModal jQuery plugin. I have no problem opening the modal window, but once it opens it stays where it is [centered] on the screen, however its contents are changing, making it taller and therefore no longer centered. Is there a simple way to realign it so it becomes centered again?
I have multiple image galleries that use the following code (simply view the demo at the following link).
http://www.sohtanaka.com/web-design/fancy-thumbnail-hover-effect-w-jquery/
However, when one clicks on the thumbnails of one gallery to change the large image preview - all the galleries change automatically to that large preview as well.
In short, the question is:
"How do I seperate each gallery from each other so when the user clicks on the thumbnails of one specific gallery the large image preview of that gallery changes and not any other?"
I want to make my component faster, I am using Javascript and JQuery to build that.
I am using JSON object to communicate with component and back-end is python.
Is there any suggestion to make component faster?
For the dataType option to the JQuery.AJAX function, I don't see byte array or blob as one of the possibilities.
How can I get it so my server can return a byte array as the result of an AJAX call?
I could convert the blob to text, but I'm going for compactness.
I have to copy repeatedly data (contact info such as name, surname, telephone...) from form A (page 1 in domain x.com) to form B (page 2 in domain y.com)
I have been thinking about creating a chrome extension with the help of jquery to copy the data from form A, and inject it form B...
I have a feeling that this is not the best way to solve this problem...
What do you think is the best way to copy and paste data from pages in different domains?
I found the following code somewhere, but I am not understanding the code properly.
ArticleVote.submitVote('no');return false;
Is ArticleVote a class and submitVote() a function of that class?
Or what does the above code mean? And is there any concept of classes and objects in jQuery or in traditional JavaScript? How to create them? Please share some reference links or code.
I'm using Shadowbox a jquery overlay and I wanted to count how many people are actually using the overlay. Thus, I would need a function that would write a counter to a file or sending a query through a php api...
has to be a a php url api because I cant use php on the server where the overlay is.
So I need help with executing a javascript function on the overlay click, tips on how to make a counter query through GET method.
Thanks
Here's my situation:
I'm writing an ASP.net MVC 1 website and I have a create/edit form that uses the default model binding to parse the form into a strongly typed complex object.
The object I'm posting has a child collection of another complex type and the way I format my id's for the model binder is as follows:
<div class="childContainer" >
<!-- There's one of these for each property for each child collection item -->
<%= Html.TextBox("ChildCollectionName[0].ChildPropertyName", /* blah blah */ ) %>
<%= Html.TextBox("ChildCollectionName[0].OtherChildPropertyName", /* blah blah */ ) %>
<!-- ... -->
</div>
This gets rendered as
<div class="childContainer" >
<input id="ChildCollectionName[0]_ChildPropertyName" ... />
<input id="ChildCollectionName[0]_OtherChildPropertyName" ... />
...
</div>
<div class="childContainer" >
<input id="ChildCollectionName[1]_ChildPropertyName" ... />
<input id="ChildCollectionName[1]_OtherChildPropertyName" ... />
...
</div>
For each entry in the chlid collection.
This collection is dynamically created in the form using jQuery, so entries can be added, removed etc. and whenever there's an operation on the collection I need to update the indexes so that it's bound correctly on the server side.
What's the best way to replace all the html input id's when I'm updating the index within the child e.g.
replace all [*] -- [N] where N is the correct index.
using jQuery / JavaScript ?
I have something coded now, but its buggy and I think there is a simpler solution.
Also, if you have an easier way to identify the child collection I'll take any advice on that as well.
Thanx!
I have a string in my db I want to pull into my page and convert to a json object.
[
{id: 1,title: "Long Event",
start: new Date(2009, 5, 6, 14, 0),end: new Date(2009, 5, 11)},
{id: 2,title: "Repeating Event",
start: new Date(2009, 5, 2)},
{id: 3,title: "Meeting",
start: new Date(2009, 5, 20, 9, 0)},
{id: 4,title: "Click for Facebook",
start: new Date(2009, 5, 27, 16),end: new Date(2009, 5, 29),
url: "http://facebook.com/"}
]
How can I do this using JQuery?
Hi,
I have an ASP.NET MVC view on which I've placed jQuery tabs. I'm loading the tabs using:
function getContentTab(index) {
var url='<% = Url.Content("~/Books/GetBookTab") %/' + index;
...
}
I have stored the user's default tab selection in the model associated with this view.
My question is this, how can I set the tab number (index) with the number in my model data?
Thanks,
Arnold
Hi All,
I am working on a site for a friend and trying to add a link to each image in a slide show. The slide show uses jquery and a script called easySlider1.7.js. Everything works just fine if the images are left alone, but when I try and wrap the images with a link, the slides no longer progress as they should. Here is the live website that is displaying the problem...
http://www.splits59.com/
Here is the html code for each of the slide images...
<div class="covercontent2box">
<div class="covercontent2">
<div id="slideshow">
<a href="/ashton-jacket-p-107.html"><img src="img/homepagesummer2010_2.2-cut.jpg" class="active" /></a>
<a href="/carly-coverup-p-106.html"><img src="img/homepagesummer2010_3.2-cut.jpg" /></a>
<a href="/shop-online-bottoms-c-15_14.html"><img src="img/homepagesummer2010_1.2-cut.jpg" /></a>
</div>
</div>
</div>
And here is the jquery code on the page that controls the slider...
<script type="text/javascript">
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
// use this to pull the images in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 4500 );
});
</script>
Does anyone have any idea why adding a link tag to the images breaks the slider? Any help or direction provided would be appreciated.
Thanks,
Devin
<script type="text/javascript">
$(function() {
$('a.StackedSystem').hover(function(e) {
var html = '<div id="StackedSysteminfo">';
html += '<div id="StackedSystemTxt">
ETTER utilizes the latest technologies for our booster systems, including PLC-Based controls complete with touch-screen panel user interfaces (HMI). The base package includes the gray scale screen as shown; color screens are also available. The PLC not only provides a cleaner interface but provides additional features like automatic logging and time/date stamping of all alarms and shut-downs. Great for trouble-shooting.';
html += '';
$('body').append(html).children('#info').hide().fadeIn(400);
}, function() {
$('#StackedSysteminfo').remove();
});
});
I got one link, and few different images.
When I press on this link, I want that this few images, change to other images with fade effect (every single image has its own image on a replacement), how can do it with jQuery or Javascript, or maybe there is some scripts :)
Thank you in advance
I have a master page that references jquery + jqueryui. Everything is fine.
In the content page I placed:
$(document).ready(function () {
$("#tabs").tabs();
});
It turns out that the ready event fires BEFORE the html of the content page is loaded :/.
So, how to determine when the whole content page is loaded ?
Looking at this jQuery example, how can I modify the code so that it only changes the color of the cell if the value of the submit button in that cell is a certain value.
i.e.-
var submitEl = $("td :submit")
//Only do the below if the submit buttons value is "XYZ"
.parent('td')
.css({background:"yellow", border:"3px red solid"})
I need this video to play automatically. It would be nice, this code can play videos from other sources like yahoo etc.. Is it also possible to use HTML5, instead of jquery?
With Jquery, is there some way to make val() return an empty string instead of 'undefined' when called against an empty list of elements?
E.g., I have this code:
var x = $('#my-textbox-id').not('.watermark').val();
The idea is that I want to get the value of my textbox, but I want an empty string if it is currently showing the watermark (i don't want the watermark value!).
The selector works, but i don't want 'undefined' - I want an empty string ''.