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 |
|---|---|---|---|---|---|
5,265,811
| 5,265,812
|
C++ & Java - overloading operator
|
<p>I have a difficult to understand the subject of overloading operator in C++ and Java.</p>
<p>For example, I define a new class Fraction:</p>
<pre><code>class Fraction {
public:
Fraction (int top, int bottom) { t = top; b = bottom; }
int numerator() { return t; }
int denominator() { return b; }
private:
int t, b;
};
</code></pre>
<p>and I want to overload the operator <code><<</code> for printing Fraction. How I do it? I need to overload it inside Class Fraction or outside Class Fraction?</p>
<p>In java - Is it possible to overload operator? How I can do it there (for example, I want to overload the operator <code>+</code>).</p>
<p>If there is a metrial about this subject, It will be great.</p>
|
java c++
|
[1, 6]
|
1,465,054
| 1,465,055
|
Receive data from PostBack in JavaScript
|
<p>I'm using jQuery to make postback then in my <code>.ascx</code> file I have code like this:</p>
<pre><code>Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args) {
if (args.get_error() == undefined) {
var dataItems = args.get_dataItems();
alert(dataItems['ctl00_cphContent_articleList_tbUpdate']);
}
}
</code></pre>
<p>Where on the Internet can I find specification of <code>args</code> object? What methods has it got? </p>
<p>Second, why do I have to pass in my server side data into control using ScriptManager?</p>
<p>Code on the server side is:</p>
<pre><code>ScriptManager.GetCurrent(this.Page).RegisterDataItem(tbUpdate, DateTime.Now.ToString());
</code></pre>
<p>and tbUpdate is the control on the site.</p>
<p>Is there any more elegant way to get access to data sent back to the client side. Do I have to send this data to any control? What does it really mean that data is sent to control?
How can I consume this data from that control? I had to use <a href="http://en.wikipedia.org/wiki/Firebug" rel="nofollow">Firebug</a> to find the id of the control and get access to it.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,764,896
| 1,764,897
|
write code to multiline
|
<pre><code>foreach (var item in products)
{
contantProduct += "<br/> <div class='linkProduct' id=\"link" + item.IdProduct + "\" onclick=\"$('.linkFlashIco').css('background-image','url(icon/Pointer.png)');$(this).find('>:first-child').css('background-image','url(icon/Activepointer.png)'); $(this).find('>:first-child').css('background-repeat','no-repeat'); $('.linkProduct').css('font-weight','normal');$('.linkProduct').css('border','1px solid orange');$('.linkProduct').css('background-color','white');$(this).css('border','1px solid blue');$(this).css('background-color','red');$(this).css('font-weight','bold');$('.detailProduct').slideUp();$(\'#" + item.IdProduct + "\').slideToggle('normal');\" id=\"link" + item.IdProduct + "\" style='text-align: right;cursor: pointer;float: right;padding-right: 2px;border:1px solid orange;text-decoration:none' > <font face='Tahoma'>" + item.NameProduct + "</font><div class='linkFlashIco' style='background-image: url(icon/Pointer.png); background-repeat: no-repeat;float: right;width: 18px;height: 20px;'></div></div>";
}
</code></pre>
<p>how can write <code>contantProduct</code> in multi line </p>
<p>i like write </p>
<pre><code>contantProduct+="<br/><div"
+"....."
+"...."
</code></pre>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
2,172,439
| 2,172,440
|
Replace setInterval call with some other algorithm placed inside called function
|
<p>I have a <a href="http://jsfiddle.net/qEupm/7/" rel="nofollow">script</a>, that changes pictures with transparency effect on same place, but I don't like, that it is called with setInterval. Is there some way to have same result, but maybe with some loop from inside function and make a delay there.</p>
<p>Thanks everyone for help.</p>
<p><em><strong>UPD:</em></strong><br>
Examples of your thoughts are always welcome.</p>
|
javascript jquery
|
[3, 5]
|
5,169,404
| 5,169,405
|
How can i show a jquery popup on PageLoad??
|
<p>I am trying to use jquery to open a popup on Pageload. I guess this is what i should use to show the popup after a button click in an Asp.Net application. How do i get the popup on Pageload. </p>
<pre><code>$(document).ready(function(){
$("#button").click(function(){
centerPopup();
loadPopup();
});
});
</code></pre>
<p>Thank you in advance!!</p>
|
jquery asp.net
|
[5, 9]
|
2,411,814
| 2,411,815
|
Possible to programmatically format text appended via stringBuffer.append()?
|
<p>A lot of text is to be appended to a StringBuffer object. Later this text will be displayed on the page. </p>
<pre><code>stringBuffer.append("A lot of text part 1");
stringBuffer.append("A lot of text part 2");
...
</code></pre>
<p>The text contains paragraph titles. Is it possible to format these titles before/after appending? Something like</p>
<pre><code>stringBuffer.append("Title of text 1");
//in this line do some formatting to the above text, like make title bold, larger font, etc.
stringBuffer.append("A lot of text part 1");
</code></pre>
<p>I know that it can be done if I set TextViews in XML layout, but it's just too many titles and this way would take so much time. </p>
|
java android
|
[1, 4]
|
1,987,553
| 1,987,554
|
Javascript not reloading DIV's contents correctly
|
<p>I have been looking online for a tutorial on how to create a Checkbox form which would cause a DIV where I show my items from a MYSQL table to reload based on the filter selected in the Checkbox.</p>
<p>This is my code so far, but it doesn't seem to work...</p>
<p>Any suggestions?</p>
<p>Thanks!</p>
<pre><code><script>
$(document).ready(function() {
$("#colors").change(function() {
console.log("changed...");
var data = $(this).serialize();
console.log(data);
$("#indexMain").load("index.php?data="+data)
});
})
</script>
<div class="colors">
<form method="post" action="index.php">
<?php
$colors = mysql_query("SELECT DISTINCT color_base1 FROM item_descr ORDER BY color_base1");
while ($colorBoxes = mysql_fetch_array($colors))
{
echo "<input type='checkbox' name='color' value='".$colorBoxes[color_base1]."' /> ".$colorBoxes[color_base1]."<br />";
}
?>
<input type="submit" onclick="document.formName.submit();" />
</form>
</div>
</code></pre>
<p>and I get the value in my div as follows:</p>
<pre><code>$color = $_POST['color'];
if ($selectedColor == '')
{
$items = mysql_query("SELECT * FROM item_descr");
}
else
{
$items = mysql_query("SELECT * FROM item_descr ORDER BY $color");
}
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
4,200,862
| 4,200,863
|
how to split a query with 'AND' and/or 'OR' arguments in it in jquery?
|
<p>how to split a query with 'AND' and/or 'OR' arguments in it in jquery?
Suppose iam having </p>
<pre><code>A=( 1=1,FirstName='aaa' or FirstName='bbb' and FirstName='ccc' or FirstName='ddd' and FirstName='eee')
</code></pre>
<p>Now i want to split 'A' with 'and' & 'or' and get the result as below</p>
<pre><code>A=(FirstName='aaa' , FirstName='dddd' , FirstName='bbb' , FirstName='dddd' , FirstName='cccc')
</code></pre>
<p>but the thing is i may or may not have 'or' in the query, still it should produce a o/p with all the values after split. Please help.
Different types of queries could be as below:</p>
<pre><code>A=( 1=1,FirstName='aaa' or FirstName='bbb' and FirstName='ccc' or FirstName='eee' and FirstName='fff')
A=( 1=1,FirstName='aaa' and FirstName='bbb' and FirstName='ccc' and FirstName='ddd' and FirstName='fff')
A=( 1=1,FirstName='aaa' or FirstName='bbb' or FirstName='ccc' or FirstName='ddd' or FirstName='fff')
</code></pre>
<p>Query is not static i just gave an example, it could be any string.</p>
|
javascript jquery
|
[3, 5]
|
4,872,199
| 4,872,200
|
looking for a jquery $.resolve() sample that makes sense
|
<p>I was trying to use a line of code:</p>
<pre><code>$.when(FUNCT1()).done(FUNCT2());
</code></pre>
<p>The issue is that done doesnt quite work, and i was trying to do</p>
<pre><code>$.when(FUNCT1(args, successCallback, failCallback)).then(FUNCT2());
</code></pre>
<p>but there is an issue that FUNCT1 is async so it cant just fire and then fire FUNCT2, but instead needs to do some sort of $.resolve() function.</p>
<p>What i was thinking was do something like this.</p>
<pre><code>$.when(FUNCT1(args, function(success){
success;
$.resolve();
}, failFUNCT()).done(FUNCT2());
</code></pre>
<p>does anyone know how this would be done. I was thinking i might be close to what needs to be done.</p>
|
javascript jquery
|
[3, 5]
|
2,427,924
| 2,427,925
|
How to trigger a jquery event if a given value is selected from a calendar
|
<p>I am using the ui date picker widget here: <a href="http://jqueryui.com/demos/datepicker/" rel="nofollow">http://jqueryui.com/demos/datepicker/</a></p>
<p>to populate this:</p>
<pre><code><input id="date" value="" type="textbox" />
</code></pre>
<p>I would like to trigger a jquery event after a date is selected, but am unsure of how to call this, i know that i can do things like keyup, click, etc. but is there a way to do this if a value is selected from the widget?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
6,014,102
| 6,014,103
|
Checking for bunch of whitespaces in javascript to prevent blank data being sent and trimming the intermediate spaces
|
<p>I'm a bit confused as to how to solve this problem. Seems standard and commonly occurring but couldn't find anything worthwhile. I have an HTML textarea and a textbox for input. I want to validate the following:</p>
<ol>
<li>The user shouldn't be allowed to enter a bunch of white spaces in the textarea - so if 15 characters is the minimum 16 whitespace characters only shouldn't count towards valid data. A simple char count won't detect this. </li>
<li>One can enter 16 whitespaces and one letter, but that is still invalid data! Anyway to check to check the validity here (it should basically be counted as 2 characters as per below point)?</li>
<li>Trimming unnecessary whitespaces - i.e., if someone enters a character/word and follows it up by 10 whitespaces then another and then a character and another set of whitespaces, I'd like them to be trimmed to a single white space. Just like what happens when you enter an answer/new question on SO. If you enter a bunch of whitespaces it will automatically trim it. I tried searching around but nothing for whitespace specific.</li>
</ol>
<p>Intuitively if I can just get solution to #3 to work I guess it could automatically feed it into a char counter function and it would be valid, correct?</p>
<p>Any ideas how to go about doing this? jQuery or javascript are both acceptable :)</p>
|
javascript jquery
|
[3, 5]
|
2,269,984
| 2,269,985
|
Jquery variabile change
|
<p>How I can show the second alert from the following code after the first showed?!</p>
<pre><code>var s = 1;
$(document).ready(function(){
if(s == 1 )
{
alert("SIMULATED");
s = 0;
}
else alert (" ok ");
});
</code></pre>
<p>I need to change the s variable to 0 and to show alert("ok") after the first alert showed</p>
|
javascript jquery
|
[3, 5]
|
4,127,937
| 4,127,938
|
Should my page check the x509certificate? If so how?
|
<p>I must admit that I am floundering a bit with certificates. I can't find much that's very clear with web searches. I have a 3rd party posting a file to my web page using an x509certificate. </p>
<p>I was told we have the party's public key. Can I just compare Request.ClientCertificate.PublicKey to this value? Can I encode them as strings and do a string compare?</p>
|
c# asp.net
|
[0, 9]
|
5,613,696
| 5,613,697
|
Can't addClass() to an object after passing it through a function - jQuery
|
<p>I have a function that passes through an object in its parameter, and then does something with that object.</p>
<pre><code>function theFunction (theButton) {
theButton.addClass('inactive');
}
$('.button').click(function () {
theFunction($(this));
return false;
});
</code></pre>
<p>The problem is that it doesn't apply that class to the button. What am I missing here?</p>
<p>Here's a <a href="http://jsfiddle.net/hNYmd/" rel="nofollow">JS Fiddle</a> with the code in.</p>
|
javascript jquery
|
[3, 5]
|
2,830,427
| 2,830,428
|
How can I read a Google Spreadsheets using jquery and php
|
<p>I have some information in Google Spreadsheets as a single sheet. Is there any way by which I can read this information from html by jquery and php. my sheet <a href="https://docs.google.com/a/rangde.org/spreadsheet/ccc?key=0An6ySbpOsu3GdFlSZkt0TzZTWHJyblBiQlNrcmZvZGc&hl=en_US#gid=5" rel="nofollow">link</a> and my username suresh@rangde.org password Pattu&1991</p>
|
php jquery
|
[2, 5]
|
2,875,855
| 2,875,856
|
Help me escape this php/js and stop warning error on zend studio
|
<p>This shouldn't be too difficult but for the life of my cant sort it out and its driving me mad.</p>
<pre><code>$script = "
$(document).ready(function(){
$('.row').hover(function() {
var id = ($(this).attr('id').replace(/\D/g, ''));
$('.row-edit-' + id).css('display', 'block');
}, function() {
var id = ($(this).attr('id').replace(/\D/g, ''));
$('.row-edit-' + id).css('display', 'none');
});
});
";
</code></pre>
<p>So its a bit of jquery inside a php tag, might be horrible to look at but as I'm using it sparingly its not too bad.</p>
<p>If anyone here has studio or eclipse could they give it a quick fix?</p>
<p>Thanks,</p>
<p>Daniel</p>
|
php jquery
|
[2, 5]
|
2,279,025
| 2,279,026
|
JQuery - Binding / Appending to document.ready
|
<p>I am working on a ASP.NET MVC 3 application that is using JQuery. In this application, I have my _Layout.cshtml file and MyView.cshtml. In _Layout.cshtml I have something like the following:</p>
<pre><code><div id="wrapper" style="background-color:Gray; height:100%;">
<div id="content" style="background-color:Silver;">
@RenderBody()
</div>
<div id="footer" style="background-color:Silver;">
Footer
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
// Do stuff
alert("Root Loaded");
});
</script>
</code></pre>
<p>In MyView.cshtml, I have the following:</p>
<pre><code><div id="contentDiv">
<!-- Page content is here -->
</div>
<script type="text/javascript">
$().ready(function () {
alert("Page Loaded");
});
</script>
</code></pre>
<p>At this time, the "Page Loaded" message box appears before the "Root Loaded" message. I kind of understand why this is happening. However, I would like to write a method in MyView.cshtml that gets called after the root document.ready function is called. Am I making sense? Is there a way to do this? If so, how?</p>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
4,454,624
| 4,454,625
|
jquery selector for multiple div Vticker
|
<p>Hi i have two division with class named "tick" what i am trying to do here is if the content overflows then only the ticker should be activated.</p>
<pre><code>div1 : <div class="home tick">
div2 : <div class="rbar tick">
</code></pre>
<p><strong>problem:</strong> if content overflows in one div the other div also starts ticking any solution ? </p>
<pre><code>if( ($('.tick > ul').height()) > 160){
$('.tick').vTicker({
speed: 500,
pause: 3000,
animation: 'fade',
showItems: 3,
height: 192
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,226,400
| 1,226,401
|
How to update value of a radio using Jquery
|
<p>I have this HTML code for radios:</p>
<pre><code><input type='radio' name='a_27' value='Yes' id='a_27_0' />
<input type='radio' name='a_27' value='No' id='a_27_1' />
</code></pre>
<p>I'm trying to set the selected value of the radio using this code:</p>
<pre><code>var field="a_" + this.id;
$('[name="' + field + '"]').val(this.value);
console.log("name is " + field + ", val is " + this.value);
</code></pre>
<p>However it doesn't work, nothing happens when this runs. Here's the output from Firebug's console which occurs after the 3rd line:</p>
<blockquote>
<p>name is a_27, val is Yes</p>
</blockquote>
<p>Any ideas?</p>
<p>I would prefer a method which would also work on <code><select>s</code>, so I wouldn't need to write additional/seperate code for radios and selects.</p>
<p>Edit: A weird problem I've noticed that although my html code gives a different value (yes/no), in firebug it shows both radios as having the value 'yes'. If I select no and click save, the javascript function still receives 'yes' instead of no. Am I doing something wrong?</p>
<p>Edit 2: The full function:</p>
<pre><code>function processMultiOptAnswers()
{
$.each(multiOpts,function()
{
var field="a_" + this.id;
console.log("name is " + field + ", val is " + this.value);
$('[name="' + field + '"]').val(this.value);
}
);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,436,377
| 4,436,378
|
asp.net OnClientClick not rendered for initially disabled Button
|
<p>I have a disabled asp.Button, which I enable later with JavaScript. Like this</p>
<pre><code><asp:Button ID="btnSave" runat="server" Text="Save" Enabled="false" OnClientClick="; return ValidateFields();" OnClick="btnSave_Clicked" />
</code></pre>
<p>However, the "onclick" method is not rendered as html when the control is disabled. My work around is to add the following code in PageLoad.</p>
<pre><code>btnSave.Attributes["onclick"] = "return ValidateFields();";
</code></pre>
<p>Is there a more convenient work around for this?</p>
<p>Thanks</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,872,827
| 2,872,828
|
Import C++ classes in python?
|
<p>so.. let's say i have this C function:</p>
<pre><code>PyObject* Foo(PyObject* pSelf, PyObject* pArgs)
{
MessageBox(NULL, "Foo was called!", "Info", MB_OK);
return PyInt_FromLong(0);
}
</code></pre>
<p>and then, I have to do this:</p>
<pre><code>static PyMethodDef Methods[] =
{
{"Foo", Foo, METH_NOARGS, "Dummy function"},
{NULL, NULL, 0, NULL}
};
Py_InitModule("bar", Methods);
</code></pre>
<p>and I execute my python script..
but C functions are a little annoying, it's C++ and I use classes for almost everything.</p>
<p>So, is there any way to import member functions from a class to my python script?</p>
<p>oh btw, the python script looks something like this:</p>
<pre><code>import bar
from bar import *
Foo()
</code></pre>
|
c++ python
|
[6, 7]
|
4,841,789
| 4,841,790
|
Unable to pass values between Activities in Android
|
<p>I am using 2.3.3 version of the Android SDK and I'm trying to pass data between two activities using the following code</p>
<pre><code>Intent myIntent = new Intent(MainAct.this, FriendsActivity.class);
myIntent.putExtra(USER_NAME, ((EditText)findViewById(R.id.username)).getText());
MainAct.this.startActivity(myIntent);
</code></pre>
<p>In the <code>FriendsActivity</code> i'm retrieving the value using </p>
<pre><code>Bundle b = getIntent().getExtras();
String user = b.getString(MainAct.USER_NAME);
</code></pre>
<p>But the <code>user</code> is null after these lines are executed. Not sure whats wrong here. Read similar questions on SO <a href="http://goo.gl/zOJfa" rel="nofollow">http://goo.gl/zOJfa</a> but still the problem continue to be seen.</p>
|
java android
|
[1, 4]
|
1,172,640
| 1,172,641
|
May I store View objects in instance fields?
|
<p>I've got an Activity class. It sould be really nice to find all the views I need in <code>onCreate</code>, and then just reference these fields, without calling <code>findViewById</code>. But is it OK to do so?</p>
<p>Can't views be assigned different objects at runtime? E.g., is it always true that <code>findBiewById(res1) == findBiewById(res1)</code> at any time?</p>
|
java android
|
[1, 4]
|
3,481,754
| 3,481,755
|
Chain this jquery expression
|
<p>Is there a way to chain this jQuery expression or improve it? All i really want to do is change "my text" to "new text".</p>
<p>HTML:</p>
<pre><code><div id="myDiv">
my text
<span>button 1</span>
<span>button 2</span>
</div>
</code></pre>
<p>Javascript:</p>
<pre><code>var element = $("#myDiv");
var buttons = element.children().detach();
element.text("new Text");
element.append(buttons);
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,499,562
| 2,499,563
|
Randomize setInterval ( How to rewrite same random after random interval)
|
<p>I'd like to know how to achieve:
generate a random number after a random number of time. And reuse it.</p>
<pre><code>function doSomething(){
// ... do something.....
}
var rand = 300; // initial rand time
i = setinterval(function(){
doSomething();
rand = Math.round(Math.random()*(3000-500))+500; // generate new time (between 3sec and 500"s)
}, rand);
</code></pre>
<p>And do it repeatedly.</p>
<p>So far I was able to generate a random interval, but it last the same until the page was refreshed (generating than a different time- interval).</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,886,413
| 3,886,414
|
jquery <span> inside next()
|
<p>im trying to get this so that it rotates through LI's, and will fadein the SPAN within that LI after and before the next slide.</p>
<p>heres my code:</p>
<pre><code> var current = ($('.slider ul li.current'));
var currentspan = ($('.slider ul li.current span'));
var next = (current.next().length) ? current.next() : $('.slider ul li:first');
var nextspan = (current.next('span').length) ? current.next('span') : $('.slider ul li:first span');
</code></pre>
<p>The problem is my nextspan variable has to be wrong. All i want to do is grab the SPAN inside the NEXT LI. as you can see the next variable gets set fine - so how do i get the span inside that next variable?</p>
|
javascript jquery
|
[3, 5]
|
5,860,357
| 5,860,358
|
Javascript validation
|
<p>I have a form that people can click and add fields to the form and I need to have it validate the values in those fields if it is clicked. </p>
<p>So say I click it twice and get the 2 separate sets of fields and I need the rotation % to make sure it equals 100 at the time of save. </p>
<p>I have put in this function to get it to validate on the save and everything works except if I edit a different form that doesnt have any fields in it.<br>
I am trying to see what the easiest way would be to check and see if the fields are on there or not so I can check them.</p>
<p>Here is my code:</p>
<pre><code>function audit()
{
var totalsum = 100;
$( '[name="rotation\\[\\]"]').each(
function()
{
totalsum -= ($(this).val() * 1);
}
)
if(totalsum > 0){
alert("Your rotation % does not equal 100");
return false;}
return true;}
</code></pre>
<hr>
<pre><code>$('.add_creative img').click(
function(){
$.post( '/json/ad_creative/',
{ action: "add_creative", this_brand_id: $("[name='this_brand_id']").val(), adtype: $( '.new_run [name="adtype"]').val()},
function(data){
if( data.result ){
$('.add_creative').append(data.html)
}
},
'json'
)
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,493,559
| 5,493,560
|
Convert an java file into android program
|
<p>hi i am a new android developer. When i am searching for a logic related to my app in google, i found a java application which is related to my android app. After making some changes i succeded in getting output, but i need the code to be in an android based project. When i change to convert it i get lot of errors, is there any possible way to convert the java application into an android app by including any external jar file..... The java application is just a part of my android app, based on that i have to develop more so pls help me....</p>
<p>thanx in Advance </p>
|
java android
|
[1, 4]
|
5,968,867
| 5,968,868
|
how to download some java jar library files
|
<p>Has anyone migrated a an application using Java AWT library to run on Android? How do you do this? I am using these packages.</p>
<pre><code> java.awt.AWTException;
java.awt.Robot;
java.awt.Rectangle;
java.awt.Toolkit;
java.awt.image.BufferedImage;
java.io.*;
javax.imageio.ImageIO;
</code></pre>
|
java android
|
[1, 4]
|
669,814
| 669,815
|
PHP only allow server to access a PHP file
|
<p>I have three pages:</p>
<pre><code>index.html
getjavascript.php?id=index
index.js
</code></pre>
<p>index.html includes the script </p>
<pre><code>'getjavascript.php?id=index'
</code></pre>
<p>and getjavascript dynamically gets the script index.js.</p>
<p>Is there any way to prevent external users from directly accessing </p>
<pre><code>getjavascript.php
</code></pre>
<p>using PHP? </p>
<p>index.js is in a hidden location.</p>
<p>Thanks,</p>
|
php javascript
|
[2, 3]
|
4,072,415
| 4,072,416
|
Javascript .on event handler
|
<p>I have the following scenario; in my js I have a dynamic hyperlink that I need to capture the clicked link id.</p>
<pre><code>for (var i = 0; i < neighbor.data[3].length; i++){
<a class="Chris" name="a" id="+i+" href="Chris">Hi</a>
}
</code></pre>
<p>Now I can get this with;</p>
<pre><code> parseInt($(this).attr("ID"));
</code></pre>
<p>I am using this to capture the it;</p>
<pre><code>$(document).on("click", "a.a", function(event) {
event.stopPropagation();
alert(clickedID);
clickedID = parseInt($(this).attr("ID"));
});
</code></pre>
<p>Now, my problem is that everytime I click on the hyperlink instead of only one clickedID I have one for every hyperlink clicked. Is there a way to prevent this?</p>
|
javascript jquery
|
[3, 5]
|
831,419
| 831,420
|
jQuery: Can I get a reference to the bound events on an element?
|
<p>I have some elements with a function bound to the <code>click</code> event. I want to bind that same function instead to the <code>mouseover</code> and <code>mouseout</code> events. Is it possible to get a reference to the click event so that I can assign it to those other events? I'm imagining something like this (inside <code>each()</code>):</p>
<pre><code>$(this).bind('mouseover', $(this).click());
$(this).bind('mouseout', $(this).click());
$(this).unbind('click');
</code></pre>
<p><strong>Questions You Might Ask</strong></p>
<p><em>Why don't you just change the code that's binding it to the click event?</em></p>
<p>The JS that's setting this up is part of a Drupal module (<a href="http://drupal.org/project/dhtml_menu" rel="nofollow">DHTML Menu</a>, if you're curious), so I don't want to change the module code because it will be wiped out when the module is inevitably updated in the future. I'm also using the <code>click</code> handler for other parts of the page - I only want to move it to <code>mouseover</code> and <code>mouseout</code> for one menu.</p>
|
javascript jquery
|
[3, 5]
|
852,431
| 852,432
|
HttpURLConnection setConnectTimeout() has no effect
|
<p>I'm connecting to a simple RSS feed using HTTPUrlConnection. It works perfectly. I'd like to add a timeout to the connection since I don't want my app hanging in the event of a bad connection or whatever. This is the code I use and the setConnectTimeout method doesn't have any effect whatsoever.</p>
<pre><code> HttpURLConnection http = (HttpURLConnection) mURL.openConnection();
http.setConnectTimeout(15000); //timeout after 15 seconds
...
</code></pre>
<p>If it helps I'm developing on android.</p>
|
java android
|
[1, 4]
|
5,292,106
| 5,292,107
|
Javascript counter on php page
|
<p>I've got a java script counter on my php page. (I should probably add that I don't know java script). It display's the time the user is active on the page. My problem is if the user presses F5 or refreshes the page the counter starts from 0 again. How do I change this so that it remembers the time? Help will be greatly appreciated.</p>
<p><strong>Javascript:</strong></p>
<pre><code>var pageVisisted = new Date();
setInterval(function() {
var timeOnSite = new Date() - pageVisisted;
var secondsTotal = timeOnSite / 1000;
var hours = Math.floor(secondsTotal / 3600);
var minutes = Math.floor(secondsTotal / 60) % 3600;
var seconds = Math.floor(secondsTotal) % 60;
document.getElementById('counter').innerHTML = hours + ":" + minutes + ":" + seconds;
}, 1000);
</code></pre>
<p><strong>The php page</strong></p>
<pre><code><head>
<?php
session_start();
?>
<script type="text/javascript" src="counter.js"></script>
</head>
<body>
<?php
echo "<span id='counter'></span>";
?>
</body>
</code></pre>
|
php javascript
|
[2, 3]
|
1,350,868
| 1,350,869
|
Mask instead of Replace?
|
<p>Im trying to figure out how to mask text in a text input as though its a password field, only its not.
This is for a personal experiment and I unserdtand it may sound strange but its something I'd like to try, Ive used the replace method to change characters to asterisks only when I alert the value, it alerts * when the asterisk should only be a mask and the alert should show the true value, does this make sense and if so has anybody an idea of how to do this? </p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,701,687
| 1,701,688
|
Mixing OOP javascript with jQuery DOM manipulation
|
<p>I'm looking to start developing with javascript jQuery development in a big way. I recently read "JavaScript: The Good Parts" by <a href="http://javascript.crockford.com/" rel="nofollow">Douglas Crockford</a>, and feel well prepared for prototypal based object oriented development.</p>
<p>I'm now trying to figure out how to weave jQuery usage with the patterns Crockford introduced. I can think of two reasonable approaches:</p>
<ol>
<li>Add methods to DOM objects returned by jQuery (possibly using jQuery's extend method)</li>
<li>Add the DOM objects returned by jQuery as properties of domain objects (and vice-versa), and delegate calls appropriately. This has the benefit of being able to add methods to the domain objects' prototype.</li>
</ol>
<p>What recommendations do you have for mixing OOP javascript with jQuery DOM manipulation?</p>
|
javascript jquery
|
[3, 5]
|
5,874,706
| 5,874,707
|
jQuery: onclick drop-down menu with controls
|
<p>I wish to create a menu (a sign-up menu), see <a href="http://jsfiddle.net/X2NXY/1/" rel="nofollow">this</a> to get an idea of it. When user clicks on this button/link a drop-down menu appears, using which he can do something (here login). </p>
<p>The behaviour of the link should be the following:</p>
<ol>
<li>The drop-down menu should appear when clicked on this button/link.</li>
<li>when clicked anywhere on the page (including the button/link itself), but outside the menu, the menu should disappear.</li>
<li>If clicked somewhere on the drop-down menu, the menu should not disappear.</li>
<li>All the controls in the drop-down menu should work.</li>
</ol>
<p>I did somehow managed to get first three working, but then the controls within the drop-down menu (4th behaviour) are not working.</p>
<p>The javascript/jQuery code along with html code is given <a href="http://jsfiddle.net/X2NXY/1/" rel="nofollow">here</a> (jsfiddle link, same as above). You can fork it and make changes.</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
4,487,070
| 4,487,071
|
JQuery Refresh the content of a UI dialog box?
|
<p>I have problem when i tried to invoke multiple dialog boxes in a page. I have three anchor tags on clicking 3 tags i have to generate dialog boxes with diferent contents . But when i clicked the 2nd tag i am getting the same dialog box of the previous one? How can i refresh the content inside a dialog box?</p>
<p>What i have done is given below</p>
<pre><code>$("a.delete").click(function (event) {
DialogBox('#DeleteConfirm');
});
$("a.message").click(function (event) {
DialogBox('#DeleteConfirm');
});
var $dialog = null; function dialog() {
// create dialog if not done already
if (!$dialog) {
$dialog = $("#dialogToShow").dialog({
title: "Confirm Password",
closeText: "Cancel",
show:"slide",
resizable: false,
modal: true,
autoOpen: false, // this is important! prevent auto open
open: function(ev, ui){
$('.ui-widget-overlay').stop().animate({"opacity": "0.40"}, 1480);
},
close: function(ev, ui){
$('.ui-widget-overlay').stop().animate({"opacity": "0"}, 1480);
}
});
}
// use the reference to the dialog and call open.
$dialog.dialog('open');
return false; }
</code></pre>
<p>Can anybody help me?</p>
|
jquery asp.net
|
[5, 9]
|
4,347,346
| 4,347,347
|
dropdownlist selectedvalue
|
<p>I've used a webservice to create a dropdownlist of countries and I'm trying to add the dropdownlist selection to the sql database, but when I do that by using ddlCountry.SelectedValue in my insert statement, only the first value in the dropdownlist is showing up in the table. Should I use onselectedindexchanged to somehow store the value? What code should I be using?</p>
|
c# asp.net
|
[0, 9]
|
1,456,620
| 1,456,621
|
How to handle multiple asyc request in java for android?
|
<p>Suppose if i have multiple url to get the information data either in xml or json. How can i manage the queue for maintaining the each request?</p>
<p>Example</p>
<p>Screen 1 --requests----> URL1 ----> DATA From Server
Screen 2 --requests----> URL2 ----> DATA FROM Server</p>
<p>Now, If user changes the screen frequently in that case how can i manage their multiple request asynchronously? </p>
<p>Any Idea?</p>
|
java android
|
[1, 4]
|
5,031,015
| 5,031,016
|
Jquery passing string to function
|
<p>I want to pass the name of my list into my function, but it's not working correctly. I am trying to pass an array and a string to my function. I want to replace "#myGallery_2" to be dynamic. How would I do this correctly? This is what i'm currently trying.</p>
<pre><code>var src = $('#'+id+ li:nth-child('+index+')')
<ul id="myGallery_2">
<li></li>
<li>
</ul>
</code></pre>
<hr>
<pre><code>var images= [
'IMG_3872_s.jpg',
'IMG_3926_s.jpg',
'IMG_3929_s.jpg',
'IMG_3930_s.jpg'
];
$('#menu li:nth-child(2)').click(function(){
addThumbs(images, '#myGallery_2');
});
</code></pre>
<hr>
<h2>Function</h2>
<pre><code>function addThumbs(paths,id) {
$.each(paths,function(index, value) {
var str = value;
var big_img=str.replace("_s","_b");
var src = $('#myGallery_2 li:nth-child('+index+')').find('img').attr('data-frame', value);
var src = $('#myGallery_2 li:nth-child('+index+')').find('img').attr('src', big_img);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,735,341
| 3,735,342
|
JQuery each loop looping through one line of code x amount of times before even looking at the rest
|
<p>I have a loop in Jquery:</p>
<pre><code>var fadeTime=500;
css_id=0;
$.each(my_array, function (i, d_U) {
css_id++;
an_v=d_U[1];
an_d=d_U[4];
do_c_function("id_344",true,true);
$("#box_"+css_id).fadeIn(fadeTime,function(){
//this stuff will happen once the fadein is complete
$("#box_"+css_id).animate({top: '-50px'},fadeTime,function(){
//this stuff will happen once the animate is complete
alert("#box_"+css_id);//for debugging
});//end of animation
});//end of fadein
});//end of each loop
</code></pre>
<p>Now as you've probably noticed, I'm trying to make the loop animate different divs each time using the <code>css_id</code> variable and <code>++;</code> (add 1) to it each time the loop runs.</p>
<p>Thing is, <code>css_id</code> reaches a high value before any of the code below has even been executed once. So when its time to animate, Jquery will try to animate <code>#box_210</code> when its supposed to animate <code>#box_1</code>.</p>
<p>Is there any way to make it only execute the <code>css_id++;</code> line once, then the animate lines get executed, and only then again with the <code>css_id++;</code> line...and so on.</p>
<p>I've tried to put the <code>css_id++;</code> line in a call back with both the animations but that seems to not work as well.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,770,799
| 3,770,800
|
jQuery - Post and reply
|
<p>Im attempting to add voteup/votedown to one of my sites, however Im having a few problems:</p>
<p>Firstly here is my jQuery:</p>
<pre><code>j(".voteup").click(function(){ // when people click an up button
j("div#response").show().html('<h2>voting, please wait...</h2>'); // show wait message
itemID = j(this).parent('div').attr('id');; // get post id
alert(itemID);
j.post(voteup.php,{id:itemID},function(response){ // post to up script
j("div#response").html(response).hide(3000); // show response
});
j(this).attr({"disabled":"disabled"}); // disable button
});
</code></pre>
<p>My voteup.php file is:</p>
<pre><code><?php
$id=$_POST['itemID'];
echo '<h2>PHP Response: You voted post '.$id.' up</h2>';
?>
</code></pre>
<p>However It doesnt appear to be working, the alert comes through with the post ID but nothing from then on. The $id doesnt get echo'd.</p>
<p>Any ideas?</p>
|
php jquery
|
[2, 5]
|
2,825,461
| 2,825,462
|
problem with Check box selection when multiple gridview exists on the form
|
<p>I am working on check box selection in a grid view. I have gone though the following link <a href="http://www.highoncoding.com/Articles/228_GridView_CheckBox_Selection_With_a_Twist.aspx" rel="nofollow">Grid view checkboxes</a></p>
<p>This works fine when i am having one grid view on my form , but if i have multiple grid views then i am facing a problem in selection. So can any one help me or give me any other alternative solution which works exactly as the link i posted..</p>
<p>My problem is when i am having multiple grid view and selecting one header grid view the items in other grid view are selected so can any one give me the best method to achieve.</p>
<p>I am using master pages too in my application </p>
|
c# asp.net
|
[0, 9]
|
4,414,880
| 4,414,881
|
Detect if browser supports contentEditable?
|
<p>There's <a href="http://stackoverflow.com/questions/3497942/browser-detect-contenteditable-features">this question</a>, but the solution posted is browser sniffing, which I'm trying to avoid.</p>
<p>I need to make my website compatible with the iPad and perhaps newer Androids. I've been using an old version of the FCKEditor (now CK Editor) for my WYSIWYG editors, but that doesn't work on mobile, so I want to swap it out for a simple textarea with something like markdown, if it's not supported.</p>
<p>Supposedly it won't work because mobile devices tend not to support this <code>contentEditable</code> property, which means the on-screen keyboard won't pop up when you click on it.</p>
<p>How can I detect if the browser supports <code>contentEditable</code>? It's been suggested that I just check the div in question with something like <code>mydiv.contentElement === undefined</code> or something like that, but the div (if it's using one) is all built into the FCK Editor and buried somewhere in an iframe. </p>
<p>Isn't there another way to detect if a browser supports <code>contentEditable</code> in general?</p>
<hr>
<p>Just tried this:</p>
<pre><code>var contentEditableSupport = typeof $('<div contenteditable="true">')[0].contentEditable !== 'undefined';
</code></pre>
<p>Says "true" on my iPad...... I don't think it should.</p>
<p><strong>Edit:</strong> It's returning "string" because all attributes are strings.... it's just reading the attribute. How else am I supposed to do this?</p>
|
javascript jquery
|
[3, 5]
|
2,430,554
| 2,430,555
|
Form reset event doesn't fire in IE
|
<p>This function fires in firefox/chrome :</p>
<pre><code>$(document).on("reset", "form", function(){
alert("working");
});
</code></pre>
<p>What alternatives are out there for IE (I have 8 installed so I'd like to make it work from 8 onwards).</p>
|
javascript jquery
|
[3, 5]
|
5,853,698
| 5,853,699
|
Get first two digits of a string, support for negative 'numbers'
|
<p>I have the following strings in JavaScript as examples:</p>
<pre><code>-77.230202
39.90234
-1.2352
</code></pre>
<p>I want to ge the first two digits, before the decimal. While maintaining the negative value. So the first one would be '-77' and the last would be '-1'</p>
<p>Any help would be awesome!</p>
<p>Thank you.</p>
|
javascript jquery
|
[3, 5]
|
3,071,953
| 3,071,954
|
Javascript / jQuery - Strip the current page URL
|
<p>I am currently working on an Enquiry system for our travel website.</p>
<p>When a user submits an enquiry, i have set it to reload the same page (by grabbing the current url and setting it as the redirect).</p>
<p>Upon redirecting my javascript detects if the following string is present in the URL - "?sendto", and if so it returns a thank you message.</p>
<p>After this process, im looking to remove the "?sendto=email@address.com" string from the end of the url (example url - www.google.com/index.html?sendto=email@address.com). My question is therefore:</p>
<p><strong>Am i able to through a script, strip a part of the current URL</strong></p>
|
javascript jquery
|
[3, 5]
|
5,847,077
| 5,847,078
|
How do I convert byte to string?
|
<p>Is there any fast way to convert given byte (like, by number - <code>65</code>) to it's text hex representation? </p>
<p>Basically, I want to convert array of bytes into (I am hardcoding resources) their code-representation like</p>
<pre><code>BYTE data[] = {0x00, 0x0A, 0x00, 0x01, ... }
</code></pre>
<p><em>How do I automate this <code>Given byte -> "0x0A" string</code> conversion?</em></p>
|
c# c++
|
[0, 6]
|
5,369,220
| 5,369,221
|
Loading content in table based upon scrolling position
|
<p>I'm using jQuery, and I already have a table set up with a specific height, with <code>overflow:scroll</code>. I'm wondering what I should access in order to know when to load more data from the server (I don't need help with the ajax calls or loading the actual data). Rather, I'm trying to understand how to know my scroll position or to know when I'm near reaching the bottom of the data (so I can load more ahead of time).</p>
<p>So, How do I know when to load more data based upon scroll position?</p>
|
javascript jquery
|
[3, 5]
|
1,612,605
| 1,612,606
|
javascript returns null on first click only
|
<p>I am making a modal that displays images for the client to viewer in larger form. and slides left and then slides the new image in from the left on click. When I click on the thumbnail on the page it is displays in the modal perfectly. But when I click on the first modal displaying image it returns null and the left settings is off. but when I click on the new image all is well and works perfectly from there on out. Why does it return null and how do I stop it.</p>
<p><em><strong>CODE</em></strong></p>
<pre><code> $( '#modal img').live('click',function(e){
var index = $(this).attr('img_index');
var img_og = $( '#viewer ul li img[img_index="' + index + '"] ');
var imgOgWidth= img_og.width();
index++;
if(index > $( '#viewer ul li img').length ) {index = 0;}
var left = ($( window ).width() - imgOgWidth )/ 2;
var src = img_og.attr('src');
console.log($( window ).width() + " - " + img_og.width() + " = " + left);
$(this).animate({"left":'-2000px'},300,function(){
$(this).attr({'src':src,'img_index':index}).css({'width':imgOgWidth,"left":'2000px'}).animate({'left':left},300);
});
});
</code></pre>
<p><em><strong>CONSOLE.LOG</em></strong></p>
<pre><code>1288 - null = 644
1288 - 470 = 409
1288 - 900 = 194
1288 - 900 = 194
1288 - 900 = 194
</code></pre>
<p><em><strong>HTML</em></strong></p>
<pre><code><div id="modal" class="none">
<img src="" img_index="" />
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,928,226
| 3,928,227
|
enabling ASP.NET hyperlink using javascript
|
<p>I use VS2010,C# to develop my ASP.NET web app, I've created an asp.net hyperlink like this:</p>
<pre><code><asp:HyperLink ID="hpAccept" runat="server" Enabled="false" Target="_parent">Hyperlink</asp:HyperLink>
</code></pre>
<p>as you can see I've defined it as enabled=false, so it is disabled at startup, I've defined a JavaScript function that should enable this hyperlink after a variable is set to true, but it doesn't work! what is my problem, it is my JS function:</p>
<pre><code> function onRadioChange(rowIndex, value) {
.....
....
if (all_ok) {
document.getElementById('hpAccept').disabled = false;
}
}
</code></pre>
<p></p>
<p>my variable (all_ok) is set to true but the hyperlink is not enabled!</p>
<p>thanks</p>
|
javascript asp.net
|
[3, 9]
|
2,130,474
| 2,130,475
|
jquery/php form validation(login as well as registration form)
|
<p>I am working on a project which requires registration/Login...
I want to write a Jquery and php code which validates the data on client side and data on the server side(For log in), if the user enters wrong data stays on same page else redirect to his account...</p>
|
php jquery
|
[2, 5]
|
616,158
| 616,159
|
Edit Dialog when Application crashes
|
<p>I would like to know if it is possible to edit the dialog which is displayed when an android application has crashed. I want to edit the whole message "'ApplicationName' has stopped"</p>
|
java android
|
[1, 4]
|
1,386,040
| 1,386,041
|
jQuery equivalent to "getElementsByName"
|
<p>What is the correct jquery syntax for a <code>getElementsByName</code> call?</p>
<p>Here is my javascript code:</p>
<pre><code>var test = document.getElementsByName(tableName)[0];
</code></pre>
<p>using this is returning a different value:</p>
<pre><code>var test = $("[name=tableName]");
</code></pre>
<p>Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
41,596
| 41,597
|
jQuery / Javascript - How do I convert a pixel value (20px) to a number value (20)
|
<p>I know jQuery has a helper method for parsing unit strings into numbers. What is the jQuery method to do this?</p>
<pre><code>var a = "20px";
var b = 20;
var c = $.parseMethod(a) + b;
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,753,293
| 5,753,294
|
populate radio button value after submit
|
<p>I try to implement the follwing code:</p>
<pre><code> <?php
$yesno1="";
$yesno2="";
$option1="";
$option2="";
$option3="";
if(isset($_POST['submit'])){
$yesno1=$_POST['yesno1'];
$yesno2=$_POST['yesno2'];
$option1=$_POST['option1'];
$option2=$_POST['option2'];
$option3=$_POST['option3'];
}
?>
<form method="POST" name="contact_form"
action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<input type="radio" name="yesno1" value="yes" style="outline:0;"/>Yes
<input type="radio" name="yesno1" value="no" style="outline:0;"/>No
<input type="radio" name="yesno2" value="yes" style="outline:0;"/>Yes
<input type="radio" name="yesno2" value="no" style="outline:0;"/>No
<input type="checkbox" name="option1" value="Milk"> Milk<br>
<input type="checkbox" name="option2" value="Butter" checked> Butter<br>
<input type="checkbox" name="option3" value="Cheese"> Cheese<br>
<input type="submit" value="Submit" name='submit'>
</form>
</code></pre>
<p>Once I click submit button, normally the value I seleted in radio and marked in the checkbox are gone, so how can I keep the value even after the click the submit button or refrsh the page using php, javascript is fine as well, would be better if any one can help me with it on both php and javascript since I am not very good on both of them, thanks for kind help:)</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,825,561
| 4,825,562
|
How would my Java program process a JS file to extract function names?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6921427/how-to-get-method-name-from-javascript-file">How to get method name from JavaScript file</a> </p>
</blockquote>
<p>I want to fetch Java Script function name in my Java file.I mean i want some solution so that i can go traverse my JS File,find out function name & list out them in my Java file.Is there any way so that i link my JS File,its function name with Java?</p>
|
java javascript
|
[1, 3]
|
1,357,083
| 1,357,084
|
access HttpPostedFile without saving, get error "Request for the permission of type 'System.Security.Permissions.FileIOPermission..."
|
<p>Can we access HttpPostedFile's uploaded file without saving the file. I am trying to read file's name and size but get error <strong>"Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</strong>"</p>
<p>It works well on local host but this error accure on shared hosting server (GoDaddy). Please guide me a solution. I need to read some properties of files before saving it.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
5,726,210
| 5,726,211
|
Detect Android phone via Javascript / jQuery
|
<p>How would i detect that the device in use is an Android for a mobile website?</p>
<p>I need to apply certain css attributes to the Android platform.</p>
<p>Thanks</p>
|
javascript jquery android
|
[3, 5, 4]
|
5,303,990
| 5,303,991
|
Adding links to specific phrases or keywords in jQuery
|
<p>I am trying to turn specific words or phrases into links with jQuery. So far I have only been successful in changing a span with a class="link" to an anchor tag after a hover event. My problem is that I want them to change when the page loads. As an added benefit it would be nice to target any words or phrases without having to put them in spans.</p>
<pre><code>$('span.link').hover(function () {
$(this).replaceWith("<a href='http://mydomain.com'>" + $(this).text() + "</a>");
});
</code></pre>
<p>Works only when they hover over the text, but what I really want is something like this:</p>
<pre><code>var keyword = 'my keyword';
var link = $(document).find(keyword);
$(document).ready(function() {
link.replaceWith("<a href='http://mydomain.com'>" + $(this).text() + "</a>");
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,388,750
| 5,388,751
|
making link disappear from window.open pop up
|
<p>I have link that opens a window, with <code>window.open("mytest.aspx");</code> the problem i am having is that when they close that pop up window I need to hide that link on the parent page. So basically, how can I hide the link (which is an anchor) on the parent page from the pop up that was opened with window.open() ?</p>
<p>Thank you</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,476,379
| 2,476,380
|
How to make a socket client ready for sending and recieving without requiring an action from the server?
|
<p>I have a server.py socket code and client.py. Now I need the client to be always ready (in standby) to receive data even if it doesn't send any to the server. Can that be done ?</p>
|
c# python
|
[0, 7]
|
1,288,307
| 1,288,308
|
Last segment of URL
|
<p>How do I get the last segment of a url? I have the following script which displays the full url of the anchor tag clicked:</p>
<pre><code>$(".tag_name_goes_here").live('click', function(event)
{
event.preventDefault();
alert($(this).attr("href"));
});
</code></pre>
<p>If the url is</p>
<pre><code>http://mywebsite/folder/file
</code></pre>
<p>how do I only get it to display the "file" part of the url in the alert box?</p>
|
javascript jquery
|
[3, 5]
|
2,703,648
| 2,703,649
|
Useful undocumented methods and properties of jQuery
|
<p>I would like to gather all <em>useful</em> undocumented methods and properties of <a href="http://jquery.com/" rel="nofollow"><strong>jQuery</strong></a> (at least for the <a href="http://code.jquery.com/jquery.js" rel="nofollow">current version 1.9.0</a>).</p>
<p>Some of them look quite promising either for solving particular problems, or for accelerating the JavaScript code evaluation.</p>
<p><strong>Important:</strong> Since the listed features here are not documented, it should be used with caution, as new versions of jQuery might not support these features in future releases.</p>
|
javascript jquery
|
[3, 5]
|
253,234
| 253,235
|
How do i declare this and set values later? (javascript)
|
<p>This is the code I have and it is not working. I dunno how to declare this</p>
<pre><code> var input = {
container: '.slide_container',
container_all: '.slide_show',
slides: []
};
var $slides = $('.slide_show .slide');
var l = $slides.length;
for( var i = 0; i < l; i++ ) {
input.slides[i].el = '#' + $slides.eq(i).attr('id');
if( i === 0 ) {
input.slides[i].weight = 1;
} else {
input.slides[i].weight = 0;
}
}
</code></pre>
<p>When it gets to </p>
<pre><code>input.slides[i].el = '#' + $slides.eq(i).attr('id');
</code></pre>
<p>it says the input.slides[i].el is undefined. Can someone let me know the correct way to declare the empty slides? </p>
|
javascript jquery
|
[3, 5]
|
2,632,388
| 2,632,389
|
How to use queue() with a 'cancel' button?
|
<p>I am trying to learn how to use the .queue() JQuery method. So I started with a basic animation using only setTimeout. I have the code here:</p>
<p><a href="http://jsfiddle.net/2gJQS/8/" rel="nofollow">http://jsfiddle.net/2gJQS/8/</a></p>
<p>I am wondering how to achieve this same animation using queues. The reason for this is I want to be able to add a 'cancel' button to the page that would completely cancel all future steps. Right now if you press the Start button several times quickly, the setTimeout's pile on each other and make it look strange.</p>
<p>I tried listing each animation separately in something like:</p>
<pre><code>$('#target').queue(function(){
$(this).delay(1000).fadeIn(1000);
$(this).dequeue();
});
</code></pre>
<p>But only the fadeIns and fadeOuts happened at the right time, and not the color and text changes. So I added setTimeout's inside the queue functions for the color and text changes, and this made the timing work. But then when I called </p>
<pre><code>$('#target').clearQueue();
</code></pre>
<p>it only stopped the fadeIns and fadeOuts, while the color and text changes still happened. </p>
<p>To summarize my question:</p>
<ol>
<li><p>How can I achieve the animation in the link while also having a cancel button that will completely clear all future steps if pressed?</p></li>
<li><p>If the answer to 1 is to use queue(), then how do I do this correctly (in light of my failed attempts described above)?</p></li>
</ol>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
1,210,634
| 1,210,635
|
Allow URLs in to website?
|
<p>I have couple of URLs that I need to allow to access before page load and remaining URLs will be redirected.</p>
<pre><code>expample: If user trying to access these urls they will be allowed and
other urls will be redirected to google.com (example)
http://mysite.com/site/Dept/IT
http://mysite.com/site/Dept/IT/ITWS
http://mysite.com/site/dept/ce
http://mysite.com/site/dept/mkt
http://mysite.com/site/teams/dgt
http://mysite.com/site/teams/mm
</code></pre>
<p>How can do this in jQuery? Making arraylist for URL and check against arraylist and allow them.</p>
|
javascript jquery
|
[3, 5]
|
4,794,363
| 4,794,364
|
Imagebutton not display image
|
<p>once i click button, my image1 will display an image;</p>
<p>when i set my imagePath to </p>
<pre><code>Server.MapPath("~/SME IMAGE/anonymous_avatar.gif");
</code></pre>
<p>my url not work</p>
<p>but when i set my path to </p>
<pre><code>"~/SME IMAGE/anonymous_avatar.gif"
</code></pre>
<p>my url work</p>
<p>so basically what happen to my Server.MapPath?</p>
<pre><code> try
{
string imagePath = Server.MapPath("~/SME IMAGE/anonymous_avatar.gif");
Image1.ImageUrl = imagePath;
Response.Write("success");
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,596,909
| 3,596,910
|
changing date format from dd/MM/yyyy to MM/dd/yyyy
|
<p>I have a datepicker which shows date in format dd/MM/yyyy(i know i coould change there itself but by client want it that way) and in database its in format MM/dd/yyyy so i do want to convert in that way.</p>
<p>e.g. in text box 23/09/2010 and in c sharp its convert to mm/dd/yyyy(txtbo1.text)</p>
<p>Regards
Indranil.</p>
|
c# asp.net
|
[0, 9]
|
5,616,270
| 5,616,271
|
Call a method when class name not known at compile time
|
<p>I have a number of sub-games, SubGame1, SubGame2 etc. Each is derived from a SubGame class and implements a static String getDescription() function.</p>
<p>I want to access these descriptions, e.g. SubGame1.getDescription(), SubGame2.getDescription() etc.</p>
<p>However I want to use a code loop and not all the subgames will exist.</p>
<p>How can I call getDescription() for a sub game when I only know the game number. Something like:</p>
<pre><code>String description = Class.forName(this.getPackageName()+".SubGame"+subGameNo.getDescription();
</code></pre>
<p>but that returns:
The method getDescription() is undefined for the type Class< capture#5-of ?></p>
<p>Any ideas?</p>
|
java android
|
[1, 4]
|
304,576
| 304,577
|
Getting all the children of an element that are textareas?
|
<p>I have a bunch of text areas that are children of a div that has an id. I want to get the text in each of those text areas in an array - so is there a way in jquery to get all the children that are of a certain type(in this case text area) of a certain parent?</p>
<p>I've tried this -</p>
<pre><code>$("#optionGroup_0").children('input[type=text], textarea');
</code></pre>
<p>but that returns an empty array. I think the above method would work if I had the right selector for a text area, but I'm not sure.</p>
<p>Can anyone help? </p>
|
javascript jquery
|
[3, 5]
|
2,280,776
| 2,280,777
|
The import javazoom cannot be resolved
|
<p>hi all
i use the javazoom.jl.player.Player package but it is says The import javazoom cannot be resolved. i am using eclipse and doing Android project. i clean the project still the same error is shown. please correct me.</p>
|
java android
|
[1, 4]
|
5,907,006
| 5,907,007
|
compare 2 arrays so that if one array has elements within the other array these elements are eliminated from the other array?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1187518/javascript-array-difference">JavaScript array difference</a> </p>
</blockquote>
<p>Using jquery or javascript how do I compare 2 arrays so that if one array has elements within the other array these elements are eliminated from the other array? </p>
|
javascript jquery
|
[3, 5]
|
4,418,985
| 4,418,986
|
how to do a group "unhighlight" on highlighted rows in a table
|
<p>I have a table in which any time a user clicks on one of the rows it highlights the row. However as of if I have multiple rows highlighted i have to click each individual highlighted row to get rid of the highlight. I want to make it so when an individual is not clicking on the table it will get rid of the highlight on all the rows. This is the code that I am using.</p>
<pre><code>//this highlights the table that has been clicked on
$('.tr_highlight').live('click',(function () {
$(this).parent().toggleClass("tr_highlight_ed");
}));
</code></pre>
<p>How do I get it to unhighlight(if thats a word) when clicking anywhere but the table?</p>
|
javascript jquery
|
[3, 5]
|
5,549,020
| 5,549,021
|
jQuery syntax: # symbol
|
<p>This piece of code - defined in a javascript function - is perplexing me...</p>
<pre><code>var defaultsortoption=decodeuricomponent(getParameter("v1",$('#defaultsort').val()));
</code></pre>
<p>I admit to being a novice with javascript and jQuery. I've done some homework and figured out what the selector refers to (#defaultsort), and I see the API for the decodeuricomponent function. However, the getParameter() method is stumping me.</p>
<p>The code would reside on a Sharepoint 2010 aspx page. Yet I don't see getParameter defined as a custom function there, nor do I find it defined as a javascript function, or jQuery.</p>
<p>If anyone can shed light on what this function might be, I'd be obliged. And thank you!</p>
|
javascript jquery
|
[3, 5]
|
2,599,618
| 2,599,619
|
What does '+variable+' mean?
|
<p>What does this: '+variable+' mean?</p>
<p>I use jQuery append method to add some DOM element:</p>
<pre><code>$('#story_pages').append('<div><button value="'+window_value+'" onclick= "reload_to_canvas(this.value)" ><img id="w'+window_value+'", src=white_data_URL, width="100px", height="100px"/> </button></div>');
</code></pre>
<p>Actually, I don't why this works...
If I just write</p>
<pre><code>value= window_value
img id= w+window_value
</code></pre>
<p>,and use the selector
<strong>$('#(w+window_value)')</strong>
to find the element. It must fail.
<br>
What is this operator? '+variable+'
<br>
And why should we use the weird notation "'+variable+'"?
<br>
When should we use this notation?</p>
|
javascript jquery
|
[3, 5]
|
3,685,496
| 3,685,497
|
replace Nth occurence in string - JavaScript
|
<p>I'm sure this was supposed to work, but I can't get it doing what I want it to:</p>
<pre><code>new_str = old_str.replace(3, "a");
// replace index 3 (4th character) with the letter "a"
</code></pre>
<p>So if I had <code>abcdef</code> then above should return <code>abcaef</code> but I must have gotten something wrong. It is changing characters, but not the expected ones.</p>
<p>Either native JS or jQuery solution is fine, whatever is best (I'm using jQuery on that page).</p>
<p>I've tried searching but all tutorials talk of Regex, etc. and not the index replace thing.</p>
|
javascript jquery
|
[3, 5]
|
3,503,078
| 3,503,079
|
.css function does not work inside of handler function
|
<p>I want to change css properties inside of a named function thant handles the click event. If I call .css in an anonymous function defined in the click event, it works. However, I want to call .css inside of a named function defined inside the handler function. Here's my code. </p>
<pre><code>$(document).ready(function () {
$('#popup').click(partial(coolTransition, $(this)));
});
function coolTransition(elem) {
shrink();
function shrink() {
elem.css('background-color', '#000000');
}
}
//used to implement partial function application so that I can pass a handler reference that takes arguments.
//see http://stackoverflow.com/questions/321113/how-can-i-pre-set-arguments-in-javascript-function-call-partial-function-applic
function partial(func /*, 0..n args */ ) {
var args = Array.prototype.slice.call(arguments, 1);
return function () {
var allArguments = args.concat(Array.prototype.slice.call(arguments));
return func.apply(this, allArguments);
};
}
</code></pre>
<p>Thanks in advance for help. </p>
|
javascript jquery
|
[3, 5]
|
4,483,525
| 4,483,526
|
disable/enable buttons
|
<p>I'm working in ASP .Net. I need to be able to click a button, disable it, have the code behind kick in and execute some functions and once they are done, enable the button again. There is no postback taking place per say in this project as we are using an UpdatePanel. About as far as I've been able to get successfully is using this syntax to disable it on the code behind Page_Load function: </p>
<pre><code>btnConnect.Attributes.Add("onClick", "document.body.style.cursor = 'wait';this.disabled = true;" + ClientScript.GetPostBackEventReference(btnConnect, string.Empty) + ";");
</code></pre>
<p>This disables the button and allows the code behind to execute. I just can't figure out how to re-enable the button once the functions that run in the code behind are done. Is there a way to capture when the code behind is done?</p>
|
c# asp.net
|
[0, 9]
|
5,343,342
| 5,343,343
|
jQuery selector with variable, not updating when variable changes
|
<p>'I am trying to do something like the below that will run a function when clicking the "hit" class only when the parent "box" id is correct.</p>
<pre><code>var selected = 1;
$('#box-' + selected + ' .hit').click(function(){
selected = randomFromTo(1,5);
});
</code></pre>
<p>The <code>selected</code> variable changes depending on other actions on the page but I can't get the function to work after any change - it stays fixed to the initially selected "box" id. I can imagine why this might be, as jQuery has taken a snapshot of that string and nothing is telling it update it but I can't figure out how to get around this.</p>
<p><strong>Edit:</strong> added the selected variable's instantiation and where it gets set. I've left out the UI changes that would make this more understandable to a user.</p>
|
javascript jquery
|
[3, 5]
|
827,296
| 827,297
|
jquery: unload or beforeunload?
|
<p>I want to post an message to the server when user navigate off from the current page, I am using .unload right now but the result is unreliable, even in its document is said true:</p>
<blockquote>
<p>The exact handling of the unload event
has varied from version to version of
browsers. For example, some versions
of Firefox trigger the event when a
link is followed, but not when the
window is closed. In practical usage,
behavior should be tested on all
supported browsers, and contrasted
with the proprietary beforeunload
event.</p>
</blockquote>
<p>Should I use beforeunload event? Is it reliable?</p>
|
javascript jquery
|
[3, 5]
|
1,393,484
| 1,393,485
|
Advice on creating a screensaver updatable via a CMS
|
<p>I've been asked to provide someone with a screensaver which contains some content pulled from a mysql database. Having never developed a screensaver before, I'm wondering how best to go about this. The screensaver will be used in an office of around 20 machines running Windows - I was originally going to use Flash to develop the screensaver, then export it to .scr format, however the need for dynamic content is making me wonder if i can do this better with python or java? Does anyone have experience or advice for this type of thing? Many thanks</p>
|
java python
|
[1, 7]
|
652,119
| 652,120
|
How to escape quotes in while creating a textbox in jquery / javascript?
|
<p>I have a couple of span elements and I need to get the contents of these span elements into a textbox so the user can edit.</p>
<p>There might be any number of span elements, so the textboxes have to be created at runtime. The problem I'm having is that when the text contains a single quotes, it's messing with my text box values since it closes one of the quotes.. </p>
<p>This is how I am creating my textbox: </p>
<pre><code>var spanContent = $(value).text();
var tmpTextBox = "<input type='text' id='t" + index + "' value='" + spanContent + "' class='dynTxt' />";
</code></pre>
<p>Notice the <strong>value='" + spanContent + "'</strong> part, this is where it's breaking if <code>spanContent</code> has a single quote in it.. Now, I know I can do this: </p>
<pre><code>value = \"" + spanContent + "\"
</code></pre>
<p>which works fine.. but, when the <code>spanContent</code> has double quotes, it breaks again..</p>
<p>What is the safest way to escape both single quotes and double quotes in this situation, please? I cannot html encode them because textbox values doesn't support them..</p>
<p>I have created a small reproduction of this <a href="http://jsfiddle.net/MTcbX/1/" rel="nofollow">on jsfiddle here</a> for you to play with..</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
5,070,595
| 5,070,596
|
adding alternate text to a programmatically created image
|
<p>So I have an ashx file that creates an image with text written on it.</p>
<pre><code>//create the image for the string
Font f = new Font("Arial", 15F);
Graphics g = Graphics.FromImage(b);
SolidBrush whiteBrush = new SolidBrush(Color.FromArgb(0,71,133));
SolidBrush blackBrush = new SolidBrush(Color.White);
RectangleF canvas = new RectangleF(0, 0, 105, 45);
g.FillRectangle(whiteBrush, canvas);
context.Session["test"] = randomString;
g.DrawString(context.Session["test"].ToString(), f, blackBrush, canvas);
context.Response.ContentType = "image/gif";
b.Save(context.Response.OutputStream, ImageFormat.Gif);
</code></pre>
<p>When called, it creates the image I want, but realized that it doesn't have have an alt text option for accessibility purposes.</p>
<p>Any idea on how to add alternate text to an image? </p>
<p>In my aspx page I have this:</p>
<pre><code> <asp:Image ID="myImage" class="styleimage" src="ImageMaker.ashx" runat="server"/>
</code></pre>
<p>I have tried: </p>
<pre><code>myImage.AlternateText = HttpContext.Current.Session["test"].ToString();
</code></pre>
<p>I receive a <code>NullReferenceException</code>.</p>
<p>This apparently happens because <code>Session["test"]</code> gets populated after the page load ( so the page loads, the image gets rendered, then the handler gets called).</p>
<p>How do I solve this?</p>
|
c# asp.net
|
[0, 9]
|
4,858,892
| 4,858,893
|
__dopostback is not working in javascript function
|
<p>am calling <code>__dopostback</code> function in javascript while closing event of browser but its not working in Chrome.</p>
<p>the same function is working in IE </p>
<p>can any one give me the solution.</p>
<pre><code><script type="text/javascript" language="javascript">
function doUnload()
{
var btnlogout = document.getElementById("ctl00_lbtn_Logout"); alert(btnlogout);
__doPostBack(btnlogout, '');
}
</script>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
2,701,964
| 2,701,965
|
How get the second td innerHTML
|
<p><strong>Scenario:</strong></p>
<p>Im using datatable library to display alot of information. That table have the following rows:</p>
<pre><code>Id Type Name Case
</code></pre>
<p>What i'm looking for is that when i click the second row <strong>Type</strong>, that value will be taking and pasted in a textbox</p>
<p>Example</p>
<pre><code>Id Type Name Case
1 text Juan 20001
3 List Pedro 20005
</code></pre>
<p>If i click the row that has the id # 1, i need to take the Type innerHTML. Does not matter what apart of the row i click just take the second td's html.</p>
<p>I tried with this code:</p>
<pre><code>$("tr td").click(function () {
alert($(this).html());
})
</code></pre>
<p>It worked great, But the problem is that the user have to click exactly the row Name, but would be better if user can click over any of the row and just take the second rows html.</p>
<p>Suggesstions?</p>
|
javascript jquery
|
[3, 5]
|
1,077,417
| 1,077,418
|
How can I wrap just a part of an element’s content using jQuery?
|
<p>how can I wrap a part of a content when I have elements and normal text? I've tried <code>.after()</code> but this automaticaly adds a closing tag.</p>
<p>I have got this:</p>
<pre><code><div class="block">
<a href="#">example 1</a>
.
<a href="#">example 1</a>
.
<a href="#">example 1</a>
.
<a href="#">example 1</a>
</div>
</code></pre>
<p>And I have to transform it to:</p>
<pre><code><div class="block">
<a href="#">example 1</a>
<div class="wrap">
.
<a href="#">example 1</a>
.
<a href="#">example 1</a>
.
<a href="#">example 1</a>
</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,750,892
| 2,750,893
|
Intranet WebSite with Windows Authentification and Forms Authentification
|
<p>Ok, so my background to the problem that i am facing is:</p>
<p>I was given a project to built an intranet website for my company in C# and ASP.NET. At first the specifications were that the site would have a normal login based page with forms (so Forms Authentification). After the project was done, about 90%, the specifications changed. Now the website must have windows mode and forms mode authentification, meaning that, if a users that is accesing the site is on a computer that belongs to a certain Domain it will be automatically logged in, if he isn't in that domain then he must logg in with username and password from database. After hat, i must know in what Group(table in the database) the user is to let him see or not some pages, so i must get the user -username and find the id in the database and so on (this is a different story).</p>
<p>So, this is world crashing for me, for the last two days i was surfing the internet to find out methods, but I have not found anything concrete. I found a method submited by Paul <a href="http://aspalliance.com/553_Mixed_Mode_Authentication" rel="nofollow">http://aspalliance.com/553_Mixed_Mode_Authentication</a>, but this is for .Net 1... and some comments told that it wouldn't work for later editions. Other thing i found that could help me is Active Directory but did not understand much, and so one. </p>
<p>If you can give me some steps to follow, articles, links, maybe the Holly Code. thanks in advance.</p>
<p>Plus one more question, is there a way that i can be notified that login failed in IIS for something like this : if the windows authentification failed => use forms authentification..</p>
<p>Reminder - i'm new (junior programmer)</p>
|
c# asp.net
|
[0, 9]
|
2,854,269
| 2,854,270
|
How do you configure SWFUpload to work with an ASP.NET C# WebService?
|
<p>I'm trying to use SWFUpload with an ASP.NET Web Forms project. I need to get at Request.Files[0] But I can't do that in my WebService! </p>
<p>Anyone know a way around this?</p>
<p>Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
2,902,412
| 2,902,413
|
How can I insert a variable into a variable string?
|
<p>I have this code which I need to set a unique <code>title</code>:</p>
<pre><code>var tmpImg = '<img src="/admin/icons/cross.png" title="' + title + '" />';
$(this).find("tr td input").each(function(){
title = $(this).attr("value");
$(this).hide().before(tmpImg);
});
</code></pre>
<p>What I want to happen, is that each time the <code>each</code> iterates over the <code><input></code>, it updates the <code>title</code> value in the <code>tmpImg</code> string. I know I could separate the img HTML like below, although I think this would get messy when I need to reuse the image later down the script.</p>
<pre><code>var tmpImg = '<img src="/admin/icons/cross.png" title="';
$(this).find("tr td input").each(function(){
title = $(this).attr("value");
$(this).hide().before(tmpImg + title + '" />');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,616,798
| 4,616,799
|
How to send udp packets using Ip address from source to destination host?
|
<p>Source side:</p>
<pre><code>import java.io.*;
import java.net.*;
class Server
{
public static void main(String args[]) throws Exception
{
DatagramSocket ds = new DatagramSocket(50074);
byte[] ms = new byte[1024];
String a="Computer";
ms=a.getBytes();
DatagramPacket ps = new DatagramPacket(ms, ms.length, InetAddress.getByName("Destination Ip address"),1599);
ds.send(ps);
}
}
</code></pre>
<p>Destination side:</p>
<pre><code>import java.io.*;
import java.net.*;
class Client
{
public static void main(String args[]) throws Exception
{
DatagramSocket ds = new DatagramSocket(1599);
byte[] ms = new byte[10024];
DatagramPacket ps = new DatagramPacket(ms,ms.length);
ds.receive(ps);
System.out.println(new String(ps.getData()));
}
}
</code></pre>
<p>This is my program, but it is not working. When I am giving Destination IP adress="localhost" it is working well. But if I replacing localhost as "Destination ip address like 117.201.12.80 " it is not working.. please help me to solve this problem</p>
|
java android
|
[1, 4]
|
1,718,841
| 1,718,842
|
Change URL on first and second clicks
|
<p>I've searched the internet and stackoverflow for how to trigger a second click function and this is what I found:</p>
<pre><code>$('.elementclass').toggle(
function(){
//on odd
},
function(){
//on even
});
</code></pre>
<p>It's perfect. Now according to this I try to change the URL of my document but something doesn't work. Here is my code:</p>
<pre><code>$('.orderby').toggle(
function(){
document.location.href+='?orderby='+$(this).val()+'ASC';
},
function(){
document.location.href+='?orderby='+$(this).val()+'DESC';
});
</code></pre>
<p>where <code>$(this).val()</code> will be something like name or date...</p>
<p>What I want to accomplish is: on first click of a button, the URL changes to <a href="http://blablabla/page.php?orderby=nameASC" rel="nofollow">http://blablabla/page.php?orderby=nameASC</a> and then on the second click, the URL changes to <a href="http://blablabla/page.php?orderby=nameDESC" rel="nofollow">http://blablabla/page.php?orderby=nameDESC</a>.</p>
<p>So what's wrong with my code?</p>
<p><strong>I don't want to refresh the page when user click on button, I just want to add some (one in this case) parameters that can take whit $_GET later but on same page.document.URL can be update whit +=?orderby=nameASC on first click and on second click +=?orderby=nameASC need to be remove and document.URL update whit +=?orderby=nameDESC.</strong></p>
|
javascript jquery
|
[3, 5]
|
2,184,702
| 2,184,703
|
Get Column Header in TableCellCollection in asp.net
|
<p>I am using a website and i have a gridview in that website.... I want to delete a row in that gridview by using that selected row column values and Column headers... i got the column values by using TablecellCollection but i cant get that column value's Corresponding Column header.... how shall i get that Column header by using TableCellCollection....</p>
<p>Please anyOne Tell me the solution of this....</p>
<p>Thanks in Advance!</p>
<p>And My code is:</p>
<pre><code> int Row = Convert.ToInt16(e.RowIndex);
TableCellCollection collection = GrdViewDetails.Rows[Row].Cells;
for (int i = 0; i < Collection.Cells.Count;i++)
{
strColumnValue = Collection.Cells[i].Text;
//strColumnName=?
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,154,026
| 1,154,027
|
How to Set Layout Background in Android UI
|
<p>I'm new to Android programming. I have a UI with some <code>TextView</code> and <code>Button</code> controls. How do I set a background behind those components? Lets call it <code>background.png</code>. </p>
|
java android
|
[1, 4]
|
639,009
| 639,010
|
In asp.net how to validate textbox depending on other text box?
|
<p>In asp.net Depending on Experience I should validate the salary of an employee. </p>
<p>If the employee is fresher his salary should be 1 lac to 1.5 lac. Or salary = 1.5 lac * years of exp to 3.5 * years of exp.</p>
<p><em><strong></em>**</strong> i have tried his*<strong><em>*</em>**</strong>
protected void Button1_Click(object sender, EventArgs e)
{</p>
<pre><code> if (IntExp == 0)
{
RangeValidator1.MaximumValue = "150000";
RangeValidator1.MinimumValue = "100000";
RangeValidator1.Type = ValidationDataType.Integer;
RangeValidator1.Validate();
if (!RangeValidator1.IsValid)
{
RangeValidator1.ErrorMessage = "Enter CTC between 100000 and 150000";
}
Response.Redirect("ABCAddEmp.aspx");
}
else
{
int max = IntExp * 150000;
int min = IntExp * 350000;
RangeValidator1.MaximumValue = "max";
RangeValidator1.MinimumValue = "min";
RangeValidator1.Type = ValidationDataType.Integer;
RangeValidator1.Validate();
if (!RangeValidator1.IsValid)
{
RangeValidator1.ErrorMessage = "Enter CTC between " + max + " and " + min;
}
Response.Redirect("ABCAddEmp.aspx");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
22,073
| 22,074
|
need help with real-time program in asp.net
|
<p>i need to build asp.net program that connect to sql-server 2008</p>
<p>i have in my program row count that count my database rows.</p>
<p>i need to see allwais this row count.</p>
<p>is there any way to show this ? any refresh ? or i need to run all the time any query ? any timer ?</p>
<p>i need something that not take A lot of resources</p>
<p>can i get any sample ?</p>
<p>thank's in advance</p>
|
c# asp.net
|
[0, 9]
|
5,033,943
| 5,033,944
|
Emulator show's spinner value's tablet show's empty value
|
<p>In my application i use an MYSQL databank. And i try to load the value's from the Database into the spinner. In the (eclipse) emulator this works perfectally (all items get loaded into the spinners) .</p>
<p>But when i try to run my application on my tablet (honeycomb 10.1) the value's from the database don't show up in the spinner. When i try to reach my database from the tablet everything works fine.</p>
<p>I'm also using the AsynTask for getting the data so that should not be the problem i think?</p>
<p>(The Code Below is working fine on the Emulator but when i load it on my honeycomb tab the data does not get loaded) And im using the AsynTask class to get the connectie to mysql</p>
<p>Any advice?</p>
<pre><code> // This Thread get's the reservation ID's
Thread asyn = new Thread(){
public void run(){
try{
int klok = 0;
while(klok < 5000){
sleep(100);
klok = klok + 100;
}
try{
// Ophalen van de Reservaties objecten
lijst = mpr.get();
ArrayAdapter<String> AdapterCountries = new ArrayAdapter<String>(Materiaal.this,android.R.layout.simple_spinner_item);
AdapterCountries.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
int lenLijst = lijst.size();
String[] temp = new String[lenLijst+1];
for(int x=0; x < lenLijst; x++){
temp[x] = Integer.toString(lijst.get(x).getRes_id());
AdapterCountries.add(temp[x]);
}
s1.setAdapter(AdapterCountries);
}catch(Exception ex){
ex.printStackTrace();
}finally{
//adapter.notifyDataSetChanged();
}
}catch(InterruptedException ex){
ex.printStackTrace();
}
}
};
asyn.start();
</code></pre>
|
java android
|
[1, 4]
|
2,900,429
| 2,900,430
|
Javascript regex replace if the matched string length is greater than limit specified
|
<p>I am using javascript regex to add a html markup for all the urls found like:</p>
<pre><code> var exp = /(((|www\.|(http|https|ftp|news|file)+\:\/\/)[&#95;.a-z0-9-]+\.[a-z0-9\/&#95;:@=.+?,##%&~-]*[^.|\'|\# |!|\(|?|,| |>|<|;|\)]))/ig;
popupText = popupText.replace(exp , "<font color='red'>"+"<b>$&</b>"+"</font>" );
</code></pre>
<p>Now the problem is i want to make sure that it will word if the url found length is greater than 20 characters</p>
<p>See <strong>$&</strong> gets the match string i need to add a filter/check to gets its length.</p>
<p>Any help is appreciated</p>
|
javascript jquery
|
[3, 5]
|
3,006,638
| 3,006,639
|
Any php code to make embed code of video?
|
<p>I Want a php code to turn a youtube/dailymotion/vimeo/metacafe... URL into an EMBEDABLE code so i can show it using <code>echo</code> , it is really hard to read the API of every website, so i'm wondering if there is a class or code to do this.</p>
<p>Note: if there isn't anyone, then maybe a jQuery facebox alternative who supports more than youtube.</p>
<p>Thanks</p>
|
php jquery
|
[2, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.