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,279,441 | 3,279,442 | events not firing for "input" in chrome jquery | <p>I can't get any key events to fire on an input element with jquery. Given the following code:</p>
<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="./js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="./js/jquery-ui-1.8.14.custom.min.js"></script>
<script type="text/javascript">
$("#cmd").keypress(function(event) {
alert("keypress");
if(event.which == 13){
$.ajax({
type: "POST",
url: "update",
data: "key=" + key + "&cmd=" + $("#cmd").val()
});
$("#cmd").val("");
$("#cmd").focus();
}
});
</script>
<title>BCMD</title>
</head>
<body>
<div id="main" style="background-color: black; color: white; width:100%; height:500px;">
<input id="cmd" type="text" style="border:0;"></input>
</div>
</body>
</html>
</code></pre>
<p>Nothing is firing. Any ideas? Thanks.</p>
| javascript jquery | [3, 5] |
4,525,284 | 4,525,285 | GZIP in Android | <p>i just wanted to ask about sending gzip for post requests using HttpClient in Android?</p>
<p>where to get that OutputStream to be passed in the GZIPOutputstream?</p>
<p>any snippets?</p>
| java android | [1, 4] |
5,135,976 | 5,135,977 | Find other checkbox | <p>Please see coments in js code.</p>
<p>I have two checkboxes</p>
<pre><code><input type="checkbox" name="first" id="first" />
<input type="checkbox" name="second" id="second" />
</code></pre>
<p>Here is my javascript</p>
<pre><code>$(function() {
$('input[type=checkbox]').click(function() {
/*
HERE i want to manipulate the checkbox which is not clicked
NOTICE: they are only two checkboxes in page
I know that I can do something like this
if($(this).attr('id') == "first) {
do something
} else {
etc...
}
But I think that way is against DNRY
Can you recommend me some more elegenat solution ?
/*
}
});
});
</code></pre>
| javascript jquery | [3, 5] |
4,796,088 | 4,796,089 | How do I load a dropdown list in ASP.NET and C#? | <p>How do I load a dropdown list in asp.net and c#?</p>
| c# asp.net | [0, 9] |
1,658,411 | 1,658,412 | Javascript only works in chrome and FireFox not IE | <p>I have been stumped by IE9 bugs lately. I have this function </p>
<pre><code> //return value in the admin/user select in url to get result via $_GET when page reloads
function toggleView() {
//parse url to remove all parameters other than ghost_id
var url = window.location.href.split("&")[0];
var view_type = $("#toggle_view").val();
//reload page with view type selected
window.location.href = url+"&view_type="+view_type;
}
</code></pre>
<p>What this function is doing is removing the parameters in the url, replacing them with a new parameter and reloading the page so my php can get the new value via $_GET when it reloads.</p>
<p>This works flawlessly in Firefox and Chrome but in IE9 the javascript function is not even being called. I am wondering if there is an alternative way to do this in jQuery or some other javascript to solve the IE9 issue.</p>
| php javascript jquery | [2, 3, 5] |
5,169,086 | 5,169,087 | scrolling issue jcover flip | <p>I am using jcover flip on my facebook application. On dragging the scroll bar towards the right first it scrolls back few images and then goes scrolls to right on scroll, due to which few images on extreme right do not get displayed.</p>
<pre><code><script>
jQuery( document ).ready( function(){
jQuery( '#flip' ).jcoverflip({
current: 6,
beforeCss: function( el, container, offset ){
return [
$.jcoverflip.animationElement( el, { left: ( container.width( )/2 - 210 - 110*offset + 20*offset )+'px', bottom: '20px' }, { } ),
$.jcoverflip.animationElement( el.find( 'img' ), { width: Math.max(10,100-20*offset*offset) + 'px' }, {} )
];
},
afterCss: function( el, container, offset ){
return [
$.jcoverflip.animationElement( el, { left: ( container.width( )/2 + 110 + 110*offset )+'px', bottom: '20px' }, { } ),
$.jcoverflip.animationElement( el.find( 'img' ), { width: Math.max(10,100-20*offset*offset) + 'px' }, {} )
];
},
currentCss: function( el, container ){
return [
$.jcoverflip.animationElement( el, { left: ( container.width( )/2 - 100 )+'px', bottom: 0 }, { } ),
$.jcoverflip.animationElement( el.find( 'img' ), { width: '200px' }, { } )
];
},
change: function(event, ui){
jQuery('#scrollbar').slider('value', ui.to*25);
}
});
jQuery('#scrollbar').slider({
value: 50,
stop: function(event, ui) {
if(event.originalEvent) {
var newVal = Math.round(ui.value/25);
jQuery( '#flip' ).jcoverflip( 'current', newVal );
jQuery('#scrollbar').slider('value', newVal*25);
}
}
});
});
</script>
</code></pre>
| php javascript jquery | [2, 3, 5] |
3,263,306 | 3,263,307 | Updating Excel file | <p>How can I add new values to an uploaded <code>application/vnd.ms-excel</code> file in C#?
Can anybody help?</p>
| c# asp.net | [0, 9] |
2,050,702 | 2,050,703 | Fastest jQuery autoellipsis plugin? | <p>I'm looking for a jQuery autoellipsis plugin. (autoellipsis plugins will add <code>...</code> at the end of a multiline text.)</p>
<p>I know these plugins: <a href="http://pvdspek.github.com/jquery.autoellipsis/" rel="nofollow">autoellipsis</a> and <a href="http://dotdotdot.frebsite.nl/" rel="nofollow">dotdotdot</a>. but both working slowly in my jQuery Mobile project.</p>
<p>What is the fastest jQuery autoellipsis plugin?</p>
<p>EDIT: I have to call autoellipsis plugin on window resize event.</p>
| javascript jquery | [3, 5] |
4,646,458 | 4,646,459 | Is event.currentTarget always equal to $(this) in jQuery? | <p>Is this phrase always true?</p>
<pre><code>$("p").click(function(event) {
alert( event.currentTarget === this );
});
</code></pre>
<p>Is one method preferred over the other? I like to use <code>$(this)</code> instead of <code>event.currentTarget</code> but can one do better in some conditions? Which is better? Are absolutely the same?</p>
<p>And another nuance - When checking on firebug <code>console.log(this)</code> and <code>console.log($(this))</code> gives me exactly the same element. If they are the same - what is different? (since I know I can write this <code>$(this).css('color','white')</code> but can't write <code>this.css('color','white')</code> </p>
<p>Thanks,
Alon</p>
| javascript jquery | [3, 5] |
2,344,507 | 2,344,508 | jQuery addClass onClick | <p>The setting is easy; I want to be able to add a class to (in this case) a button when onClick-event is fired. My problem is that I haven't found a way to pass the button itself as the parameter to the function. I'd like to do something like:</p>
<pre><code><asp:Button ID="Button" runat="server" onclick="addClassByClick(this)"/>
</code></pre>
<p>And then a javaScript function something like this:</p>
<pre><code>function addClassByClick(button){
button.addClass("active")
}
</code></pre>
<p>I know I've got a lot of errors here, but that's why I'm posting. I've tried different scenarios with jQuery and without jQuery but I always end up with a broken solution (clicks suddenly stop coming through, class not added etc etc) so I decided to ask the pro's.</p>
<p>Any suggestion to what I can try? Thanks for reading *<em>edit</em>*and all the help!</p>
| javascript asp.net jquery | [3, 9, 5] |
5,686,326 | 5,686,327 | Removing elements from array dynamically | <p>So I've learnt how to add elements to an array dynamically - how about removing them?</p>
<p><strong>jQuery</strong></p>
<pre><code>$(document).on('change blur', '.roomFac', function () {
var park = $("#park2").val();
var lecturestyle = $("#lecture_style2").val();
var roomstructure = $("#room_structure2").val();
var groupsize = $("#groupSize2").val();
var facilities = "";
$('select[name*=roomFac]').each(function () {
facilities += $(this).val();
facilities += ",";
});
var dataString = 'park=' + park + '&' + 'lecturestyle=' + lecturestyle + '&' +
'roomstructure=' + roomstructure + '&' + 'groupsize=' + groupsize + '&' +
'facilities=' + facilities;
$.ajax({
type: "POST",
url: "process_timetableMon2.php",
data: dataString,
cache: false,
success: function (html) {
$('#mon').html(html);
}
});
});
</code></pre>
<p><strong>process_timetableMon2.php</strong></p>
<pre><code>$array = explode(",", $_POST["facilities"]);
for($i = 0; $i < count($array)-2; $i++){
echo $array[$i].'<br>';
}
</code></pre>
<p>I've uploaded some code here: <a href="http://jsfiddle.net/kfm5b/3/" rel="nofollow">http://jsfiddle.net/kfm5b/3/</a></p>
| php jquery | [2, 5] |
1,764,643 | 1,764,644 | How to clone element with new id? | <p>I have some elements on the page. Here is example of one element:</p>
<pre><code><div id="119" class="message">
<div class="messageAuthor">iggy</div>
<div class="messageBody messageMessage">hello</div>
<div class="messageDate messageCreate_date">12:13</div>
</div>
</code></pre>
<p>I get from server new items and items which were updated in JSON. Here is example of using JSON response:</p>
<pre><code>$.each(ajaxResult.items, function(index) {
for (var key in ajaxResult.items[index]) {
if (ajaxResult.items[index].hasOwnProperty(key)) {
if ($('.'+ajaxResult.controller + self.toUpperFirst(key)).length) {
if ($('#'+ajaxResult.items[index].id).length) {
$('#'+ajaxResult.items[index].id).children('.'+ajaxResult.controller + self.toUpperFirst(key)).text(ajaxResult.items[index][key]);
}
else {
var prevIndex = parseInt(index) - 1;
$('#'+ajaxResult.items[prevIndex].id).after($('#'+ajaxResult.items[prevIndex].id).html());
}
}
}
}
});
</code></pre>
<p>I want to add new elements after existing elements. I don't know what the best way to do it. I need help.</p>
| javascript jquery | [3, 5] |
1,149,332 | 1,149,333 | Slow append with li, for loop with ajax call after makes it slow? | <p>For loop with ajax call after, slow for loop?</p>
<pre><code> for (var x = this.from; x < this.emax; x++) { this.list.append('<li></li>'); }
jQuery.ajax({
.....
</code></pre>
<p>Some how, it will start the ajax request at the same time as the for loop. So Chrome
chokes a second. I dont want that, can it be fixed?</p>
| javascript jquery | [3, 5] |
5,341,199 | 5,341,200 | Javascript for showing image on mouseover | <p>Please see this <a href="http://www.fotolia.com" rel="nofollow">link</a>.</p>
<p>How images are showing large on mouseover according to the position of mouse and screen scrolling?</p>
<p>Can any one provide the same script for this purpose.</p>
<p>Thanx in advance</p>
| javascript jquery | [3, 5] |
3,738,554 | 3,738,555 | Jquery validation of input array elements manually | <pre><code><input type="text" name="member_name[]" size="13" value="">
<input type="text" name="member_name[]" size="13" value="">
<input type="text" name="member_name[]" size="13" value="">
<input type="text" name="member_name[]" size="13" value="">
</code></pre>
<p>How do i validate these 4 fields so that they are not blank.. without using jquery validate plugin.?</p>
| javascript jquery | [3, 5] |
992,229 | 992,230 | Order of Postback event handler and Validate method of all validator controls | <p>I'm learning asp.net page life cycle.
I find an article on MSDN
<a href="http://msdn.microsoft.com/en-us/library/ms178472.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms178472.aspx</a>
It says that </p>
<blockquote>
<p>If the request is a postback, control event handlers are called. After that, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page.</p>
</blockquote>
<p>And the picture in the article also says validate fires after event handling.
If this is true how can I get status of validator when I handling the event? </p>
| c# asp.net | [0, 9] |
4,911,746 | 4,911,747 | How to locate a file on multiple directories using C# | <p>I am searching for a file say "abc.txt" on multiple directories. These directories are comma seperated values like </p>
<pre><code>string paths= 'C:/hello,D:/Hello';
</code></pre>
<p>How can I search for "abc.txt" using the above comma seperated directories?</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
3,134,048 | 3,134,049 | Append element problem | <p>I am creating some elements and appending it, and its working fine but when I want to call any function or want to call any jquery that not work, but when i put that elements directly instead of appending then it works properly. In all to say that appending element does not call any function or anything.</p>
<p>JQUERY CODE:</p>
<pre>
var cart_content = jQuery($.create('li', {}, [])).append($.create('span',{}, [av_title]),$.create('img', {"src":"images/delete_icon.png", "class":"cart_content", "alt":"delete", "title":"Delete"}, []));
$(".advertise_cart").append(cart_content);
$(".cart_content").click(function(){ alert("Hello"); });
</pre>
<pre><code><ul class="advertise_cart" id="advertise_cart_id">
<li>
<span>Inner Content 1</span>
<img src="images/delete_icon.png" class="cart_content" alt="delete" title="Delete"> <!------ On clicking on this will show alert box, but on clicking on appended element will not call alert box or anything ----->
</li>
</ul>
</code></pre>
<p>Thanks in advance</p>
| javascript jquery | [3, 5] |
491,204 | 491,205 | Error while JDK version is changed | <p>I have created a project on jdk 1.6 and android Rev. 20 . Now I have installed 1.7 for few features, but it is not accepting. We have to import <code>sun.audio</code> package in java 1.7 which we intend to use in android. But it is giving me errors. Please help me out. Thanks in advance.</p>
| java android | [1, 4] |
762,645 | 762,646 | Button link to random div | <p>I am creating a photography course app in dreamweaver, and want users to be able to tap a button to randomly give them an assignment out of the numerous ones in the app.</p>
<p>All the various assignments are in separate div's, with separate div id's.
I've tried various javascript random link generators, but they don't link to the div ids...they are looking for the whole link (www.noelchenier.ca/#self) instead of the div ID's (#self).</p>
<p>Is there any way to do this?</p>
<p>This seems to be what this guy was asking too, but there is no explaination on where to use it?
<a href="http://stackoverflow.com/questions/5289615/how-to-jump-to-an-anchor-div-per-random-button-jquery-mobile">How to jump to an anchor / div per random button (jQuery mobile)?</a></p>
<p>Thanks for any possible help
Noel Chenier</p>
| javascript jquery | [3, 5] |
2,636,583 | 2,636,584 | Why we use if, else if instead of multiple if block if the body is a return statement | <p>I am always in the habit of using if, else-if statement instead of multiple if statements. </p>
<p>Example:</p>
<pre><code>int val = -1;
if (a == b1) {
return c1;
} else if (a == b2) {
return c2;
} ...
...
} else {
return c11;
}
</code></pre>
<p>How does it compare to example 2:</p>
<pre><code>if (a == b1) {
return c1;
}
if (a == b2) {
return c2;
}
....
if (a == b11) {
return c11;
}
</code></pre>
<p>I know functionality wise they are the same. But is it best practice to do if else-if, or not? It's raised by one of my friends when I pointed out he could structure the code base differently to make it cleaner. It's already a habit for me for long but I have never asked why. </p>
| java c++ | [1, 6] |
2,349,028 | 2,349,029 | Avoid popping blocking when calling window.open from .change() | <p>I have a select menu, for which I have the following code:</p>
<pre><code>$('#sister-site-menu').change(function(){
if ($(this).val()) {
window.open($(this).val(), '_blank');
}
});
</code></pre>
<p>This however causes the popup blocker to be invoked in Chrome. I'm sure I've seen sites do this before, any ideas?</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
3,027,784 | 3,027,785 | On page load jquery | <p>I have a jQuery click event which runs when an element is clicked. Is it possible to get this to run once when the page is loaded?</p>
| javascript jquery | [3, 5] |
1,787,528 | 1,787,529 | How to call a function from Masterpage into new form in c# | <p>I've a Master Page which contains a <code>DropDownList</code>. I've a function for binding the list in the master and it works fine.</p>
<p>My problem is: How will I call that Master Page function from a form, which is not the child of the above master page</p>
| c# asp.net | [0, 9] |
3,513,855 | 3,513,856 | html pagedisplay in activity | <pre><code>Bundle bundle = this.getIntent().getExtras();
WebView detailsLink=(WebView)findViewById(R.id.web_view);
detailsLink.getSettings().setJavaScriptEnabled(true);
detailsLink.loadUrl(bundle.getString("keyLink"));
</code></pre>
<p>This is code for displaying whole web page within Activity. But I want to display particular part of web page within Activity. I have try for this but not display particular Part this is code for that please tell me where I m doing wrong.</p>
<pre><code>detailsLink.loadUrl(url, extraHeaders)
String detailsLink1="<html><body><iframe src='keyLink' width='100%' height='100'
scrolling='no'> </iframe></body></html>";
detailsLink.loadData(detailsLink1, "text/html", "utf-8");
</code></pre>
| java android | [1, 4] |
4,547,428 | 4,547,429 | jQuery AJAX callback | <p>I'm having a difficult time trying to get this javascript function to return false inside of a .post() function.</p>
<p>Is this even possible? or is there another way to do a simple ajax check to validate the voucher code is in the database.</p>
<pre><code>function check_options(){
var voucher_code = $('#voucher_code').val();
$.post(baseURL+"ajax.php", { tool: "vouchers", action: "check_voucher", voucher_code: voucher_code },
function(data) {
if(data == 'invalid'){
// NEED TO RETURN FALSE FOR THE MAIN FUNCTION
}
});
}
</code></pre>
| javascript jquery | [3, 5] |
1,592,687 | 1,592,688 | How can I write simple custom Android Handler class? | <p>It's interesting for me how it's possible to write simple Android Handler class using only pure java to send signals from one thread to another?</p>
<p>I saw the source code:
<a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/os/Handler.java" rel="nofollow">http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/os/Handler.java</a></p>
<p>But how for example to write class (Handler class) that can send for example int value from one thread to another(not using share data(like in Android Handler?))?</p>
| java android | [1, 4] |
1,260,353 | 1,260,354 | Replay on BG Music | <p>I made a service that play background music, but when the music finished I want to replay it again. Which method can I use in my service?</p>
<pre><code>public class BackgroundSoundService extends Service {
private static final String TAG = null;
MediaPlayer player;
public IBinder onBind(Intent arg0) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
player = MediaPlayer.create(this, R.raw.idil);
player.setVolume(100,100);
}
public int onStartCommand(Intent intent, int flags, int startId) {
player.start();
return 1;
}
public void onStart(Intent intent, int startId) {
// TODO
}
public IBinder onUnBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}
public void onStop() {
}
public void onPause() {
}
@Override
public void onDestroy() {
player.stop();
player.release();
}
@Override
public void onLowMemory() {
}
}
</code></pre>
| java android | [1, 4] |
5,802,357 | 5,802,358 | Submit method by enter key? | <p>I'd like to submit a method when the user hits the ENTER key inside a editText field.</p>
<pre><code><EditText android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:imeOptions="actionDone"
android:singleLine="true"
/>
</code></pre>
<p>Atm this results in going to the next UI element on screen if the user hits done.
But i'd like to fake-submit a button?</p>
| java android | [1, 4] |
1,784,671 | 1,784,672 | How do I add a function to an element via jQuery? | <p>I want to do something like this:</p>
<pre><code>$('.dynamicHtmlForm').validate = function() {
return true;
}
$('.dynamicHtmlForm .saveButton').click(function() {
if (!$(this).closest('.dynamicHtmlForm').validate()) {
return false;
}
return true;
});
</code></pre>
<p>And then when I have a form of class dynamicHtmlForm, I want to be able to provide a custom validate() function:</p>
<pre><code>$('#myDynamicHtmlForm').validate = function() {
// do some validation
if (there are errors) {
return false;
}
return true;
}
</code></pre>
<p>But I get this when I do this:</p>
<pre><code>$(this).closest(".dynamicHtmlForm").validate is not a function
</code></pre>
<p>Is what I've described even possible? If so, what am I doing wrong?</p>
| javascript jquery | [3, 5] |
240,867 | 240,868 | find HtmlInputCheckbox control in repeater? | <pre><code>protected void Button1_Click1(object sender, EventArgs e)
{
foreach (RepeaterItem contact in rptList.Items)
{
HtmlInputCheckBox cBox = contact.FindControl("chkteklif") as HtmlInputCheckBox;
if (contact is HtmlInputCheckBox)
{
string a = cBox.Value;
}
}
}
</code></pre>
<p>i used this code but this code couldn't find HtmlInputCheckBox.. any idea ?</p>
| c# asp.net | [0, 9] |
276,571 | 276,572 | Mobile remote program | <p>I'm writing a mobile remote program that the mobile's touch screen will be the remoted computer mouse. I'm using android for mobile and C# for server side programming.</p>
<p>Question:</p>
<ul>
<li>How can I establish a data connection between a mobile phone and
computer that passes mouse position continuously without stopping?</li>
</ul>
<p>I found <a href="http://32feet.codeplex.com/" rel="nofollow">32feet.net</a> that is free class library about Bluetooth but I couldn't solve my problem. </p>
<p>Thank you in advance.</p>
| c# java android | [0, 1, 4] |
5,484,803 | 5,484,804 | Javascript (using jQuery) in a large Project... organization, passing data, private method, etc | <p>I'm working on a large project that is organized like so:
Multiple javascript files are included as needed and most code is wrapped in anonymous functions...</p>
<pre><code>// wutang.js
//Included Files Go Here
// Public stuff
var MethodMan;
// Private stuff
(function() {
var someVar1;
MethodMan = function(){...};
var APrivateMethod = function(){...};
$(function(){
//jquery page load stuff here
$('#meh').click(APrivateMethod);
});
})();
</code></pre>
<p>I'm wondering about a few things here. Assuming that there are a number of these files included on a page, what has access to what and what is the best way to pass data between the files?</p>
<p>For example, I assume that <code>MethodMan()</code> can be accessed by anything on any included page. It is public, yes? </p>
<p><code>var someVar1</code> is only accessible to the methods inside that particular anonymous function and nowhere else, yes? Also true of <code>var APrivateMethod()</code>, yes?</p>
<p>What if I want <code>APrivateMethod()</code> to make something available to some other method in a different anonymous wrapped method in a different included page. What's the best way to pass data between these private, anonymous functions on different included pages? Do I simply have to make whatever I want to use between them public? How about if I want to minimize global variables?</p>
<p>What about the following:</p>
<pre><code>var PootyTang = function(){
someVar1 = $('#someid').text();
//some stuff
};
</code></pre>
<p>and in another included file used by that same page I have:</p>
<pre><code>var TangyPoot = function(){
someVar1 = $('#someid').text();
//some completely different stuff
};
</code></pre>
<p>What's the best way to share the value of someVar1 across these anonymous (they are wrapped as the first example) functions?</p>
| javascript jquery | [3, 5] |
4,303,959 | 4,303,960 | How to renable document.write after jQuery ajax has completed | <p>I have to grab a snippet of JS that has document.write in it - this causes the page to go blank once the document.write renders. I was able to work around this by redefining document.write and pass the response of the script to a function that I use to output the response from the getScript() jQuery function. I am having an issue however with other elements and scripts that load later in the page that my redefining is preventing to output on the page. How can I set document.write back to the default functionality after the jQuery getScript() has completed?</p>
<pre><code>$.getScript('somescript.com/script/', function(){
//Prevent document.write normal behavior
document.write = function(markup) {
fullMarkup += markup;
appendResponse(markup);
}
}
});
</code></pre>
| javascript jquery | [3, 5] |
2,706,974 | 2,706,975 | Adding days to a date - date getting converted to string | <p>So I'm trying to add a certain number of days to a date, and I'm getting a strange issue:</p>
<pre><code>var date = new Date();
var newdate = date.getDate() + $('#ddlDays option:selected').val();
date.setDate(newdate);
</code></pre>
<p>So if today is 09/29/2010, the Date is 29. But if a user selects "5" from ddlDays, it will assume I am adding strings together, adding 295 days to my date.</p>
<p>I was under the impression that javascript would assume they were integers? Does getDate() return a string instead of an integer?</p>
<p>How can I fix this?</p>
| javascript jquery | [3, 5] |
4,066,067 | 4,066,068 | Continue execution of the code after alert message from clientside | <p>I've to send mail using webappplication.All works fine but i've to show a confirm message if attachments are not selected.In that confirm box when ok is clicked execution of the code should continue,when cancel button is clicked it should return.</p>
<p>This is my code</p>
<p>Code behind</p>
<pre><code> protected void btnSend_Click(object sender, EventArgs e)
{
string str = "Are you sure, you want to proceed without attachment?";
this.ClientScript.RegisterStartupScript(typeof(Page), "Popup", "ConfirmApproval('" + str + "');", true);
...Send mail code goes here
}
</code></pre>
<p>ASPX</p>
<pre><code>function ConfirmApproval(objMsg)
{
if(confirm(objMsg))
{
alert("execute code.");
return true;
}
else
return false;
}
</code></pre>
<p>It works fine, ie when ok button is clicked an alert "execute code" is displaying.Instead of displaying alert i want to continue execution of the code.How will we do that from client side ???</p>
| c# javascript | [0, 3] |
350,955 | 350,956 | How do i get relative dimensions of scrollbale window viewport | <p>I am having a Tooltip (larger image view) that is being positioned via e.pageX e.pageY and i am trying to make sure it is not hidden below the current scrolled view port.</p>
<p>I have seen many sites have this
my code is something like this but i am missing something.</p>
<pre><code>var positionImg = function(e) {
var viewportWidth = $(window).width();
var viewportHeight = window.innerHeight ? window.innerHeight : $(window).height();
var mouseAtY = e.pageY;
var mouseAtX = e.pageX;
var maxBottomVPos = viewportHeight-"i dont know";
var maxTopVPos = 30;
if (mouseAtY >= maxBottomVPos)
{
tPosX = mouseAtX+ 10;
tPosY = mouseAtY -520;
}
else if (mouseAtY <= maxTopVPos)
{
tPosX = mouseAtX;
tPosY = mouseAtY +40;
}
else
{
tPosX = mouseAtX;
tPosY = mouseAtY +20;
}
$zoomContainer.css({top: tPosY, left: tPosX});
};
</code></pre>
| javascript jquery | [3, 5] |
4,897,244 | 4,897,245 | How to make fixed floating element stop at #footer? | <p>Below is the code I am using to fix a sidebar as the user scrolls. As of now, it overlaps with my footer. How can I make it stop at a certain point or when it hits the footer?</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
if ($('.pageheaderwrap').length) {
$(window).scroll(function() {
if ($(this).scrollTop() > 362) {
$(".sidebar-left").css({
"position": "fixed",
"top": 0
});
} else {
$(".sidebar-left").css({
"position": "absolute",
"top": "255px"
});
}
});
} else {
$(window).scroll(function() {
if ($(this).scrollTop() > 230) {
$(".sidebar-left").css({
"position": "fixed",
"top": 0
});
} else {
$(".sidebar-left").css({
"position": "absolute",
"top": "125px"
});
}
});
}
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
3,105,686 | 3,105,687 | jquery dynatree array function | <p>I have an array of functions and also I am using a dynatree plugin inside it.</p>
<p>Example:</p>
<pre><code>fn1: function(){
.....
}),
fn2: function(){
.....
}),
fn3: { param1: xValue, param2: yValue }
</code></pre>
<p>Now I would like to add a function in fn3 like,</p>
<pre><code>fn3: fn3a
//In fn3a
function fn3a(){
//Based on condition add values.
if...
param1: xValue, param2: yValue
else...
param1: xValue, param2: zValue
}
</code></pre>
<p>How can I define those params in {...} in function.</p>
<p>Please suggest.
Thanks in advance.</p>
| javascript jquery | [3, 5] |
2,906,379 | 2,906,380 | search and count entries in a table jquery | <p>I have the following table:</p>
<pre><code><table>
<tr>
<th>Alarm</th>
</tr>
<tr>
<td>OK</td>
</tr>
<tr>
<td>Missing</td>
</tr>
<tr>
<td>OK</td>
</tr>
</table>
</code></pre>
<p>I want to count the rows in this table like this<br>
OK = 2<br>
Missing = 1</p>
<p>But I have no idea how to do it with jQuery, the selector should be specified just for alarm columns because I have other columns contains ok and missing</p>
<p><strong>Note:</strong> I want to count the rows for specific column in the table just for alarms column
alaram columns contains 2 ok and 1 missing.</p>
| javascript jquery | [3, 5] |
4,587,512 | 4,587,513 | Scan trough .txt file with multiple values on one line. Find right Value | <p>I got a .txt file wich i load into a string with Buffered string reader. The data in the String is in this format.</p>
<pre><code>20 000 5 000
50 000 6 000
60 000 7 000
80 000 8 000
90 000 9 000
</code></pre>
<p>I need to go trough these numbers and find the right one. I have a int variable with a number. Lets say the int variable is "24000". Then the right answer from the list would be 20 000. As this is the closest match. I Then need to extract the number after 20 000 (5 000) and write it to a separate int. I cannot change the format of the numbers, because there are like a million of them formated in a .txt file like this.</p>
<p>Summary : UserNumber -> Find closest match from the left side -> Store right side number to an int.
Any ideas on how i can manage this?</p>
| java android | [1, 4] |
810,943 | 810,944 | android project not appear in file>new | <p>my O.S is windows 7 32 bit i installed java jdk 6 ,downloaded eclipse and install android SDK ,the problem is android project does not appear in file>new only appear android application project i tried a lot of versions but not worked , I need to know how can i start with application like in android project not what exist in android application project I try to Run it but this error appear
[2012-11-17 02:54:42 - Emulator] Failed to allocate memory: 8
[2012-11-17 02:54:42 - Emulator]
[2012-11-17 02:54:42 - Emulator] This application has requested the Runtime to terminate it in an unusual way.
[2012-11-17 02:54:42 - Emulator] Please contact the application's support team for more information.
please help me how to appear android project like before, or how to work with that android application project, thanks in advance </p>
| java android | [1, 4] |
2,505,292 | 2,505,293 | Javascript function help needed | <p>I'm trying to hide one div and show another, when a button is clicked. The button needs to change class after click.</p>
<p>I tried to change these this with <code>toggleClass</code> and <code>toggleSlide</code>, but it didn't work. Now I just try to show and hide divs onclick. It seems to work somehow, but <code>removeClass</code> won't work.</p>
<p>Can somebody understand what's wrong? Or is there better way to do it?</p>
<p>Maybe I can make it with toggle array or something, that simplifies the code or click counts (<code>if count c++%2!=2</code>), don't even know if that's possible.</p>
<pre><code>$('div.more-lang').hide();
$('div.lang-arrow').click(function () {
$('div.lang-arrow').addClass('more');
$('#lang').hide('');
$('div.more-lang').show('');
});
$('div.lang-arrow.more').click(function () {
$('div.lang-arrow').removeClass('more');
$('div.more-lang').hide('');
$('#lang').show('');
});
</code></pre>
| javascript jquery | [3, 5] |
4,297,624 | 4,297,625 | export into PDF everything in a panel content using C# | <p>I have a panel and inside the panel there is a gridview and charts(fusion-chart). What i am trying to do is to export everything in the panel as a image into PDF. So far, i am only able to export the gridview and the chart is not showing up at all. How can i export everything in the panel content as image into pdf format? pls. help. Here is my code:
I am using ITEXT Sharp</p>
<pre><code>protected void btnExport_Click(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=Panel.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
pnlPerson.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
}
</code></pre>
| c# asp.net | [0, 9] |
5,213,980 | 5,213,981 | Detect a page submit in jQuery | <p>I am currently working with reading data from a USB card reader and it sends a page submit command along with the card track data.</p>
<p>Is there a way for me to detect a page submit command and can I programmatically disable the submit command?</p>
| asp.net javascript jquery | [9, 3, 5] |
4,471,541 | 4,471,542 | ProgressDialog working in thread on android | <p>I have a little problem, I hope U can help me;)</p>
<p>Trouble is, that ProgressDialog show only after loading run(), but I need to show it on start and showing it while loading some data. I put: "dialog = ProgressDialog.show(CategoriesListActivity.this,"Working...","Loading data", true);" in method run(), but the same. I print in Log.i() some info (int i++) and put title of ProgressDialog. Method work correctly, but don't show ProgressDialog. I have read some info that some thread block another thread (my created), that's why doesn't show progressDialog, but can't do anything. Thx.</p>
<pre><code> public void run() {
/** getting there long execution **/
handler.sendEmptyMessage(0);
}
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
// stop and hide dialog
dialog.dismiss();
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_
dialog = ProgressDialog.show(CategoriesListActivity.this, "Working...",
"Loading data", true);
// start new thread where get long time execution
Thread thread = new Thread(this);
thread.start();
//wait while data is loading, 'cause I need use variable from calculation
// in "EfficientAdapter" later
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
ListView l1 = (ListView) findViewById(R.id.list);
l1.setAdapter(new EfficientAdapter(this));
}
</code></pre>
| java android | [1, 4] |
1,233,430 | 1,233,431 | Thumbnail preview of a url using php and javascript | <p>I have a need for getting preview a url over mouse hover, my application is built on php , js and jquery. Although I have an idea of to get to my requirements but am a little confused with the right approach, i checked all the posted question on here but most of them refer to some third party tools or installables. Frnakly i do not want to use them and think i should try one on my own. Please can you guide me through on the best possible step as per you?</p>
<p>Thanks!</p>
<p>11-Jun-2012
Finally I managed to use Curl and get a preview of the site on a Div placed next to the Link on my site, well now the problem is of fitting the content in the Div ..is there a way that I can adjust the css of the extracted html page in such a way that all the content fits in the fixed height and width of the Div.scaledown option or something? that would scale everything down to the required proportion?</p>
| php javascript jquery | [2, 3, 5] |
1,837,710 | 1,837,711 | Cycle fadeIn and fadeOut between 2 images | <p>I took a look at some answers already posted but didn't find the correct way to do this.<br>
I have 2 images in the same <code>div</code>, one is visible the other is set to <code>display:none;</code><br>
I want a non-ending loop between the 2 images, with the fade-out/fade-in effects, <strong>without any jQuery plugin</strong>. </p>
<p>I think, it's just a few lines of code.</p>
| javascript jquery | [3, 5] |
4,882,181 | 4,882,182 | What's the easiest way to get a popup window in jQuery? | <p>I just need something simple: a clicked link that will open up a pop up box. </p>
| javascript jquery | [3, 5] |
242,688 | 242,689 | AsyncTask from Activity Class | <p>I am using this class to download txt file</p>
<pre><code>class RetreiveFeedTask extends AsyncTask<String, Void,String> {
@Override
protected ArrayList<Item> doInBackground(String... params) {
try{
URL url = new URL("myurl");
InputStream is = url.openStream();
BufferedReader in = new BufferedReader(new InputStreamReader(is));
String str;
while ((str = in.readLine()) != null){
}
in.close();
return str;
}
catch (MalformedURLException e){}
catch (IOException e){}
return null;
}
protected void onPostExecute(Strin str) {
}
</code></pre>
<p>this is how i call this class from my activity:</p>
<pre><code>new RetreiveFeedTask().execute();
</code></pre>
<p>And i want to know if there is a way to pass out this result to the activity that make the call.</p>
| java android | [1, 4] |
2,190,027 | 2,190,028 | how to conver date like 01 mar 2011 to only mar 2011 | <p>how to conver date like 01 mar 2011 to only mar 2011 in javascript or jquery</p>
| javascript jquery | [3, 5] |
4,894,348 | 4,894,349 | jquery fadein fadeout problem in firefox | <p>I want to initially hide .noteHover and then use a hover event that will fade this class in and then out very quickly. This seems to work fine in chrome but my problem is that in ff .noteHover remains as display:none which prevent the fadein fadeout effect, can anyone offer some advice to where im going wrong?</p>
<p>Here is my code:</p>
<pre><code>/* Hover test */
/* Hover test */
var $notes = $('.note');
$notes.each(function() {
var thisNote = $(this);
var nestedNoteHover = thisNote.find('.noteHover');
var nestedPath = thisNote.find('path');
nestedNoteHover.hide();
thisNote.hover(
function() {
nestedPath.css('opacity', 0.8);
nestedNoteHover.fadeIn(100, function() {
nestedNoteHover.fadeOut(300);
});
},
function() {
nestedPath.css('opacity', 1);
}
);
});
</code></pre>
<p>I have updated the code but still no change on ff?</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
4,157,615 | 4,157,616 | how to change a price based on selections | <p>please someone help me. i have posted this 2 days ago on stack overflow but no one has answered. i am pulling my hair and cant figure out what to do. here is my original post.</p>
<p><a href="http://stackoverflow.com/questions/4533509/attempt-to-create-apple-like-shopping-cart-page-price-updates-based-on-customiza">attempt to create apple like shopping cart page (price updates based on customization selections)</a></p>
<p>i dont know what this type of cart is called and i have spent days on google and cannot find one single tutorial that explains how i can do this. how the heck has the developer at apple or dell or hp learned to create such a thing. the knowledge came from somewhere....</p>
| php javascript jquery | [2, 3, 5] |
2,388,748 | 2,388,749 | Stop jQuery Mouseleave Event When Entering Another Specific Element | <p>I need to know how I can stop my mouseleave event from occuring when I slide my mouse over to a different element (link). How can I setup a condition that says to only do the mouseleave animation if I have not entered a specific element?</p>
<pre><code>$(activity_link).mouseenter(function() {
$(this).siblings(".delete_place").animate({
"left" : "-28px"
}, 300);
}).mouseleave(function() {
$(this).siblings(".delete_place").animate({
"left" : 0
}, 300);
});
</code></pre>
| javascript jquery | [3, 5] |
1,904,331 | 1,904,332 | Problem in passing arrays from C# to C++ | <p>I have an application in which I need to pass an array from C# to a C++ DLL. What is the best method to do it? I did some search on Internet and figured out that I need to pass the arrays from C# using ref. The code for the same:</p>
<pre><code>status = IterateCL(ref input, ref output);
</code></pre>
<p>The input and output arrays are of length 20. and the corresponding code in C++ DLL is </p>
<pre><code>IterateCL(int *&inArray, int *&outArray)
</code></pre>
<p>This works fine for once. But if I try to call the function from C# in a loop the second time, the input array in C# is showing up as an array of one element. Why is this happening and please help me how I can call this function iteratively from C#.</p>
<p>Thanks,
Rakesh.</p>
| c# c++ | [0, 6] |
854,226 | 854,227 | Adding Content During Runtime | <p>I've just started learning Android, and have been working on a simple application where the user has a simple conversation with the computer.</p>
<p>My question is, how can I set up the UI in a way that allows the input from the user to be displayed on the view, during runtime? As the input prompts increase, there will be more content to be displayed, so I'll need to use a scrolling bar, which I believe could be taken care of by the scrollview layout. </p>
<p>Basically, what I'm trying to achieve is very similar to how chat applications display content, during runtime. How do I go about doing that? I've looked around, but can't exactly point myself in the right direction.</p>
| java android | [1, 4] |
51,661 | 51,662 | Problem with loop on IE8 | <p>Hi i have this javascript function</p>
<pre><code>function test(){
var count = 0;
var date1 = $('#alternatestartdate').val();
var date2 = $('#alternateenddate').val();
var startDate = new Date(date1);
var endDate = new Date(date2);
var loop = true;
while (loop)
{
$('#pa').append('first test');
if (startDate<=endDate)
{
$('#pa').append('second test');
loop = true;
}
startDate.setDate(startDate.getDate()+1);
}
else
{
loop = false;
}
}
}
</code></pre>
<p>The problem is the function will not enter the if loop when tested in IE8. So only <strong>first test</strong> will be printed. <strong>second test</strong> will not be printed. Other browser all work fine. How to fix this? </p>
| javascript jquery | [3, 5] |
5,660,034 | 5,660,035 | Stop propagation for a specific handler | <p>Let's say I have custom dropdown(). When the button is clicked I want to bring up the menu, and when the user clicks outside of the menu I want it to close. So I do something like this:</p>
<pre><code>$(myDropDown).mousedown(dropDownMouseDown);
$("html").mousedown(htmlMouseDown,myDropDown);
function dropDownMouseDown(event) {
event.target.open();
event.stopPropagation();//I need this line or else htmlMouseDown will be called immediately causing the dropDown-menu to close right before its opened
}
function htmlMouseDown() {
this.close();
}
</code></pre>
<p>Well, this works. But what if I add two of these? If I click to open the first, then the same on the second then both will be open because dropDownMouseDown stops the propagation so that htmlMouseDown never gets called for the first.
How do I get around this?
If I only had these two then adding some logic for that would of course be easy, but if the quantity is dynamic? Also I might not want to call event.stopPropagation() because it will do strange stuff to other libraries I'm using which listen for that event too?
I also tried putting this line:
$("html").mousedown(htmlMouseDown,myDropDown)
inside the dropDownMouseDown-handler but it will be called immediately anyway once the bubbling reaches the html-element.</p>
| javascript jquery | [3, 5] |
3,534,920 | 3,534,921 | When starting from scratch: Javascript or JQuery? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/668642/is-it-a-good-idea-to-learn-javascript-before-learning-jquery">Is it a good idea to learn JavaScript before learning jQuery?</a> </p>
</blockquote>
<p>I'm new to javascript in general. I can write basic functions that do basic things and that's just great. I started to dabble in JQuery recently because, well, its trendy and does cool things. For example I used their validation plugin on a site, saved me loads of time. Thing is I'm just depending on pre-written scripts to get the job done. I'd like to learn more so I can write my own custom solutions as problems arise. So my question is which is better to build a foundation on, Javascript or JQuery. I know JQuery is essentially a Javascript object with lots of cool methods so would it be better to learn the ropes on plain old Javascript because I'll be more "well rounded". Or should I skip the foreplay and stick with the trending hip JQuery?</p>
| javascript jquery | [3, 5] |
2,035,648 | 2,035,649 | how to finish two or more activites created by parent activity in android | <p>i am creating an app in which Activity A creates Activity B and Activity A goes to Background and activity B in Foreground..</p>
<p>when back is pressed in activity B then Activity A comes to foreground and Activity B to background..
Now Activity A creates Activity C again Activity A in background and Activity C in foreground..
I.e now C is foreground and activity A,B are in Background</p>
<p>when back is pressed in activity C then Activity A comes to foreground and Activity C to background..</p>
<p>I.e now A is foreground and activity C,B are in Background</p>
<p>now if Back is pressed in Activity A den i should finish All activities i.e A,B,C and should close the app...</p>
<p>how to implement this can any one help me out..</p>
| java android | [1, 4] |
2,598,020 | 2,598,021 | How to find a asp control id using java script? | <p>I am using following code to find control id.</p>
<pre><code>alert(document.getElementById("<%# TextBox1.ClientId %>").value )
</code></pre>
<p>but this code is giving error "object required".
Please help me.</p>
| javascript asp.net | [3, 9] |
1,180,629 | 1,180,630 | How do I get the value of a select in code-behind? | <p>I am using ASP.NET and in my <code>.aspx</code> page I have the following code, and, based on the selection, I am displaying the appropriate <code>div</code>s. It's working great, as is, but the question is: <em>How do I get the value (whatever selected by user) on code-behind?</em></p>
<pre><code><select id="filterResultsBy" >
<option value="">Select...</option>
<option value="Date">Date</option>
<option value="Subject">Subject</option>
<option value="Status">Status</option>
</select>
</code></pre>
<p>If I add <code>runat="server"</code> or use the server <code>asp:DropDownList</code> control, jQuery does not work. </p>
<pre><code>$('#ddlFilter').change(function(){
var sel = $(this).val();
if(sel === 'DATE'){
hideAll();// a function to hide all the divs first
$('#divDateRangeSearch').show();
} else if(sel === 'SUBJECT'){
///so on...
}
});
</code></pre>
| jquery asp.net | [5, 9] |
3,368,354 | 3,368,355 | this find parent of another div and toggle its child using jQuery | <p>I've done some research and nothing seems to be working. Here is the HTML followed by the JavaScript I am putting together. What I am trying to do is set it up so that whenever dashboard_gear_options is clicked, it toggles the appropriate hidden options row. Each block of code exists multiple times at different locations on the page. I tried using this, find, parent, next and children to no avail.</p>
<p>HTML:</p>
<pre><code>// start block
<div class="content_block_holder">
<div class="content_top">
<div class="dashboard_gear_options"></div>
<div class="dashboard_gear_divider"></div>
</div>
<div class="dashboard_holder">
<div class="hidden_options_row"></div>
</div>
</div>
// end block
// start block
<div class="content_block_holder">
<div class="content_top">
<div class="dashboard_gear_options"></div>
<div class="dashboard_gear_divider"></div>
</div>
<div class="dashboard_holder">
<div class="hidden_options_row"></div>
</div>
</div>
// end block (etc..)
</code></pre>
<p>JS:</p>
<pre><code>$(document).ready(function(){
$('.dashboard_gear_options').click(function(){
$(this).parent('.content_block_holder').find('.hidden_options_row').toggle();
});
});
</code></pre>
| javascript jquery | [3, 5] |
5,833,655 | 5,833,656 | php server connection + jquery post | <p>I'm making an admin panel for a gameserver and I got a little problem. </p>
<p>I got a working connection and I'm getting the playerlist. Then I'm trying to kick / warn somebody with a jQuery POST. But with this post I need to make a new connection. </p>
<p><strong>Is there a way to keep only 1 connection alive and send commands to it with jQuery</strong> or do I have to make a new connection every time? </p>
| php jquery | [2, 5] |
4,549,212 | 4,549,213 | On IE cursor is comming always at start in textarea | <p>I am dealing with textarea, and on click of this I am calling one replace function which will remove some specified string in textarea, this is the basic operation.</p>
<p>Expected behavior after clicking on textarea</p>
<p>1) At first click :</p>
<ul>
<li>It should remove specified string from textarea</li>
<li>Cursor should come at end of string</li>
</ul>
<p>2) more than one click :
- Cursor should come at where ever user clicks in text area</p>
<p><strong>Below is my replace function....</strong></p>
<pre><code>function replace(id,transFromDb) {
newStr = $("#"+id).val();
var len = null;
if(transFromDb == '') {
newStr = newStr.replace(Lang.Message27,'');
newStr = newStr.replace(Lang.Message28,'');
}
else {
newStr = newStr.replace(Lang.Message28,'');
newStr = newStr.replace(Lang.Message27,'');
}
/* change font weight as bold. */
$("#"+id).css({"fontWeight":"bold"});
$("#"+id).val(newStr);
}
</code></pre>
<p>Assume that Lang.Message is specified string.</p>
<p><strong>It's working above behavior with FF.
Facing issue on IE, it always keep cursor position at first.</strong></p>
<p>Please provide any solution....</p>
<p>Thanks in Adavance
Pravin</p>
| javascript jquery | [3, 5] |
3,897,915 | 3,897,916 | PLC Compiler and an Interpreter | <p>I am Trying to Build a PLC Compiler and an interpreter can anybody give me Some Links which will be useful for me..
Thanks</p>
| java javascript | [1, 3] |
1,334,919 | 1,334,920 | What is the equivalent of Master Page and Web User Control in PHP? | <p>Assume that I have some advertisments that I want to put in specific area of my pages. In ASP.NET I would use Web User Control for this pupose. What about in PHP? The same question for Master Page.</p>
| php asp.net | [2, 9] |
3,956,257 | 3,956,258 | why is is fault | <p>Default.aspx</p>
<pre><code><%=if isChecked%>
<label for="form_remember"><input name="remember" type="checkbox" id="remember" value="Re" checked="checked"></input>
<%=else %>
<label for="form_remember"><input name="remember" type="checkbox" id="Checkbox1" value="Re"></input>
remember me </label>
<%=end if%>
protected bool isChecked = false;
isChecked ,this variable ,i defined in default.aspx.cs
</code></pre>
<p>now ,i want to make it work ,but ,it doesn't ,faint ,how could i do ?</p>
| c# asp.net | [0, 9] |
1,925,131 | 1,925,132 | Prompt user about pending changes | <p>I have a ASP.NET page, where I have couple of editable dropdowns, few editable textboxes and few display only fields.</p>
<p>I want to track whether user changed any dropdown values or textbox values. When user click goBack button, I want to prompt them with a message that the changes are not saved and if they really want to go back.</p>
<p>Please let me know what is the easiest way to track the changes on textbox or dropdwon list.</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
5,866,147 | 5,866,148 | alternative for .val() to use it for select option | <pre><code><select id="width">
<option value="23" selected="selected">10cm</option>
<option value="26">100cm</option>
<option value="43">1000cm</option>
</select>
</code></pre>
<p>I have two similar select options, I am unable to get the value with the .val() function because it will get the id value (23,26,43) I wont to get the 10cm or 100cm or 1000cm.. and then remove the <strong>cm</strong> from the selected value and use that value to multiply with the value of the other select option called height. any ideas?</p>
| javascript jquery | [3, 5] |
5,472,393 | 5,472,394 | How can I overload abstract constructor in derived class | <p>I have an abstract constructor and a derived class like follows:</p>
<pre><code>abstract ab {
ab();
}
class dc {
dc();
}
</code></pre>
<p>I want to execute first the constructor of the derived class and then execute the constructor of the abstract class</p>
<p>Please give me an example.</p>
| java php | [1, 2] |
1,305,754 | 1,305,755 | Access String Resource in AppWidget? | <p>Normally, I'd do getString(R.string.myString), however it doesn't seem to work in a widget.</p>
| java android | [1, 4] |
1,619,914 | 1,619,915 | How to add fixed variable name with changing variable name | <pre><code><script>
var data1_1 = $value;
var data1_3 = $value;
var data1_5 = $value;
</script>
</code></pre>
<p>The above code is hard-code which is correct.
Now I want to make the code more flexiable using for loop.
However, there is something wrong on <code>data1_keysArr[i] = $value</code>.</p>
<p>Can anyone help me?</p>
<p>Thanks in advance!</p>
<pre><code><script>
var keysArr = [1, 3, 5];
for(var i=0; i<keyArr.length; i++){
data1_keysArr[i] = $value;
}
</script>
</code></pre>
| javascript jquery | [3, 5] |
2,586,382 | 2,586,383 | Write a function inside jquery .html() | <p>I am running a bg slider..."Supersized - Fullscreen Slideshow jQuery Plugin"</p>
<p>what i need is when a background changes some contents in a specific div must also change...</p>
<p>here i found a code line from script</p>
<pre><code>if (options.slide_captions)
$('#slidecaption').html(options.slides[currentSlide].title);
</code></pre>
<p>this one pulls the image title to a specific div, but i want to load unique div for each background change...</p>
<p>or is there any other ways to do??</p>
<p>i have very little knowledge in jquery...
please help</p>
<p>advance thanks...</p>
| javascript jquery | [3, 5] |
3,678,513 | 3,678,514 | displaying a commenting form with the on click event | <p>Please am trying to create a scenario where by if a user clicks on a link called comment to comment on a post, a commenting form will appear for him to be able to comment only on that post. this is the function i created but its not working.</p>
<pre><code>function comment() {
$(this).click(function() {
$('#commentForm').show();
return false;
});
};
</code></pre>
<p>I impemented the function on the link like this.</p>
<pre><code><a href"#" onClick"comment()">comment</a>
</code></pre>
<p>The same link is meant to show up under every retrieved post result please help.</p>
| javascript jquery | [3, 5] |
2,987,798 | 2,987,799 | How to find out which function in asp.net has memory leak | <p>We have a asp.net web application which seems to crash IIS 7.0. The reason I say this is the application works for 16 hours with new issues and every 16 hours approx, it needs IIS RESET.</p>
<p>Is there any tool or method we can find out what's (e.g. ado.net, dll etc)causing the memory leak in web application. </p>
| c# asp.net | [0, 9] |
4,302,185 | 4,302,186 | Make an ajax request with elements attributes with jquery | <p>I want to make an ajax request where I want to give all my elements attributes. For exemple i select all my elements : </p>
<pre><code>var elements = $('.droppable')
</code></pre>
<p>and then i make my ajax :</p>
<pre><code> $.ajax({
url: "test.html",
data: {myelements : elements},
success: function(){
}
});
</code></pre>
<p>How can i do to give all my elements attributes as <strong>height, width, position, top, left</strong>... to my ajax request. I have to make an array myself or there is an other way?</p>
<p>I want to do that because i want to save in database all the absolute position of my elements.</p>
<p>Thank you for help.</p>
| javascript jquery | [3, 5] |
2,420,982 | 2,420,983 | A second button to start php script, how? | <p>I have read the answer to <a href="http://stackoverflow.com/questions/1697484/a-button-to-start-php-script-how/">this question</a>, to execute PHP scripts with the click of a button. But what if I have a "<em>nested button</em>", like this :</p>
<pre><code> <?php
if(!empty($_POST['act'])) {
echo "Ready to rock!";
$someVar = "Rock n Roll";
if(!empty($_POST['act2'])) {
echo $someVar;
} else {
?>
<form method="POST" action="">
<input type="hidden" name="act2" value="run">
<input type="submit" value="Rock It!">
</form>
<?php
}
} else {
?>
<form method="POST" action="">
<input type="hidden" name="act" value="run">
<input type="submit" value="Show It!">
</form>
<?php } ?>
</code></pre>
<p>I heard my problem can be solved with jQuery, but I no idea.</p>
<p>anyone please.</p>
| php jquery | [2, 5] |
5,649,841 | 5,649,842 | How do I set my 2nd datepicker one day ahead of the 1st? | <p>I have 2 datepicker textfields: one of them is #from, the other is #to.
Right now, my users can have the same date for #from and #to. </p>
<p>How do I make the #to datepicker start at #from + 1 day?</p>
<p>Here's my current code:</p>
<pre><code> var dates = $( "#from, #to" ).datepicker({
numberOfMonths: 2,
minDate: 0,
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
</code></pre>
| javascript jquery | [3, 5] |
4,073,661 | 4,073,662 | Is goto ok for breaking out of nested loops? | <p>JavaScript supports a goto like syntax for breaking out of nested loops. It's not a great idea in general, but it's considered acceptable practice. C# does not directly support the <code>break labelName</code> syntax...but it does support the infamous <code>goto</code>. </p>
<p>I believe the equivalent can be achieved in C#:</p>
<pre><code> int i = 0;
while(i <= 10)
{
Debug.WriteLine(i);
i++;
for(int j = 0; j < 3; j++)
if (i > 5)
{
goto Break;//break out of all loops
}
}
Break:
</code></pre>
<p>By the same logic of JavaScript, is nested loop scenario an acceptable usage of <code>goto</code>? Otherwise, the only way I am aware to achieve this functionality is by setting a <code>bool</code> with appropriate scope.</p>
| c# javascript | [0, 3] |
4,371,459 | 4,371,460 | Sending Mail with an attachment using SMTP | <pre><code>protected void Button1_Click(object sender, EventArgs e)
{
var fromAddress = new MailAddress(fromid.Text, fromname.Text);
var toAddress = new MailAddress(toid.Text, toname.Text);
string fromPassword = pswd.Text;
string subject = subjectbox.Text;
string body = bodybox.Text;
Attachment at = new Attachment(Server.MapPath("~/Penguins.jpg"));
var smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
Credentials = new NetworkCredential(fromAddress.Address, fromPassword),
Timeout = 20000,
};
using (var message = new MailMessage(fromAddress, toAddress)
{
Subject = subject,
Body = body,
IsBodyHtml = false,
})
{
message.Attachments.Add(at);
smtp.Send(message);
}
}
</code></pre>
<p>There is no error but while sending mail it takes some time and shows "Connection TimeOut" and not sending mail...:(
Can any one tell where is the problem. </p>
| c# asp.net | [0, 9] |
1,110,427 | 1,110,428 | jQuery Calculation Plugin: Summing subtotals to create grand total | <p>I am working with the <a href="http://www.pengoworks.com/workshop/jquery/calculation/calculation.plugin.htm" rel="nofollow">jQuery Calculation Plugin</a> on a page where I do quantity x price calculations that then add to a subtotal. This is repeated 4 times.</p>
<p>Each set of 4 involve fields with different ids and differing calculations (more than just price x qty). </p>
<p>The id's of the 4 subtotal fields are subtotal_events, subtotal_raffle, subtotal_sdc, subtotal_late.</p>
<p>In addition to displaying the individual subtotals, I need to display a "grand total"...a total of the subtotals.</p>
<p>In the fiddle referenced below, I've hard-coded the values of two of the 4 subtotals. </p>
<p>I've also created a function recalc3, which is currently producing the NaN in the #grandtotal span. The value should be $70 based upon the hard-coded subtotals, even if no tours or extra tickets are ordered.</p>
<p>Hours of reading posts and trial and error aren't getting me any closer, so any help with achieving the goal is very much appreciated. </p>
<p>Here's the fiddle: <a href="http://jsfiddle.net/sadiem/7spHt/" rel="nofollow">http://jsfiddle.net/sadiem/7spHt/</a></p>
| javascript jquery | [3, 5] |
4,238,451 | 4,238,452 | Prevent redirect on form submission and use the POST variables in php | <p>I am working on a messaging system for a networking website wherein I want to use the data that the user enters. Like if the user enters 'Andy' as the recipient I want the php mechanism to use the $_POST['recipient'] variable to retrieve the id of that user and conduct a lookup rather than just going into a javascript function and terminating. I want the javascript function which actually sends the message to get called after the user clicks another button. I am new to PHP and don't understand the inner workings that well. I have given a small sample code below that is similar to mine but easier on the eyes.</p>
<pre><code><form>
To:<input type="text" id=rec">
<input type="submit" value="confirm" id="confirm" name="confirm">
<button type="button" id="sub1" onclick="sendPM()">Submit</button>
</form>
<--some mysql look ups using $_POST['rec'] which copies values from the table into the
php variables and stores it in hidden HTML fields to be accessed later by the
sendPM() function-->
$('#sub1').click(function sendPM(){.......}
</code></pre>
| php javascript | [2, 3] |
2,726,251 | 2,726,252 | What does the obscure javascript error b(e.target).zIndex is not a function mean? | <p>To give more information I am using the modular form here:</p>
<p><a href="http://jqueryui.com/demos/dialog/#modal-form" rel="nofollow">http://jqueryui.com/demos/dialog/#modal-form</a></p>
<pre><code>`b(e.target).zIndex` is not a function
[Break on this error] `(function(a){a.widget("ui.mouse",{opti...is._unrotate}return this}})})(jQuery);`
/js/jquery-ui.min.js
</code></pre>
<p>I also seem to be getting the error "Too much recursion"</p>
<pre><code>too much recursion
[Break on this error] `3||a.nodeType===8)){if(a.setInterval&&...this.special[o]||{};if(!t){t=e[o]={};`
https://my.dev.peer1.com/js/jquery/jquery-1.4.min.js
</code></pre>
<p>I know its not much to go on but I was hoping someone might have experience with similar issues.</p>
| javascript jquery | [3, 5] |
5,370,132 | 5,370,133 | Get Current System Time And After That Want To add 30 minutes in That Time | <p>I want to <code>get current time</code> in my application.<br>
Then i want to <code>add 30</code> minutes in the current time.<br>
can any one help me how to achieve this?</p>
<p>I am getting start and stop time from my web service.
eg: ((start time)11:00 am to (stop time) 11:00 pm)
now i want to add 30 minutes in the current time till the stop time reach.</p>
| java android | [1, 4] |
43,694 | 43,695 | Create a div using loop | <p>I create a div and its css id like this.</p>
<pre><code><div id="r1" class="ansbox"></div>
<div id="r2" class="ansbox"></div>
<div id="r3" class="ansbox"></div>
<div id="r4" class="ansbox"></div>
<div id="r5" class="ansbox"></div>
<div id="r6" class="ansbox"></div>
<div id="r7" class="ansbox"></div>
<div id="r8" class="ansbox"></div>
<div id="r9" class="ansbox"></div>
<div id="r10" class="ansbox"></div>
</code></pre>
<p>is there a way to create this div using looping statement. Anyone help me..</p>
| javascript jquery | [3, 5] |
16,983 | 16,984 | How to show the custom message when database down | <p>I have deployed the web application and customer accessing web application publically in between my databse down then I want show the custom message to the user. In my web application 50 pages, and I want to handle message commonly for all pages. Please help how to do this.</p>
| c# asp.net | [0, 9] |
978,763 | 978,764 | How to check ranges of java versions in javascript? | <p>I am stuck: how to check if a user has a specified java requirement? I need to find ranges (for instance java versions between 1.5.0_10 and 1.6.0_10). I am using javaDeploy.js from Oracle and using the versioncheck method but I can't figure what I need to pass inside the versionCheck method for ranges such as the example I provided.</p>
| java javascript | [1, 3] |
5,745,487 | 5,745,488 | Class and acessibility problem c# & asp.net | <p>i have small class like</p>
<pre><code>public static class TSM
{
static string TokenID = "";
public static string GetTSM()
{
TokenID = new Guid().ToString();
return TokenID;
}
}
`GetTokenID `will return a string
</code></pre>
<p>i just call GetTokenID from my aspx page like</p>
<pre><code><script language="javascript" type="text/javascript">
var token= <% =TSM.GetTSM() %>;
</code></pre>
<p></p>
<p>i am getting error when i am running that aspx page.</p>
<h2>the error is</h2>
<p>Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.</p>
<p>Compiler Error Message: CS1002: ; expected</p>
<p>please guide me what is going wrong. thanks</p>
| c# asp.net | [0, 9] |
354,075 | 354,076 | Should I store users friend list on device or server? | <p>I am making an application based on location services. I want to know best practices for storing users friend list. If friends list is stored on server then if user don't have internet connection he will not be able to see the friends list. On the other hand if friends list is stored on device (and there is no internet connection), list might be not up to date.
I understand it is not a programming question but would like to know what will be the better practice.
Any suggestions will be greatly appreciated.</p>
| android iphone | [4, 8] |
4,836,477 | 4,836,478 | Use Onload or ready? | <p>In my application i am using </p>
<pre><code>$(document).ready()
</code></pre>
<p>What is the difference between this and </p>
<pre><code>$(document).onload()
</code></pre>
| javascript jquery | [3, 5] |
4,506,352 | 4,506,353 | How to position jQuery Output? | <p>I have the following that produces a drop down using a JSON file:</p>
<pre><code><script type="text/javascript">
$.getJSON('shares.json', function(data) {
var items = [];
$.each(data.Destinations, function(key, val) {
items.push('<option id="' + val.shareName + '">' + val.shareName+ '</option>');
});
$('<select/>', {
'class': 'my-new-list',
html: items.join('')
}).appendTo('body');
});
</script>
</code></pre>
<p>I can't position this drop down as I would usually, how can I tell it to go to a div for example? I suppose the appendTo('body') is simply adding it to the end of my HTML but how do you change it?</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
3,957,880 | 3,957,881 | In JQuery is it possible to skip an optional argument and pass the next ones? | <p>In JQuery is it possible to skip an optional argument and pass the next ones? if yes, how a jquery function determines which value is for which parameter?</p>
<p>An example:</p>
<pre><code>//
// function signature is
// jQuery.get( url [, data] [, success(data, textStatus, jqXHR)] [, dataType] )
//
// function is called as
//
$.get('ajax/test.html', function (data) {
$('.result').html(data);
alert('Load was performed.');
});
</code></pre>
<p>In call to $.get() after the url the [, data] is skipped and next the success callback is passed.</p>
| javascript jquery | [3, 5] |
4,655,477 | 4,655,478 | How can I make POST query for my web-service on Java, Anroid? | <p>I have code for POST query on Java</p>
<pre><code> ArrayList<HashMap<String, String>> books=SQLiteDbWrapper.getInstance().getAllBooks();
JSONObject object=new JSONObject();
object.put("key", KEY);
JSONArray isbns=new JSONArray();
for (HashMap<String, String> book:books) {
isbns.put(book.get(SQLiteDbHelper.ISBN13_FIELD));
}
object.put("isbns", isbns);
object.put("email", email);
Log.e("log", object.toString());
HttpClient client = new DefaultHttpClient();
HttpPost request = new HttpPost(BASE_URL+SUBMIT_SCRIPT);
request.setEntity(new ByteArrayEntity(
object.toString().getBytes("UTF8")));
HttpResponse response = client.execute(request);
</code></pre>
<p>I need to send JSON data into server; my web-service must get this data from $POST['json'] variable, but I don't know how can I put my JSONObject object into 'json' field for POST query? Please, help me</p>
| java android | [1, 4] |
3,454,482 | 3,454,483 | how to give horizantal scrolling in tab controls using jquery | <p>My prob is : when i click the link button it open the window and when i click the window it going to add as tab, now my problem is when it open in window page
is proper alignment when it going to add as a tab page alignment is different </p>
| jquery asp.net | [5, 9] |
640,131 | 640,132 | Appending and manipulating elements | <p>Please see the my test site <a href="http://garyryan.info/tests/bubbles.html" rel="nofollow">here</a>.</p>
<p>The script is written in the <code><head></code> so you will be able to see it there.</p>
<p><strong>Instructions</strong></p>
<p>If you click the blue area a new element will be made. Do this four or five times. Now click all the elements you've just created. They should all have a black outline. However, some do and some don't.</p>
<p><strong>Additional Info:</strong></p>
<p>Only tested on chrome so far.</p>
<p>Any ideas on what's going wrong here?</p>
| javascript jquery | [3, 5] |
142,055 | 142,056 | Implement Custom Numpad for EditText | <p>I have an application with a numpad (keys 0-9, Ok and Delete) that is always visible on screen.</p>
<p>When the user sets the focus on an <code>EditText</code> that has an numeric input method, then the key pressed on the numpad should be applied to the focused <code>EditText</code>.</p>
<p>My current approach is to set a <code>OnFocusChanged</code> listener on each <code>EditText</code> with numeric input method, and then remember the focused control:</p>
<pre><code> EditText txt1 = (EditText) findViewById(R.id.editText1);
txt1.setOnFocusChangeListener(new View.OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
if(hasFocus)
focused = (EditText)v; // focused is a member of the Activity class
}});
</code></pre>
<p>Then when a numpad key is pressed the key is applied to the <code>focused</code> control.</p>
<p>To me this seems a bit complex, is there an easier way that works automagically (without the focus change listener) on all <code>EditText</code> widgets with numeric input method?</p>
<p>Secondly, is there a way to disable the soft keyboard for those <code>EditText</code> widgets with numeric input only?</p>
| java android | [1, 4] |
4,410,342 | 4,410,343 | Using progress bar? | <p>in the application when user click on button to run new activity it have to wait some time to activity load everything and start up, till then user can see only black screen, so I want to put progress bar till activity is ready.
How can I do that?
Thank you. </p>
| java android | [1, 4] |
2,042,883 | 2,042,884 | Convert C# to unmanaged C++ | <p>I have the unenviable task of converting a couple of C# (CCW) COM servers (one is an Activex Control) to unmanaged C++. Any suggestions on tools I could use to make this as easy as possible would be gratefully accepted.</p>
| c# c++ | [0, 6] |
2,412,647 | 2,412,648 | window.parent.location.reload(true); causing problems! | <p>I have a aspx page that pops up a new window to edit some info. When the user is done editing they click save and at the end of the save event I have this C# code:</p>
<pre><code>Context.Response.Write("<script type='text/javascript'>window.parent.location.reload(true);window.frameElement.commitPopup();</script>");
Context.Response.Flush();
Context.Response.End();
</code></pre>
<p>So that the parent page will refresh and display the updated info. My problem is that if I have done some other action on the previous page that caused a postback, the code above will try to redo that postback (attempting to delete an item for instance). </p>
<p>Is there some way that I can update my information on the parent page without redoing the last postback?</p>
| c# javascript asp.net | [0, 3, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.