Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
3,857,700 | 3,857,701 |
Slide effect (jQuery)
|
<p>I wonder why this isn't working as expected:</p>
<pre><code>$(function() {
$(".door1-trigger").click(function() {
$(".door").hide();
// $(".door1").show("slide", { direction: "right" }, 1000);
return false;
});
$(".door2-trigger").click(function() {
$(".door").hide();
$(".door2").show("slide", { direction: "left" }, 1000);
return false;
});
$(".main-trigger").click(function() {
$(".door").hide();
if ($('.door1:visible')) {
$(".main").show("slide", { direction: "left" }, 1000);
} else {
$(".main").show("slide", { direction: "right" }, 1000);
}
return false;
});
});
</code></pre>
<p><a href="http://jsfiddle.net/UePuR/36/" rel="nofollow">JSFiddle</a></p>
<p>I would like only the <code>main</code> shown initially, clicking on <code>door 1</code> slides the appropriate container from left, and clicking <code>door 2</code> slides the door2 container from right.</p>
<p>Many thanks for your help!</p>
|
javascript jquery
|
[3, 5]
|
1,161,869 | 1,161,870 |
Javascript concatenate variable to url
|
<p>If i have a variable lets say </p>
<pre><code>var id = //something dynamically generated
then i have <a href="http://localhost/ (the variable id)"
</code></pre>
<p>How do i go about this?</p>
|
javascript jquery
|
[3, 5]
|
3,192,579 | 3,192,580 |
jCarousel stop immediately on mouseover
|
<p>I'm using jQuery jCarousel for a slider, after few mins I found the way to stop the slider on mouseover, but the problem is it doesn't stop immediately on mouseover, it only stop at the end of the image set (3 images in my demo). However it does start immediately on mouse out. I'm new javascript stuff and couldn't do much by diving to it's source. :(</p>
<p>My Current Code - <a href="http://bit.ly/ijNcow" rel="nofollow">http://bit.ly/ijNcow</a></p>
<p>Thank You </p>
|
javascript jquery
|
[3, 5]
|
383,954 | 383,955 |
Determining ASP.NET client ids
|
<p>This question is similar to <a href="http://stackoverflow.com/questions/546392/forcing-client-ids-in-asp-net">http://stackoverflow.com/questions/546392/forcing-client-ids-in-asp-net</a> but not quite.</p>
<p>ASP.NET generates clientids according to its own internal mechanism. I would like to run a xmlhttprequest query in the background to do an update and selectively reload some of the controls. My plan is to run the query and regenerate the page in the background, but only selectively rendering the controls I want to update - then just replace the html of those controls with the new ones.</p>
<p>My question is, can I expect the clientids to be the same (since I'm generating the same page) and is there any thing else I need to be aware of if I want to update asp.net-generated html through javascript?</p>
|
asp.net javascript
|
[9, 3]
|
2,759,194 | 2,759,195 |
Implementation of a social app
|
<p>I would like to gain some knowlegde and expertience on the subject of what it takes to build a social app.</p>
<p>Such as allowing the user to:</p>
<p>Like things.</p>
<p>Have a profile with username, picture, about you section. etc.</p>
<p>Have friends</p>
<p>Have the ability to view friends profiles.</p>
<p>Okay so i know i would need a server for these basic operations but does anyone have any recommendations or guides on how to go about creating something like this?</p>
<p>Cloud-based servers i could use to store, retrieve, and send information(such as the profile information, pictures etc)</p>
<p>I tried to get my question easy to understand as possible.</p>
<p>Hope to get some good advice.</p>
<p>Thanks!</p>
|
java android
|
[1, 4]
|
3,159,581 | 3,159,582 |
x must be < bitmap.width()
|
<p>I'm building an app that takes a picture, displays the picture and then once tapped, returns the color of the picture wherever it was tapped.</p>
<p>It gets as far as the tap before it crashes. I get the error that x must be < bitmap.width()</p>
<p>As far as my understanding goes, if I'm clicking within the bitmap and gaining the coordinate, how can it be greater than the bitmap.width()?</p>
<p>I'll post my code below and see if anyone can help me make sense of what I'm doing wrong.</p>
<p><a href="http://pastebin.com/scwiuM4w" rel="nofollow">http://pastebin.com/scwiuM4w</a></p>
|
java android
|
[1, 4]
|
3,889,252 | 3,889,253 |
When mousing over any control in this user control, the text of every label turns red
|
<p>I have a custom user control that contains <code>asp:ValidationSummary</code>. It is placed on a page along with other controls that display data. When I try to save the page and the validation fires, I get the following, strange behavior:</p>
<p>If I mouse over any controls on the page, all labels turn to red color. When the cursor leaves page, they return to the color specified in their CSS. I did not find any code for mouseover, etc...</p>
<p>I wonder if the ValidationSummary is doing something that I am not aware of? I appreciate any feedback.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
2,335,040 | 2,335,041 |
Running android using device connected to usb
|
<p>can I somehow run the android project currently running using my phone that is connected via usb?
the android emulator starts pretty slow so i think it would be better to use my device</p>
|
java android
|
[1, 4]
|
2,107,932 | 2,107,933 |
Add a Click Event to elements added to the DOM
|
<pre><code> var myOP = '<div>';
for (var i = 0; i < op.length; i++) {
myOP += '<div>';
myOP += '<div id="myBTN-' + [i] + '">' + op[i]['Field1'] + '</div>';
myOP += '<div id="blah-' + [i] + '">' + op[i]['Field2'] + '</div>';
myOP += '</div>';
}
myOP += '</div>';
$("#myBTN-" + i).click(function () {
$('#blah-' + i).toggle("slow");
});
$('#container').html(myOP);
</code></pre>
<p>I'm trying to get the click function to fire on the elements i'm created w/ the above for loop. Can anyone point me in the right direction?</p>
|
javascript jquery
|
[3, 5]
|
4,472,301 | 4,472,302 |
c#: crawler project
|
<p>Could I get very easy to follow code examples on the following: </p>
<ol>
<li>Use browser control to launch request to a target website.</li>
<li>Capture the response from the target website.</li>
<li>convert response into DOM object.</li>
<li>Iterate through DOM object and capture things like "FirstName" "LastName" etc if they are part of response.</li>
</ol>
<p>thanks</p>
|
c# asp.net
|
[0, 9]
|
2,002,440 | 2,002,441 |
Adding several input boxes based by a select box value
|
<p>I have a select box:</p>
<pre><code><select id="steps_number">
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</code></pre>
<p>Now, if the user selects "4", then 4 input boxes needed to be added to the page, if he changes his selection to 8, 8 input boxes need to be there, an so on...</p>
<p>And also, the input boxes names are important, I'm gonna send the form values to another page for processing and inserting the data into db, how I could know/get the newly made input boxes names?</p>
|
javascript jquery
|
[3, 5]
|
3,802,606 | 3,802,607 |
Working with money in android app
|
<p>Hello my app is working with money. What structure i should use and how ? </p>
<p>I mean that from web service i get decimal number price.
I don't do any operations with this money, no calculating. Can i keep this in String and when time comes to pass this price to bank ? Nothing would happens. Can i lose in this way some numbers ? </p>
<p>At some time i need to give this money using Intent and extras. Or i should use some other structure ? I appreciate for your help guys.</p>
<p>So give me your ideas.</p>
<p>Thanks.</p>
|
java android
|
[1, 4]
|
3,255,234 | 3,255,235 |
Is there are proper way to $.extend a nested properties in jQuery?
|
<p>What I have and what I need. It's easy.</p>
<p>The default options (there are nested properties):</p>
<pre><code>{
sDom: 'frt<"tfoot"lp>',
bInfo: false,
sPaginationType: "full_numbers",
oLanguage: {
sSearch: "",
sLengthMenu: "Show _MENU_",
oPaginate: {
sFirst: "|<<",
sLast: ">>|",
sNext: ">>",
sPrevious: "<<"
}
}
}
</code></pre>
<p>Actual options:</p>
<pre><code>{
oLanguage: {
oPaginate: {
sNext: "MODIFIED"
}
}
}
</code></pre>
<p>The result of $.extend:</p>
<pre><code>{
sDom: 'frt<"tfoot"lp>',
bInfo: false,
sPaginationType: "full_numbers",
oLanguage: {
oPaginate: {
sNext: "MODIFIED"
}
}
}
</code></pre>
<p>What I need is to properly extend the defaults options with the actual options and get the following result (one property has been modified):</p>
<pre><code>{
sDom: 'frt<"tfoot"lp>',
bInfo: false,
sPaginationType: "full_numbers",
oLanguage: {
sSearch: "",
sLengthMenu: "Show _MENU_",
oPaginate: {
sFirst: "|<<",
sLast: ">>|",
sNext: "MODIFIED"
sPrevious: "<<"
}
}
}
</code></pre>
<p>The problem is that $.extend function ignores nested properties and operates only first-level properties. Now I have manually $.extend each of the nested properties, but I guess it is not a solution.</p>
|
javascript jquery
|
[3, 5]
|
3,567,487 | 3,567,488 |
How can i rearrange div order at every reload?
|
<p>Is there a way of rearanging div order?
More exact how can i get from</p>
<pre><code><div id="1"></div>
<div id="2"></div>
<div id="3"></div>
<div id="4"></div>
</code></pre>
<p>this</p>
<pre><code><div id="3"></div>
<div id="1"></div>
<div id="4"></div>
<div id="2"></div>
</code></pre>
<p>or any other order at every reload.</p>
|
javascript jquery
|
[3, 5]
|
5,745,039 | 5,745,040 |
declare an array in a for
|
<p>Is there a method for declare and use an array in a <code>for</code> loop like this:</p>
<pre><code>foreach(string j in ["1","1"])
{
}
</code></pre>
<p>?</p>
<p>thanks</p>
|
c# asp.net
|
[0, 9]
|
912,914 | 912,915 |
How to put a LinkButton INTO a tooltip using ASP.NET?
|
<p>When using the core ASP.NET 3.5 (w/ Ajax), is it possible to include a LinkButton in a tooltip?</p>
<p>Unfortunately, these tooltips are generated on-the-fly within a GridView to display custom data from each row. Tooltips are currently showing using jQuery.</p>
<p>So, I don't know how to add a LinkButton (for a "Modify" action) to call a method on code-behind.</p>
<p>Maybe I'm going the wrong way... Any suggestions?</p>
<p>Thank you!</p>
|
c# asp.net
|
[0, 9]
|
5,537,068 | 5,537,069 |
problem with setInterval(); and clearInterval
|
<p>I have a problem involving setinterval. It's probably best to show an example so here's a link here:</p>
<p><a href="http://boudaki.com/testing/carouselTest" rel="nofollow">http://boudaki.com/testing/carouselTest</a></p>
<p>Basically I'm having problems making this work like I need it to. When the page loads the content rotates every three seconds and the numbered buttons on the right do so also. when you click on a button the buttons extend and the animation is stopped - all good. Then when you click the little close button at the bottom of the buttons the animation resumes - all good....but then when you come to click on the numbered buttons again the animation keeps on going. Why?</p>
<p>There's rather a lot of code but the setIntervals and clear intervals are:</p>
<ul>
<li>line 69: on document.ready start the animation off -assign timerId to a global var</li>
<li>line 87: When the user clicks on the numbered button clearinterval in that animation</li>
<li>line 102: when the user clicks on the close button start the animation again</li>
</ul>
<p>That's it....I just don't get why it doesn't stop the animation the second time around??? Can anyone see why?</p>
<p>Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
1,397,788 | 1,397,789 |
Problem removing a dynamic form field in jquery
|
<p>I'm trying to remove a dynamic form field by click a button. It will also subtract whatever values it had from the total amount from my calculation. This is the code:</p>
<pre><code>function removeFormField(id) {
var id = $(id).attr("name");
$('#target1').text($("#total" + id).map(function() {
var currentValue = parseFloat(document.getElementById("currentTotal").value);
var newValue = parseFloat($("#total" + id).text());
var newTotal = currentValue - newValue;
document.getElementById("currentTotal").value = newTotal;
return newTotal;
}).get().join());
$(id).remove();
}
</code></pre>
<p>Okay, it will do the subtraction portion of the code with no problem, this issue is with the last line to remove the field. If I comment out the rest of the code it will work, but not with the rest of the code. I know this is something simple, yet I can't seem to wrap my mind around it. Can someone please help?</p>
|
javascript jquery
|
[3, 5]
|
2,739,888 | 2,739,889 |
Dynamically get changed select value JQuery
|
<p>What I need to do is get the value of the selected option (when changed) in a select list and change the text in a span next to the select list. The problem is I don't know the id the the select list. There are lot of different select list on the page (5-25+) and they are all created dynamically and so I can't have the id specified in the .change(). Here is what I have:</p>
<p><strong>JS:</strong></p>
<pre><code>$("select").change(function () {
var str = "";
str = $("select option:selected").text();
$(".out").text(str);
}).trigger('change');
</code></pre>
<p>(Of course this doesn't work, puts all of the select values in each span)</p>
<p><strong>HTML:</strong></p>
<pre><code><select name="animal[]">
<option value="dog">dog</option>
<option value="cat">cat</option>
<option value="bird">bird</option>
<option value="snake">snake</option>
</select>
<span class="out"></span>
</code></pre>
<p>I feel like I am missing something simple but I can't find anything. Thanks for all of your help.</p>
|
javascript jquery
|
[3, 5]
|
5,278,873 | 5,278,874 |
how to remove error text from the email format checker code?
|
<p>I have been writing a code for validating forms using javascript/jquery. Following is a code snippet for checking email format. The problem is when I enter invalid email, it recognizes it, but when I go back to this field and enter correct email, the error text still stays even though I have used the 'else' part. How do I remove the error text in this case?</p>
<pre><code>if(e1.value!=''){
var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
if (document.signupForm.email1.value.search(emailRegEx) == -1) {
$("#err_email1").html("Please enter valid email address.");
}
status=0;
}
else{
$("#err_email1").html("");
status=1;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,915,392 | 4,915,393 |
whats the pros/cons with working with PHP as opposed to asp.net or the whole .net framework?
|
<p>I'm currently working with php but everyone is telling me that asp.net is so much better. What is the real story?</p>
|
php asp.net
|
[2, 9]
|
4,570,963 | 4,570,964 |
Fade out before loading new content
|
<p>How do I fade out #special, then load the content, and when it´s loaded fade in again.</p>
<pre><code>function test(x,y) {
$('#special').fadeOut('fast').fadeIn('slow');
$('#special').load('index.php?close=1 #special');
}
</code></pre>
<p>I don´t want it to display/load the new content until #special has faded out.</p>
|
javascript jquery
|
[3, 5]
|
3,373,368 | 3,373,369 |
How to get the text from the selected option?
|
<pre><code>string x = "<select><option value='2'>dfgdfh</option><option value='3'>cvncvn</option><option value='4'>cvn</option><option value='5'>dhdfh</option><option value='6'>dfhdfh</option><option selected="selected" value='7'>dfhdfh</option><option value='8'>dfgfdh</option><option value='12'>New type</option></select>"
</code></pre>
<p>How to get the text from the selected option?</p>
|
javascript jquery
|
[3, 5]
|
2,089,555 | 2,089,556 |
Can I prepend table to another table using jQuery?
|
<p>I am trying to prepend table "new" to table "lasttable" using jQuery but I cannot get the result. Am I doing the right thing or I misunderstood the meaning of prepend?</p>
<pre><code><table id ="lasttable" class="add" border="1px" width="100%">
<tr class="header"><td class="location" colspan="7">New Item</td></tr>
</table>
</code></pre>
<p>My jQuery:</p>
<pre><code>$("#lasttable").prepend("<table id=\"new\" class=\"add\" border=\"1px\" width=\"100%\">"
+"<tr class=\"header\"><td class=\"stretch\"><a class=\"eloc\" rel=\"leanModal\" href=\"#modal_location\"><img src=\"images/edit-icon.png\" alt=\"Location\"></a></td><td class=\"location\" colspan=\"6\"></td></tr>
+"</tbody></table>");
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,931,846 | 4,931,847 |
java from command line over and over
|
<p>i have a PHP application that invokes a command line to execute some specific operations.</p>
<p>The command line calls a 'java -jar somefile.jar arg1 arg2'</p>
<p>The problem is that this is slow, since it has to startup the jar every time it get's invoked.</p>
<p>Is there any way keep the java machine code in cache or is there any way to optimize the whole process? </p>
<p>Thanks,
joel</p>
<p>Update:
The JAR was developed by our team.</p>
<p>To use as a service, i'll have to install some java server (tomcat or alike), right?</p>
<p>And how about a java php bridge? Can that be any faster?</p>
|
php java
|
[2, 1]
|
4,521,044 | 4,521,045 |
Ajax jquery unauthorized request
|
<p>I am making an ajax request using Jquery and everything works fine except the page is protected so only logged in users can make request. I am already logged in but I think Jquery ajax doesn't send my cookies to the url. How can I solve this error so cookies, headers are also sent so the page doesn't treat it as 401 request?</p>
<p>Thanks in advance :)</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
2,709,373 | 2,709,374 |
jQuery :: How to execute one function based off two possible events
|
<p>I'm looking for a clean way to fire one function that may be triggered by two possible events. For example:</p>
<pre><code>$('form').on('submit', function() {
stuff in here...
});
$('input').on('change', function() {
same stuff in here as before...
});
</code></pre>
<p>I could do</p>
<pre><code>function doStuff() {
Stuff in here....
}
$('form').on('submit', function() {
doStuff();
});
$('input').on('change', function() {
doStuff();
});
</code></pre>
<p>But I was wondering if there was a more elegant way of doing this? </p>
|
javascript jquery
|
[3, 5]
|
1,785,584 | 1,785,585 |
Jquery Anythingslider too much recursion error
|
<p>I am getting a too much recursion error on my main page.</p>
<pre><code>too much recursion
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_...|absolute|fixed)/.test(b.curCSS(this,
</code></pre>
<p>jquery-ui.min.js (line 11)</p>
<p>and another one that looks like this:</p>
<pre><code>too much recursion
(function(){"use strict";Raphael.proto...e a(this).addClass(b)})}})})(jQuery);
</code></pre>
<p>jquery.wijmo-complete.1.1.4.min.js(line 23)</p>
<p>I have no idea how to fix this. Thanks :)</p>
<p>here is the javascript for it:</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$(":input[type='text'],:input[type='password'],:input[type='textarea']").wijtextbox();
$(".button").button();
$("#slider").anythingSlider({
width: 1000,
height: 300,
toggleControls: true,
startStopped: true,
theme:'metallic'
});
});
</script>
</code></pre>
|
c# jquery
|
[0, 5]
|
5,282,105 | 5,282,106 |
thread problem in suspend() and resume()
|
<p>hi all
i doing a stop watch. for pause i use Thread.suspend() and resume i use Thread.resume(). but the resume is not resume the work.
code:</p>
<pre><code>pause(){
shouldRun = false;
currentThread.suspend();
}
resume(){
shouldRun = true;
currentThread.resume();
}
</code></pre>
<p>while(shouldRun){
.......
}</p>
|
java android
|
[1, 4]
|
1,584,959 | 1,584,960 |
jQuery.on() not working
|
<p>I'm trying to change some things in my wordpress lightbox plugin when click event is fired on it. The lightbox itself is injected after the page is loaded so I have to use <code>on()</code>.</p>
<p>Javascript in the header:</p>
<pre><code>jQuery(document).ready(function(){
jQuery("body").on("click", "#lightbox img", function() {
alert("t");
});
});
</code></pre>
<p>I never see an <code>alert</code>. I tried changing the <code>#lightbox img</code> selector to <code>div</code> and still nothing.</p>
<p>EDIT: i get no error on chrome console and fixed the syntax error, which was caused by removing the functions that were useless for the question.</p>
|
javascript jquery
|
[3, 5]
|
4,068,094 | 4,068,095 |
How to run <br> when using .text()
|
<p>I try to use php post $value for jquery and slow on .text()</p>
<pre><code>$value = "<html>";
$value .= "</html>";
$(document).ready(function(){
$('#area').text(value);
});
result is: <html></html>
</code></pre>
<p>I try add \n ,<br>,but not work. </p>
<p>How to change it output </p>
<pre><code><html>
</html>
</code></pre>
|
php jquery
|
[2, 5]
|
3,165,390 | 3,165,391 |
  suddenly coming all over the aspx. file
