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,986,387 | 3,986,388 | JQuery selector - full or optimized scan? | <p>Code example:</p>
<pre><code>$JK("body *").each(function() { ... });
</code></pre>
<p>Will JQuery fill the elements' array first before calling <code>each()</code> or there is kinda <code>LINQ</code>-style optimization, so that <code>function</code> will be called during the DOM tree traversal? I guess that this optimization might (or not) be deployed into the JS engine. If so, how one can know if it is implemented for this or that engine/browser?</p>
| javascript jquery | [3, 5] |
4,547,164 | 4,547,165 | Asp.net detailsview - get data after update | <p>I have a web page with an editable DetailsView. After it is (successfully) edited, I need to use some of the edited fields to update some other tables in the database (in the code behind). I tried to use the DetailsView.DetailItem in the DetailsView_ItemUpdated event code, but the DetailItem isn't available any more - it is null. What's the best way to get at the updated field information?</p>
| c# asp.net | [0, 9] |
63,261 | 63,262 | Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 | <p>i didn't find Microsoft word document under the "Control Panel - Administrative Tools - Component Services - Computers - My Computer - DCOM Config" then how to grant the permissions for microsoft word and excel </p>
| c# asp.net | [0, 9] |
3,765,307 | 3,765,308 | Hide element depending on value of if/else statement not working | <p>I have a Rails app that uses the <a href="https://developer.linkedin.com/documents/sign-linkedin" rel="nofollow">LinkedIn Javascript API</a> to authenticate users. What I'd like to do is hide an element depending on whether the user is signed up or not. I've tried a few things:</p>
<ul>
<li>Put the code with the if/else statement at the bottom of the HTML before <code></body></code></li>
<li>Check to see if <code>document.cookie</code> is an empty string instead of a more specific if/else</li>
</ul>
<p>However, neither of these has hidden the element. If I go into my browser's console and paste in my code after the page is finished rendering, the element hides. So I thought this was a JavaScript load issue, but I must be doing something wrong. Can anyone shed some light on this?</p>
<p>Here's the code I've tried, none of which works:</p>
<pre><code><%= content_for(:script_footer) do %>
<script type="text/javascript">
// if ($('span.IN-widget:contains("inSign in with LinkedIn")').length > 0) {
// $('#select').hide();
// } else {
// $('#select').show();
// }
if (document.cookie == "") {
$('#select').hide();
} else {
$('#select').show();
}
</script>
<% end %>
</code></pre>
<p>And my application layout:</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<title>rdtrip</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= yield(:linked_in) %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
<%= yield(:script_footer) %>
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
5,317,417 | 5,317,418 | Creating a textfield which takes values based on the first character | <p>I have a textfield. If we enter a number for the first character, the textfield should only accept numbers. Otherwise if the first character is a letter, then the textfield should accept only letters. I am trying to achieve this in jQuery/Javascript.</p>
| javascript jquery | [3, 5] |
1,720,721 | 1,720,722 | How to move to code in codebehind from javascript | <p>I have a gridview .When i click on one row in it i have to go to javascript which is like this.</p>
<pre><code> <script type="text/javascript" language="javascript">
function GetDetails(rowNo)
{
document.getElementById('hidRowNo').value = rowNo
document.getElementById('btnDet').click();
}
</script>
</code></pre>
<p>I have written following code in codebehind </p>
<pre><code> protected void btnDet_Click(object sender, EventArgs e)
{
if (hidRowNo.Value != "")
{
int rowNo = Convert.ToInt32(hidRowNo.Value);
TextBox1.Text = GridView1.Rows[rowNo].Cells[0].Text;
TextBox2.Text = GridView1.Rows[rowNo].Cells[1].Text;
TextBox3.Text = GridView1.Rows[rowNo].Cells[2].Text;
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "GetDetails(" + e.Row.RowIndex + ");");
}
}
</code></pre>
<p>The problem is javascript is working but document.getElementById('btnDet').click(); is not working.While debugging also,control is not moving to btnDet_Click.what change i have to include to move control to btnDel_Click in code behind.</p>
<p>can anybody help?</p>
| c# asp.net | [0, 9] |
74,577 | 74,578 | findviewbyid returns null in a dialog | <p>I have a custom dialog and when I try to get the value of an EditText it returns null.</p>
<p>This line returns null</p>
<pre><code>EditText et = (EditText)findViewById(R.id.username_edit);
</code></pre>
<p>Here is the code in its entirety.</p>
<pre><code>protected Dialog onCreateDialog(int id) {
switch (id) {
case DIALOG_TEXT_ENTRY:
LayoutInflater factory = LayoutInflater.from(this);
final View textEntryView = factory.inflate(R.layout.alert_dialog_text_entry, null);
return new AlertDialog.Builder(TicTacToe.this)
//.setIconAttribute(android.R.attr.alertDialogIcon)
.setTitle(getTitleText())
.setView(textEntryView)
.setPositiveButton("JOIN GAME", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
try
{
EditText et = (EditText)findViewById(R.id.username_edit);
playerName = et.getText().toString();
}
catch (Exception e)
{
}
}
})
.create();
}
return null;
}
</code></pre>
| java android | [1, 4] |
2,936,490 | 2,936,491 | How to get number of words on a web page? | <p>I need to get total number of WORDS on a web page. I know about the <code>System.Net.WebClient</code> class. But it's <code>DownloadString()</code> method return the whole HTML markup where as what I need is only the TEXT so that I can figure out the number of words.</p>
<p>Any ideas/suggestions welcome.</p>
| c# asp.net | [0, 9] |
3,879,393 | 3,879,394 | Scroll text div on hover and return to first element | <p>How to replace "home" button with another text when I hover by mouse on it instead of it repeating itself?</p>
<pre><code><ul class="topnav">
<li><a href="#">Home</a></li>
</ul>
jQuery(function($) {
$('.topnav li').find('a[href]').parent().each(function(span, li){
li = $(li); span = $('<span>' + li.find('a').html() + '<\/span>');
li.hover(function(){
span.stop().animate({marginTop: '-60'}, 250);
}, function(){
span.stop().animate({marginTop: '0'}, 250);
}).prepend(span);
});
});
</code></pre>
<p>Here is the example: <a href="http://jsfiddle.net/fxdigi/3YNHp/1/" rel="nofollow">http://jsfiddle.net/fxdigi/3YNHp/1/</a></p>
| javascript jquery | [3, 5] |
1,278,945 | 1,278,946 | Draw image using mouse | <p>I need to create a web page where i can draw a image using mouse (similar to paint).is it possible in c# ,asp.net or silver light please help</p>
| c# asp.net | [0, 9] |
4,569,828 | 4,569,829 | Replace text inside a div without affecting any HTML tags inside of it | <p>I see that this has been asked many times. But, unfortunately I have not come across a straight forward solution. Most solutions revolve around multiple nodes within the div.</p>
<p>So here's problem. I have the following markup:</p>
<pre><code><div class="test">Text1<span></span></div>
</code></pre>
<p>I need "Text1" to be replaced with "Text2" without affecting the span tag and event handlers attached to the span tag.</p>
<p>Doing something like <code>$('.test')html('Text2<span></span>')</code> does replace the text. But, removes the event handlers on the span tag, which is not desired. I am looking for a quick and efficient method for this one.</p>
| javascript jquery | [3, 5] |
3,072,407 | 3,072,408 | Capture all links including form submission | <p>I am wondering how to capture all links on a page using jQuery. The idea being similar to Facebook. In Facebook, if you click on a link it captures the link and loads the same link using ajax. Only when you open a link in new tab etc. will it load the page using regular call.</p>
<p>Any clue on how to achieve such kind of functionality? Am sure capturing links should not be a problem, but what about capture form submissions and then submitting the entire data via ajax and then displaying the results?</p>
<p>Is there any plugin which already exists?</p>
<p>Thank you for your time.</p>
| javascript jquery | [3, 5] |
2,842,382 | 2,842,383 | Bold text in a text area? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3322895/bold-text-in-textarea">bold text in textarea</a> </p>
</blockquote>
<p>My user is typing in a textarea, using js they have the ability to make url links within this area, is there a way to bold the text in the textarea so a user can see where they have made the links?</p>
<p>Or is there a better solution?</p>
| javascript jquery | [3, 5] |
1,416,807 | 1,416,808 | Removing $() jQuery wrapper to just get raw JS element | <p>Random <em>just out of curiosity</em> question:</p>
<p>Let's say for whatever reason I get an element back from a function </p>
<pre><code>$(element)
</code></pre>
<p>But I want to remove the <strong>$( __ )</strong> jQuery wrapper to leave the regular DOM Element:</p>
<pre><code>element
</code></pre>
<p><strong>Is this possible?</strong> (I'm sure it'd be smart to test <code>$(element).length()</code> to make sure it isn't more than 1 thing inside beforehand too...</p>
<p><a href="http://jsfiddle.net/xHj5d/" rel="nofollow">jsFiddle</a></p>
| javascript jquery | [3, 5] |
3,646,999 | 3,647,000 | Use checkbox to set val() for field | <p>Total N00b here, I have a long form wizard that needs one step to be dynamically shown/hidden dependant on a radio button. All is cool with the code thus far.</p>
<pre><code>function checkRb () {
if($(this).is(":checked")){
//yes
$("#do_frick").val("step5");
//alert ("yeah");
}else {
//no
$("#do_frick").val("submit_step");
//alert ("no");
}
}
</code></pre>
<p>The issue is that the hidden field "#do_frick" is several steps further down the page. If I place it in the same div as the checkbox, values change no problem. Place "#do_frick" further down the form and it doesnt change.</p>
<p>I expect that $(this) is only looking inside the current div and not the entire document. I got this far with the help of a very good programmer and dont want to annoy him further with N00b questions, any help greatly appreciated :)</p>
<p>It appears that if I put the "#do_frick" inside a div that is further down the page the form wizard sets the to display:none and anything inside the div cannot be set... would this be correct ?</p>
| javascript jquery | [3, 5] |
926,246 | 926,247 | Android and jQuery Problem (might also be an asp.net issue?) | <p>Hello I'm programming an Web-Application with asp.net and jQuery (parts of it in jQueryMobile).
I can't use the loading-animations of jQueryMobile as they don't work with my aspx sites. So i implemented my own loading animation on several pages. Which looks like so:</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$("#loading").addClass("hidden");
$("a.ui-btn").removeClass("hidden");
$("a").click(function () {
$("#loading").removeClass("hidden");
$("a.ui-btn").addClass("hidden");
});
});
</script>
</code></pre>
<p>Now the problem:
on any Desktop Browser, on Mobile Opera and on any Safari-Based Browser (like on iPhone and iPad) everything works as one would expect it, except of the integrated Android-Browser (which is as far as i know a Chrome-derviate).
On these devices the loading animation doesn't show when i click a button. But(!) after the following page loaded and one uses the back-button of the Browser the animation shows up and one can't acces the normal page...
I don't understand what exactly happens here. Seems like a racing condition or something similar to me?! And how can i solve this?</p>
| jquery asp.net android | [5, 9, 4] |
3,913,488 | 3,913,489 | When page loads display 1st image text - hide all other text | <p>I have created <a href="http://techavid.com/design/test3.html" rel="nofollow">this page</a> and when you load the page you see there are 3 images. The sun image is focused(in color), while the others are greyed out until clicked. That is how it should be for the images.</p>
<p>Also when you load the page you see under each image it's own text(i.e. 1st: Sun, 2nd: Airplane, 3rd: Nano), but on page load I only want 1st:Sun to display and hide all other text until their respective image is clicked.</p>
| javascript jquery | [3, 5] |
3,379,019 | 3,379,020 | Attemp at jquery refreshing a div and php | <p>I'm trying to refresh a div with jquery that loads the time which is generated with php. </p>
<p>I've read some of the articles on jquery that were already on here and tried using those to refresh my div, but I failed.</p>
<pre><code>echo '<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>' . $title . '</title>
<link type="text/css" rel="stylesheet" media="all" href="styles/style.css" />
<link type="text/css" rel="stylesheet" media="all" href="styles/layout.css" />
<link type="text/css" rel="stylesheet" media="all" href="styles/' . $bodycss . '" />
</head>
<body>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.timers.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function update() {
$.get("'.$_SERVER['REQUEST_URI'].'", function(data) {
$("#time").html(data);
window.setTimeout(update, 500);
});
}
</script>
<div id="container">
<header id="header" class="margin5">
<div id="info"> <a href ="home.php"> <img src="images/logo.jpg" alt="Oppasweb" /> </a> </div>
<div id="time"><time datetime=' . getTimeForTag() . '>' . getTime() . '</time></div>
<div class="clear"></div>
';
}
</code></pre>
<p>The javascript should refresh the div every .5 of a second, generating the new time, however it doesn't do that, the time stays static.</p>
| php jquery | [2, 5] |
2,871,686 | 2,871,687 | Monitor the progress of an input stream / httpclient.exectute | <p>I'm trying to get the progress of an Apache HTTP Client Execute method. Is it possible to either</p>
<ol>
<li>Get the mount of input stream that has been read by the execute method
or </li>
<li>Monitor the execute process using some internal method either by percent or amount of data sent?</li>
</ol>
<p>The code below sends an input stream to the server (in this case an image) which is then stored appropriately. Problem is with high resolution cameras and slow mobile operators its hard to tell if an upload is actually taking place. The code does work, but feedback is desired.</p>
<pre><code>public List writeBinary(String script, InputStream lInputStream) {
Log.d(Global.TAG,"-->writing to server...");
HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, 5*1000);
HttpConnectionParams.setSoTimeout(httpParameters, 60*1000);
HttpClient httpclient = new DefaultHttpClient(httpParameters);
HttpPost httppost = new HttpPost("http://xxx.xxx.xxx.xxx" + script);
String responseText = null;
List responseArray = new ArrayList();
try {
httppost.setEntity(new InputStreamEntity(lInputStream, -1));
HttpResponse response = httpclient.execute(httppost);
if (response.getStatusLine().getStatusCode() == 200){
InputStream lInputStreamResponse = response.getEntity().getContent();
DataInputStream lDataInputStream = new DataInputStream(lInputStreamResponse);
BufferedReader lBufferReader = new BufferedReader(new InputStreamReader(lDataInputStream));
while ((responseText = lBufferReader.readLine()) != null){
responseArray.add(responseText);
}
lInputStream.close();
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return responseArray;
}
</code></pre>
| java android | [1, 4] |
2,436,695 | 2,436,696 | Javascript data models in jQuery | <p>Recently I've been using ExtJs and its data stores to load data and bind them to a datagrid.</p>
<p>What I'm trying to work out is the best way of doing that using jQuery (+any plugin) and javascript.</p>
<p>I've got a series of plugins that used a known object to render themselves. This is fine, although the definition of the objects is assumed.</p>
<p>But what I want to do is create say a Record object with some known properties and "bind" the values of the Record object to the plugins' input elements.</p>
<p>The Record object would need to have datachanged events etc. probably similar to something that's already available. I would also need to to hold collections of sub Records with a different model definition.</p>
<p>Would the best way be to start from scratch and develop a pure JavaScript class that holds a set of model definitions and the "records" that are bound the input elements, or would this be better as jquery plugin (although there is no dom element specifically for the store, but could use document?) or is there something out there that already in use? (that's widely used)</p>
| javascript jquery | [3, 5] |
1,939,353 | 1,939,354 | How to get input id of datepicker in c#? | <p>I am using datapicker jquery but it is not able to get Input Id in C#.If i give runat=server ,i can call the input id in c#,but it does not work in page. Can anyone help me for that, I am new to Dnn. Any answer would be appreciated. Thank you.</p>
<pre><code>enter code here
<div class="demo">
<p>Date: <input id="datepicker" type="text" />
</p>
</div>
</code></pre>
| c# javascript asp.net | [0, 3, 9] |
2,093,051 | 2,093,052 | How to show a web page in full screen mode without statusbar and addressbar in all browsers? | <p>How to show a web page in full screen mode without statusbar and addressbar in all browsers and it should not show the taskbar also.</p>
| c# javascript asp.net jquery | [0, 3, 9, 5] |
5,261,505 | 5,261,506 | PHP transfer files from server to server in LAN | <p>So, I have 5-6 pages of requirements. I'm trying to build this application in PHP based on the requirements.</p>
<p>I want to transfer files from one server to the other server in LAN, and then send a shell command to the other server to find out if the file has been transferred successfully.</p>
<p>In php, I can transfer files using FTP, and send shell commands using SSH.</p>
<p>Using the methods above, I will need to open connection to the server first, but I don't know the ftp server name, domain name, ip address, or anything like that.</p>
<p>I only know the the server ID (I'm not sure what this ID is, but I guess it is like the computer's name).
An example of the server ID is: "c23bap234"</p>
<p>How do I open a connection with just that server ID? These servers are in the same building, have LAN connection, don't have connection to the outside world. These machines have PHP, Apache, ... installed.</p>
<p>If my post doesn't make sense to you, it's because I'm a learner. I hope someone can help me on this.
Thanks in advance.</p>
| java php | [1, 2] |
5,243,752 | 5,243,753 | How to create Intent using a string to launch another activity? | <p>The first activity in my app needs to load a small amount of data from a text file. Two strings and an integer.</p>
<p>Once I load the data, I want to use one of the strings to create an intent, that will launch the next activity.</p>
<p>The current activity will not be able to have a hard-coded reference like so:</p>
<pre><code>startActivity(new Intent(this, NextClass.class));
</code></pre>
<p>NextClass.class will need to be specified from a string in the file, and is included with the project.</p>
<p>I could create the data file in another activity, but I'm hoping to avoid creating another activity just for that when another way may be possible.</p>
| java android | [1, 4] |
3,523,534 | 3,523,535 | compare sql date to javascript date | <p>Is there an easy way to compare a sql dateTime to a javascript date time so that the two can be compared easily?</p>
<p>Are there built in javascript functions as I cant edit the sql</p>
| javascript jquery | [3, 5] |
4,776,714 | 4,776,715 | Code in onActivityResult() not executed | <p>I've got an android application that I want to open a different activity then my main one after a fresh install.</p>
<p>I tried this using startActivityForResult() and SharedPreferences. Here is my code:</p>
<p>main activity:</p>
<p>public class ONTTMainActivity extends Activity {</p>
<p>static final int REQUEST_CODE = 5;</p>
<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences settings = getSharedPreferences("prefs", 0);
boolean firstRun = settings.getBoolean("firstRun", true);
if(firstRun){
startActivityForResult(
new Intent(this, ONTTSplashActivity.class), REQUEST_CODE);
}
setContentView(R.layout.activitymain);
}
</code></pre>
<p>second activity:</p>
<p>public class ONTTSplashActivity extends Activity {</p>
<p>@Override<br>
public void onCreate(Bundle savedInstanceState) {</p>
<pre><code> super.onCreate(savedInstanceState);
setContentView(R.layout.activityonttsplash);
final Button btnSkip = (Button) findViewById(R.id.button_skip);
btnSkip.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
setResult(RESULT_OK);
finish();
}
});
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Toast.makeText(ONTTSplashActivity.this, "Toast Reached", Toast.LENGTH_LONG).show();
if (resultCode == RESULT_OK) {
SharedPreferences settings = getSharedPreferences("ONTT_prefs", 0);
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("firstRun", false);
editor.commit();
}
}
</code></pre>
<p>The problem is that even though the second activity is ended the code in the onActivityResult function is never executed. I tried using a toast to see if it has been reached.</p>
<p>I've seen several similar questions but I've tried every solution but it's not working.</p>
| java android | [1, 4] |
4,182,521 | 4,182,522 | onCreateContextMenu | <p>I can seen to understand what I am doing wrong here.</p>
<pre><code>public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;
Map<String, String> data = (Map<String, String>) getListView().getItemAtPosition(info.position);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
String admin = preferences.getString("Admin", null);
String user_ids = preferences.getString("userID", null);
menu.setHeaderTitle("Options");
menu.add(0, profile, 0, "Show Profile");
if (admin.equals("Admin")){
menu.add(0, add, 0, "Add Friend");
menu.add(0, pm, 0, "Send PM");
menu.add(0, warn, 0, "Send Warning");
menu.add(0, edit, 0, "Edit Post");
menu.add(0, delete, 0, "Delete Post");
menu.add(0, block, 0, "Block User");
}else if (data.get("pid").equals(user_ids)){
menu.add(0, edit, 0, "Edit Post");
}else{
menu.add(0, add, 0, "Add Friend");
menu.add(0, pm, 0, "Send PM");
menu.add(0, warn, 0, "Send Warning");
menu.add(0, block, 0, "Block User");
}
}
</code></pre>
<p>It errors out to </p>
<pre><code> view.showContextMenu();
</code></pre>
<p>But if I comment out the IF ELSE statements it works. Confused.</p>
| java android | [1, 4] |
76,267 | 76,268 | Trigger event automatically once per 24h / per user in ASP .NET Application | <p>What selection of solution do I have if I want to launch particular piece of code for logged in user, <strong>but not more often then once per day</strong> (it can change in the future to run once per 6 hours though). I though about setting a cookie that will store a date when code was launched the last time, but I still have to check that cookie's value with every request in global.asax when request start event is raised. Are there any other more efficient solutions?</p>
<p>Ah, and also that event result is particular JavaScript code being rendered to user's page. So I need <strong>HttpResponse</strong> instance when the event is launched.</p>
<p>Thanks,Pawel</p>
| c# asp.net | [0, 9] |
1,573,185 | 1,573,186 | Am I learning programming right? | <p>So I am at a faculty of computer science and was a bit occupied with some issue and have to speed up things a bit. But I still want to be able to learn the languages good, not just fast.</p>
<p>We were teached c, then oop in c++ in the first year. Now, we are being teached java. I started reading <a href="http://www.learncpp.com/" rel="nofollow">http://www.learncpp.com/</a> and I can say it is pretty good(I remembered some of the things I have forgotten, and learned new stuff), but is it enough to get started with java?(this is because I want to start with java after being finished with that tutorial)</p>
<p>The only thing that I don't know yet is oop(didn't get to that part of the tutorial yet) since I couldn't go to faculty when they teached that.</p>
<p>Am I doing it right or wrong?</p>
| java c++ | [1, 6] |
83,169 | 83,170 | Insert content of child of selector into another element on hover | <p>I would like to add the content of a hidden span that is nested in an "a" element into another element on the page. Ideally, I'd like the content of the span injected into the other element, not the span tags themselves.</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
$(".test").hover(function() {
var rolloverText = $(this).children("span");
$("#rollover_text").html(rolloverText);
});
});
</script>
</code></pre>
<p>And the html is like this:</p>
<pre><code><div id="rollover_holder">
<h3 id="your_family">Your Family</h3>
<div id="rollover_image_top_left">
<a href="#" class="test" title="Your Family"></a><span>test text</span>
</div>
</div>
<div id="rollover_text">
</div>
</code></pre>
<p>It doesn't seem to be working for me :(</p>
| javascript jquery | [3, 5] |
746,867 | 746,868 | How to focus main web page after opening a new window? | <p>I want to be able to focus the original page after opening a new window/tab, the same way as it's done on this website: <a href="http://www.vouchercodes.co.uk/laredoute.co.uk" rel="nofollow">http://www.vouchercodes.co.uk/laredoute.co.uk</a></p>
| javascript jquery | [3, 5] |
5,841,012 | 5,841,013 | jQuery function only inside a specific div ID | <p>I have the following function that I only want to run inside <code><div id="imgWrapper"></code></p>
<p>I have tried a few things with parent but I cannot seem to figure this out. </p>
<pre><code> <script type="text/javascript" language="javascript">
$(document).ready(
function () {
$("img").each(function () {
var src = $(this).attr("src");
if (src.substring(0, 1) == "/")
$(this).attr("src", "http://serverName.com/" + src.substring(1))
});
}
);
</script>
</code></pre>
| jquery asp.net | [5, 9] |
5,068,187 | 5,068,188 | Android Loop Images | <p>How do i loop this array, so that I do not have to write out 100 lines of images. I know it's simmple</p>
<pre><code>private String[] pics = {
//want to loop these
Constants.BASE_URL+"/bg/a/A1.jpg",
Constants.BASE_URL+"/bg/a/A2.jpg",
Constants.BASE_URL+"/bg/a/A3.jpg",
Constants.BASE_URL+"/bg/a/A4.jpg",
Constants.BASE_URL+"/bg/a/A5.jpg",
Constants.BASE_URL+"/bg/a/A6.jpg",
//
};
</code></pre>
| java android | [1, 4] |
3,621,434 | 3,621,435 | Multiple JQuery actions based on timer | <p>I have a testimonial box that has the testimonial within it, and then I have icons indicating whom provided the testimonial underneath. Connected to the box and right above the icon is a little arrow that can be generated via CSS or an image.</p>
<p>Every 5 seconds, it should change the testimonial content via a fade-in/fade-out, the little image should slide to the right, and the icon should fade to a colored version of the icon. At the end of the loop (when it reaches the 5th one), the arrow should slide all the way to the left and the loop should begin again.</p>
<p>I'm not too familiar with how I can do this with a loop efficiently, or how to time it. I know the basics of how I can fade it in and whatnot, but I'm lost on the rest. </p>
<p><img src="http://i.stack.imgur.com/6lUQD.jpg" alt="enter image description here">
Thank you very much!</p>
| javascript jquery | [3, 5] |
5,339,713 | 5,339,714 | Can't $_POST values from disabled Radio buttons | <p>I have two pages, in the first page I submit the form which contains Radio buttons.</p>
<p>From the second page, I try to read the responses from the Radio buttons using the $_POST.</p>
<p>The problem is when I hit submit, the $_POST in the second page reads NULL.
But when I'm not disabling the Radio buttons in the first page the $_POST form the second page reads the data from the Radio butons correctly.</p>
<p>Is there any solution to make the $_POST reads the values of disabled Radio buttons?</p>
<p>I'm using this Javascript code to disable the radio buttons when the user clicks on it:</p>
<pre><code>function disableRadio(groupName){
var radio=document.getElementsByName(groupName);
for(c=0;c<radio.length;c++)
radio[c].disabled=true;
}
</code></pre>
<p>Here is a simple code from each of the two pages.</p>
<p>Page1:</p>
<pre><code>echo '<form action="Page2.php" method="post">',
"<input type='radio' name='Question1' value='1' onClick='disableRadio(Question1)' />",
"<input type='radio' name='Question1' value='2' onClick='disableRadio(Question1)' />",
"<input type='radio' name='Question1' value='3' onClick='disableRadio(Question1)' />",
"<div><input type='submit' value='Submit'></div>",
"</form>";
</code></pre>
<p>Page2:</p>
<pre><code>$response=$_POST['Question1'];
echo $response;
</code></pre>
<hr>
<h2>Update to this question</h2>
<p>When using the ReadOnly attribute, the Radio buttons in the group are still click-able. So, I decided to Disable the other Radio buttons. Is there a better solution, as I don't want the user to have the feeling that he is able to change the answer.</p>
| php javascript | [2, 3] |
5,487,607 | 5,487,608 | Android SDK - java not found | <p>This problem was asked many times, but none of solutions doesnt help me.</p>
<p>I am using <code>Windows 7 SP1 (x64)</code>, <code>JDK 1.7.0_03 (x86)</code>, <code>JRE 7 (x86)</code> and <code>Android SDK Tools r16</code>.</p>
<p>When I install <code>Android SDK Tools</code> it says -</p>
<blockquote>
<p>Java SE Development Kit (JDK) version 1.7 has been found</p>
</blockquote>
<p>But after install <code>SDK Manager</code> closes instantly. <code>android.bat</code> and <code>find_java.bat</code> say - </p>
<blockquote>
<p>WARNING: Java not found in your path.</p>
</blockquote>
<p>I have tried set enviroment variables <code>JAVA_HOME</code>, <code>PATH</code> manually but this doesnt help. Searching solution many hours, setting variables, reinstalling java / sdk - nothing helps.</p>
<p>Thanks in advance.</p>
| java android | [1, 4] |
4,812,987 | 4,812,988 | Open excel file in asp.net | <p>I am trying to open a Excel(.xls) file from asp.net.The code i am using is given here.It is showing a save as dialog box which i don't want .Please help me !!!</p>
<pre><code> Response.ContentType = "application/xls";
Response.Flush();
Response.WriteFile(fileName);
Response.End();
</code></pre>
| c# asp.net | [0, 9] |
3,657,851 | 3,657,852 | Creating a for each loop on multitple letters using jquery | <p>im working on an mobile web application, which uses data from a .jsp page in the same directory. I made it possible to get formdata and put it in a variable using jQuery's .val().</p>
<p>now i have created an array of the input, and want to loop it using the $.each.
Only problem is when i try to create the loop, it separates every letter, instead of words..</p>
<p>This is the code i wrote:</p>
<pre><code>var entrylist= $('#entrylistForm').val ();
/* gettin the formvalue. This looks like this:
[{s.ENTRYID=1480565, s.SHEETID=131444777, s.ENTRYDATE=2012-14-04}]
*/
$.each (entrylist, function (key, value) {
alert( key + "=>" + value+"");
// ...
}
</code></pre>
<p>I'm tying to get the array like this:</p>
<pre><code>[0]ENTRYID=1480565,
[1]SHEETID=131444777, etc...
</code></pre>
<p>help anyone, i cant figure out what i'm doing wrong..</p>
<p>thnx in advance!</p>
| javascript jquery | [3, 5] |
3,766,496 | 3,766,497 | javascript error with label | <p>I have a function as follows:</p>
<pre><code>function textNext(element, num) {
document.getElementById("lblContent").innerHTML = "hello";
}
</code></pre>
<p>However, the text of the <code>lblContent</code> label won't change when the function is called. </p>
<p>What am I doing wrong?</p>
<p>btw : lblContent is of type asp:Label</p>
| javascript asp.net | [3, 9] |
289,399 | 289,400 | Android Custom button with imageview and textview inside? | <p>I'm looking to create a custom button. This button ideally would have an image on the left and a textview on the right. How would I accomplish this?</p>
| java android | [1, 4] |
1,015,562 | 1,015,563 | Passing Javascript variable to PHP not working | <p>I am trying to pass the value of a javascript variable to a php variable.</p>
<p>This is my code but it's not passing anything...</p>
<pre><code> <script>
var newVar = "2000";
<?php $value ?> = newVar;
</script>
</code></pre>
<p>Sorry, I need to javascript variable to be passing into php.</p>
<p>Code above turned round.</p>
| php javascript | [2, 3] |
4,400,953 | 4,400,954 | Populating data based on users selection | <p>How do you populate data coming from SQL server based on users request?</p>
<p>Example:</p>
<p>I have a page with about 50 links(all user links) and I want to be able to have the user click on their link and bring another page(template I believe) with all their data. The catch here is that I don't want to create 50 pages(one of each user).</p>
<p>How can I accomplish this in ASP.NET C#?</p>
| c# asp.net | [0, 9] |
4,720,925 | 4,720,926 | How to handle javascript events from a native android application? | <p>I have a native android application using which, I want to track the javascript events and method calls while an HTML page runs in the browser on Android phone. So basically, whenever a function-call/event is triggerred in javascript on a web-page in the browser, I want the browser to notify the native application about the function-call/event.
How can it be done??</p>
| java javascript android | [1, 3, 4] |
2,897,990 | 2,897,991 | jQuery $.each multiple div names | <p>Hello following problem,
i need the id attribute string for each div in a loop how i can make this ?</p>
<pre><code><div id="3r23r32_ProgressBar" class="upload-progress-bar"></div>
<div id="gfdgfdgfd_ProgressBar" class="upload-progress-bar"></div>
</code></pre>
<p>Here is my sample jquery code which does nothing -.-</p>
<pre><code>$.each("div.upload-progress-bar", function (index,value) {
alert(index);
$('#' + value + 'ProgressBar').animate({
'width': 10 + '%'
}, 250).animate({
'width': 25 + '%'
}, 250).animate({
'width': 65 + '%'
}, 250).animate({
'width': 95 + '%'
}, 250).animate({
'width': 100 + '%'
}, 250);
});
</code></pre>
| javascript jquery | [3, 5] |
3,912,184 | 3,912,185 | Select child of earlier clicked item in jQuery | <p>I have clicked on a div. In this div is an image:</p>
<pre><code><div class="grid_2 shareContent" id="facebook_45">
<a href="#">
<img class="facebook"
src="http://roepingen.kk/skins/admin/default/images/social/facebook.png"
alt="Facebook not shared" width="32px" height="32px" />
</a>
</div>
</code></pre>
<p>How can I change the image in the div?
I have the clicked item saved in the variable 'clicked'.
If possible I'd like to delete the link around the image also.</p>
| javascript jquery | [3, 5] |
1,412,696 | 1,412,697 | counting from textbox,asp.net | <p>How can I count characters in a TextBox using ASP.NET(C#)?</p>
| c# asp.net | [0, 9] |
5,306,180 | 5,306,181 | Total number with jquery | <p>How can total the number of characters between the <code>p</code> tags with jQuery?</p>
<p>I try as:</p>
<p><strong><a href="http://jsfiddle.net/TPFkF/" rel="nofollow">DEMO</a></strong></p>
<p>html:</p>
<pre><code><b>1</b>
<b>1</b>
<b>1</b>
</code></pre>
<p>js:</p>
<pre><code>var tBytes = 0,
tFiles = $('b').length;
for (var tFileId = 0; tFileId < tFiles; tFileId++) {
tBytes += $('b').text();
}
alert(tBytes); // Output is : 0111111111 I want output as: 3
</code></pre>
<p>What do i do?</p>
<p></p>
| javascript jquery | [3, 5] |
4,341,325 | 4,341,326 | Set margin for html body dynamically by obtaining viewport width | <p>I am trying to set margin of the id:main dynamically by obtaining viewport width. I have numerous blocks of same width in the page. So, i want to fit as many blocks as possible and centre them by dynamically calculating the remaining width. the block is of size 240px, 20px of padding </p>
<p>I have tried two codes, i'm stuck at this for a while.</p>
<pre><code>var width=$(window).width()
var stickies=Math.floor(width/240); //* calculate how many can fit in a row
var mrg=(width-(stickies*240)-20);//*calculating remaining width
var mrg=(width-(stickies*240)-20)/2;
var el1=$('#main');
var el2=$('#main');
el1.css('margin-left',mrg+'px');
el2.css('margin-right',mrg+'px');
var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body') [0],x=w.innerWidth||e.clientWidth||g.clientWidth;
var stickies=Math.floor(var x/240);
var mrg=(var x-(var stickies*240)-20)/2;
var el1=$('#main');
var el2=$('#main');
el1.css('margin-left',mrg+'px');
el2.css('margin-right',mrg+'px');
</code></pre>
| javascript jquery | [3, 5] |
736,191 | 736,192 | jQuery, Uncaught TypeError | <p>I have some javascript code on my webpage that is loading some divs onto the page. I also want to add onmouseenter, and onmouseleave event handlers to each div. I am using jquery to add these handlers, but i get the error:</p>
<blockquote>
<p>"Property '$' of object [object DOMWindow] is not a function"</p>
</blockquote>
<p>My code looks like this, it is in a for loop:</p>
<pre><code>var newItem = document.createElement('div');
newItem.innerHTML = results[i];
newItem.setAttribute("id", "resultDiv_" + i.toString());
dropDown.appendChild(newItem);
//Error on next line...
$("resultDiv_" + i.toString()).bind("mouseenter", function() {
$("resultDiv_" + i.toString()).css({ 'background-color': 'blue' });
});
</code></pre>
<p>Does anyone have any ideas why i am getting this error, or even what the error means?</p>
| javascript jquery | [3, 5] |
3,639,670 | 3,639,671 | Get values of a textbox changed by javascript | <p>strange bug:</p>
<p>i have an ajax datepicker added to a text box of my form.</p>
<p>i submit the form.. and I could receive all values excepting those of the datepicker checkboxes.</p>
<p>why is the .Text property empty of this elements?</p>
<p>Thanks</p>
| c# asp.net javascript | [0, 9, 3] |
4,204,393 | 4,204,394 | Passing variables from php to javascript (Safely) | <p>I have been struggling with this kind of problem for a while now, and cannot seem to find any information or sample code to transfer some data between PHP and JavaScript.
I saw many ways to do it, but not safely. What I mean exactly is , when you transfer some variable data between the systems, it is directly shown on the view-source window of your page, when it is loaded. What need exactly is a way to transfer the data, but silently and safely , so that it won't show up on the user-side when the page is loaded. </p>
<p>So in brief, is there a way to do this, and possible how ?</p>
<p>I have already tried, transferring the data with a XML file, JSON also, straight forward with echo + , or just after the ?> abbreviation in php. But every way I have used so far, is displayed in the source code of the page when loaded .</p>
| php javascript | [2, 3] |
3,898,672 | 3,898,673 | How can i change the background color or apply an color to an Item in Drop down list | <p>Hi all i am having a drop down list with some items now while checking the items from the list and if that item exists in the drop down i would like to apply color for that particular item.</p>
<p>Assume i have my drop down as follows</p>
<pre><code> 123
1234
12345
</code></pre>
<p>Now if i found <code>123</code> i would like to apply color for that particular element any help please</p>
| c# asp.net | [0, 9] |
3,654,681 | 3,654,682 | Making grid set size no matter how many words are in it | <p>I have a list of 3 letter words that dynamically generate a grid. </p>
<p>The problem is I need a 6x6 grid, and if there is not enough words in the list to facilitate a 6x6 (12 words) then it won't be the size needed, and only be a grid as big as the words in it. </p>
<p>How can I make it so it always produces a 6x6 grid, randomly generates positions for the words and fills the gaps with empty cells?</p>
<pre><code>var listOfWords = {};
var ul = document.getElementById("wordlist");
var i;
for(i = 0; i < ul.children.length; ++i){
listOfWords[ul.children[i].getAttribute("data-word")] = {
"pic" : ul.children[i].getAttribute("data-pic"),
"audio" : ul.children[i].getAttribute("data-audio")
};
}
console.log(listOfWords);
var shuffledWords = Object.keys(listOfWords).slice(0).sort(function() {
return 0.5 - Math.random();
}).slice(0, 12);
var guesses = {}
console.log(shuffledWords);
var tbl = document.createElement('table');
tbl.className = 'tablestyle';
var wordsPerRow = 2;
for (var i = 0; i < Object.keys(shuffledWords).length - 1; i += wordsPerRow) {
var row = document.createElement('tr');
for (var j = i; j < i + wordsPerRow; ++j) {
var word = shuffledWords[j];
guesses[word] = [];
for (var k = 0; k < word.length; ++k) {
var cell = document.createElement('td');
$(cell).addClass('drop').attr('data-word', word);
cell.textContent = word[k];
// IF FIREFOX USE cell.textContent = word[j]; INSTEAD
row.appendChild(cell);
}
}
tbl.appendChild(row);
}
document.body.appendChild(tbl);
</code></pre>
<p>I have tried this, but cannot get it to work....</p>
<pre><code>while(listOfWords.length < 12)
listOfWords.push(" ");
</code></pre>
| javascript jquery | [3, 5] |
2,947,689 | 2,947,690 | Displaying DOM element events and their handlers | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2623118/inspect-attached-event-handlers-for-any-dom-element">Inspect attached event handlers for any DOM element</a> </p>
</blockquote>
<p>Is there a tool - such as a browser extension, jQuery console script, bookmarklet or Firebug plugin - that displays all events that can be fired by a particular DOM element, and include any event handlers currently listening to those events?</p>
| javascript jquery | [3, 5] |
5,595,815 | 5,595,816 | It scrolls to the top of the page after clicking | <p>I have this code to switch a switching button image:</p>
<pre><code>$("#invio_scatola_on, #invio_scatola_off").click(function(){
$("#invio_scatola_off").toggle();
$("#invio_scatola_on").toggle();
});
</code></pre>
<p>when it is executed, the browser goes to the top of the page. why?</p>
| javascript jquery | [3, 5] |
4,601,093 | 4,601,094 | How to Upload User Profile image and show it | <p>i am working on a project in which i have registration form in which i want to upload a user image . i have done upload work and store it in a folder. but i am confused how to show it when user open his account. please give idea in c# regards.</p>
| c# asp.net | [0, 9] |
1,041,818 | 1,041,819 | javascript countdown clock | <p>im trying to write a countdown clock to a certain day in js. I have the following which works if i output it to the page but I cant seem to write it to a div using innerhtml?</p>
<p>Can anybody see where im going wrong? </p>
<pre><code>today = new Date();
expo = new Date("February 05, 2012");
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (expo.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
document.getElementById('cdown').innerHTML = document.write(daysLeft);
</code></pre>
| javascript jquery | [3, 5] |
1,219,364 | 1,219,365 | embedded video in asp:ListView | <p>I've a <code>Link</code> field. The sample value of <code>Link</code> like this : <code>https://vimeo.com/62941191</code></p>
<p>I want to bind <code>Link</code> in <code>asp:ListView</code> and show video inside it. Don't know how to show video. Can somebody tell me?</p>
| c# asp.net | [0, 9] |
1,193,231 | 1,193,232 | Can you explain this jQuery method? | <p>Trying to understand how jquery works under the covers, what's the difference between:</p>
<p>jQuery.fn and jQuery.prototype</p>
<pre><code>jQuery = window.jQuery = window.$ = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
</code></pre>
<p>and then:</p>
<pre><code>jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
</code></pre>
| javascript jquery | [3, 5] |
2,354,944 | 2,354,945 | DropdownList with Multi select option? | <p>I have a DropDownList as following</p>
<pre><code><asp:DropDownList ID="ddlRoles" runat="server" AutoPostBack="True" Width="150px">
<asp:ListItem Value="9" Text=""></asp:ListItem>
<asp:ListItem Value="0">None</asp:ListItem>
<asp:ListItem Value="1">Ranu</asp:ListItem>
<asp:ListItem Value="2">Mohit</asp:ListItem>
<asp:ListItem Value="3">Kabeer</asp:ListItem>
<asp:ListItem Value="4">Jems</asp:ListItem>
<asp:ListItem Value="5">Jony</asp:ListItem>
<asp:ListItem Value="6">Vikky</asp:ListItem>
<asp:ListItem Value="7">Satish</asp:ListItem>
<asp:ListItem Value="8">Rony</asp:ListItem>
</asp:DropDownList>
</code></pre>
<p>I want to select Multiple name at once suppose I want to select Ranu Mohit or Ranu Kabeer Vikky, How its possible?</p>
| c# asp.net | [0, 9] |
3,123,304 | 3,123,305 | error message in asp.net c# | <p>if you please help me out i can not find out whats wrong with the above code since i am learning on my own asp.net c# with the above code:</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
try
{
Response.Write("<script>");
Response.Write("alert('Organizer added!');");
Response.Write("</script>");
}
catch (Exception Ex)
{
Response.Write(Ex.Message);
}
}
</code></pre>
<p>thanks in advance </p>
| c# asp.net | [0, 9] |
5,301,158 | 5,301,159 | Highlight table row with some background color | <p>I am using rails3 and on my page i am iterating a loop which have some records and i want when </p>
<p>user click on some row its color will be green and when he again click some row its color will </p>
<p>be green and the color of previous highlighted row should be none.</p>
<p>Thanks in advance</p>
<p>My code is like this </p>
<pre><code> <div class="top-heading-detail-admin">
<div class="table-headings">
<div class="email-admin"><p>Email</p></div>
<div class="date-admin"><p>Date Added</p></div>
<div class="added-by-admin"><p>Added by</p></div>
</div>
<div id="checkbox_list">
<% @users.each do |user| %>
<div class="email-admin-detail"><%= user.email %></div>
<div class="date-admin-detail"><%= user.created_at.strftime("%m/%d/%Y") unless user.created_at.blank? %></div>
<div class="added-by-admin-detail"><%= user.added_by %></div>
</div>
<% end %>
</div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
2,640,271 | 2,640,272 | JQuery: How to AutoComplete "City, State"? | <p><strong>Question</strong>: How can you use the <a href="http://docs.jquery.com/Plugins/Autocomplete">JQuery Auto-Completion plugin</a> to suggest a location (<code>"City, State"</code>) for an input field?</p>
<p>Meaning, someone wants to type in <strong>"Chicago, IL"</strong> ... so they begin typing <code>"Chi"</code> and it auto-suggestions <code>"Chicago, IL</code>".</p>
<p><em>My biggest hurdles is finding a service that I can query to find out all US city+state names.</em></p>
<p>I essentially want to do what the StackOverflow "Tags" input form works but form "City, State" auto completion.</p>
| javascript jquery | [3, 5] |
390,302 | 390,303 | Is it possible to read a PHP session using Javascript? | <p>I am using cakePHP 1.26.<br/>
In a controller, I got a function which contains these lines of code:<br/></p>
<pre><code>$this->Session->write('testing', $user);
$this->Session->read('testing');
</code></pre>
<p>Now the system wrote a session and stored on the server.
Is it possible to use Javascript or Jquery to read the session named 'testing' ?</p>
| php jquery | [2, 5] |
4,401,664 | 4,401,665 | How to pass javascript prompt value to a view | <p>Is there a way to pass a js popup value directly to a python/django view, or is necessary to capture this value with a javascript function and then do an ajax call?</p>
<p>For example:</p>
<pre><code><form>
<input type="text" name="name"/>
<input type="submit" id="submit"/>
</form>
<script type="text/javascript">
function myFunction() {
$('#submit').click(function() {
var name=prompt("Please enter your name","");
});
}
</script>
</code></pre>
<p>If it can be done directly, how would this be done?</p>
| javascript jquery python | [3, 5, 7] |
606,735 | 606,736 | why an object created in the code behind is not available in the aspx page? | <p>I have a simple question. When we create an object in the code behind(".aspx.cs"), why is it not available in the aspx page.</p>
<p>For example, if I have a class(present in another .cs file and not in the code behind) and in that class I have a property declared, lets say "Name". </p>
<pre><code>namespace BLL.SO
{
public class SOPriceList
{
private string _name;
public string Name
{
get { return _name;}
set { _name = value; }
}
}
}
</code></pre>
<p>Now when I create an object, lets say "obj" in the code behind(".aspx.cs"), with scope within the partial class.</p>
<pre><code>namespace Modules.SO
{
public partial class PriceListRecordView : PageBase
{
SOPriceList obj = new SOPriceList();
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
</code></pre>
<p>Using this object "obj" I can access the property. Then why can't I use the same object "obj" to get the property in the aspx page in this manner,</p>
<pre><code><%= obj.Name%>
</code></pre>
| c# asp.net | [0, 9] |
3,280,711 | 3,280,712 | How to improve performance of inserting text into an HTML element? | <p>In Firefox, I am inserting text into ~500 DIVs using this code:</p>
<pre><code>$(".divs").text("default"); // ~500 DIVs
</code></pre>
<p>On my computer, this consistently takes <strong>9ms</strong> <em>if the DIVs are empty</em>. However, this same code consistently takes <strong>18ms</strong> <em>if the DIVs already contain text</em>.</p>
<p>Why is it that an empty DIV is 2x faster at inserting text (does jQuery need to empty the DIV first)? And, is there any way to improve the performance of replacing text in a DIV that already contains text?</p>
<p>Note: In IE 7, the speed differences were not as dramatic. Inserting text in an empty DIV was about 1.5x faster.</p>
| javascript jquery | [3, 5] |
5,754,905 | 5,754,906 | What JavaScript/JQuery syntax is this? | <p>I have no idea how to search for this so I'm asking here.</p>
<p>I've inherited a project and no one that's here knows what this syntax trick is called.</p>
<p>There's a select drop down change event that will call a function if one or another specific value is selected from among the list.</p>
<pre><code>$('#accordion select[name=x_range]').change(function(){
$('#custom-time')[$(this).val() == 'custom' ? 'show' : 'hide']();
$('#custom-time-to-now')[$(this).val() == 'custom_to_now' ? 'show' : 'hide']();
updateTimeIntervalOptions();
}).triggerHandler('change');
</code></pre>
<p>In this the show or hide function is called on the <code>#custom-time</code> or <code>#custom-time-to-now</code> divs.</p>
<p>What is calling functions like this called?</p>
<p>EDIT:<br>
I should have said that I understand ternary if/else, but not the <code>$(selector)[function_name]()</code> part.</p>
| javascript jquery | [3, 5] |
3,108,581 | 3,108,582 | .Net Control Library Embeded CSS and Web.Config Page theme | <p>I have one control library which built runtime custom infobox control. </p>
<p>There is one CSS file embedded in this control library which works properly for my few modules. But, in one of my module it loads WebResource.axd in the client browser but unable to apply classes over any control. I have opened AXD file and all the defined classes exists. </p>
<p>Then, I found the root cause of this issue. In my this project we use page theme in the web.config file, where this embeded css file doesnt work. </p>
<p></p>
<p>When I remove this tag from my web.config file, hence its started applying all the declared classes under embeded css file.</p>
<p>Please help me on this. How can I get rid of this kind of problem. </p>
| c# asp.net | [0, 9] |
4,644,905 | 4,644,906 | Special character on Http Request | <p>I am new to Android platform and trying to establish a http request but My Url contains some special characters So it is throwing an Exception.How to Avoid this problem.I did same thing In i-phone Using
[mystring stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]</p>
| java android | [1, 4] |
248,091 | 248,092 | Passing parameters stored in Javascript Object to jQuery .load page | <p>I am using Ben Alman's jQuery BBQ to get the current page Querystring and Hash Values and storing them in a Javascript object using the following code:</p>
<pre><code>var params = $.deparam.querystring();
var paramsHash = $.deparam.fragment();
</code></pre>
<p>These are all being set correctly; if I <code>console.log</code> them I get the returned values:</p>
<pre><code>distance "0.1"
floorFrom "0"
floorTo "1000"
floorUnit "1"
ipp "10"
locationName "London"
location_val "LK||001"
tab "3"
</code></pre>
<p>Now what I want to do is pass these values to a page using a jQuery .load call.</p>
<p>At the moment I am using the code below</p>
<pre><code>$('#result').load('mypage.php', { querystringData : params, hashData : paramsHash }, function()
{
...
}
</code></pre>
<p>Obviously though this is passing the data to mypage.php as: <code>querystringData[locationName]=London</code></p>
<p>I need it to be passed through as <code>locationName=London</code> etc but unsure the best way to achieve this.</p>
<p><strong>Update, adding clarification, copy of comment made on answer below</strong></p>
<p>The thing I want to move away from is using querystringData and hashData in the .load call. If I was to write it all out it would look something like: </p>
<pre><code>$('#result').load('mypage.php', { distance : '0.1', floorFrom: '0', floorTo : '1000', floorUnit : '1', ipp : '10', locationName : 'London', location_val : 'LK||001', tab : '3' }
</code></pre>
<p>I don't know how to get the values out the object and display them in the .load call like that. The other problem is that I will add and remove querystring values so I don't think it is something I can hardcode.</p>
| javascript jquery | [3, 5] |
5,329,016 | 5,329,017 | JavaScript: Assign an object to another object | <p>I'm trying to assign the local var <code>UgcItems</code> to <code>uploadedItems</code> but when I try to return the value I get <code>undefined</code>. If I put the <code>console.log</code> inside of the <code>.getJSON</code> then I get the appropriate value. The problem with that is that the scope is inside of the function. What can I do to get the JSON out of the function?</p>
<pre><code>$(function(){
var uploadedItems;
$.getJSON("GetExistingUgcItems?workItemId=1", function (UgcItems) {
uploadedItems = UgcItems;
});
console.log(uploadedItems);
});
</code></pre>
<p>Thank you,</p>
<p>Aaron</p>
| javascript jquery | [3, 5] |
49,636 | 49,637 | Android - Black Screen after clicking BACK in an Activity with an AltertDialog after Search Activity | <p>I have an Activity which displays an alert dialog priot to the content.
Also a search activity is called before this activity.</p>
<p>Now when i press back on this activity i am lead to a black screen (which i assume is eighter because of the dialog [unlikely] or from the search activity). Only when i press BACK twice i get to the activity i was before.</p>
<p>How can i get rid of this?</p>
<p>Thank you.</p>
| java android | [1, 4] |
1,078,501 | 1,078,502 | JavaScript Namespace with jQuery | <p>How do you manage namespace for a custom JavaScript library depends on jQuery?</p>
<p>Do you create your own namespace, say <code>foo</code> and add your objects there? e.g. <code>foo.myClass, foo.myFunction</code></p>
<p>Or do you add your objects to jQuery's namespace? e.g. <code>jQuery.myClass, jQuery.myFunction</code></p>
<p>Which is the more common practice and why?</p>
| javascript jquery | [3, 5] |
506,940 | 506,941 | Jquery: Adding toggle action to drop down menu | <p>I am trying to create my own drop down navigation that expands when an arrow is clicked (for now just a > within a span)</p>
<p>My script cycles through a series of <code><li></code>s and checks if any have a child <code><ul></code> within them. If a <code><ul></code> is detected it then appends <code><span class='submenuarrow'> ></span></code> to the parent <code><li></code> so the user can click something to expand the menu. This works ok up until the toggle - the submenarrow span appears but does nothing when clicked.</p>
<p>Is this because I am using find to locate the an appended element? Im I doing anything else wrong?</p>
<p>My full script is:</p>
<pre><code>$("#menu ul li").each(function() {
var sub = $(this).find("ul");
//IF UL IS DETECTED
if (sub.size() > 0) {
//APPENDS ARROW TO LI
$(this).append("<span class='submenuarrow'> ></span>");
//ADDS TOGGLE
$(this).find("span").click(function() {
$(this).find("ul").toggle("slow");
});//END TOGGLE
}//END IF
});//END EACH
</code></pre>
| javascript jquery | [3, 5] |
5,842,245 | 5,842,246 | calling php file from jquery at specific interval | <p>i have following variables in jquery</p>
<pre><code>var uemail="[email protected],[email protected],[email protected]";
var subj="test message";
var text="<b>This is Email Body Text</b>";
</code></pre>
<p>i have one PHP file named "email.php" to send email</p>
<pre><code><?php
$email =$_GET['email'];
$subject =$_GET['subj'];
$message = $_GET['text'];;
if(mail($email, $subject, $message, "From: $email"))
echo "1";
else
echo "0";
?>
</code></pre>
<p>what i want to do is</p>
<p>call email.php for number of time i have email address in variable uemail and each time pass email,subj,text to email.php and print result on page that with 10 Sec interval Between each time email.php called.</p>
<blockquote>
<p>[email protected] (ok)<br>
[email protected] (Error)<br>
[email protected] (ok)</p>
</blockquote>
<p>Thanks</p>
| php javascript jquery | [2, 3, 5] |
4,911,396 | 4,911,397 | PHP code to open new resized window | <p>I am not very well versed in PHP code, but I have an overall goal I hope someone can help me with. I have this code snippet from my site:</p>
<pre><code>$show = false;
if($this->_general['post_ci_linkedin_show'])
{
$url = urlencode(get_permalink($post->ID));
$title = urlencode($post->post_title);
$source = urlencode(get_bloginfo('url'));
$surl = $this->_general['post_ci_linkedin_url'];
$surl = str_replace('[%url]', $url, $surl);
$surl = str_replace('[%title]', $title, $surl);
$surl = str_replace('[%source]', $source, $surl);
$out .= '<a class="icon" href="'.$surl.'" rel="LinkedIn"><img class="unitPng" src="'.get_bloginfo('template_url').'/img/icons/community/comm_LinkedIn.png" /></a>';
$show = true;
}
</code></pre>
<p>Which produces:</p>
<pre><code>src="http://www.websitename.com/subpage/mypage"
</code></pre>
<p>It produces other things obviously, like rel="blah" and such, but this is the part I want to tweak.</p>
<p>I want to change the PHP code snippet above so that the end result is:</p>
<pre><code>href="javascript:void window.open('http://www.websitename.com/subpage/mypage','', 'height=700,width=500');"
</code></pre>
<p>I am just not sure of which parts of this code to change to get this result, I have tried just pasting it around the <code>.$surl.</code> but it gave me an error on my whole page.</p>
<p>Thanks!</p>
| php javascript | [2, 3] |
1,438,071 | 1,438,072 | GridView Databinding and Paging | <p>What is the best way to retrieve records from the database?
Currently we are grabbing all of them, caching them, and binding them to our GridView control. We incorporate paging using this control.
So what would be better? Retrieving all the records like we are currently doing, or just retrieving the records needed using an index and row count.</p>
| c# asp.net | [0, 9] |
2,497,805 | 2,497,806 | Suggestions for a menu application (PHP & Javascript) | <p>I'm currently building a menu application for my final year project at university.</p>
<p>And would like to forum ideas for how I will display the order being placed, back to the customer....</p>
<p>A few ideas i have is using a normal textarea for example when a menu choice is clicked</p>
<pre><code>document.getElementById('order').innerHTML += menuOption + "\t" + price + "\n";
</code></pre>
<p>But at the same time that leaves much thought for allowing the user to delete the a certain line of the text area and denominate from the subtotal, tax & total.</p>
<p>Another idea was to maybe use plain text in a div with the same logic as above only with [cancel item] next to it, which would delete the object instance?</p>
<p>Im not sure how to go about it, so just looking for ideas
Cheers</p>
| php javascript | [2, 3] |
3,957,597 | 3,957,598 | Why is .val() not a function? | <p>I have a dynamic form where the user provides a name and description:</p>
<pre><code><label>Name</label><br />
<input type="text" name="name[]" maxlength="255" /><br />
<label>Description</label><br />
<textarea name="desc[]"></textarea><br />
</code></pre>
<p>I am trying to validate the form with Javascript to ensure that if the name is specified, then a description must be entered.</p>
<pre><code>$("input[name='name[]']").each(function() {
var index = $("input[name='name[]']").index(this);
if ($(this).val() != '') {
alert($("textarea[name='desc[]']").get(index).value);
alert($("textarea[name='desc[]']").get(index).val());
}
}
</code></pre>
<p>The first alert() works as expected however with the second alert I get:
$("textarea[name='desc[]']").get(index).val() is not a function</p>
<p>What is the difference? Why can't I use the jQuery function?</p>
| javascript jquery | [3, 5] |
2,146,691 | 2,146,692 | Mapping variables from a string formula | <p>I have a textarea where user can create a dynamic formulas using dropdown lists(for operators, variables etc) like this:</p>
<pre><code>basic / workingDays * attendingDays
</code></pre>
<p>where values of <code>basic</code>, <code>workingDays</code>, <code>attendingDays</code> are saved in database. I want to map these variable from database during runtime. How can I do this.</p>
| c# asp.net | [0, 9] |
5,180,336 | 5,180,337 | Help passing GET data to a php file in the same location as my Java applet | <p>I have a java applet trying to pass some GET data to a php file in the same directory as my applet. When I start a url connection to the file.php and pass the data, I don't get anything, however when I append the full URL in front of the PHP file, it works.</p>
<p>Here's what I have:</p>
<pre><code>URL sp = new URL ("file.php?data1=" + data1 + "&data2=" + data2 + "&data3=" + data3);
BufferedReader in = new BufferedReader(new InputStreamReader(sp.openStream()));
</code></pre>
<p>But, the data only gets passed if i add my full <a href="http://www.website.com/" rel="nofollow">http://www.website.com/</a> url in front of file.php</p>
<p>EDIT:
It works now, with a URL test = new URL(getCodeBase(), "form.php");</p>
| java php | [1, 2] |
5,246,029 | 5,246,030 | Changing Android Device name in code | <p>I am trying to change the name of the Android Device that my program that is currently running on because the name of the device will contain information that is relevant when it communicates with other phones. The name of the phone will be constantly changed as phone scans for other phones and calculates information. Any ideas on how to change the name of the phone within the java code? I can't image it being more than a few lines of code, but I can't find anything.
Thanks in advance.</p>
| java android | [1, 4] |
153,787 | 153,788 | Why does an AJAX call sometimes redirect the page? | <p>I have a page that contains 3 iframes, the top header, left navigation and the content iframe.</p>
<p>(this is a legacy application).</p>
<p>The page that contains the 3 iframes makes an jQuery AJAX call to a page: </p>
<p><code>/users/getNotifications.aspx</code></p>
<p>Sometimes (I believe when I am not logged in) the browser redirects to the URL of my AJAX call i.e. localhost/users/getNotifications.aspx</p>
<p>I obviously don't want it to redirect like this, any idea why this may be happening?</p>
<p>Note:</p>
<p>My page responds with:</p>
<pre><code> Response.ContentType = "text/html";
Response.Write(resultInHtml);
</code></pre>
<p>Also, the page doesn't redirect if the user isn't logged in.</p>
<p>This is the method I call to get the data using an ajax requesT:</p>
<pre><code>var x = function () {
$.ajax({
type: "GET",
url: webRoot + "users/getNotifications.aspx",
cache: false,
success: function (payload) {
if (payload.length > 0) {
$("#users-popup").html(payload);
}
displayPopup();
}
});
}
</code></pre>
| javascript jquery asp.net | [3, 5, 9] |
4,068,920 | 4,068,921 | How to check the existance of a value from asp designer page? | <p>I'm getting a list of string from db like:</p>
<pre><code>AddCustomer,
AddUser,
ListCustomer,
ListUser
</code></pre>
<p>These are the prefix of asp pages.
I need to hide and show certain pages in the page. Following is the html snippet:</p>
<pre><code><li>Customer Management
<ul>
<%if (AddCustomer) //how to check whether my string is present or not, is it possible?
{ %><li><a href="AddCustomer.aspx">Add Customer</a></li><%} %>
<li><a href="ListCustomer.aspx">List Customer</a></li>
</ul>
</li>
</code></pre>
| c# asp.net | [0, 9] |
5,797,946 | 5,797,947 | Key events on a custom android View object | <p>I have a class that extends <code>View</code> and I wish to add some effects for <code>onKeyDown</code> events so I can change the colour of the item etc.</p>
<p>I have the following code in my class:</p>
<pre><code>@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.v("keydown", "event");
super.onKeyDown(keyCode,event);
if(event.getAction() == KeyEvent.ACTION_DOWN) {
return true;
}
return super.onKeyDown(keyCode, event);
}
</code></pre>
<p>I'm trying to override the parent <code>onKeyDown</code> method but I cannot get this to work... The log is not displayed. Is it possible to add methods for changing a view item appearance within its own class?</p>
| java android | [1, 4] |
5,004,811 | 5,004,812 | Validation check with jQuery | <p>In my aspx page, am using some validation controls like required field validator, if I click on save button If the particular field is empty, the validation error fires.</p>
<p>And if I fill that particular field and give tab out, that validation error automatically disappears. My query here is, is it possible to display any message using jQuery or anyother method, until the validation error disappears.</p>
<p>Whenever the validation error appears in that page the message should appear, and if we clear the validation error that message should disappear automatically.I dont know how to do this, coz I dont have much knowledge in jQuery.</p>
<p>Can anyone help me here, thanks in advance</p>
| jquery asp.net | [5, 9] |
3,087,733 | 3,087,734 | Start view drag after adding to parent | <p>Okay so I am working with 2 separate views in android, one that has a list of things (We will call this the listview, this is a linear layout contained in a horizontal scroll view), and another that shows a display of items (the mainview). The idea is that when you long press on something from the list, it adds a view to the mainview, and then the users can drag/drop the view wherever they want. While the user is dragging the item over the main screen I want it to update, showing them what it will look like when they drop the view. The code that I have is the following:</p>
<p>In the listivew (In a longClickListener for a list item)</p>
<pre><code>public boolean onLongClick(View v) {
ClipData data = ClipData.newPlainText("data", "asdf");
DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(icon_view);
v.startDrag(data, shadowBuilder, v, 0);
return false;
}
</code></pre>
<p>And then in the main view:</p>
<pre><code>rloverlay.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch( event.getAction() ) {
case MotionEvent.ACTION_MOVE:
Log.v("Overlay", "On Touch Moving");
}
return false;
}
});
</code></pre>
<p>The only problem is that the view doesn't actually recieve onTouch events unless you started the clicking on that view (Even if it you are still touching the screen when you move over top of the mainview). So I am unable to recieve the ACTION_MOVE events unless I click again on the view (thus ending the drag).</p>
<p>Is there a way to make onTouch start recieving the ACTION_MOVE events even though I started the click from somewhere else.</p>
<p>Thanks a bunch.</p>
| java android | [1, 4] |
2,117,932 | 2,117,933 | set a particular option in a select box using jquery | <p>I'm unable to perform the desired event.</p>
<pre><code> <?php
include_once 'includes/db.php';
$result = mysql_query('SELECT country,code FROM countries') or die(mysql_error());
echo '<select id="CountryCode">';
echo '<option value="Select">Select</option>';
while ($row = mysql_fetch_array($result))
{
echo '<option value=$row["country"]>'.$row['country'].'</option>';
}
echo '<option value="Other">Other</option>';
echo '</select>';
?>
<input id="country" type="hidden" value="IN"/>
<script>
$(function()
{
$('#CountryCode').val($('#country').val());
});
</script>
</code></pre>
<p>Everything works fine. But the desired item is not selected in the select box</p>
| javascript jquery | [3, 5] |
1,854,777 | 1,854,778 | fire .change with keyup and keydown | <p>I have the following which works as long as I use the mouse to select an option from the selectbox, or use keyboard arrow keys to select the option, but when using the keyboard, the change event does not fire until I press enter on the keyboard.</p>
<p>How would I detect a change using the keyboard arrow keys without having to press enter?</p>
<pre><code>$('#select_box').change(function() {
some_function($(this).val());
});
</code></pre>
| javascript jquery | [3, 5] |
5,924,592 | 5,924,593 | ASP.NET Learning Path for a PHP Programmer | <p>I'm a beginning PHP programmer with little real-world experience (haven't even graduated yet), but I'd like to learn ASP.NET to possibly qualify for twice as many jobs in web development as opposed to knowing just PHP and having seen far too many <code>!== false</code> I love the idea of working with a strongly-typed language. I started using the MVC framework CodeIgniter recently, but I can write PHP without a framework, too. I also like to be in control of my HTML. I read an ASP.NET/C# book a couple of months ago, but somehow Web Forms just don't "click" for me. What approach would you recommend for a PHP programmer to ease into ASP.NET?</p>
| php asp.net | [2, 9] |
3,552,936 | 3,552,937 | Replace the first line of a file in android | <p>Hello
In my android application i would like to replace my first line of a txt file with some other data.
Is there any way that i can do this.</p>
<p>Please let me know your valuable suggestions.</p>
<p>Thanks in advance :)</p>
| java android | [1, 4] |
4,549,551 | 4,549,552 | dropdownlist bind datatext field with a calculation | <p>I have a datatable with one column that is taken from DB</p>
<pre><code>DataTable dt = ent.GetDataTable();
</code></pre>
<p>I am binding it to dropdownlist with </p>
<pre><code>ddl.Datasource = dt;
ddl.datatextfield = "Test";
ddl.DataBind();
</code></pre>
<p>Now i want multiply each value in that column by 1000 and bind to dropdownlist. Is there a way to do this with out looping and changing each value.
I cannot modify the method or query that calls getdatatable() because these are predefined and used in many places.</p>
| c# asp.net | [0, 9] |
1,903,310 | 1,903,311 | not entering in Jquery function | <p>I am pretty new to jquery, my problem is that I have done jquery function in a page which inherits from master page. For some reason the function is totally ignored as if there is nothing and the page is loaded without any script. </p>
<p>Do I need to do something in the page load in the code behind? Underneath I am showing the function;</p>
<pre><code><script type="text/javascript">
var index = 0;
var images = [
'child.jpg',
'girl.gif',
'sponsor.jpg'
];
$('#Image1').attr('src', 'Resources/ChildrenImages/' + images[0]);
setInterval(change_image, 5000);
function change_image() {
index++;
if (index >= images.length)
index = 0;
$('#Image1').attr('src', 'Resources/ChildrenImages/' + images[index]);
}
</script>
</code></pre>
| c# jquery | [0, 5] |
4,510,275 | 4,510,276 | Sometimes imagebutton click event not fired | <p>I have a method that add's an onclick event too an imagebutton.
But sometimes you have to press the button multiple times before the "pop-up" window opens.
Any idea why this happens?</p>
<p>this is my code were I add the event to my imagebutton:</p>
<pre><code>private void AddProjectDetails()
{
ImageButton imgBtn;
HiddenField hfld;
String ProjectNumber;
for (int i = 0; i < GridViewProperties.Rows.Count; i++)
{
hfld = GridViewProperties.Rows[i].FindControl("HiddenProjId") as HiddenField;
imgBtn = GridViewProperties.Rows[i].FindControl("ibtnShowExtra") as ImageButton;
ProjectNumber = hfld.Value;
imgBtn.Attributes.Add("onclick", "window.open('ProjectDetails.aspx?ProjectNumber=" + Server.UrlEncode(ProjectNumber) + "','Graph','height=590,width=600,left=50,top=50,scrollbars=yes'); return true;");
}
}
</code></pre>
| c# asp.net | [0, 9] |
4,927,717 | 4,927,718 | web-development: how to display an increasing number of messages? | <p>I want to build a website that display changing text-messages.</p>
<p>The server gets the text-messages from a DB.
I wanted to grab a chunck of msgs, shufle them and send them to the client to present each of them. When the client is done with the current chunck he asks the server for the next chunck.</p>
<p>can some one help me with client side psudou-code?
I though to use asp.net ans JS but I'm newbie to JS.</p>
| c# javascript asp.net | [0, 3, 9] |
2,899,123 | 2,899,124 | AndroidHttpClient cannot be resolved to a type | <p>I'm very new to Android development (just started today), and also very new to Java development, although I've been programming C# for several years.</p>
<p>I'm trying to make an HTTP request using the <a href="http://developer.android.com/reference/android/net/http/AndroidHttpClient.html" rel="nofollow"> AndroidHttpClient</a>, but my code won't even compile.</p>
<p>Eclipse simply highlights the line of code and says, <code>AndroidHttpClient cannot be resolved to a type</code>. </p>
<p>Here's the code I'm using:</p>
<pre><code>package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.net.*;
import android.net.http.*;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AndroidHttpClient client = new AndroidHttpClient();
}
}
</code></pre>
<p>I started with an empty Android project after installing the Android SDK and the ADT. What am I missing? </p>
| java android | [1, 4] |
2,077,686 | 2,077,687 | c# control names | <p>Is there a way to control how .Net sets the <code>Name</code> and <code>ID</code> property of my controls? I have some radio buttons for which I need the name to be the same. However if I set the <code>ID</code> property of the radio button control it sets the <code>Name</code> and the <code>ID</code>. I see no way to treat the <code>ID</code> and <code>Name</code> separately. So now all button's ids are the same as well.</p>
<p>If you are thinking that I should be using a <code>RadioButtonList</code> to achieve this you may be right, but I have not found a way to include table structure in a dynamically created <code>RadioButtonList</code>. </p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
2,711,349 | 2,711,350 | Find uppercase substrings and wrap with acronym tags | <p>For example replace the string <code>Yangomo, Congo, DRC</code> with <code>Yangomo, Congo, <acronym>DRC</acronym></code>. There may potentially be mulitple uppercase substings in each string. I assume some form of regex?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
1,789,754 | 1,789,755 | C# equivalent of Java instance initializer | <p>In <code>Java</code> instance variables can be initialized by an initialization block as shown below:</p>
<pre><code>class Example {
private int varOne;
private int varTwo;
{
// Instance Initializer
varOne = 42;
varTwo = 256;
}
}
</code></pre>
<p>Is there an equivalent construct in <code>C#</code>?</p>
<p><strong>[Edit]</strong> I know that this can be inline with the instance variable declaration. However, I am looking for is something similar to the static constructor in <code>C#</code> but for instance variables.</p>
| c# java | [0, 1] |
Subsets and Splits