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 |
---|---|---|---|---|---|
1,169,251 | 1,169,252 | JQuery On Select change assign value to variable and reload script | <p>Is it possible at all to be able to assign the selected value of a select and assign it to the variable of a script and re-run the script?</p>
<p>Here is my current code sample:</p>
<pre><code><select onchange="reload_script;">
<option value="123">Select 123</option>
<option value="456">Select 456</option>
<select>
<div id="123">
<a href="http://same.com/index.do?n=152991">link title</a>
<br/><br/>
<a href="http://some.com/">Link</a>
</div>
<script language="javascript" type="text/javascript">
var code = '123' // <-- THIS VARIABLE WOULD BE THE VALUE OF THE SELECTED DROPDOWN VALUE
</script>
</code></pre>
<p>See: var code = '123' .... That's what's changed when the select box is changed ... then I would need the script to re-run...</p>
<p>Is this possible at all?</p>
| javascript jquery | [3, 5] |
2,518,333 | 2,518,334 | Why does my if condition prevent either clause from executing? | <p>I'm trying to re-write the URLs of a set of links that I select using a jQuery class selector. However, I only wish to re-write the links that don't already have a <em>href</em> attribute specified, so I put in an if/else construct to check for this... However, it's not working. It does work without the if else statement so I'm pretty sure that is where I screwed up. I'm new to both JavaScript and jQuery so sorry if my question is elementary and/or overly obvious.</p>
<pre><code> var url = window.location;
var barTwitter = $("a.shareTwitter").attr('href');
if (barTwitter).val() == "null") {
$("a.barTwitter").attr('href','http://www.twitter.com/home?status='+ url +'');
} else {
$("a.barTwitter").attr('href',barTwitter);
}
</code></pre>
| javascript jquery | [3, 5] |
2,544,763 | 2,544,764 | Display word/pdf/excell etc. files in browser. (Asp.net , C#.net 2008) | <p>I have a requirement where in need to display the Pdf / Word doc(any version) or excel in the browser. Something similar to the GMAIL feature. How can I achieve this?
I am using Asp.net with code behind as C#. Application is in 2008</p>
<p>Thanks in advance</p>
| c# asp.net | [0, 9] |
1,503,649 | 1,503,650 | How do i reset values of dynamically created controls on ASP .NET c# page? | <p>i have an array of buttons added to a panel control and need to reset them to their original values, is this possible pragmatically?</p>
<pre><code> protected void Page_Load(object sender, EventArgs e)
{
RenderTable();
}
private void RenderTable()
{
Button[] board = new Button[9];
for(int i =0; i <board.Length; i++)
{
board[i] = new Button();
board[i].Text = " ";
board[i].Width= board[i].Height = 50;
board[i].Click += PlayerClick;
board[i].ID = "pos" + i;
Panel1.Controls.Add(board[i]);
}
}
</code></pre>
| c# asp.net | [0, 9] |
4,951,288 | 4,951,289 | Jquery variable not set | <p>In the top part of my document I have this Jquery code:</p>
<pre><code>// RATING
$('.rateit').click(function(){
var position = $(this).position();
});
</code></pre>
<p>In the footer I have a ajax call:</p>
<pre><code> jQuery.ajax({
url: frm.attr('action'), //your server side script
data: frm.serialize(), //our data
type: 'POST',
success: function (data) {
alert(position.left);
},
</code></pre>
<p>The problem is that the alert box is not showing with the position. I have tested with <code>alert('something');</code> and it works fine. </p>
<p>My real ajax call:</p>
<pre><code> jQuery.ajax({
url: frm.attr('action'), //your server side script
data: frm.serialize(), //our data
type: 'POST',
success: function (data) {
$('.warning').fadeIn(500).css({display: 'block',
position: 'absolute',
left: position.left + 50,
top: position.top - 25
}).append('asdasdsadsad'),
$(ri).next('.ratingcount').html('asdasdasd')
},
error: function (jxhr, msg, err) {
alert(msg); //something went wrong.
}
});
</code></pre>
| javascript jquery | [3, 5] |
4,980,298 | 4,980,299 | Using JavaScript to switch through tabs without changing layout? | <p>My webpage is at <a href="http://sarahjanetrading.com/js/j/index.html" rel="nofollow">http://sarahjanetrading.com/js/j/index.html</a></p>
<p>I have done all the layout and coding. I want the tabs to toggle when clicked over them. I tried google but was in vain. I am willing to achieve the effect using either JavaScript or jQuery. My tabs are empty right now, And I want the layout to remain the same.</p>
<p>NEW :</p>
<p>This is my code so far: </p>
<pre><code><script type="text/javascript">
var lis = $('#main-tabs li');
lis.click( function() {
//Reset all the tabs
lis.removeClass('active-tab').addClass('inactive-tab');
$(this).addClass('active-tab');
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$(".tab-content").hide();
$("ul#main-tabs li a:first").addClass("active").show();
$("#wrap > div").hide().filter(":first").show();
$("ul.tabs li a").click(function() {
$("ul.tabs li > a").removeClass("active");
$(this).addClass("active");
$("#wrap > div").hide();
var activeTab = $(this).attr("href");
$(activeTab).show();
return false;
});
});
</script>
</code></pre>
<p>For the full HTML and JavaSript code (new) please go to <a href="http://sarahjanetrading.com/js/j/index.html" rel="nofollow">http://sarahjanetrading.com/js/j/index.html</a></p>
<p>What it does is that when I click on a list item, it changes the tab, but not the content. And when I click on the anchor of a list item, it changes the content, but not the tab. I want both the content and the tab to change consistently. </p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
5,744,645 | 5,744,646 | Setting the value of an input field without refreshing the page | <p>I am trying to use AJAX to auto complete the users text. Right now I got AJAX to return the results I need for the auto complete feature to the 'suggestions' div as the user types. However, what I am trying to accomplish is a dropdown coming out of the input field ("prod-name") with suggestions as options where the user can simply click on their preferred suggestion and make it the 'value' of the input (similar to how google has search suggestions as you type, but a simplified version).</p>
<p>My markup sof far:</p>
<pre><code><script type="text/javascript">
function search(searchword) {
$('#suggestion').load('invoice-get-data.php?searchword=' + searchword);
}
</script>
</head>
<body>
<div class="prod-name">
<input onKeyPress="search(this.value)" type="text" id="prod-name"/>
<div id="suggestion"></div>
</div>
</body>
</code></pre>
<p>My AJAX code so far (invoice-get-data.php code snippet)</p>
<pre><code>$searchword = $_GET['searchword'];
$results = mysql_query("SELECT * FROM products WHERE prod_name LIKE '".$searchword."%'") or die(mysql_error());
while($row = mysql_fetch_array($results)){
echo $row['prod-name'] . '<br>';
}
</code></pre>
| php javascript jquery | [2, 3, 5] |
795,266 | 795,267 | using jquery to load data from mysql database | <p>I'm currently using jquery's ajax feature or whatever they call it. To load data from mysql database. Its working fine, but one of the built in features of this one is to load all the data which is on the database when you press on backspace and there's no character left on the text box.</p>
<p>Here's my query:</p>
<pre><code>SELECT * FROM prod_table WHERE QTYHAND>0 AND PRODUCT LIKE '$prod%' OR P_DESC LIKE '$desc%' OR CATEGORY LIKE '$cat%'
</code></pre>
<p>As you can see I only want to load the products which has greater than 0 quantity on hand.</p>
<p>I'm using this code to communicate to the php file which has the query on it:</p>
<pre><code>$('#inp').keyup(function(){
var inpval=$('#inp').val();
$.ajax({
type: 'POST',
data: ({p : inpval}),
url: 'querys.php',
success: function(data) {
$('.result').html(data);
}
});
});
</code></pre>
<p>Is it possible to also filter the data that it outputs so that when I press on backspace and there's no character left. The only products that's going to display are those with greater than 0 quantity?</p>
| php jquery | [2, 5] |
4,674,960 | 4,674,961 | need to get the left property of an object | <p>I can't get the left property of an object</p>
<p>i've tried</p>
<pre><code>$('myobject').left() //it doesn't work`
$('myobject').css().left() //invalid property
$('myobject').css('left') //invalid property
</code></pre>
<p>i've been using offset().left which is totally wrong, i need to get the left property of an object</p>
| javascript jquery | [3, 5] |
4,012,200 | 4,012,201 | Is there a C# equivalent to File.separator in Java | <p>How does C# cope with file separators? Is it always assumed the file separator is "\" (or "\\" and does this have to be escaped like this?</p>
| c# java | [0, 1] |
4,478,182 | 4,478,183 | JQuery need to clear a text box when clicking calendar button | <p>I have a textbox with calendar button. Here my requirement is I need to clear the text box when user clicks Calendar Image control. Please provide JQuery for this. </p>
<p>Thanks in advance.</p>
| c# asp.net jquery | [0, 9, 5] |
2,560,594 | 2,560,595 | In Asp.net (c#) ,how to store an image as binary(bytearray)? | <p>i need to store a image(system.web.ui.image) in a sql[i use linq],for that i need to convert it into Binary(System.Data.Linq.Binary)....how to do this ?</p>
| c# asp.net | [0, 9] |
3,239,956 | 3,239,957 | How can I add a new row to my datagrid? | <p>Currently, it's outputting everything on one row. How can I separate the rows?</p>
<p>For example, the code is outputting:</p>
<pre><code><tr>
<td>blah</td>
<td>blah</td>
<td>blah</td>
</tr>
</code></pre>
<p>When it should be:</p>
<pre><code><tr>
<td>blah</td>
</tr>
<tr>
<td>blah</td>
</tr>
<tr>
<td>blah</td>
</tr>
<asp:DataGrid ID="DataGrid1" runat="server" AlternatingItemStyle-BackColor="#e4e4e4" AutoGenerateColumns="false">
DbCommand command = db.GetStoredProcCommand("sel_Member_p");
db2.AddInParameter(command2, "@pMemberID", DbType.String, s);
ds2 = db2.ExecuteDataSet(command2);
try {
BoundColumn memberIdColumn = new BoundColumn();
memberIdColumn.DataField = "ID";
memberIdColumn.HeaderText = "ID";
BoundColumn statusColumn = new BoundColumn();
statusColumn.DataField = "Status";
statusColumn.HeaderText = "Status";
DataGrid1.Columns.Add(memberIdColumn);
DataGrid1.Columns.Add(statusColumn);
}
DataGrid1.DataSource = ds2;
DataBind();
</code></pre>
| c# asp.net | [0, 9] |
4,055,155 | 4,055,156 | automatically submit a file in jquery | <p>how would I automatically submit a form to a php file in jquery. I have this form right now:</p>
<pre><code> <form action = 'add.php' method='get'>
<input type='hidden' name = 'title' value='$title'>
</form>
</code></pre>
<p>I ask this because I want to use this to pass a post variable to another php file (ie...going from A to B to C).</p>
| php jquery | [2, 5] |
2,551,463 | 2,551,464 | how to add new datatable to dataset at first position | <p>i have one dataset with 3 data tables again i have to add one more data table in same dataset at first position(Ex:mydataset.tables[0]th position) .can any one help me regarding this.</p>
| c# asp.net | [0, 9] |
2,346,964 | 2,346,965 | How to get a form processing event | <p>My code is as simple as like this</p>
<pre><code>$(document).ready(function(){
$('#somebutton').click(function(){
$('#someformid').submit();
return false;
});
});
</code></pre>
<p>During this form submit ,normally the page will wait for 1 or 2 sec for the load ,in this mean time user can click the 'somebutton' again and the form will submit again.My question is how do i lock the browser or disable form submit if a form submit process is going on ?</p>
<p>P.S somebutton is an image</p>
| javascript jquery | [3, 5] |
5,141,301 | 5,141,302 | android inline class | <p>This might be a dumb question, but I've been thinking about it for some time and I have no idea what it's really called.</p>
<p>So for Android, for OnClickListeners, OnTouchListeners, etc., you're allowed to do the following:</p>
<pre><code> bio.setOnCancelListener(new OnCancelListener() {
public void onCancel(DialogInterface arg0) {
// TODO Auto-generated method stub
}
});
</code></pre>
<p>Pretty much making a new class inline. What is this called in Java or is it an Android specific thing? Basically, what's going on when this happens? Are you pretty much creating an inner class that implements OnCancelListener since On[blah]Listeners are interfaces?</p>
<p>Thanks!</p>
| java android | [1, 4] |
1,051,163 | 1,051,164 | javascript not execute at live | <p>I am using Visual Studio. My javascript is functioning if I debug it at local host, the function is very simple, photo change at mouseOver.</p>
<p>But after I upload my file to my server, this function is not working. I have tried it on Chrome, Firefox, IE and Safari:</p>
<pre><code>function mouseOver1()
{
var category1 = document
.getElementById('ctl00_ContentPlaceHolder1_lblItemID')
.innerHTML + '_1.jpg';
document
.getElementById('<%= iPhotoMain.ClientID.Replace("$","_") %>')
.src = 'photos/product/' + category1;
}
<img id ="photo1"
src ="photos/product/noImage.gif"
onmouseover="mouseOver1();"
class="thumbpic"
runat ="server" />
</code></pre>
| c# javascript | [0, 3] |
1,503,054 | 1,503,055 | jQuery: sharing function between page code and document.ready code | <p>I have some nice dialogues defined as such in jQuery:</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
$( "#someDialog" ).dialog({
autoOpen: false,
model: true,
buttons: {
"Do Something": function() {
var cleanInput = sanitizeInput(input);
// Do something with the clean input
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
}
});
function sanitizeInput(input) {
// Some magic here
return input;
}
});
</script>
</code></pre>
<p>Somewhere in the page, unrelated to the dialog, I have an element that calls a function with a parameter:</p>
<pre><code><a href="#" onclick="doSomething('wendy');">Wendy's stats</a>
</code></pre>
<p>And the associated JavaScript:</p>
<pre><code><script type="text/javascript">
function doSomething(input) {
var cleanInput = sanitizeInput(input);
// Some code here
}
</script>
</code></pre>
<p>I would like to reuse the sanitizeInput() function for this function as well. However, from outside the document.ready function, the dialog does not work. Putting the doSomething() function inside the document.ready function breaks it likewise. So where do I put the sanitizeInput() function such that both can use it?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
3,273,316 | 3,273,317 | How to remove Main Domain cookie from Sub Domain | <p>is it possible to remove Main Domain cookie from Sub Domain ?I am using single sign on .On logout i want to remove the maindomain cookie </p>
| c# javascript asp.net | [0, 3, 9] |
4,681,734 | 4,681,735 | Android ProgressDialog delayed before showing up | <p>I'm using the ProgressDialog in android to prevent the user from, say, pressing a button multiple times while a long task is updating the UI. </p>
<p>My problem is that the ProgressDialog does not seem to show up after awhile, as it seems to be another thread. </p>
<p>In my experiment I called this ProgressDialog show() in an EditText's text changed listener. It still allows me to type in multiple characters in a short period before showing up.</p>
<p>Is there a way I can detect that the ProgressDialog has already started?</p>
<p>Edit 1:
This was done on a real device. The code is simply this:</p>
<pre><code> editText.addTextChangedListener( new TextWatcher() {
...
public void onTextChanged(CharSequence s, int start, int before, int count) {
ProgressDialog lock = new ProgressDialog(UIClass.this);
lock.show();
}
...
});
</code></pre>
<p>My first assumption was that this would show the dialog immediately after the first character I type, but when I tested by typing multiple characters in a short period it was still possible, and the locking only starts after the 2nd or 3rd character. I am assuming that this is because the ProgressDialog is another thread. I wish to know how to make it properly lock the UI at the exact point I am interested in.</p>
| java android | [1, 4] |
90,654 | 90,655 | Jquery Image Slide Up After Page Load | <p>Pls I am working on a website. I want a situation on the home page where an image of a man standing will slide up 1 or 2 seconds after the whole page has loaded. I need someone to help me with a codepen example.</p>
<p>Below is the code I inserted in the head section. I set the image to display:none in css, but when I refresh, I found out it's not working. #man is the id of the image.</p>
<p>Thank u.</p>
<pre><code>$(function() {
$("#man").one('load', function () {
$(this).show("slide", { direction: "up" }, 2000);
}).each(function() {
if(this.complete)
$(this).load();
});
});
</code></pre>
| javascript jquery | [3, 5] |
2,735,120 | 2,735,121 | Robust Javascript parser in Java | <p>I am looking for a <em>robust</em> Javascript parser written in Java - by which I mean a Javascript parser that is able to handle most real world Javascript.</p>
<p>I am only interested in <em>parsing</em> Javascript, <em>not</em> in executing it.</p>
<p>I have found Rhino:
<a href="http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/1eff23a8ee57b991" rel="nofollow">http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/1eff23a8ee57b991</a></p>
<p>Am I missing anything? Is this the best solution?</p>
<p>Thank you!
Misha</p>
| java javascript | [1, 3] |
5,672,748 | 5,672,749 | jQuery custom draggable control slide without jQuery UI | <p>I have successfully made a custom control-slider, but it's not draggable. I tried searching for solutions online but most of them use jQuery UI. </p>
<p><a href="http://jsfiddle.net/LWabn/1/" rel="nofollow">http://jsfiddle.net/LWabn/1/</a></p>
<p>How do I make the control-slide-button draggable and dynamically update the value of the <code>input</code> field?</p>
| javascript jquery | [3, 5] |
2,648,638 | 2,648,639 | How to get all input elements from page using only plain JavaScript? | <p>How to get all input elements from page using only plain JavaScript ( I have only three ) ? I cannot use any framework because I need to use this in android WebView.</p>
| javascript android | [3, 4] |
3,313,018 | 3,313,019 | asp.net - how do i synchronize users on domain for windows authentication | <p>i am trying to do windows authentication on my site because it is only local on our network:</p>
<p>im using the website administration tool and selected windows authentication, but when i try to choose users for specific roles it does not give me any users that are on my domain</p>
<p>my question is how do i synchronize the users on our domain with this tool so that i can give access to specific users?</p>
| c# asp.net | [0, 9] |
5,029,786 | 5,029,787 | pdf download functionality asp.net | <p>I am making a web site in asp.net with c sharp.
I need to place a download file functionality(pdf, doc, xls) on one of my web page.</p>
<p>How can I do that?</p>
| c# asp.net | [0, 9] |
2,036,250 | 2,036,251 | Live video stream from Android to server , pc and, android device | <p>I'm going to do my final project on android video streaming ,so i need your help guys.
actually i want to send Live video streaming from Android to server , pc and, android device. Can any body refer to similar <strong>code</strong> or doc. related to this topic. I'll appreciate that. </p>
<ul>
+
</ul>
| java android | [1, 4] |
468,601 | 468,602 | How to display the content coming from .exe file to Web Page | <p>I want to plot a graph from the data coming from a device attached to source. I dont want to store it. So i am just trying to post a sample data using a C# console application and display it on the web page. My C# code is :-</p>
<pre><code>WebRequest request = WebRequest.Create("http://localhost:49537/asp1.aspx");
request.Method = "POST";
string postData = "post this on server";
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
</code></pre>
<p>Now i want to display it on the ASP page, I tried using WebRequest and GET method on Page_Load method to show the content, but somehow its not working. </p>
| c# asp.net | [0, 9] |
4,729,571 | 4,729,572 | Default select issue for JQuery UI 'selectable' | <p>Below is my JS. When the page loads, I want it to automatically run the function as if its being clicked on. The default selection makes it started selected, but doesn't initiate the function. Any idea on how to make that work?</p>
<pre><code>$(function() {
$( "#selectable" ).selectable({
selected: updatefilters
});
function updatefilters(ev, ui){
// get the selected filters
var template, html;
var pagego;
if(! pagego){
var page = 0;
}
var $selected = $('#selectable').children('.ui-selected');
// create a string that has each filter separated by a pipe ("|")
var filters = $selected.map(function(){return this.id;}).get().join("\|");
$.ajax({
type: "POST",
url: 'updatefilters',
dataType: 'json',
data: { filters: filters, page: page },
success: function(data){
html = "Do Something";
$('#board').html(html);
}
});
}
$('#lets').addClass('ui-selected')
});
</code></pre>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
1,674,404 | 1,674,405 | How to receive notification form web in Android? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1378671/push-notifications-in-android-platform">Push Notifications in Android Platform</a> </p>
</blockquote>
<p>Hey i want to create notification for my project. The back end is MySQL server. If any user update their account <strong>the server will automatically updated</strong> that can be indicate me as a <strong>notification</strong>. Like a Facebook. </p>
| java php android | [1, 2, 4] |
1,911,779 | 1,911,780 | Javascript not working on site | <p>I've recently created my first wordpress site, and have installed it all manually. It's all working fine, except that none of the Javascript on the site works. I think this may have been corrupted when installing the site, as there were a few issues. What needs to be in the site and where in order for Javascript to be called? </p>
<p>I've tried various themes but they all have the same issue. It seems that JS is never called. I've tried removing everything and re-installing wordpress but to no joy, this is 5 hours later and I haven't made any progress in finding a solution. </p>
<p>My site is <a href="http://www.alternastock.co.uk/work" rel="nofollow">http://www.alternastock.co.uk/work</a> (the gallery on this page should be the standard gallery, but because the JS doesn't work it just loads the images in separeate pages.</p>
| jquery javascript | [5, 3] |
1,032,523 | 1,032,524 | limiting of strings or numbers in text boxes Java android | <p>How to limit or restrict the words or numbers in the EditText boxes in android Java?</p>
| java android | [1, 4] |
5,769,160 | 5,769,161 | 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,209,906 | 5,209,907 | Label id is changing, how to fix this? | <p>I have this asp:label in my page and what I want is to change the text from time to time. But label id is changing from page to page when i run the code. its been appended with "ctl00_bh_" something...</p>
<p>how to fix this?</p>
<p>here are my code snippets.</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "onLoad", "DisplaySessionTimeout()", true);
}
<asp:Label ID="lblSessionTime" runat="server" />
function DisplaySessionTimeout() {
document.getElementById("lblSessionTime").innerHTML = "updating text here";
sessionTimeout = sessionTimeout - 1;
if (sessionTimeout >= 0)
window.setTimeout("DisplaySessionTimeout()", 1000);
else
{
alert("Your current Session is over.");
}
}
</code></pre>
<p>thanks </p>
| javascript asp.net | [3, 9] |
5,619,874 | 5,619,875 | Converting Microsoft Word Smart Quotes to Straight Quotes | <p>We have a program where the user needs to do a Copy-Paste of some content from Microsoft Word into a HTML editor (Visual Studio 2008).</p>
<p>That content in the HTML is then used in our confirmation emails.</p>
<p>Some of the characters like curly quotes turn into ? on the browser & in our confirmation email.</p>
<p>For the browser... I was able to find how to resolve this issue by using jQuery.</p>
<p>But for the confirmation email I cannot use JavaScript.</p>
<p>I tried this ASP.net / C# code but it hasn't worked for me.</p>
<pre><code>if (s.IndexOf('\u201b') > -1) s = s.Replace('\u201b', '\'');
if (s.IndexOf('\u201c') > -1) s = s.Replace('\u201c', '\"');
if (s.IndexOf('\u201d') > -1) s = s.Replace('\u201d', '\"');
if (s.IndexOf('\u201e') > -1) s = s.Replace('\u201e', '\"');
</code></pre>
<p>I would appreciate any help in resolution.</p>
<p>Thanks.</p>
<hr>
<p>Thank you all for your responses.</p>
<p>I am using the StreamReader to read the HTML file containing the Word characters.</p>
<pre><code>string sFileText = "";
StreamReader objReader = new StreamReader(sFilePath);
sFileText = objReader.ReadToEnd();
objReader.Close();
return sFileText;
</code></pre>
| c# asp.net | [0, 9] |
813,625 | 813,626 | How to draw dotted lines between geopoints in google map on android | <p>I have displayed the locations on map with marker images, but now i want to connect the locations by dotted lines, in same line locations.</p>
<p>Please give any idea....</p>
| java android | [1, 4] |
4,703,798 | 4,703,799 | Calling a function and pass it a json object | <p>I have a json object named data like below</p>
<p><img src="http://i.stack.imgur.com/1Rw9b.png" alt="enter image description here"></p>
<p>And I have a function denomination in a string like below</p>
<p><img src="http://i.stack.imgur.com/G8x09.png" alt="enter image description here"></p>
<p>test is the name of the function I would like to call and pass it the json object data.</p>
<p>here is the test function:</p>
<pre><code>test = function (data) {
alert('I am the test function');
}
</code></pre>
<p>I already try:</p>
<pre><code>eval(func(data));
</code></pre>
<p>It doesn't work.</p>
<p>Any idea?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
451,920 | 451,921 | jQuery post array | <p>Am wondering how to post an array using $.ajax. My array is something like this:</p>
<pre><code>var a = new Array();
a['test'] = 1;
a['test2'] = 2;
and so on...
</code></pre>
<p>I tried:</p>
<pre><code>$.ajax({
url: baseUrl+"chat.php",
data: { vars: a},
type: 'post',
success: function(data) {
alert(data);
}});
</code></pre>
<p>Any suggestions? Thank you for your time.</p>
| javascript jquery | [3, 5] |
755,049 | 755,050 | getting values from price range slider jquery | <pre><code><meta charset="utf-8">
<title>jQuery UI Slider - Range slider</title>
<link rel="stylesheet" href="jquery.ui.all.css">
<script src="jquery-1.7.1.js"></script>
<script src="jquery.ui.widget.js"></script>
<script src="jquery.ui.mouse.js"></script>
<script src="jquery.ui.slider.js"></script>
<link rel="stylesheet" href="demos.css">
<script>
$(function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
}
});
$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
" - $" + $( "#slider-range" ).slider( "values", 1 ) );
$( "#minValue" ).val( ui.values[ 0 ] );
$( "#maxValue" ).val( ui.values[ 1 ] );
});
</script>
</code></pre>
<p></p>
<p>
Price range:
</p>
<p>" />
" /></p>
<p></p>
<p>1)How i can get the min & max values.
2)when slider sliding how i read that values from this code;
3)Is there any fuction is needed for reading the min & max values</p>
| php jquery | [2, 5] |
396,279 | 396,280 | how do I tell if an event is fired by .click() or by the user? | <p>I want to differentiate actual mouse clicks from script generated clicks.How can i do it with jquery?</p>
| javascript jquery | [3, 5] |
4,795,973 | 4,795,974 | Achieving slideUp() without content distortion | <p>I want to implement a simple slide up and slide down mechanism for revealing content on the press of a button. Using the out of the box jquery functions slideUp() and slideDown() squishes the content. I want the slide mechanism to be similar to the one used in twitter (in the timeline when you click on a tweet, more info and options slide down). There the content does not get squished. Instead the bottom border seamlessly moves over the content thus sliding up without squishing. Any pointers on how to implement this?</p>
<p>Edit:</p>
<p>The content to be slided into and out of visibility is inside a div</p>
<pre><code><div id='container'>
<div id='slider'>
<div> other content </div>
</div>
<div id='button'>
Click to slide
</div>
</div>
</code></pre>
<p>I listen to the click event of the 'button' div</p>
<pre><code>$('.button').click(function(){
if($('.slider').is(":visible"))
{
$('.slider').slideUp();
}
else { $('.slider').slideDown(); }
});
</code></pre>
<p>This is a basic slider. The contents inside the 'slider' div get squished and distorted when animating.</p>
| javascript jquery | [3, 5] |
3,062,351 | 3,062,352 | Which JavaScript framework does Visual Studio natively support? | <p>Is it jQuery? Is there a way to integrate support for the excellent ExtJS or YUI libraries?</p>
<p>Any news on whether Visual Studio 2010 will support another JS framework?</p>
| asp.net javascript | [9, 3] |
1,639,014 | 1,639,015 | Check if an asp:FileUpload control has a file selected in JavaScript | <p>How do I check if an asp:FileUpload control has a file selected in JavaScript?</p>
<p>I've tried <code>.HasFile</code> and <code>.value</code>, both have returned undefined.</p>
| javascript asp.net | [3, 9] |
2,458,183 | 2,458,184 | retrieve objects own tag | <p>I am using jQuery to sort a list of li tags, My current code is:</p>
<pre><code>var arr = [];
$("ul li").each(function() {
arr.push($(this));
});
arr.sort(cmpFunction);
$("ul").find("li").remove();
$.each(arr, function(index, item){
console.log(item.html());
});
</code></pre>
<p>What i'm finding with the console.log though - is I am losing the outside containing li tag (with the html5 data attributes that I want to keep)</p>
<p>Is there another option to .html() that will give me the objects li tag as well</p>
<p>I have provided a simple example of what I need here: <a href="http://jsbin.com/esalas/5" rel="nofollow">http://jsbin.com/esalas/5</a></p>
| javascript jquery | [3, 5] |
1,837,005 | 1,837,006 | onCreate method is called after calling onConfigurationChanged method in an Activity class | <p>I am a beginner in android programming, now i am working on an android application which displays the data in a sort order by default and also provides a search facility. For this i have written an activity called search that will search the contents and displays in a listview. My problem is when i rotate the device the onCreate method of the Activity class is called even after overridding the onConfigurationChanged method. I had also done the following changes in the manifest file to invoke the onConfigurationChanged method.</p>
<pre><code><activity
android:name=".Search"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="sensor" >
</activity>
</code></pre>
<p>My Search Activity is as follows :</p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
System.out.println("HERE AT ONCREATE");
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
System.out.println("HERE AT ON CONFIGURATION CHANGED");
if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
setContentView(R.layout.search_port);
} else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
setContentView(R.layout.search_land);
}
}
</code></pre>
<p>So the output while rotating the device will be : </p>
<ol>
<li><p>HERE AT ON CONFIGURATION CHANGED</p></li>
<li><p>HERE AT ONCREATE</p></li>
</ol>
<p>I dont want to get the <code>onCreate()</code> method called while rotating the device. Please help me to solve this issue. I am using Android 2.2 SDK with Samsung Galaxy Tab (7 inch display).</p>
| java android | [1, 4] |
4,859,805 | 4,859,806 | Single UL that auto creates a paginated slide depending on the number of LIs that fits a container? | <p>I wonder if there's an existing js/jquery plugin to achieve something similar on Jay Salvat's portfolio site <a href="http://jaysalvat.com" rel="nofollow">http://jaysalvat.com</a>. </p>
<p>He got a single UL that automatically/dynamically creates a paginated slide depending on the number of LIs that fits a specified container. Anyone? Thanks.</p>
| javascript jquery | [3, 5] |
3,605,653 | 3,605,654 | Onclick event for image tag inside PHP echo, is not working | <p>In my image.php file i have code</p>
<pre><code>$id=abs($_GET['id']);
$query = mysql_query("SELECT image FROM table1 WHERE id=$id");
$data=mysql_fetch_array($query);
header('Content-type: image/jpg');
echo $data['image'];
</code></pre>
<p>And while retrieving i am using query</p>
<pre><code>$query = mysql_query("SELECT id FROM table1");
while($data=mysql_fetch_array($query)) {
echo '<'.'img src="image.php?id='.$data['id'].'">';
</code></pre>
<p>It is perfectly displaying images from my data base...
But i want to detect which image user clicked for that i tried </p>
<pre><code>echo '<'.'img src="image.php?id='.$data['id'].'" onclick="doSomething()">';
</code></pre>
<p>this onclick java script function doesn't getting call..(i am using mozilla fire fox)
I am new to PHP. </p>
<p>Finally I need to detect the clicked image among the images which are displayed using PHP echo from Mysql.Is there any other way that i can follow for this?</p>
| php javascript | [2, 3] |
1,767,636 | 1,767,637 | How to obtain the current time differences between two timezones | <p>I want to calculate the current time differences between US/Central timezone and British Summer Time. I mean, currently these both timezones have daylight savings going on, so they have a 6 hours time difference. But after Sunday October 31 2010, daylight savings will be off for British summer time, at which moment there will be a 5 hours time differences between these two timezones. </p>
<p>Is there any way I can calculate these varying time differences?</p>
| c# asp.net | [0, 9] |
3,428,344 | 3,428,345 | Notify a running Java process with PHP | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3350231/how-can-i-communicate-between-php-and-a-java-program">How can I communicate between PHP and a Java program?</a> </p>
</blockquote>
<p>I'm currently writing a web service which needs to handle events in real time.
So I thought it would be a nice approach to write a java program which runs in the background and handles all the events.</p>
<p>So the frontend of the web application is written in PHP. The user creates a new event and what I want is, that that PHP script notifies the running java process about that event. Is this possible?</p>
| java php | [1, 2] |
3,307,987 | 3,307,988 | How to use payment gateway in asp.net using C# | <p>I'm new to asp.net and I want to use Payment Gatway Process for my application. I would appreciate if any one can suggest for me how do for that...</p>
<p>I referred so many websites, but have been unable to implement it.</p>
| c# asp.net | [0, 9] |
286,336 | 286,337 | Send array in JS to php | <p>I'm trying to do something similar to this <a href="http://stackoverflow.com/questions/2793891/send-selects-values-in-array">question</a>.
I want to send to the server the id's of the selected checkboxes. I'm using jquery only because the example. my ajax code is pure JS.</p>
<p>This is my code:</p>
<p>js:</p>
<pre><code>function DeleteTest(ind)
{
if (confirm('Are you sure you want to delete this test?'))
{
$(function() {
var testdel = $('input[name=deletetest]').serialize();
alert(testdel);
window.open('test.php' + "?"+testdel,'_self');
} );
return true;}
else { return false;}
}
oCell.innerHTML = "<input type='checkbox' name='deletetest' value='"+ ind + "')';>"; // create checkbox for each row in ajax
</code></pre>
<p>html:</p>
<pre><code><form id="checkboxform" action="test.php" method="post">
<tbody id="auditTblBody">
</tbody>
</table>
<input type="button" value="Submit AJAX Request" onclick="DeleteTest()" />
</form>
</code></pre>
<p>With this code i get only one value with GET.<code>testdel</code> is fine. (i.e <code>deletetest=477&deletetest=476</code>) my problem is how to send this information.</p>
<p>thank you!</p>
| php javascript | [2, 3] |
2,692,338 | 2,692,339 | Accessing a control dynamically added to a placeholder during an event | <p>I'm creating an ASP.NET control dynamically based on a value selected in a dropdown; for instance the field can be a textbox or a checkbox (for now), and then it gets added to a placeholder control. However, I'm unsure how to retrieve the value - using the placeholder's <code>FindControl</code> method returns null although I'm specifying the ID when I create the control.</p>
<p>Here's my code:</p>
<pre><code>protected void ddlFields_SelectedIndexChanged(object sender, EventArgs e) {
// this simply gives me back an object with some properties
// such as the type of field (e.g. text, boolean, number)
var column = GetFieldDetailsByValue(ddlFields.SelectedValue);
this.CreateInputControl(column.Type);
}
private void CreateInputControl(string dataType) {
Control controlToAdd = null;
switch (dataType) {
case TYPE_STRING:
case TYPE_NUMBER:
controlToAdd = new TextBox();
break;
case TYPE_BOOL:
controlToAdd = new CheckBox();
break;
}
if (controlToAdd != null) {
controlToAdd.ID = "ctlFieldValue";
this.fieldsPlaceholder.Controls.Add(controlToAdd);
}
}
</code></pre>
<p>I have a Button event which checks for the <code>ctlFieldValue</code> control to retrieve it's value, however it's always null. How should I go about handling this?</p>
| c# asp.net | [0, 9] |
2,635,171 | 2,635,172 | ArrayList Filter Logic | <p>I have an arraylist <code>arrTotalItems</code> of <code>class Operation.Operation</code>.</p>
<p>the class has two properties one is <code>ID</code> and <code>name</code>.
Now I have other <code>arraylist arrSelectedItems</code> which contain ID of <code>operations</code></p>
<p>Now I have to bind two <code>DataList</code> to name of <code>operation</code>.</p>
<p>First <code>DataList</code> will be bind to selected <code>arraylist</code>.</p>
<p>Other <code>DataList</code> will be bind to <code>arrTotalItems - arrSelectedItems</code> that is those operations that are not in arrSelectedItems.</p>
<p>not able to find the logic how to bind both the lists </p>
| c# asp.net | [0, 9] |
4,643,334 | 4,643,335 | Set Activity title ellipse to middle? | <p>I have an Activity whose title keeps change, but sometimes its long and get ellipses by end. Can I set ellipse to middle ?</p>
| java android | [1, 4] |
5,561,872 | 5,561,873 | add event to Jquery Plugin | <p>I have a JQuery plugin and I want to add some event to it.
Any help, tips, or tutorial?</p>
| javascript jquery | [3, 5] |
2,136,855 | 2,136,856 | Obtaining selected item, value or index from drop down list in formview after button press | <p>I have a formview with an insertion template. In this template there is a drop down list with a number of items I want users to be able to select from. Beside the drop down list there is a button which I am using to add the selected item from the drop down list to a gridview which also exists in the insertion template.</p>
<p>My problem is that when I click the button to add the selected item from the drop down list the selected item, index or value from the drop down list are not available. I am using a OnClick event handler to catch the event from the button click but I suspect there is some kind of refresh of the template going on here which I am not understanding as nothing appears to be accessible from the button event handler. I don't believe a postback is occurring as I have disabled the CausesValidation property for my button.</p>
| c# asp.net | [0, 9] |
2,467,403 | 2,467,404 | How do I make a Generic Data Access Class? | <p>ASP.net C# 3.5 Framework, working in Visual Studio 2008 currently.</p>
<p>What I want is a Generic Data Access Class. I have seen several of them but what I want is to see one that I pass the Connection String and the SQL statement and it will return a List of Objects or when only one item an Object or when no response needed a boolean to let me know if it succeeded?</p>
<p>I hope this makes sense if not let me know and I will explain more.</p>
| c# asp.net | [0, 9] |
28,009 | 28,010 | Issue Related to Hidden Field in asp.net | <p>I have an asp.net application. i have added Hidden field on Master Page..</p>
<pre><code><asp:HiddenField runat="server" ID="hiddenCriteria" Value="abcd"/>
</code></pre>
<p>When I try to get the value of Hidden field from Javascript :</p>
<pre><code>alert(document.getElementById("ct100_hiddenCriteria").value);
</code></pre>
<p>I get the following value :</p>
<p><img src="http://i.stack.imgur.com/06KLS.png" alt="enter image description here"></p>
<p>How to get real stored value ?</p>
| c# asp.net | [0, 9] |
2,486,076 | 2,486,077 | Widget Building: Uncaught TypeError: Object [object Object] has no method 'fancybox' | <p>Why is it that this works: <a href="http://jsfiddle.net/w82W8/1/" rel="nofollow">http://jsfiddle.net/w82W8/1/</a>
But this doesn't?: <a href="http://jsfiddle.net/w82W8/2/" rel="nofollow">http://jsfiddle.net/w82W8/2/</a></p>
<p>This question may seem convoluted; you may wonder, why not just use the first!? Why are you using jQuery to load in JS+CSS assets that you could easily load in the original HTML.</p>
<p>Well, I'm in the process of building a web widget and I'd like to keep the embed code as small as possible. The idea is to have the user include a single <code><script type='text/javascript' src='http://mysite.com/widget.js'></script></code> line in their code, and the widget.js code will take care of all the details. Including fetching fancybox.</p>
<p>I'm getting the error: <strong>Uncaught TypeError: Object [object Object] has no method 'fancybox'</strong></p>
<p>I hypothesize that javascript is not waiting for fancybox.js to load, and immediately attempting to apply fancybox() to the trigger. Can I get a callback working here when the assets have been loaded? I'm certain they are getting included in the DOM though... I've inspected with Chrome Tools.</p>
<p>I know this question has been asked on StackOverflow before, but not in this context.</p>
<p>Thanks, and Happy Holidays!</p>
| javascript jquery | [3, 5] |
291,159 | 291,160 | How do I scroll to the right on a page that overflows horizontally? | <p>I want to scroll to the far right edge of a page that is really wide (it's wide on purpose) when the user closes a modal (specifically, the Reveal modal in Foundation 4).</p>
<p>I've tried setting an id on a div that's aligned all the way right, but that obviously doesn't work.</p>
| javascript jquery | [3, 5] |
1,313,618 | 1,313,619 | PHP/JavaScript form validation? | <p>I'm new with PHP and JavaScript. I eant to validate form, and if the form input fields are correct, then send it to php external script. I've tried something like this:</p>
<pre><code><head>
<script type="text/javascript">
function Validate(){
var x=document.forms["form"]["firstname"].value;
var y=document.forms["form"]["lastname"].value;
var z=document.forms["form"]["age"].value;
if(x==null || x=="") {
alert("Input name!");
} else if(y==null || y=="") {
alert("Input surname!");
} else if(z==null || z=="") {
alert("Input age!");
} else {
// IS IT POSSIBLE TO SEND FORM HERE FORM VARIABLES TO PHP SCRIPT?
}
}
</script>
</head>
<body>
<form name="forma" action="validate.php" method="post" onSubmit="return Validate()">
Firstname: <input type="text" name="firstname">
Lastname: <input type="text" name="lastname">
Age: <input type="text" name="age">
<input type="submit">
</form>
</body>
</html>
</code></pre>
| php javascript | [2, 3] |
2,466,622 | 2,466,623 | Popup window in ASP with image | <p>Can I have a popup window in ASP page when I click on a hyperlink? And on that popup, can I display my image?</p>
| asp.net javascript | [9, 3] |
4,053,036 | 4,053,037 | how to call a code behind button_click in jquery | <p>I opened a Popup using Jquery dialog it contains all asp.net controls [ submit,textbox]</p>
<p>When i click submit on popup no action is performing.....how can i call that action with jQuery </p>
<p>i am beginner..can u explain in detail...if possible with sample code.......</p>
| jquery asp.net | [5, 9] |
4,179,747 | 4,179,748 | How to run new window.open and auto add Ctrl key? | <p>In ff & chrome Ctrl + click the url, it will open a new tab and the screen keep on the old url.
When I try to use javascript window.open it will open a new tab too, but the screen will change to the new tab.
How to use window.open open new tab and keep the screen in the old url ??</p>
<p>Or,.. can I use jquery auto add ctrl when I click url ??</p>
<p><strong>jquery</strong></p>
<pre><code>$(".link").mousedown(function(e) {
if (e.which === 1) {
window.open($(this).attr('href'));
}
});
</code></pre>
| javascript jquery | [3, 5] |
320,096 | 320,097 | Making the most of available memory on higher end devices? | <p>I've noticed that e.g. the Samsung Galaxy S allows apps to allocate much more memory (>24Mb) than a Droid (<=24Mb) or a G1 (<=16Mb) before OutOfMemoryExceptions are thrown. I'd like my app to scale to higher end devices like the Galaxy and take advantage of the higher allocation limit.</p>
<p>Is there a reliable way to detect how much memory my app can use? Is it risky to attempt to use e.g. 70% of the maximum memory reported? Otherwise, I'd need to limit my app to what the G1 allows to guarantee my app won't crash.</p>
| java android | [1, 4] |
1,821,857 | 1,821,858 | Prevent link <a> without href from clicking | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1164635/how-to-enable-or-disable-an-anchor-using-jquery">How to enable or disable an anchor using jQuery? </a> </p>
</blockquote>
<p>I have this:</p>
<pre><code><a onclick="javascript:btnSave_onclick();" class="button">Save</a>
</code></pre>
<p>Basically, the link is acting like a button.</p>
<p>However, there are some conditions when I need to make it disabled. How to do this?</p>
| javascript jquery | [3, 5] |
322,736 | 322,737 | Execute javascript after a partial postback of an updatepanel? | <p>I have a page that add tree file script to it .</p>
<pre><code><script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/init.js"></script>
<script type="text/javascript" src="js/easing.js"></script>
</code></pre>
<p>I have a updatepanel with a dropdownlist. When run SelectedIndexChanged event (partial postback of an updatepanel), don't execute javascript .</p>
| javascript asp.net | [3, 9] |
3,049,419 | 3,049,420 | Java equivellent c# implicit | <p>I have an object A </p>
<pre><code>class A {
B contained = new B();
}
class B
{
}
</code></pre>
<p>and a collection of A's </p>
<pre><code>Queue<A> q1 = new PriorityQueue<A>();
</code></pre>
<p>what I want to do </p>
<pre><code>Queue<B> q2 = new PriorityQueue<B>(q1);
</code></pre>
<p>in c# i can use the implicit keyword, is there an equivelent?</p>
| java android | [1, 4] |
5,616,772 | 5,616,773 | How to send data to new activity from current activity via intent? | <p>How I can use the intent to send the data to the second class?</p>
<p>I am doing this actually</p>
<pre><code>Intent connectGetData = new Intent(Main.this, GetData.class);
startActivityForResult(connectGetData, REQUEST_GET_DATA);
</code></pre>
<p>From <code>Main.java</code> activity I am calling the <code>Getdata.java</code> activity and I when come back I again get data using.</p>
<pre><code>public void onActivityResult(int mRequestCode, int mResultCode, Intent mDataIntent)
</code></pre>
<p>Please tell me how I can send data to other activity </p>
| java android | [1, 4] |
2,107,229 | 2,107,230 | Running queries, good design here? | <p>Sorry for posting so many nubbin questions on ASP.net, I'm getting the hang of it slowly.</p>
<p>I execute queries on my pages as such (working):</p>
<pre><code><%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script runat="server">
// When the registration form is submitted
protected void regSubmit(object sender, EventArgs e)
{
// No erros so far
Boolean anyError = false;
string errorMessages = "";
// Take all form values
string username = txtUsername.Text;
string password1 = txtPassword1.Text;
string password2 = txtPassword2.Text;
string emailAdd = txtEmail.Text;
// Verify that username is unique
using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["MyDbConn"].ToString()))
{
SqlCommand cmd = new SqlCommand("SELECT COUNT(*) FROM tblUsers WHERE username = '" + username + "'", cn);
cn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
rdr.Read();
int result = int.Parse(rdr[0].ToString()); //read a value
}
statusLabel.Text = username;
}
</script>
</code></pre>
<p>My question is, is this the best practise, do I have to have a 'using' block and that inner structure for every query I run, or is there a simpler way of doing it? Also, do I need to close anything off or does the garbage man take care of it?</p>
<p>In Classic ASP I would just have a </p>
<pre><code>adoCon.execute("DELETE FROM TABLE")
</code></pre>
<p>or a </p>
<pre><code>rsCommon.open("SELECT * FROM TABLE"), adoCon
do until rsCommon.EOF
rscommon.movenext
loop
rsCommon.close
</code></pre>
<p>Tallyho! Thank you for any help!
Which seems a lot simpler and intuitive to me.</p>
| c# asp.net | [0, 9] |
3,820,033 | 3,820,034 | click to add border to div | <p>I have a web page with multiple div. When the user clicks on the body, all div elements will have their border changed to red. However, when the user clicks on a div, only that div will have their border changed to blue.Every other div element will remain with a red border. this is my code so far:</p>
<pre><code>$('body').click(function() {
var $target = $(event.target);
if (!target.closest($('div')).length) {
//I want the border of all div on the page to change to red
$('div'). css('border', '2px solid red');
} else if (target.closest($('div')).length) {
//Here just the div that was clicked on will have its border changed to blue
$(this).css('border', '2px solid blue');
}
});
</code></pre>
| javascript jquery | [3, 5] |
5,706,135 | 5,706,136 | Python C++: is the any python.split() like method in c++? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/53849/how-do-i-tokenize-a-string-in-c">How do I tokenize a string in C++?</a><br>
<a href="http://stackoverflow.com/questions/236129/splitting-a-string-in-c">Splitting a string in C++</a> </p>
</blockquote>
<p>Is there any python.split(",") like method in C++ please.</p>
| c++ python | [6, 7] |
2,523,870 | 2,523,871 | How should I code my jQuery so when I hover over my div, the image in it dissolves into another image? | <p>I know I need to use the hover function on the div, then change the images src attribute, but I don't know how to make it dissolve from one to the other. If I hide it, it just fades back in from white. But I want it to dissolve image to image.</p>
| javascript jquery | [3, 5] |
2,429,433 | 2,429,434 | changing colour of a background image with js on the fly | <p>I have been looking to changing image colours with javascript but the problem is that I need to change the background colour of an image - ie add a tint to it</p>
<p>so i have read a lot of posts on here and it seems possible when the html has a img in it (ie an src) but i cant find any solutions for a background image</p>
<p>So my css may have this in it</p>
<pre><code>.productBenefits ul li {
background: url("tick.png") no-repeat scroll 0 4px transparent;
}
</code></pre>
<p>depending on the url for example i have different colours, and I need to colour this background image with the provided hex - so for example #ff0000</p>
<p>can anyone help?</p>
| javascript jquery | [3, 5] |
2,967,719 | 2,967,720 | javascript equivalent of jquery code | <p>Can someone help what's the javascript equivalent of below jquery line. </p>
<pre><code>$("#abc option[value='1']").text();
</code></pre>
<p>abc is the id of selectbox</p>
| javascript jquery | [3, 5] |
4,543,066 | 4,543,067 | jQuery $('form').serialize() returns only one element of a form serialized | <p>Given the following form:</p>
<pre><code><form id="form" name="form">
<input name="name"/>
<input name="version"/>
<input name="template"/>
<textarea name="elements"></textarea>
<textarea name="features"></textarea>
<textarea name="layout"></textarea>
<input type="submit" value="Save"/>
</form>
</code></pre>
<p>and javascript (using jQuery 1.3.2):</p>
<pre><code>$(function() {
$('#form').bind('submit',function() { alert($('#form').serialize()); return false; });
});
</code></pre>
<p>The output of submitting the above form from the above javascript alert is:</p>
<pre><code>elements=...
</code></pre>
<p>Where ... is whatever is contained in the elements field.</p>
<p>I would expect that $('#form').serialize() to return a string something like:</p>
<pre><code>name=&version=&template=&elements=&features=&layout=.
</code></pre>
<p>I do note that $('input,textarea').serialize() <strong>does</strong> perform the expected behaviour (i.e. return "name=&version=&template=&elements=asdafe&features=&layout="), however I'm curious as to why the $('#form') version only returns "elements=".</p>
<p>I've tried this on Safari 4 and Firefox 3.5, so I'm confident it's something I'm missing.</p>
<p>Thanks for reading.</p>
| javascript jquery | [3, 5] |
5,679,841 | 5,679,842 | JavaScript won't work unless I use alert()! | <p>I run into this issue from time to time and I don't know how to solve it. Here's my code that fails:</p>
<pre><code>function on_lightbox_open() {
system.contextBrowserInit();
updateUrl(year + '/' + month + '/' + id);
ads.reload();
system.analytics.reload();
FB.XFBML.parse($('#bottom_flap .fb_like').get(0)); // facebook
$.ajax({ url: 'http://platform.twitter.com/widgets.js', dataType: 'script', cache: true });
$('#lightbox .close').live('click', function(){
$.modal.close();
});
}
</code></pre>
<p>If I add an alert at the begining like so:</p>
<pre><code>function on_lightbox_open() {
alert('i work now');
system.contextBrowserInit();
updateUrl(year + '/' + month + '/' + id);
ads.reload();
system.analytics.reload();
FB.XFBML.parse($('#bottom_flap .fb_like').get(0)); // facebook
$.ajax({ url: 'http://platform.twitter.com/widgets.js', dataType: 'script', cache: true });
$('#lightbox .close').live('click', function(){
$.modal.close();
});
}
</code></pre>
<p>It magically works. How to make it work without an annoying random alert? </p>
| javascript jquery | [3, 5] |
733,700 | 733,701 | Getting access to standalone JVM / Java Access bridge | <p>I want to get access through the Java Access Bridge to an application that has its own JRE. JAB works fine for me with the "public" JRE (SE 7). But the target application has its own JRE (SE 6). Well neither Monkey nor Ferret display any information about the application. But I know that it is possible due to third party applications that make use of JAB to get access to it. Has anybody an idea how to manage this?</p>
<p>Using Win7 x64,
Visual Studio 2010,
Win 32 application,
Java SE 7_u7,
target apps JRE is JSE 6.</p>
| java c++ | [1, 6] |
4,683,658 | 4,683,659 | Positioning images to fit all size screens | <p>I'm having a problem with positioning images,I need to position a lot images over another larger background image.</p>
<p>An image Like this
<img src="http://i.stack.imgur.com/P5tf3.jpg" alt="enter image description here"></p>
<p>I have tried Absolute but it does not keep the position of the image say I wanted to put a clip art image of a board pin over the background image and need it pointing at a sun and when it's clicked I get a popup dialog,
but then when I change the size of the emulator screen the clip art image is not at the same position I wanted it on the background image.</p>
<p>I first tried just putting the clip art on it with a image editor and used onTouch Listener but that didn't work out when I changed the size of the screen with the x and y coordinates. And tried Absolute Layout and that doesn seem to keep the position.</p>
<p>any ideas would help me big time thanks</p>
| java android | [1, 4] |
1,537,240 | 1,537,241 | Checking whether a click event was triggered by physically mouse clicking or not? | <p>I have a button, and I decided to trigger that button:</p>
<pre><code>$(button_name).trigger("click");
</code></pre>
<p>The handler of the function requires that the left button triggers the click when triggering using the mouse, but also does accepts clicks by triggering using code, like the line shown above. How can I create a conditional statement which evaluates if such conditions are true?</p>
<pre><code>if((navigator.appName === "Microsoft Internet Explorer" && window.event.button === 1)
|| window.event.button == 0
|| ...){
/* If true, do this */
}
</code></pre>
| javascript jquery | [3, 5] |
2,957,686 | 2,957,687 | onerror=string . $varible - fails | <p>Why it fails? It works when onerror=is not a varible but just a hadrtyped string.</p>
<pre><code><?php
$error = "onerror='this.src = \'http://userlogos.org/files/logos/pek/stackoverflow2.png\'';";
for ($i = 1; $i <= 10; $i++) {
echo "<img src='http://services.runescape.com/m=itemdb_rs/3716_obj_sprite.gif?id=" . $i . "' alt='ID " . $i . "' title='ID " . $i . "'" . $error . "/>";
}
?>
</code></pre>
| php javascript | [2, 3] |
1,290,586 | 1,290,587 | Android RSS Example | <p>How do you do you fetch a single RSS feed and show it in an ListView?</p>
<p>I realize there's hundreds of ways, but a clean and simple example would be appreciated.</p>
| java android | [1, 4] |
4,574,838 | 4,574,839 | Look for multiple classes with jQuery | <p>I have a simple script to hide/show a table row. I'd like it to look for an additional class, but I can seem to get it to work. Here is the original:</p>
<pre><code> jQuery(function () {
jQuery(".toggle").click(function () {
jQuery(this).closest("tr").next("tr").find(".hide1").slideToggle("none");
});
});
</code></pre>
<p>I tried adding an 'or' operator to specify another class, but that doesn't work:</p>
<pre><code> jQuery(function () {
jQuery(".toggle").click(function () {
jQuery(this).closest("tr").next("tr").find(".hide1" || ".hide2").slideToggle("none");
});
});
</code></pre>
<p>Can someone point out my error - Javascript is not my strong suit.</p>
| javascript jquery | [3, 5] |
3,175,533 | 3,175,534 | Passing Evercookie values out of the function | <p>I'm totally stuck trying to get the best evercookie value out of the retrieval function and into a JS or PHP function I can use. </p>
<p>The code below works to trigger the alert for best_candidate, but I can't figure out how to return the value out of the function (I'm guessing the nested functions are what are tripping me up) so I can use the value outside the ec.get() function.</p>
<p>Any help would be greatly appreciated. Thanks!</p>
<pre><code>function getCookie(best_candidate, all_candidates)
{
alert("The retrieved cookie is: " + best_candidate + "\n" +
"You can see what each storage mechanism returned " +
"by looping through the all_candidates object.");
for (var item in all_candidates)
{
document.write("Storage mechanism " + item +
" returned: " + all_candidates[item] + "<br>");
}
}
ec.get("id", getCookie);
</code></pre>
| php javascript | [2, 3] |
4,459,739 | 4,459,740 | Caps and Shift key using jquery/javascript | <p>I am facing a problem. I have to identify my Caps Lock is on or not?</p>
<p>If my caps lock on then i have to tell user that your caps on. but the problem is if some one press <kbd>shift</kbd> + <kbd>A</kbd> then it should behave normally.i think key events of <kbd>Caps Lock</kbd> on + <kbd>a</kbd> equal to <kbd>Shift</kbd> + <kbd>a</kbd>.</p>
<p>How can i identify only my Caps Lock key on. i have seen some example in stackoevrflow but these are not working fine.</p>
<p>This all should be using javascript or jquery.</p>
| javascript jquery | [3, 5] |
454,600 | 454,601 | Proper way of binding events with jQuery | <p>I am somewhat new to Javascript but even more green with jQuery. I've already come across something that's got me scratching my head.</p>
<p>What is the difference between:</p>
<pre><code>$('.foo').click(function(){
//blah
});
</code></pre>
<p>and</p>
<pre><code>$('.foo').onclick = function(){
//blah
}
</code></pre>
<p>I prefer the second way but it doesn't seem to work. Am I doing something wrong?</p>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
694,792 | 694,793 | How do I trigger a function when the time reaches a specific time | <p>I want to trigger a javascript function when the time reaches, say, 3:00 PM.</p>
<p>The time will be assigned dynamically. So is there any javascript function to achieve that??</p>
| javascript jquery | [3, 5] |
3,591,750 | 3,591,751 | Static countdown with javascript/php, how? | <pre><code>var austDay = new Date("May 18, 2012 00:00:00");
$('#countdown').countdown({until: austDay});
</code></pre>
<p>Is what I got. I wish to make this static, which I mean by it shows the same countdown in all timezones. So no matter if you change your timezone or your date on your pc, it should not affect the countdown and it should still be e.g 8 hours left.</p>
<p>Maybe this is not possible because Javascript is Client side?</p>
<p>What can I do? I really want it to live countdown and not so you need to refresh. Maybe I can use some help from PHP? </p>
<p>The countdown should be the same for example 4 hours left, it should also display that in new york and asia..</p>
| php javascript jquery | [2, 3, 5] |
1,055,671 | 1,055,672 | Mobile ERP-Android | <p>I have a Project of "An Android Based Mobile ERP Assistant for an Educational Institute". in which i m gonna create a mobile UI application in Android which is capable of fetching the ERP data from server(oracle or any other) e.g. simple select queries...no record insertion will be done using Mobile.
as well as i want to have a faclitiy to send a mail using my UI application to all users which uses the application.
plz some guide me on this that where should my research i start as i m novice in android platform and mobile development also..</p>
| java android | [1, 4] |
4,989,898 | 4,989,899 | Javascript validation for a dynamic gridview have checkbox | <p>I have created a GridView Dynamically. This dynamic gridview has two Template Field column. Both the column has checkboxes in every row. How do I write the client side validation so that only one checkbox is checked at a given time in a particular row.</p>
<p>I tried using this code but it didn't work</p>
<pre><code> function MutExcCheckBox()
{
var wipChk = document.getElementById("ckhBoxSelect");
var aukChk = document.getElementById("chkBoxABC");
for(i = 0; i<wipChk.length ; i++)
{
if(wipChk[0].checked==true)
{
aukChk[0].checked=false;
}else if (aukChk[0].checked==true)
{
wipChk[0].checked=false;
}
}
</code></pre>
<p>I have added the <code>Onclick</code> attribute from code behind.</p>
<pre><code>ckh.Attributes.Add("Onclick", "MutExcCheckBox()");
</code></pre>
<p>Thanks</p>
| c# javascript | [0, 3] |
3,205,964 | 3,205,965 | download zip files by use of reader in c# | <p>I have been working on this application that enables user to log in into another website, and then download specified file from that server. So far I have succeeded in logging on the website and download the file. But everything ruins when it comes to zip files.</p>
<p>Is there any chunk of code that could be helpful in reading the .zip files byte by byte or by using stream reader?</p>
<p>I m using <code>downloadfile()</code> but its not returning the correct zip file.</p>
<p>I need a method by which I can read zip files. Can I do it by using <code>ByteReader()</code></p>
<p>The code used to download zip file is</p>
<pre><code>string filename = "13572_BranchInformationReport_2012-05-22.zip";
string filepath = "C:\\Documents and Settings\\user\\Desktop\\" + filename.ToString();
WebClient client = new WebClient();
string user = "abcd", pass = "password";
client.Credentials = new NetworkCredential(user, pass);
client.Encoding = System.Text.Encoding.UTF8;
try
{
client.DownloadFile("https://web.site/archive/13572_BranchInformationReport_2012-05-22.zip", filepath);
Response.Write("Success");
}
catch (Exception ue)
{
Response.Write(ue.Message);
}
</code></pre>
<p>Thanks in advance.</p>
| c# asp.net | [0, 9] |
2,658,494 | 2,658,495 | Getting variables values from URL after being dynamically added by JQuery | <p>I am using this code below</p>
<pre><code>var delLink = $('#deleteItem').attr('href');
</code></pre>
<p>to get the URL <code>(href)</code> of a link identified by <code>#deleteItem</code>.</p>
<p>The problem occurs when I use JQuery to add new variables onto this URL and I want to see the new dynamically added variables also displayed by the above code.</p>
<p>How can this be done, now it only displays the orginal URL without any of the new variables.</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
4,200,358 | 4,200,359 | Shift select table rows | <p>I know this question has been asked a lot but there is really no definite answer that I can find.
Here is my code. Basically I have everything set up. I'm just lost on where to get the rows of a table by index. I've tried the .index function but I that's not working. I'm trying to do something like <code>$('#pkgLineTable').index(i).addClass('row_selected');</code></p>
<p>But that's not working correctly. Any help would be great. Thank you very much.</p>
<pre><code>var lastSelected;
$('#pkgLineTable tr').live('click', function(event) {
var tableRow = $(this).closest("tr").prevAll("tr").length + 1;
if ($(this).hasClass('row_selected')) {
$(this).removeClass('row_selected');
}
else {
$(this).addClass('row_selected');
}
if (event.shiftKey) {
var table = $('#pkgLineTable');
var start = Math.min(tableRow, lastSelected);
var end = Math.max(tableRow, lastSelected);
for (var i = start; i < end; i++) {
//$(this).parent().parent().addClass('row_selected');
}
} else {
lastSelected = $(this).closest("tr").prevAll("tr").length + 1;
}
</code></pre>
<p>My start and end values are correct. If you select the 2 row and the 5 row you get back 2 and 5. It then iterates 2 - 5. I need to add a class to the rows 2 - 5.</p>
<p>Edit I used this:</p>
<pre><code> for (var i = start; i < end; i++) {
$('#pkgLineTable').each(function() {
$(this).find("tr").eq(i).addClass('row_selected');
});
}
</code></pre>
<p>That's probably not the best way to do it.</p>
| javascript jquery | [3, 5] |
5,531,362 | 5,531,363 | ASMX HTTP Get Parameter is a C# Keyword | <p>I use asp.net 2 and need to consume a 3rd party HTTP GET call that includes a parameter named <code>interface</code></p>
<p>I have created an asmx file and have a function like</p>
<pre><code>[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public void Test(string interface)
{
}
</code></pre>
<p>However, this is a compile error because <code>interface</code> is a C# keyword and so it won't let me create a variable named that. </p>
<p>Is there a way around this problem?</p>
| c# asp.net | [0, 9] |
2,387,794 | 2,387,795 | how to use try catch on <object> attribute? | <p>if i have declared <code><object></code> under my .aspx page named MyPage.aspx as shown below.
for example, this class will receive two parameter for performing a division.</p>
<pre><code><object classid="clsid:XXXXXX-XXXX-XXXX-XXXX-XXXXXX" name="MyControl1" id="Object1">
<PARAM name="param1" VALUE="<%=value1 %>" />
<PARAM name="param2" VALUE="<%=value2 %>" />
</object>
</code></pre>
<p>and the value1 and value2 come from public int value1 and public int value2.
for example;</p>
<pre><code>public class MyPage
{
public int value1 = 6;
public int value2 = 2;
}
</code></pre>
<p>i want to know that is there a way for me to check whether my external class in <code><object></code> is really being called or not? and can i use try catch to check about error that can be happened?</p>
<p>Thank you</p>
<p>vcha</p>
| c# asp.net | [0, 9] |
1,142,775 | 1,142,776 | Delete null items from a dictionary | <p>I have a web page which queries a database and and stores the results in a mapped array dictionary type. the issue im having is that some of the "rows" in the results are null, so I might have 20 records returned and the first three might be null</p>
<p>so I am going through each individual array and checking if that is null, so my questions is how do I delete this from the collection of array.</p>
<p>if I do something like </p>
<pre><code>Objects[i].Remove(Objects[i].Keys.ToString());
</code></pre>
<p>I get an error because Objects[i] is null</p>
| c# asp.net | [0, 9] |
2,141,935 | 2,141,936 | Session Capturing and Modifying | <p>I want to know how can I capture web sessions and modify them.</p>
<p>I`m developing websites and desktop apps, and I want to know if they can be penetrated using the sessions that are created or not. So I want to know how to capture session variables and how to modify them.</p>
<p>If possible, a sample code in <strong><em>C++</em></strong> or <strong><em>C#</em></strong> will be great.</p>
| c# php | [0, 2] |
1,521,609 | 1,521,610 | Correct way to deal with potential session expiration | <p>I am wondering what is the best (e.g. most efficient, commonly accepted, industry standard) way to deal with the potential expiration of a session when you are regularly using the values stored in it in your code.</p>
<p>For example, I am often using (in C#) lines similar to the following:</p>
<pre><code>Guid personGuid = (Guid)Session[SSPersonGuid];
</code></pre>
<p>I am checking in Page_Load whether the values are null and dealing accordingly, but the session might expire while the person is on the page, in which case when they click a button on the page, and we need to use something like the above, there will be a NullReferenceException.</p>
<p>Is the best way to handle this just to check for null before each usage like this:</p>
<pre><code>if (Session[SSPersonGuid] == null) {...}
</code></pre>
<p>Or is there some kind of special thing I don't know about?</p>
| c# asp.net | [0, 9] |
3,079,416 | 3,079,417 | Jquery not called? | <pre><code><div>
<asp:Button ID="btnCalculate" runat="server" Text="Calculate Claim" OnClientClick="cfrm();"/>
</div>
<div style="visibility: hidden;">
<asp:Button ID="btnYes" runat="server" OnClick="btnYes_Clicked" />
</div>
<script language="javascript" type="text/javascript">
function cfrm() {
var fee = $('[id$=lblTotalProcedureFee]').text();
if (fee > 500) {
if (confirm('Are you sure to do this operation?')) {
$('#<%= this.btnYes.ClientID %>').click();
}
}
}
</script>
</code></pre>
<p>I am trying to call "btnYes_Clicked" from the query. Refer to above code. It doesn't work.. then i edited the code just to test. First click, it doesn't work. 2nd click, it goes to the btnYes_Clicked event. I'm using master page which has update panels. Please help. Thanks..</p>
<pre><code><script language="javascript" type="text/javascript">
function cfrm() {
$('#<%= this.btnYes.ClientID %>').click();
}
</script>
</code></pre>
| c# jquery asp.net | [0, 5, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.