I have a page that does a JSON result, get and post method in the controller with two submit buttons. One button goes to the Post method only for a redirect, and the other button goes to the JsonResult method(named AddTableData). How do I set this up in my JQuery code?
$('#firstSubmit').click(function() {
$(document).submit(functi...
I use this quick snippet with an image to close a show/hide DIV:
$('a.close').click(function() {
$('#timeline-2010-1').hide();
$('#timeline-2010-2').hide();
return false;
});
The problem is that when I close one box all of the boxes close...
Is there a way to modify this so that when you click the image "x" on ...
Hi, I am trying to crate a panorama slider as a jQuery plugin, and I have the following code..
$.fn.panorama = function(settings) {
var myPanorama = this;
..
this.mousedown(function(e){
//do stuff
$(this).css... //this all work
}
//Call mouseup on document in case user lets go of mouse outside dr...
Hi,
I installed the jquery and jquery-ui plugins for grails into SpringSource Tool Suite (STS-Eclipse) following the documentation located at http://www.grails.org/plugin/jquery and using the grails command-line tool included with STS-Eclipse as follows:
grails> install-plugin jquery
grails> install-plugin jquery-ui
According to the d...
Im trying to paste with html content (the one in the var) and paste it in <fieldset id="previewDataBlock">
Obviously Im doing something wrong:
function createPreviewBlock(){
var emptyBlock = '<ul class=emptyList id=previewBlock>' +
'<li id=periodLi></li>' +
'<li id=companyLi></li>' +
...
I want to modify this code so that the value is a variable and so that the progress bar refreshes in real time (or the smallest meter of time possible - milliseconds)
I am going to "seed" the current time to drive the updates
<script type="text/javascript">
$(function()
{
$("#container").progressbar({ value: 0 });
});...
I am trying to get the ID of an element bound with a jQuery delegate() function. I want to pass the element's ID to another function. The ID returned is always "undefined" and I'm not sure why. Here is my code:
$(document).ready(function() {
var timeout = undefined;
$('body').delegate(
'#tab-form input[type="text"]',
'keypre...
Hello all, I am trying to build a dynamic drag&drop modul for my App.
It include a table that holds all the dropable divs and few shapes.
As i can't know from advance the type of shape someone will put in a div and i have to save the div or divs which the user chose to drop the shape in i need to allow the app to be very dynamic...
I ...
I'm working on some script but it have a serious problem with hashes.
I have a list of link-images like:
<a href="#1"><img src="1.jpg" /></a>
<a href="#1"><img src="2.jpg" /></a>
<a href="#1"><img src="3.jpg" /></a>
All I want to do is to load file files/#1.html after clicking the first image, files/#2.html after the second etc.
Her...
Hey all !
I'm building a line chart and I want my points to have an id. How to do that in using push ?
options.series.data.push(data,id); ???
or something like that
Thanks a lot.
...
This seems to be a common problem among coders from different languages.
I'm using jQuery to pull AJAX text into a screen, but firebug reports an
unterminated string literal with a worthless example :
$("#content").html("<div class=\'grid_...g\'><\/div>\n<p>Cold Seafood Platters\n
I double checked in my AJAX example text if there w...
I looked into previous questions, but they didn't seem to answer what's happening to me.
In my real code i'm creating a form on the fly and adding to it two buttons, one for submission and another for other function. For this I'm setting the "type" attribute of the buttons to "submit" for one and "button" for the other. The problem is th...
Hi,
I have some DIV's in my HTML that I load dynamically using AJAX.
$("#workPanel").load("ex.html");
I also have some static links that onclick, call the JQUery masonry to shuffle these dynamic DIV's..
$('#filtering-nav li.1 a, li.2 a, li.3 a').click(function(){
$('#primary').masonry();
r...
I have a DOM element like this:
<div id='master-value'>Apples</div>
I have many other elements elsewhere on the page that I need to sync with the 'master-value'.
<div class='fruit-value' data-reference='master-value'>Apples</div>
<div class='some-fruit' data-reference='master-value'>Apples</div>
When I change the value of the 'mast...
Problem
I want to validate a field using a custom validator I've created that's essentially a regex for a phone number only IF the field has a value, otherwise it doesn't need to be validated because it's optional.
Custom validator:
$.validator.addMethod('phone', function (value) {
return /^[01]?[- .]?\(?[2-9]\d{2}\)?[- .]?\d...
So I'm working on a site, and we need to check if jQuery is defined before writing it to the page. I want to convert it to use JS conditional shorthand, but for some reason when I do that the statement does not execute. Here is my code:
Original (this works, tested):
if (typeof jQuery == 'undefined') {
document.write('<script typ...
Since I have a panning ` element do to a jQuery spritely plugin method which I'm calling to pan some Super Mario Bros backgrounds, it appears to increase the page length quite a bit.
If you visit http://www.marioplanet.com you will notice that there 3 different panning backgrounds. With only 2, there isn't enough to fill the entire hei...
I have a bunch of inputs and buttons, similar to how Facebook's news feed:
<div class="section_1">
<input name="input-name"/>
<button style="display:none">Save</button>
</div>
I have a bunch of these (section_2, section_3, etc.). I could put id's like this:
<div class="section_1">
<input class="expandableinput" name="inpu...
I've got some pages such as the user-agreement that I want to appear with or without the layout (extends tag) depending on how it is called. I'm using jQuery Fancybox to load up these pages in iframes. If JS is disabled, the links should open in a new window w/ the full layout, otherwise, if they're in an iframe, they don't need the layo...
Hi Guys,
I'm trying to get the exact mouse position relative to the window.
Here is my issue...
document.height = 1600 (actual document size)
window.height = 400 (viewable)
I need to figure out the mouse position relative to the window, not to the document which the pageY attribute provides.
It's for a large tooltip, which gets ...