|
<p>Suddenly i noticed <code>&nbsp;&nbsp;&nbsp;&nbsp;.....</code> suddenly showing up in my .aspx file.
Everything seems to be working fine but i have no idea where this is coming from?</p>
<p>These lines appear everywhere inside my validator control where the display="dynamic".</p>
<p>The debugger shows 0 warnings and 0 errors.
What is the cause of this most wierd occurence?</p>
|
c# asp.net
|
[0, 9]
|
5,787,260 | 5,787,261 |
How could I access the ring and vibration as an alert from java script or html
|
<p>How could I access the ring and vibration as an alert from java script or html.</p>
<p>I am trying to activate the ring tone, when AJAX returns the valid data.</p>
<p>I couldn't find anything so far.</p>
<p>Thanks,
Zafer Boz</p>
|
javascript iphone
|
[3, 8]
|
5,608,681 | 5,608,682 |
Unable to evaluate expression because the code is optimized or a native frame is on top of call stack
|
<p>I am working on a website where user comes and submits some information. After the information is submitted I am trying to send two mails simultaneously - one to my sales team and one to the visitor on my website.</p>
<p>While the mails are getting sent I am getting the following error while redirecting to another page using <code>Response.Redirect("http://www.targetsite.com/index.php")</code>:</p>
<blockquote>
<p>Unable to evaluate expression because the code is optimized or a
native frame is on top of call stack</p>
</blockquote>
<p>Can anybody help me with this issue? Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
4,811,294 | 4,811,295 |
Error unterminated string literal when using php javascript?
|
<p>I have a file with format</p>
<pre><code><script src="test.php"></script>
</code></pre>
<p>And code in test.php with table test(id, name) with 4000 rows</p>
<pre><code><?php
$sql = "Select * From test";
$data = array();
$query = mysql_query($sql);
while($row = mysql_fetch_object($query)) {
$data[] = $row;
}
$str = '';
foreach($data as $row) {
$str .= $row->name;
}
?>
output('<?php echo $str ?>');
</code></pre>
<p>When I run code is error is <code>unterminated string literal</code>, but when repair code with
<code>$sql = 'Select * From test order by id limit 100'</code> is no error, how to fix it ?</p>
|
php javascript
|
[2, 3]
|
4,284,051 | 4,284,052 |
Using clientscript.registerstartupscript with parameters to call javascript function
|
<p>1) I'm having an javascript control created with HTML5 and showing it with div.</p>
<pre><code><div id="<%=this.ClientID%>" style="z-index:100;"></div>
</code></pre>
<p>The control has a method <code>init()</code> to which I need to pass parameters from code behind; in order to initialize it. So this is how I'm doing it:</p>
<pre><code>string script2 = String.Format("<%=this.ClientID%>.init({0},{1})", param1, param2);
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "initialize control", script2, true);
</code></pre>
<p>Is this the right way?</p>
<p>2) What's the difference between setting parameter as <code>{1}</code> and <code>'{1}'</code>? </p>
|
c# javascript asp.net
|
[0, 3, 9]
|
487,782 | 487,783 |
selectedindexchanged event of dropdownlist is not working with jquery
|
<p>hello I have a <code>dropdownlist</code>. I am using jquery plugin to give style to <code>dropdownlist</code>. jquery plugin is <strong>jquery.dd.js</strong>. but my problem is <code>selectedindexchanged</code> event is not working in Internet exlorer 8 although it is working fine in other browsers.</p>
|
jquery asp.net
|
[5, 9]
|
4,912,941 | 4,912,942 |
remote implementing c++ program through php
|
<p>Recently I've been working on web page based remote control. the function is already there done by c++ and now I'm trying to find a way linking this function to my web page.
I tried using soap and now almost give up because of those "cannot load wsdl file" and "http get method not implemented" errors</p>
<p>Is there any other way to do this beside using soap?
Cheers</p>
|
php c++
|
[2, 6]
|
2,024,912 | 2,024,913 |
Passing Value to Javascript function
|
<p>I'm calling a jQuery function, but the alert function displays [object Object]. The check value works, but not the passed id value.</p>
<p>Here's the call to the function taken from the html output:</p>
<pre><code><td class="myGroups">
<input class="chkSubscribed" type="checkbox" onclick="UpdateSubscription(2)" name="subscribed">
</td>
</code></pre>
<p>Here's the javascsript function:</p>
<pre><code>$(".chkSubscribed").change(function(id) {
alert(id);
var chkd=0;
var groupid=id;
if (this.checked) { chkd=1; }
$.ajax({
type:"POST",
url:"resources/updateSubscribe.php",
data: { group_id: groupid, checkval: chkd },
success: function(){
alert("Account updated!" + "chkval=" + chkd + " id=" + groupid); }
});
});
</code></pre>
<p>Thanks for any help!</p>
|
javascript jquery
|
[3, 5]
|
4,462,543 | 4,462,544 |
preventing android daily alarm from running the intent during alarm setup
|
<p>I followed the instructions in <a href="http://stackoverflow.com/questions/7845660/how-to-run-a-service-every-day-at-noon-and-on-every-boot">this thread</a> to create a daily alarm that starts a service at 12:30 each day which shows a notification. The problem I'm having is that setting the alarm also triggers the service (=> and the notification) every time the app starts.</p>
<p>Since I figured that the alarm will run only at the specified time (12:30) then I have no problem setting it when the app starts.</p>
<p>I realize that setting the alarm from scratch every time the app is launched is a bit ineffective since it only needs to be set once (I made it set on device boot as well), but it seemed like the easiest way.</p>
<p>So what's the best way to fix this? is there a way to set the alarm for the specified time without running the intent when setting?</p>
<p>Here's the code if you are interested (this function is called every time when launching the app):</p>
<pre><code>public static void setAlarm(Context context)
{
Intent intent = new Intent(context, AlarmReceiver.class);
intent.setAction("com.Rani.app.SET_NOTIFICATION_ALARM");
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
Calendar dailyCheckTime = Calendar.getInstance();
dailyCheckTime.setTimeZone(TimeZone.getTimeZone("GMT"));
dailyCheckTime.set(Calendar.HOUR_OF_DAY, 12);
dailyCheckTime.set(Calendar.MINUTE, 30);
AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
alarm.cancel(pendingIntent);
alarm.setRepeating(AlarmManager.RTC_WAKEUP, dailyCheckTime.getTimeInMillis(),
AlarmManager.INTERVAL_DAY, pendingIntent);
}
</code></pre>
<p>thanks in advance.</p>
|
java android
|
[1, 4]
|
1,796,885 | 1,796,886 |
How can I remove an element from a list returned by a jQuery selector?
|
<p>I would like to uncheck all checkboxes that have a specific class with the exception of the one just checked.</p>
<pre><code>function PizzaToppings_OptionValueChanged(checkboxElement) {
if ($(checkboxElement).attr("checked")) {
if($(checkboxElement).hasClass('cheese_toppings'))
{
// This will uncheck all other "cheese_toppings" but I want the newly selected item "checkboxElement" to remain checked.
$('input:checkbox.cheese_toppings').attr('checked', false);
}
}
}
</code></pre>
<p>The code above will uncheck all "cheese_toppings" including the one just selected. I don't want to then recheck the one just selected or the event will be recalled.</p>
<p>I thought the best solution would be to remove "checkboxElement" from the list returned by <code>$('input:checkbox.cheese_toppings')</code> and then set the <code>.attr('checked', false)</code> to that list. But I'm not sure how to remove checkboxElement from the list.</p>
|
javascript jquery
|
[3, 5]
|
3,308,768 | 3,308,769 |
Determine the browsers homepage
|
<p>I've searched for an answer but I can't seem to find out how this is done. Obviously I know that access to the browsers homepage is a security issue and not easily obtained, but I want to know if there is a way we can compare it.</p>
<p>If you search for something on Google in Internet Explorer and click on page 2, then hit the refresh button, you'll see a blue bar appears that says "Come Here Often? Make Google your Homepage". My questions is, how is this accomplished?</p>
<p>I've tried putting in an iFrame that contains an HTML file that has <code>window.location = "about:home";</code> But, that doesn't work because it will just keep reloading the page if I am the homepage...</p>
<p>Hopefully someone out there can help me out with a solution.</p>
<p>Thanks!</p>
|
php javascript
|
[2, 3]
|
250,799 | 250,800 |
why alert function not show index of each one
|
<p>I create one object named "Ball".
after document load, script will create 12 instance of object and insert so many element li to </p>
<pre><code><ul></ul>
</code></pre>
<p>my purpose is that when click ball, it show index of ball.
for exmaple: click No 3 ball, it show 3.
but when i click each ball, it always show 12. </p>
<p>sorry, i cannot upload snapshot for html document, since i am new guy here.</p>
<pre><code>function Ball(idx, parent, libra) {
this.idx = idx;
this.parent = parent;
this.libra = libra;
this.init();
}
Ball.r = 30;
Ball.prototype = {
init: function() {
var _html = $("<li><div class='ball'><span>" + this.idx + "</span></div></li>"),
pos
_this = this;
this.parent.append(_html);
this.html = _html.find(".ball");
this.html.css({
height: Ball.r * 2 + "px",
width: Ball.r * 2 + "px",
lineHeight: Ball.r * 2 + "px"
});
pos = this.html.position()
this.html.css({
left: pos.left + "px",
top: pos.top + "px",
position: "absolute"
});
this.html.mousedown(function() {alert(_this.idx)});
}
};
$("document").ready(function() {
var parent = $("#balls ul"),
libra = 1;
for (var i = 1; i < 13; i++) {
new Ball(i, parent, libra)
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,278,260 | 3,278,261 |
Jquery Clone Function
|
<p>Is there any way to customize html by JQUERY clone function let say i have a div</p>
<pre><code><div id="my_Div" style="margin-right:14px;"> Name :
<input type="text" name="file_name[]" id="file_name" class="validate[required]"/>
&nbsp;&nbsp; Choose File :
<input type="file" name="upload_file[]" id="upload_file" class="validate[required]" onChange="getFileExtension('upload_file');"/>
</div>
</code></pre>
<p>no by clone function </p>
<pre><code>$('#my_Div').clone().appendTo("body");
</code></pre>
<p>i can make as it is clone html but i wanna customize </p>
<pre><code><input type="text" name="file_name[]" id="file_name" class="validate[required]"/>
</code></pre>
<p>i.e</p>
<pre><code><input type="text" name="file_name[]" id="file_name1" class="validate[required]"/>
<input type="text" name="file_name[]" id="file_name2" class="validate[required]"/>
<input type="text" name="file_name[]" id="file_name3" class="validate[required]"/>
</code></pre>
<p>any help???</p>
|
javascript jquery
|
[3, 5]
|
3,443,298 | 3,443,299 |
Captcha image not displaying on remote server
|
<p>I have a problem with my Captcha image. It's working fine on my local system but not on remote server. Recently we shifted server that was working fine in previous server. I didn't miss any references. Please reply soon</p>
|
c# asp.net
|
[0, 9]
|
5,858,599 | 5,858,600 |
Count Down Timer on Resume
|
<p>I'm currently updating an Android application that uses an AsyncTask to do a countdown timer, which isn't stopped onPause or onStop. (The process gets cached by Android, and resumed after the activity is brought back up)</p>
<p>However, I think this could be done in a better way, rather than a AsyncTask. The biggest thing about this timer is that it's not actually resuming from where it was previously -- it needs to act as if it was running the entire time. </p>
<p>Basically what's being done is we have an endtime/date & we subtract the current time from it to get what the counter needs to display.</p>
<p>What's the best way to implement this?</p>
|
java android
|
[1, 4]
|
3,464,411 | 3,464,412 |
How to make list header and footer not click able?
|
<p>I have a list with footer and header. I added onLongClick to delete item from list. When I press long on header it remove first item from list. When I click on last item or footer the app will crash- item out of range.</p>
<blockquote>
<p><strong>Can I make footer and header not clickable? or how should i count item in adapter? or is there some other way to baypass it?</strong> </p>
<blockquote>
<p>Removing items: </p>
</blockquote>
</blockquote>
<pre><code>list.setOnItemLongClickListener(new OnItemLongClickListener() {
public boolean onItemLongClick(AdapterView<?> parent, View v,
int position, long id) {
// Delete Item from List
ShoppingItem simpleItem = null;
if (shoppingListApplication.getAdapter().getCount() > 0) {
simpleItem = (ShoppingItem) shoppingListApplication
.getAdapter().getItem(position);
removeShoppingItem(simpleItem,
shoppingListApplication.getAdapter());
}
</code></pre>
|
java android
|
[1, 4]
|
2,578,551 | 2,578,552 |
getLocationOnScreen crashes, pls help
|
<p>I need to get the coordinates of my app on screen to use them as an offset for a popout.</p>
<pre><code> View tempView = (View) findViewById(R.layout.main);
int[] loc = {0,0};
tempView.getLocationOnScreen(loc); /// crashes here!
</code></pre>
<p>Tried this code, but the last line of it makes the app crash. Maybe the tempView I'm getting from the main layout somehow doesn't correspond with the layout on screen?</p>
<p>Any suggestions... thanks! :)</p>
<hr>
<p>added:
solved</p>
<pre><code> int[] loc = new int[2];
View tempView = (View) findViewById(R.id.LL_whole);
tempView.getLocationOnScreen(loc);
post( String.valueOf(loc[1]) );
</code></pre>
<p>works! :)</p>
|
java android
|
[1, 4]
|
5,788,869 | 5,788,870 |
Javascript: Tabs in an searchsystem?
|
<p>Well I need a bit help here, i just dont get how i can manage to make that script dynamic.
I like to press one continent, and it opens the correct land - then from the land it should open the correct region -> And from there it should open the correct city.
Also it shouldn't try to open one, if this continent/land/region has no child-> no another tab.</p>
<p>Its my part of an search engine. The Php and HTML doesent need to be shown here, it works right.</p>
<p>I like to make an Tab system with that i could close every box, beside the first one.
That should be the box that contains the continents.
From there you select one point from that box, in example Europa. Then the box that contains the lands from Europa should be visible. Then you can again select the next step, here in example you select now in the second box Europa->Spain Then it should open the box with the content of spain and so on.</p>
<pre><code> $(document).ready(function(){
$('#select_land_1').click(function(){
$('.box_land').hide();
$('.box_region').hide();
$('.box_city').hide();
$('#land_1').show();
$('#select_region_12').click(function(){
$('#region_12').show();
$('#select_city_34').click(function(){
$('#city_34').show();
});
$('#select_city_35').click(function(){
$('#city_35').show();
});
});
});
</code></pre>
<p>The Css looks like that :
<a href="http://img641.imageshack.us/img641/1479/bildnr1error.jpg" rel="nofollow">http://img641.imageshack.us/img641/1479/bildnr1error.jpg</a></p>
<p>Thank you very much for your help :)</p>
|
javascript jquery
|
[3, 5]
|
5,791,193 | 5,791,194 |
Check if device is dual core
|
<p>Is there any way to check if an Android device is dual core? (Other than <code>Runtime.availableProcessors()</code> as it only reports the correct number occasionally.)</p>
<p>I need it as SoundPool doesn't work on dual cores (see <a href="http://code.google.com/p/android/issues/detail?id=17623" rel="nofollow">http://code.google.com/p/android/issues/detail?id=17623</a>)</p>
|
java android
|
[1, 4]
|
65,102 | 65,103 |
Dynamic change of select values in a form, how to save them
|
<p>Html Code</p>
<pre><code><select id = "country">
<option selected = "selected" value = "0">all</option>
<option value = "1">country1</option>
<option value = "2">country2</option>
<option value = "3">country3</option>
</select>
<select id = "region">
<option selected = "selected">all</option>
</select>
</code></pre>
<p>Javascript Code</p>
<pre><code> //add an option and it's value with jquery append and javascript split.
//Array elements are in form of option|value
//so that we can process them with split
var regions = new Array()
regions[0] = ["all|1"];
regions[1] = ["region1|2","region2|3"]
regions[2] = ["region3|4","region4|5"]
regions[3] = ["region5|6","region6|7"]
$(document).ready(function() {
$("#country").change(function(){
$("#region").empty()
var v = $("#country").val()
for(i=0; i<regions[v].length; i++)
$("#region").append(new Option(regions[v][i].split("|")[0]),
regions[v][i].split("|")[1])
});
});
</code></pre>
<p>I will have many different forms like this (so i will have to create many arrays) and every form will be reused to more than one pages, so if i want to add a new option inside a select tag, code must be in one place, so that i will do the changes once. The arrays will be really long.. I'm thinking of putting the first select in an external file and retrieve it with php, and the arrays for the second select will be all in an external javascript file that will be included in all my files.. Can you think of a cleaner implementation so that i don't have to make large arrays in a basic javascript file or do you think it's a correct method?</p>
|
javascript jquery
|
[3, 5]
|
2,672,443 | 2,672,444 |
When form submission not accepted, dependent selector is messed up
|
<p>I have a page with a selector/drop-down menu that's dependent on another selector. In other words</p>
<p>-there is selector 1, which contains some number of categories, and selector 2, which contains some number of subcategories for each category in selector 1. </p>
<p>-when the page loads, selector 1 has its full range of categories available, and selector 2 has its full range of subcategories available.</p>
<p>-when a selection is made on selector 1, the number of available subcategories on selector 2 is narrowed down (as appropriate for the option selected on selector 1) through $('selector1').change(function(){ [... functionality implemented ...] });</p>
<p>The problem is that when a user submits the form, and the form is not accepted (i.e. contains errors in the fields, fields are not filled-in, etc.), since the 'change' functionality is not re-triggered, the full number of subcategories becomes available on selector 2, which makes it possible for a user, through mischief or accident, to select a subcategory which does not apply to the category selected on selector 1. Any recommendations on how to best deal with this issue? Thank you!</p>
|
javascript jquery
|
[3, 5]
|
362,877 | 362,878 |
jsgauge - setValue gives Illegal invocation in Chrome
|
<p>I'm using <a href="http://code.google.com/p/jsgauge/" rel="nofollow">jsgauge</a> initialised with:</p>
<pre><code>$('#gauge').gauge('init');
</code></pre>
<p>If I try to call</p>
<pre><code>$('#gauge').gauge('setValue', 50);
</code></pre>
<p>With Chrome I get</p>
<blockquote>
<p>Uncaught TypeError: Illegal invocation</p>
</blockquote>
<p>But it works on Firefox & IE9.<br>
Do you have an idea of why ?</p>
|
javascript jquery
|
[3, 5]
|
720,103 | 720,104 |
Using a constant variable in C++
|
<p>I have a C++ file in my C++ project in Visual Studio.
The C++ file has a snippet wherein some applications are run using <code>system</code></p>
<pre><code>system("Files\\tx1");
system("Files\\tx2");
system("Files\\tx3");
system("Files\\tx4");
</code></pre>
<p>I want to replace the "Files" constant with some constant variable which can be changed at a single place. Something like what we wuld do in C# with app.config files etc.<br/>
Directly hardcoding a constant is not a good practice. C++ project doesn't have settings file unlike C# projects. So, any suggestions what I should do in this case?</p>
|
c# c++
|
[0, 6]
|
1,358,968 | 1,358,969 |
Using a dynamic variable within a for statement
|
<p>I would like to dynamically create and reference some variables on the fly, but i'm not understanding how to.</p>
<p>Here is what I would think 'should' work, but I know doesn't.</p>
<pre><code>var weeks = 4;
for(i=0; i<weeks.length;i++){
var 'week_'+i = valueFromXML;
}
function wtFn (){
'week_'+i.splice(-1, 1);
if('week_'+i.length <=0){
$(this).parent().parent().slideUp();
}
}
</code></pre>
<p>I'm open to suggestions. Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
1,565,097 | 1,565,098 |
populate rows of programatically created asp:table
|
<p>I m creating one Empty <code>asp:Table</code> in design view.</p>
<p>Pro-grammatically I am adding <code>row</code> to this <code>table</code>.
This rows contains various <code>custom controls</code>. for e.g combination of (<code>text box & dropDownList</code>).</p>
<p>Initially I m adding all <code>control</code> to <code>rows</code> & finally into <code>table</code>.
Its properly displaying.<br/>
After changing the values inside custom control's I want to save that value in <code>database</code> on button click event.</p>
<p>On that click event I want to iterate through that table for all rows which i have added.<br/>
but on click event I am always getting empty table.</p>
<p>On net I search regarding this, but every one telling that you have to re-create table.</p>
<p>is their any way in which without re-creating the all rows I'll get all rows. so that from that rows I can save changed values to database.</p>
|
c# asp.net
|
[0, 9]
|
1,901,909 | 1,901,910 |
Getting a PHP variable in jQuery
|
<p>So I have this:</p>
<pre><code><?php
echo '
<script>
$(function(){
$("a#yeah").click(function(){
$.ajax({
url: "ajax.php?action=yeah&id='.$id.'",
success: function(html){
$("a#yeah").html("your cool")
}
})
})
})</script>';
?>
</code></pre>
<p>basically I am using the PHP variable $id wich can be find in the document, how could i get this same variable but without echoing the jQuery(so i could keep my editor syntax highlight in the Javascript part)?</p>
|
php jquery
|
[2, 5]
|
1,174,107 | 1,174,108 |
Accesing contents of res/raw programatically (Android)
|
<p>I'm working on an app for Android with a few other people, and the primary content is specified by our designers as text files in a certain file format, which we then parse, process, and serve in the app. We're currently storing them in <code>res/raw</code>.</p>
<p>This makes things great for the designers because when they want to add content, they simply add a file to <code>res/raw</code>. This is annoying as a developer, however, since we developers then need to add <code>R.raw.the_new_file</code> to an array in the code specifying which files to process at startup.</p>
<p>Is there a way to access the resource ID's of <code>res/raw</code> programatically? Ideally when the application starts, we could make a call to see which files are in <code>res/raw</code>, process all of them, so we could eliminate the small overhead with matching up the contents of <code>res/raw</code> with that of our array in the code.</p>
<p>The most promising path I've seen is <a href="http://developer.android.com/reference/android/content/res/Resources.html#getAssets()" rel="nofollow"><code>getAssets</code></a> from <a href="http://developer.android.com/reference/android/content/res/Resources.html" rel="nofollow">Resources</a>, which would let me call <a href="http://developer.android.com/reference/android/content/res/AssetManager.html#list(java.lang.String)" rel="nofollow"><code>list(String)</code></a> on the <a href="http://developer.android.com/reference/android/content/res/AssetManager.html" rel="nofollow">AssetManager</a>, but I've had trouble getting this to work, especially since you can't directly call <code>"res/raw"</code> as your filepath (or at least, it hasn't worked when I've tried. </p>
<p>Suggestions? Thanks</p>
|
java android
|
[1, 4]
|
1,147,117 | 1,147,118 |
Inconsistent behavior of Javascript click method on file input element
|
<p>I have 2 HTML elements:</p>
<pre><code><input type="file" name="file" id="file">
<a href="#" id="link">Click me!</a>
</code></pre>
<p>and the following jQuery code:</p>
<pre><code>jQuery(document).ready(function() {
$('#file').click();
$('#link').on('click',function (e) {
$('#file').click();
e.preventDefault();
});
});
</code></pre>
<p>In Firefox 16 and IE 9, the file selection dialog is opened right after the page finish loading as well as when I click on the link. However, in Chrome, the dialog is only opened when I click on the link.</p>
<p>In this question <a href="http://stackoverflow.com/questions/210643/in-javascript-can-i-make-a-click-event-fire-programmatically-for-a-file-input">In JavaScript can I make a "click" event fire programmatically for a file input element?</a>, Romas mentions that trigger file input is not allowed in Firefox and Opera. </p>
<p>It looks like Firefox allows to do that by now, but I don't understand why Chrome has 2 different behavior for the click method. Is it a bug or just because of implementation?</p>
<p>Hope for your help!</p>
|
javascript jquery
|
[3, 5]
|
1,476,848 | 1,476,849 |
where to call the base class's implementation in derived class?
|
<p>Sometimes,deriving classes should always call through to the base implementation. where should I put the calling statement, before or after the subclass-specific code. For example:</p>
<pre><code>boolean foo(T x) {
super.foo(x);
....blabla...; //< derived calss-specific code
return true;
}
</code></pre>
<p>OR</p>
<pre><code>boolean foo(T x)
{
....blabla...; //< derived calss-specific code
return super.foo(x);
}
</code></pre>
<p>How to make a correct decision on different situation?</p>
<p>Thanks in advance.</p>
|
java android
|
[1, 4]
|
1,361,305 | 1,361,306 |
difference between $("#id").load and $.ajax?
|
<p>does anyone know what is the difference between $("#id").load and $.ajax?</p>
|
javascript jquery
|
[3, 5]
|
5,249,780 | 5,249,781 |
Using string format for Url.Content doesn't work
|
<p>I have this little foreach statement in an ASPX page: </p>
<pre><code><%
foreach(string path in pathList)
{
%>
<img src="<%=Url.Content(string.Format("~/Content/Images/{0}", path))%>" />
<%
}
%>
</code></pre>
<p>I want that to display all images using <code>Url.Content</code> from the list of paths.</p>
<p>But my code doesn't work.</p>
<p>In the generated HTML, the above code returns me <code><img src='/Content/Images/' /></code> instead of <code><img src='/Content/Images/page.png' /></code> and others.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
4,408,955 | 4,408,956 |
Jquery horizontal select list
|
<p>I have seen this select list:</p>
<p><img src="http://i.stack.imgur.com/xnM10.png" alt=""></p>
<p>any one have an Idea how can I do similar select list like this with jQuery?</p>
|
javascript jquery
|
[3, 5]
|
502,529 | 502,530 |
onDestroy for making data persistent and sync with the server
|
<p>I have a little problem to detect when the application is finished. I need to do some actions onDestroy like save the parameters into the database and make a final connection to the server.</p>
<p>The problem is that if I put the code in <code>onDestroy</code> its is called when the orientation changes for example. Putting</p>
<pre><code>android:configChanges="orientation|keyboardHidden"
</code></pre>
<p>in the manifest for that activity the landscape/portrait layouts don't swap. And adding </p>
<pre><code>@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setContentView(R.layout.main);
}
</code></pre>
<p>Changes the layouts but the buttons and labels do not get the <code>onClickListeners</code> and the text labels correctly. How can I solve that? Thanks</p>
|
java android
|
[1, 4]
|
656,948 | 656,949 |
Jquery droppable live disabling/enabling
|
<p>I have a some draggables in a list of droppables (1 draggable per droppable li). </p>
<p>When I move a draggable from one droppable to another free droppable, I want to diable the receiving droppable, and enable the droppable it is leaving from. </p>
<p>In firebug the droppable class gets removed – but the functionality of the droppable remains. I have a feeling I need to use live() somehow, but could use a leg-up.</p>
<pre><code>$(function() {
$(".user").draggable({
revert : true,
revertDuration : 200
});
$("li.droppable").droppable({
accept : ".user",
hoverClass : "drophover",
drop: function(event, ui) {
var position = this.getAttribute("id").replace("position_", ""),
user_id = ui.draggable.attr("id").replace("user_", "");
droppable = this
parent = ui.draggable.parent()
$.ajax({
url : "users/"+user_id+"",
type : "POST",
dataType: "JSON",
data : ({
"position" : position,
"_method" : "PUT"
}),
success : function() {
$(ui.draggable).parent().addClass("droppable");
$(ui.draggable).appendTo(droppable);
$(parent).removeClass("droppable");
}
});
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,064,959 | 2,064,960 |
I want to change combobox when mouse is on it or when its not
|
<p>in my application i need ... if a user click on combobox it will work as usual like show all the list and when mouse is not on any of item or on combobox...then that combobox should take its default position .... that mean it must compress again </p>
<p>in jquery or javascript..you can post your answer ...
i just want solution :(</p>
|
javascript jquery
|
[3, 5]
|
4,308,709 | 4,308,710 |
jQuery help: How can i hide divisions?
|
<pre><code><div id="rightside">
<div id="rightsideone" >
<div class="class_color_title" ></div>
<div id="id_color_archive" ></div>
</div>
<div id="rightsidetwo">
<div class="class_color_title" ></div>
<div id="id_color_mostcomments" ></div>
</div>
<div id="rightsidethree">
<div class="class_color_title" ></div>
<div id="id_color_mostviewed" ></div>
</div>
<div id="rightsidefour">
<div class="class_color_title" ></div>
<div id="id_color_categories" ></div>
</div>
<div id="rightsidefive" >
<div class="class_color_title" ></div>
<div id="id_color_tags" ></div>
</div>
<div id="rightsidesix" >
<div class="class_color_title" ></div>
<div id="id_color_polls" ></div>
</div>
</div>
</code></pre>
<p>I want to hide divisions with id_color_* .</p>
<p>How can i do this ?</p>
|
javascript jquery
|
[3, 5]
|
2,278,868 | 2,278,869 |
Datagrid refresh not working
|
<p>I have a datagrid to display some information from a SQL table, and then a simple textbox and button to allow users to add records to the database. Problem is, when the user clicks Add, the datagrid SHOULD update, but it doesn't, any ideas? The code in question is as follows:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
username.Text = Session["username"].ToString();
datetime.Text = DateTime.Now.ToString();
BindData();
}
protected void BindData()
{
string SQLQuery = "SELECT * From Filters";
OleDbConnection MyConn = new OleDbConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
DataSet resultsDataSet = new DataSet();
MyConn.Open();
OleDbDataAdapter DataAdapter = new OleDbDataAdapter(SQLQuery, MyConn);
DataAdapter.Fill(resultsDataSet);
DGFilters.DataSource = resultsDataSet;
DGFilters.DataBind();
if (resultsDataSet.Tables[0].Rows.Count == 0)
{
no_records.Visible = true;
DGFilters.Visible = false;
}
else
{
DGFilters.Visible = true;
no_records.Visible = false;
}
MyConn.Close();
}
protected void AddFilter_Click(object sender, EventArgs e)
{
OleDbConnection MyConn = new OleDbConnection(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString);
MyConn.Open();
string SQLInsert = "INSERT INTO Filters (FilterString) VALUES ( '" + FilterToAdd.Text + "')";
OleDbCommand MyCmd = new OleDbCommand(SQLInsert, MyConn);
MyCmd.ExecuteNonQuery();
MyConn.Close();
DataBind();
}
</code></pre>
<p>Any ideas?</p>
|
c# asp.net
|
[0, 9]
|
2,715,069 | 2,715,070 |
How to check whether GridView is Empty or not in Android?
|
<p>I have add buttons in <code>GridView</code> using base adapter, that buttons depend on word length when click the button then hide. After clicking all buttons the <code>GridView</code> is make empty i want to check, if <code>GridView</code> is Empty Display another buttons. I want to check whether <code>GridView</code> is empty or not in <code>GridViewActivity.java</code></p>
<p>Here is the code.</p>
<p>GridViewActivity.java</p>
<pre><code>public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.spellword);
txt=(TextView)findViewById(R.id.txtview);
image=(ImageView)findViewById(R.id.imgview1);
map.put("melon", R.drawable.melon);
image.setImageResource(map.get("melon"));
gridView=(GridView)findViewById(R.id.grid1);
gridView.setAdapter(new SpellAdapter(this,words,word));
detector = new SimpleGestureFilter(this, this);
}
</code></pre>
<p>SpellAdapter.java</p>
<pre><code>public class SpellAdapter extends BaseAdapter{
public Context context;
public char[] word;
public SpellAdapter(Context context, char[] word, String orglWord)
{
this.context=context;
this.word=word;
}
public int getCount() {
count=word.length;
return count;
}
public Object getItem(int position) {
return null;
}
public long getItemId(int position) {
return 0;
}
public View getView(final int position, View convertView, ViewGroup arg2) {
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.buttonlist, null);
}
final Button btn= (Button)v.findViewById(R.id.letterbtn);
btn.setText(word[position]+"");
btn.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{
letters=btn.getText();
String word = letters.toString();
btn.setVisibility(View.GONE);
}
});
return v;
}
}
</code></pre>
|
java android
|
[1, 4]
|
3,743,768 | 3,743,769 |
android post https request through HtttpClient apache
|
<p>I've created complete method that executes https and returns an answer as a string.</p>
<pre><code> public static String makeHttpsRequest(String url) throws ClientProtocolException, IOException {
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
HttpParams params = new BasicHttpParams();
params.setParameter("name", "Arthur");
SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry);
HttpClient client = new DefaultHttpClient(mgr, params);
HttpPost httppost = new HttpPost(url);
HttpResponse response = client.execute(httppost);
BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuilder sb = new StringBuilder();
String line;
while ((line = in.readLine()) != null) {
// System.out.println(line + "[break]");
sb.append(line);
}
return sb.toString();
}
</code></pre>
<p>There are no errors returned, but neither a string result?
May be something wrong in my code?
Please, help.</p>
|
java android
|
[1, 4]
|
5,760,477 | 5,760,478 |
How to use parseDate()
|
<p><code>variable</code> currently outputs as <code>2013-02-05T16:30:01Z</code></p>
<p>How do I use parseDate(), to change how the date is formatted?</p>
|
javascript jquery
|
[3, 5]
|
3,778,323 | 3,778,324 |
UpdatePanel misplaced buttons
|
<p>I am using an update panel inside a tag of a table using the code below. However, because of the update panel, the Log Story button appears on top of the remaining two buttons: reset and cancel. This is probably an easy fix, so how can I align all buttons in one row? Thanks!</p>
<pre><code> <td colspan="2" align="right">
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<asp:Button CssClass="button_style" id="btnSubmit" class="btn" Text="Log Story" runat="server" onClientClick="javascript:return validate();" Width="80px" />
</ContentTemplate>
</asp:UpdatePanel>
<div style="display: none;">
<asp:Button CssClass="button_style" id="Submit" class="btn" runat="server" OnClick="btnSubmit_Click" />
</div>
&nbsp;
<asp:Button CssClass="button_style" id="btnReset" class="btn" Text="Reset" onClick="clear" runat="server" Width="70px" />
&nbsp;
<asp:Button CssClass="button_style" id="btnCancel" class="btn" Text="Cancel" onClick="cancel" runat="server" Width="70px" />
</td>
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,358,246 | 5,358,247 |
Finding out when both JSON requests have completed
|
<p>I currently have the following code:</p>
<pre><code>function render(url1, url2, message) {
utility.messageBoxOpen(message);
$.getJSON(url1, function (items) {
// Do something
utility.messageBoxClose();
});
$.getJSON(url2, function (items) {
// Do something
});
}
</code></pre>
<p>When the function is executed a modal window appears to inform the user something is loading. Initially I only had one $getJSON request so when the request was done the modal window closed as per the code above.</p>
<p>I am looking to add another $getJSON request but want to close the modal window only when both $getJSON requests have completed.</p>
<p>What is the best way of achieving this?</p>
|
javascript jquery
|
[3, 5]
|
4,678,279 | 4,678,280 |
How to find the exact same element as the one on the page in an iframe
|
<p>So I need to find an element in an iframe that is the exact same element of that that is in the webpage (the iframe is of the same page). I need to figure out what the index is of the elements without id's with jquery so I can get the same element in an iframe. </p>
<p>Edit: How can I find the index of an element?</p>
<p>i.e. for this html: </p>
<pre><code><div>
<a>1</a>
<a>2</a>
<a>3</a>
<a id="someA">4</a>
<a>5</a>
<a>6</a>
<a>7</a>
</div>
</code></pre>
<p>How would I find the index (so I can it by doing <code>$('a')[index]</code>) of one of the random anchor elements from it's jQuery object? </p>
<p>(By doing <code>$('#someA').siblings()[Math.floor(Math.random()*6)].getIndex()</code>)</p>
<p>jsfiddle: <a href="http://jsfiddle.net/YP5hQ/2/" rel="nofollow">http://jsfiddle.net/YP5hQ/2/</a></p>
|
javascript jquery
|
[3, 5]
|
2,172,923 | 2,172,924 |
Session Timeout Add to QueryString
|
<p>I have an web app in C# and after 20 mins the session times out. I can't change this because other apps use the same config.</p>
<p>So I am checking to see if the Session is NULL and if it is. It redirect and adds a QueryString with the Session ID. The problem I am having is when the Session times out the SessionID because NULL. Is there anyway to still get the sessionid after the timeout?</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
2,922,421 | 2,922,422 |
Use a PHP variable inside a jquery click()?
|
<p>I have this, </p>
<pre><code> $(document).ready(function(){
$('#link').click(function(){
var user_login = <?php $base_url; ?>;
window.location = user_login + '/login';
});
});
</code></pre>
<p>note that <code>$base_url</code> is global variable. This works in FF but not on Chrome and IE. Thanks.</p>
|
php jquery
|
[2, 5]
|
5,961,595 | 5,961,596 |
Store & Return Settings for a Webpage
|
<p>So I am using C# ASP.NET 3.5 and I would like to add a feature to my site to turn on and off a sort of debug mode for testing purposes. </p>
<p>Is there a best way to have a file or class that stores or returns simply if myDebug is on or off. It has to be accessed fast since it will be used a lot on multiple pages and it should be easy to set using the website itself.</p>
<p>My first thought is just a class with get/set which is stored on every page... perhaps the master page?</p>
<p>Thanks for any input
-Scott</p>
|
c# asp.net
|
[0, 9]
|
3,041,622 | 3,041,623 |
anchor tag scrolls to top after onclick event return false doesn't work
|
<p>I have a click event that will not return false after I have called my ajax function i was wondering how I can get around this. I have used e.preventDefault() which works so that the url doesn't add a hash but when I use return false after my ajax function it doens't work but If I do it the other way round it works but cancels out my ajax call.</p>
<pre><code><a href="#">Click me</a>
$('a').click(function(e) {
getProducts(..., ...., ....) //my ajax function
e.preventDefault() // doesn't work
return false; doesn't work either
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
164,293 | 164,294 |
Resetting preferences when using PreferenceScreen
|
<p>I am loading a PreferenceScreen from an xml file to use as the screen to configure a new event so I'm attempting to clear and reset the values of the SharedPreference this activity is using. The problem I'm encountering is that when attempting to move to using a named preference manager, it seems the preference gets cleared but when I select an EditTextPreference element, the old data is still the default entered text on the popup.</p>
<p>In my onCreate method I'm attempting to initialize the preferences, clear them, then set to default values. My understanding from the dev resources were that there's no way to clear/reset in one step..</p>
<pre><code>private static final String PREFNAME = "newmeetingactivity.preferences";
//load preferences and set name
addPreferencesFromResource(R.layout.newmeeting_preferences);
getPreferenceManager().setSharedPreferencesName(PREFNAME);
getPreferenceManager().setSharedPreferencesMode(MODE_PRIVATE);
//Clear the preferences
_sharedPreferences = getPreferenceManager().getSharedPreferences();
SharedPreferences.Editor ed = _sharedPreferences.edit();
ed.clear();
ed.commit();
//Load default preferences from file again
PreferenceManager.setDefaultValues(this, _sharedPreferences.toString() , MODE_PRIVATE, R.layout.newmeeting_preferences, true);
</code></pre>
<p>Edit: To try to better explain what I'm attempting to do (in case my approach is way off): I need to clear shared preferences used on a given activity while not interfering with the settings from other activities (as they should persist indefinitely).</p>
|
java android
|
[1, 4]
|
610,170 | 610,171 |
Window resized when window is small and remains same even after window width is larger
|
<p>Sorry for the ambiguous title, wasn't sure what should I use. I want to resize the player (Javascript) on the basis of the window size in an attempt to make it responsive. The standard width is <code>620px</code>, if the width is less than that I want that the width of the components should be <code>100%</code>. I have added a event listener using jQuery. But, the problem is that the player's components width becomes <code>100%</code> when the window size is less than 620, and it remains as 100% even if the window size becomes greater afterwards. Here is my code. </p>
<pre><code>function resizeVideo() {
var width = $('#slideshow').width();
if(width < 620) {
$('#object').width('100%');
$('#object #background').width('100%');
$('#object #slide_area').width('100%');
$('#object #controls').width('100%');
// alert("here");
}
else {
}
}
resizeVideo();
window.addEventListener("resize", resizeVideo, false);
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,631,731 | 2,631,732 |
sd.canWrite() always returns false
|
<p>I've set the following my android manifest:</p>
<pre><code><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</code></pre>
<p>I've got the following in my activity:</p>
<pre><code>File sd = Environment.getExternalStorageDirectory();
boolean can_write = sd.canWrite();
</code></pre>
<p>sd returns /mnt/sdcard</p>
<p>I'm testing on my device (evo 3d) not the emulator. The sd card is mounted. It happens both when in charge only mode and when the usb cable isn't plugged in. Various pages on google and posts on stack show that exact same method to check if the sd card is writable so I must be missing something.</p>
<p><strong>UPDATE:</strong></p>
<p>I try the following code and it throws ioexception permission denied.</p>
<pre><code> File TestFile = new File(sd + "/testfile.txt");
try {
boolean result = TestFile.createNewFile();
if(result)
{
Log.i("tag","successfully created file");
} else {
Log.i("tag","failed to create file");
}
} catch (IOException e) {
Log.e("tag",e.toString() + " " + TestFile);
return false;
}
</code></pre>
<p>I've formatted my sdcard, re-mounted it, and rebooted phone and still have the same error.</p>
<p><strong>UPDATE</strong></p>
<p>Apparently it's my own ignorance that caused it to fail. I had my permissions block in the wrong section of my manifest. Thanks again :) </p>
|
java android
|
[1, 4]
|
1,857,700 | 1,857,701 |
CharSequence ArrayList to charSequence casting
|
<p>There is problem of class casting. Please tell me how to cast this. I want to this <code>ArrayList<CharSequence></code> in my <code>CharSequence[]</code> named <code>Contacts</code>.</p>
<p><code>java.lang.ClassCastException</code> (in Android):</p>
<pre><code>CharSequence[] Contacts;
List<CharSequence> contacts = new ArrayList<CharSequence>();
Contacts = (CharSequence[]) contacts.toArray();
for(CharSequence p : contacts) {
Log.i("log_tag", "AAAAAAAAAAAAAAAAAAA" + p);
}
</code></pre>
|
java android
|
[1, 4]
|
5,695,787 | 5,695,788 |
Newly Opened Tab kills Function Calls
|
<p>I have such a for loop:</p>
<pre><code>for (var i = 0; i < documentsCount; i++) {
var e = checkBoxes[i];
if (e.checked) {
var documentType = documents[i].value;
if ("ConcreteType_1" == documentType) {
makeAction();
} else {
if (attachmentCount > 0) {
downloadDoc();
}
}
}
}
</code></pre>
<p>The downloadDoc() function opens an iframe for each file (that has attachemnts and is not of 'ConcreteType_1' type) and the makeAction() function opens a new tab to preview the file source. If I check several files with attachments, everything is fine - several download boxes are raised, but if there is at least one file of 'ConcreteType_1' type among files with attachments, a new tab opens and no download boxes are raised...</p>
<p>If somebody knows how to deal with it, please share.</p>
|
javascript jquery
|
[3, 5]
|
4,498,302 | 4,498,303 |
jquery exclude data out of object when sending via ajax
|
<p>I am sending post data via ajax, and that data looks like this:</p>
<pre><code>var cardProperties = {
container: $("#cardContainer"),
elementsWrapper: $("#cardElementsWrapperBorder"),
size: 0, //0 -> (90x50mm <-> 510px x 283px), 1-> (85x55mm <-> 482px x 312px)
position: "h", //default horizontal
bgImagesPath: "media/images/designs/backgrounds/", //path to card bg images
floatingImagesPath: "media/images/designs/floating-images/", //path to card bg images
imagesPerPage: 8,
innerBorderMargins: 40, //this should be divided by 2 to get the actual margin
currentCardSide: 1
};
</code></pre>
<p>So basicly there is some usual data, but fields like <code>container</code> or <code>elementWrapper</code> is probably containing a lot of information about that object and also it's child objects, so this is causing me very ugly error <code>Uncaught RangeError: Maximum call stack size exceeded</code> and since i don't need those two fields how could i exclude it from the object without deleting any of that info, since i will need that stuff later in my <code>js</code> script.</p>
<p><strong>EDIT</strong></p>
<p>Also here is my <code>ajax</code> code:</p>
<pre><code>$.post("server.php", {data: cardProperties},
function(response){
}
);
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,034,920 | 5,034,921 |
How to use the addChild method of javascript to add a node to my div?
|
<p>Hello I have a div as follows</p>
<pre><code><div id="test" class="test2">
<p> <a href=""> <a> </p>
<p> <a href=""> <a> </p>
<p> <a href=""> <a> </p>
<p> <a href=""> <a> </p>
</div>
</code></pre>
<p>(I have stripped out the data but that is the structure)</p>
<p>How does one use the addChild function of javascript to add a new node </p>
<pre><code><p> <a href=""> <a> </p>
</code></pre>
<p>I know how to use the removeChild function but I haven't been able to find documentation and examples using the addChild function.</p>
<p>If I have the node string in a php array, and can execute the php script containing the array with a GET call via a button click how can I use the addChild function to put the node string into the div?</p>
|
php javascript
|
[2, 3]
|
2,615,099 | 2,615,100 |
Reading a binary file and using Response.BinaryWrite()
|
<p>I have an app that needs to read a PDF file from the file system and then write it out to the user. The PDF is 183KB and seems to work perfectly. When I use the code at the bottom the browser gets a file 224KB and I get a message from Acrobat Reader saying the file is damaged and cannot be repaired.</p>
<p>Here is my code (I've also tried using File.ReadAllBytes(), but I get the same thing):</p>
<pre><code>using (FileStream fs = File.OpenRead(path))
{
int length = (int)fs.Length;
byte[] buffer;
using (BinaryReader br = new BinaryReader(fs))
{
buffer = br.ReadBytes(length);
}
Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", String.Format("attachment;filename={0}", Path.GetFileName(path)));
Response.ContentType = "application/" + Path.GetExtension(path).Substring(1);
Response.BinaryWrite(buffer);
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,514,328 | 5,514,329 |
how can an create a dotnet desktop application to access SMS.db on IPhone without Jailbreak?
|
<p>i want to create a desktop application using c#, by which i can access the iphone device and able to read SMS.db to read the SMSs</p>
|
c# iphone
|
[0, 8]
|
2,021,998 | 2,021,999 |
Jquery class removed after link click, but second click is still recognized
|
<p>I'm having a little problem. I'm trying to use Jquery <code>load()</code> function to load in stuff on a page using AJAX. After the content has been loaded, and the link gets tapped on a second time, I need to loaded content to slideup/hide; And when the same link is clicked for the 3+ time, I need to just toggle the loaded content display, since it's already been loaded once. </p>
<p>My problem is that after clicking the link once, I remove the <code>loadable</code> class, but on the second click the same function executes as if the class were still there. Here is my HTML:</p>
<pre><code><a title="Food" id="food" class="loadable" href="get-taste/food">Food</a>
<div class="food_load_space"></div>
</code></pre>
<p>The link triggers the load and the data loads into <code>.food_load_space</code>. And here's my JS:</p>
<pre><code>$(document).ready(function(){
$('a.loadable').click(function(){ //executed upon link click 1;
url = $(this).attr('href');
linkid = $(this).attr('id');
toload = url + ' #content-area';
//now, remove loadable, add loaded and expanded
$(this).removeClass('loadable');
alert(toload);
$('.' + linkid + '_load_space').load(toload);
return false;
}); //kill loadable
</code></pre>
<p>I'm also planning on adding an .expanded class and a <code>.loaded</code> class so that the script knows at which state the link is in. But what happens is this function fires even if the <code>.loadable</code> class is gone.</p>
|
javascript jquery
|
[3, 5]
|
804,897 | 804,898 |
What is the problems of using onClick function in Javascript?
|
<p>Is there a particular reason programmers prefer not to use onClick function in Javascript? </p>
|
javascript jquery
|
[3, 5]
|
3,343,185 | 3,343,186 |
how to Highlight being read words in text to speech asp.net?
|
<p>I'm am building a web app and need a text to speech which highlights the text being read at the moment. I built the text to speech but don't have any idea how to tackle the highlighting of text are there any tips or functions for this problem?
10x a lot.</p>
|
c# asp.net
|
[0, 9]
|
1,488,030 | 1,488,031 |
jQuery delegate selector problem
|
<p>I'm trying to delegate click event to all first anchor tags of all now and future divs with "panels" class. I did something like that:</p>
<pre><code>$('#panel').delegate('.panels a:first', 'click', function(event) [...]
</code></pre>
<p>but that doesn't work. It binds event only to one, first ".panels". Any hints?</p>
|
javascript jquery
|
[3, 5]
|
1,872,959 | 1,872,960 |
How to populate IList<t> from DataTable or from a table in database?
|
<p>I have a table say, Student.
I have a class 'Student'.
I want to populate <code>IList<Student></code> with objects of Student class from Student table in database.</p>
<p>Is it possible to implement this?</p>
<p>If yes then how to implement this.</p>
<p>Please help.</p>
|
c# asp.net
|
[0, 9]
|
1,775,782 | 1,775,783 |
Can I iterate through table using JQuery and collect values in three arrays?
|
<p>Can I iterate through table with id="tbl" using JQuery with three columns and collect this value in three javascript arrays ? </p>
|
javascript jquery
|
[3, 5]
|
1,980,209 | 1,980,210 |
Passing data between webpages
|
<p>I have a webpage with a form on it. The heading of the form is this: </p>
<pre><code> <form name="sw" METHOD ="POST" ACTION="logger1.php">
</code></pre>
<p>After some event has happened, a javascript function submits the form like this: </p>
<pre><code> document.forms["sw"].submit();
</code></pre>
<p>The php file logs the data from the form in a text file on the server, and then redirects the browser to another page. My issue is that I want to examine one of the values in the form from the previous page on the page that the browser is redirected to. I am completely lost. help!</p>
|
php javascript
|
[2, 3]
|
338,296 | 338,297 |
Get value of checkbox in gridview template field inside jquery ui dialog
|
<p>I have a gridview that is dynamically bound to a datasource. It has a template field with a checkbox in it. This gridview is also inside a jQuery UI dialog which is shown/displayed when a button is pressed.</p>
<p>Now, I am able to loop thru all the rows in the gridview, however when I get the checkbox control, the 'Checked' property is always false even when checked. What should I do to get the actual 'Checked' value of the rows?</p>
<p>The code for getting the value of the checkbox:</p>
<pre><code>foreach (GridViewRow dgRow in dgvInventoryList .Rows)
{
if(dgRow.RowType != DataControlRowType.DataRow)
{
continue;
}
chkSelected = (CheckBox)dgRow.FindControl("chkSelected");
if(!chkSelected.Checked)
{
continue;
}
</code></pre>
<p>I have tried debugging the code and it do get upto the if(!chkSelected.Checked) validation</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
949,071 | 949,072 |
check uncheck all checkbox of checkboxlist using jquery ASP.Net
|
<p>i was trying to check uncheck all option of checkboxlist programmatically but my code is not working. here is snippet</p>
<pre><code> $(document).ready(function () {
$('#myLink').click(function () {
$("INPUT[id^='chkFileds']").attr('checked', $('#chkFileds').is(':checked'));
});
});
</code></pre>
<p>what is wrong in my code. i want that when user click on check hyperlink then all option of checkbox list will be checked and when click again on the same link then all option of checkbox list will be uncheck. please guide me how to do it. thanks</p>
<p><strong>UPDATE:</strong></p>
<p>thanks for ur answer but i am not talking about check rather checkbox list what has many checkbox inside.it looks like....he i am giving the html of checkboxlist</p>
<pre><code><table style="font-weight:bold;" id="chkCountry">
<tbody>
<tr>
<td>
<input type="checkbox" value="GB" name="chkCountry$0" id="chkCountry_0">
<label for="chkCountry_0">UK</label>
</td>
<td>
<input type="checkbox" value="US" name="chkCountry$1" id="chkCountry_1">
<label for="chkCountry_1">USA</label>
</td>
</tr>
</tbody>
</table>
</code></pre>
|
jquery asp.net
|
[5, 9]
|
2,813,664 | 2,813,665 |
Optimal Way to Pass C# Variables to JS
|
<p>I have several functions that are written in JS that do error checking on my site. On one instance I want to disable two of the checks if a certain instance in the DB is true. </p>
<p>I have something like this on the aspx.cs</p>
<pre><code>if (this.exemptcheck == true) {
// could set a variable to pass or whatever is optimal here
}
</code></pre>
<p>Then in JS I have a function like this in my .aspx</p>
<pre><code>if (NotANumberCheck(item.GetMember("TotalSpace").Value, 'Space must be Numeric') == false) { return false; }
</code></pre>
<p>I don't want this check to run if this.examptcheck returns true. What is the optimal way to do this? I have heard of putting variables in non-visible fields but that doesn't seem ideal. Any suggestions would be appreciated.</p>
<p>Thanks</p>
|
c# javascript
|
[0, 3]
|
3,299,934 | 3,299,935 |
how to create the div on the fly in javascript / jquery in this way
|
<p>i have asp.net mvc 2 application where i have a scenario as follows:
I want to create the parent div and in side it want to create n-number of divs with controls.like</p>
<pre><code> for(j=0;j<parentCount;j++)
{
//Create the parent div
for(i=0;i<childDivCount;i++)
{
//create child div, with controls (like radio,checkboxes).and attach to parentDiv
}
//Attach parent div to document.
}
</code></pre>
<p>how to achieve this . </p>
<p><strong>Edited:</strong>
i am bit get satisfaction with answers. but when i am using getJson in each loop as:</p>
<pre><code> //$.getJSON(url1,,function(data1){
//for each item in data1 :-
for(j=0;j<parentCount;j++)
{
//Create the parent div
//$.getJSON(url2,,function(data2){
//**** here j automatically get j++ , why ? ****//
//For each item in data2 :-
for(i=0;i<childDivCount;i++)
{
//create child div, with controls (like radio,checkboxes).and attach to parentDiv
}
});
//Attach parent div to document.
}
});
</code></pre>
<p>when entering for getJson of data2 (subloop) var j get automatically incremented. why that should be ? </p>
<p><strong>Edited:-</strong>
in fact i want to create the question-answer scenario. since in first getJson call i am getting all questions and then in sub getJson call i am getting answers of each question. for each question i am creating div as parent div , and for its answers appending parent div with answers child div. thats all. i didn't wanted to use user control here , so i used the json-jquery combination to generate scenario. this is what i want to achieve.</p>
|
javascript jquery
|
[3, 5]
|
2,092,189 | 2,092,190 |
Are the values in android app preferences saved automatically?
|
<p>I am trying to create preferences for an experimental app for android. However I can get the preferences to work. </p>
<p>The preference that I want to use determine the display langue and use this function to retrieve it:</p>
<pre><code>private String selectLang()
{
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
String lang = preferences.getString("lang", "n/a");
return lang;
}
</code></pre>
<p>Then inside onCreate method for the ListActivity I use this code to display the right language:</p>
<pre><code>String lang = selectLang();
String title = (lang == "english") ? "English" : "Arabic";
</code></pre>
<p>title is a column in the database. The code does not seem to work and I get Arabic no matter what. I used this code just to know the value of lang:</p>
<pre><code>Toast.makeText(this, lang, Toast.LENGTH_LONG).show();
</code></pre>
<p>and I get "english" but the English language does not display.</p>
<p>Here is is my XML for the list:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="lang">
<item>Arabic</item>
<item>English</item>
</string-array>
<string-array name="langValues">
<item>arabic</item>
<item>english</item>
</string-array>
</resources>
</code></pre>
<p>I have read in number of answers here on SO that I should use SharedPreference editor but I could not get a full working example of that.</p>
<p>Can you please help?</p>
|
java android
|
[1, 4]
|
4,601,982 | 4,601,983 |
Jquery call function dynamically
|
<p>I have a following scenario that I have to call a function on a jquery object dynamically. The code looks like this :</p>
<pre><code>$('div[class]').each(function(){
var class=$(this).attr('class');
// I want to now check if that function with the name of class exists for jquery
// object. I need help here.
// if that function exists, i need to apply that function to the enumerated object.
});
</code></pre>
<p>I want to now check if that function with the name of class exists for jQuery object. I need help here. If that function exists, I need to apply that function to the enumerated object.</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.