Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
http://jsfiddle.net/PF8nL/1/
Using the code in the above jsfiddle I am unable to unhide and hide a row using jQuery. According to this stack answer it seems I am doing this correctly.
Do I have some stupid error? possibly causing this?
Code:
$('input[name="custom_rejection_option"]').click(function() {
$('.custom_reject_area').toggle(this.checked);
}};
You had a syntax error
$('input[name="custom_rejection_option"]').click(function () {
$('.custom_reject_area').toggle(this.checked);
});
//You had `}` instead of the closing `)`
You just had some typos and things.
$('input[name=custom_rejection_option]').click(function() {
$('.custom_reject_area').toggle(this.checked);
});
http://jsfiddle.net/PF8nL/5/
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I need get a value using jquery "data()". but I need to do it by doing something like this. So please give me an idea . Thank you in advance.
//html
<div id="myid" data-cityid="Colombo" ></div>
var name = "cityid";
$("#myid").data(""+name+""); // this way not working :(
Your are trying to get attribute, use attr() for it with complete name of attribute:
var name = "data-cityid";
alert($("#myid").attr(name));
Here is demo
You try to use attr():
To get:
$("#myid").attr('data-cityid');
To set:
$("#myid").attr('data-cityid', name);
Try with attr.
$("#myid").attr("data-"+name);
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am struggling with this for some time and hope to get experts help me.
Context is:
window.open blocked by default (popups blocked)
I was provided with an answer in comment 1 in that question the fiddle is as below
http://jsfiddle.net/chokchai/EgBQK/
This might be the answer but I am failing to understand that:
Can not this be done purely in jQuery? I am talking abt following code:
$('body').append('<div> Share on Facebook </div>');
How can I convert this code to pure jQuery? In the code above, html code is created in jquery code?????
Try this way:
var url = ['http://google.com', 'http://bing.com', 'http://duckduckgo.com/'],
$coll;
$coll = $.map(url, function (val) {
return $('<div/>').append($('<a/>', {
href: '#',
rel: val,
text: 'Share on Facebook'
}).click(handleClick));
});
$('body').append($coll);
function handleClick(e) {
e.preventDefault();
window.open('https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(this.rel), 'facebook-share-dialog', 'width=626,height=436');
}
Demo
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I want to remove an attribute of img. Here you can see my codes :
$("#zoom_05").removeAttr('data - zoom - image');
And my img :
<img id="zoom_05" src="http://localhost:3192/ProductImages/Small/093.jpg" data-zoom-image="http://localhost:3192/ProductImages/Larges/093.jpg" />
I can remove src attribute but I can not remove data-zoom-image attribute. Do you have any suggestion?
You are using whitespaces when you shouldn't:
$(document).ready(function(){
$("#zoom_05").removeAttr('data-zoom-image');
});
In case you don't believe me... :) http://jsfiddle.net/7ZTkC/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have following jQuery code to submit form data to the server.
$(document).ready(function() {
$("#update").click(function() {
$.post("./Index/StatusUpdateDo",
{
status: $("#status").val()
},
function(data, status) {
setTimeout(quit, 2000);
});
});
Also I have
<div id="response"></div>
in that same page. What i want to do is get server response and print on that 'div'. as I'm new to jquery please help me to do this.
A quick look at the docs would have revealed that .html() assigns HTML content to an element and the front page of jquery.com shows that $('#response') selects an element by ID.
$('#response').html(data);
You put this code in the callback function where you currently call setTimeout.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Hello I have a database populated dropdown table that is not working in IE when I try to use
<script>
$(".viewall").click(function () {
$(".alltable").css("display", "table");
$(".alltable tr").css("display", "table-row");
$(".alltable td").css("display", "table-cell");
});
$(".closeall").click(function () {
$(".alltable").css("display", "none");
$(".alltable tr").css("display", "none");
$(".alltable td").css("display", "none");
});
</script>
I use to use slideDown() in JQuery and work but took way to long.....if you could give me a hand thanks :)
It does not make sense, why are you hiding it on 3 different levels? If you hide the outer level, they will all be hidden! Also you are reinventing jQuery's hide() and show().
$(".viewall").click(function () {
$(".alltable").show();
});
$(".closeall").click(function () {
$(".alltable").hide();
});
You can't just set a short animation speed for slideDown()?