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 |
---|---|---|---|---|---|
639,272 | 639,273 |
Android orientation changing exceptions
|
<p>I'm having a hard time with the screen orientation in Android. I have an activity which captures a signature after the user draws his signature on the device. And for that activity I am passing a parceable object and I get it in oncreate. When the activity changes the orientation sometimes the activity cannot get the parceable object and gives an exception. I tried using a static object for the parceable object but no use. I tried onsaveinstance state method and onRetainNonConfigurationInstance methods as well. </p>
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.signature_capture_view);
Bundle bundle = getIntent().getExtras();
info = bundle.getParcelable("info");
logo= (Bitmap) bundle.get("logo");
}
</code></pre>
<p>And my save instance state method is like this;</p>
<pre><code>@Override
protected void onSaveInstanceState(Bundle outState) {
outState.putParcelable("info", info);
super.onSaveInstanceState(outState);
}
</code></pre>
<p></p>
<p>From the onconfiguration changed method i call the setcontentview method to set a fresh layout. </p>
<pre><code>@Override
public void onConfigurationChanged(Configuration newConfig) {
setContentView(R.layout.signature_capture_view);
super.onConfigurationChanged(newConfig);
}
</code></pre>
<p>Sometimes when the orientation changes an out of memory exception occurs from the setcontentview method. </p>
<p>Any help would be greatly appreciated. Thanks in advance. </p>
|
java android
|
[1, 4]
|
511,957 | 511,958 |
JavaScript: max of an array not working
|
<p>I have this javascript code: <a href="http://jsfiddle.net/MvWV7/5/" rel="nofollow">http://jsfiddle.net/MvWV7/5/</a></p>
<p>What I'm trying to achieve is that user should fill the inputs starting with 1. After the user types 1 the next value must be 2 (not nanother number) and so on.</p>
<p>I'm trying to fill the inputs values in an array by doing this (as shown in the fiddle):</p>
<pre><code>var ary = [];
$(".activity_order").not(self).each(function(t) {ary.push(this.value);})
</code></pre>
<p>but when I do</p>
<pre><code>ary.max()
</code></pre>
<p>I get</p>
<pre><code>Uncaught TypeError: Object ,,,,,,,, has no method 'max'
</code></pre>
<p>In console when I do <code>ary.max()</code> i get 0 if there's no numbers</p>
<p><strong>UPDATE</strong></p>
<p>My fault, I was using google console in jsfiddle and I started to look up for array methods inside.
When I did ary.max() it gives 0</p>
|
javascript jquery
|
[3, 5]
|
3,595,112 | 3,595,113 |
How compatible is the Java implementation of Android exactly?
|
<p>Is there any definition that states which standard class libraries are supported on Android?</p>
<p>Let's assume we build a jar library and compile it using JavaSE.
This library will maybe used by a JavaSE server application and/or on a JSP Server.</p>
<p>Are there any means to know beforehand if Androids dex will be able to compile this Library into Dalvik bytecode?
Other means than Trial&Error i mean :).</p>
|
java android
|
[1, 4]
|
1,924,114 | 1,924,115 |
Which way is true for Exit from app include IF method?
|
<p>How we can exit from app include if method , like this method but it's not true :</p>
<pre><code>if (ClassName.this.finish(); == true) {
//code..
}
</code></pre>
|
java android
|
[1, 4]
|
409,747 | 409,748 |
Loop through all IDs that begin with XXX
|
<p>Would anyone know how to loop through all ID's that being with name_</p>
<p>So, for example, within the markup I may have 50 id's that all start with "name_", the full ID would be like name_2, name_55, name_25, etc.</p>
<p>I'd like to loop through all of these getting the number.</p>
<p>Not really sure where to begin....... thank you!</p>
|
javascript jquery
|
[3, 5]
|
3,645,076 | 3,645,077 |
How to save files(doc,image,etc.,) through Jquery
|
<p>I am loading Html page to panel, in that html page html file(uploadfile) is there. when ever i upload some file(doc,image,etc.,) and save html button.. i want to save that file to project in SAVED_DOCUMENTS folder, and also that path to database..</p>
<pre><code>$('input[type="file"]').each(function () {
completeids.push($(this).attr('id'));
completevalues.push($(this).attr('value'));
completetype.push('FILE');
completeselected.push('no');
});
</code></pre>
<p>After finding the value of file i want to dump that to SAVED_DOCUMNETS folder...
can you give some suggestion to handle this..</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
3,467,856 | 3,467,857 |
Maximum three checkbox selected and other disable
|
<p>I'm working on a project and made a grid on admin side in which all projects are shown so that when admin click on three projects they should be shown on index page of that site and makes other check boxes disable after selecting three projects and when to change it remove one of selected check box and then give selection to others.what I did is got a java script code from stack overflow.Now this code is working but problem is that when i refresh page or navigate from other menu more check boxes could be selected even it shows the previous three selected projects on index page.how can i make it to not select after page refresh. here is code </p>
<pre><code>function disableHandler (form, inputName) {
var inputs = form.elements[inputName];
for (var i = 2; i < inputs.length; i++) {
var input = inputs[i];
input.onclick = function (evt) {
if (this.checked) {
disableInputs(this, inputs);
}
else {
enableInputs(this, inputs);
}
return true;
};
}
}
function disableInputs (input, inputs) {
for (var i = 2; i < inputs.length; i++) {
var currentInput = inputs[i];
if (currentInput != input) {
currentInput.disabled = true;
}
}
}
function enableInputs (input, inputs) {
for (var i = 2; i < inputs.length; i++) {
var currentInput = inputs[i];
if (currentInput != input) {
currentInput.disabled = false;
}
}
}
</code></pre>
|
php javascript
|
[2, 3]
|
2,283,043 | 2,283,044 |
Asp.Net(C#) Label Text inline
|
<pre><code><asp:TextBox ID="TextBox1" runat="server" Text='<%# DateTime.Now.ToLongDateString() %>'></asp:TextBox>
</code></pre>
<p>ı need textbox text set DateTime.Now.ToLongDateString() how to make ?
must inline</p>
|
c# asp.net
|
[0, 9]
|
3,517,284 | 3,517,285 |
insert mysql record with table format in a string then echo in a html
|
<p>Ok, I have this code.</p>
<pre><code>$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("juliver", $con);
$result = mysql_query("SELECT * FROM items");
while($row = mysql_fetch_array($result))
{
$hi1='<img src="'.$row['name'].'" />';
$hi2= $row['title'];
$hi3= $row['description'];
$hi4= $row['link'];
}
</code></pre>
<p>Now, Im in a process of making those records above to display in a table view and that 4 row should be on one td and so the rest.</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,370,661 | 5,370,662 |
How to get Client timeZoneOffset from server side code
|
<p>How can I get getTimezoneOffset(); value from the client side in codebehind(aspx.cs file) on Page_load event?</p>
|
c# asp.net
|
[0, 9]
|
5,724,099 | 5,724,100 |
Hide div doesn't work?
|
<p>I have div which it is hidden by default , when the use clicks show link the following javascript method is called:</p>
<pre><code>function ChangeControlVisibility(elementID) {
var element = $("#" + elementID);
if (element.css('display') != 'block' && element.css('display') != 'table') {
element.show();
var tempElement = $('div.expanded');
if (tempElement.length > 0) {
tempElement.css('background-image', 'url(../images/arrow1.gif)');
}
}
else {
element.hide();
var tempElement = $('div.expanded');
if (tempElement.length > 0) {
tempElement.css('background-image', 'url(../images/arrow2.gif)');
}
}
}
</code></pre>
<p>this step works but when i call the previous method at page_load event the method doesn't work:
element.css('display') undefined.</p>
<p>Is there any problem at the previous code????</p>
|
asp.net jquery
|
[9, 5]
|
4,094,508 | 4,094,509 |
how to retain a button1 clicks action with a sleep against another button2 click action without sleep
|
<p>My problem is I have two labels and two buttons in two different update panel in ASP.Net. The update panels contains two buttons. When buttons are clicked it will update the corresponding label text. The issue is, suppose I gave a delay of 5 seconds in my button1_click() method, when I click button1 and button2 immediately, label2 is gettin updated, whereas label1 is not getting updated.</p>
<p>Can you suggest where I'm going wrong?</p>
<pre><code>protected void Button1_Click2(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(5000);
Label1.Text = "Hello";
}
protected void Button2_Click1(object sender, EventArgs e)
{
Label2.Text = "World";
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,105,278 | 4,105,279 |
Web page download progress with percentage
|
<p>i saw that flash website can be develop to show percentage of loading page. when web page is downloading in client machine then a percentage is shown and show much content is downloading in client machine. so i just want to know the same effect can be achieve in asp.net website where we will show the percentage of the page content is downloading in client machine with the help of JQuery when page will be requested by user.</p>
<p>please discuss how to achieve it. thanks.</p>
|
asp.net jquery
|
[9, 5]
|
4,124,975 | 4,124,976 |
Select Form Array Value Using JQuery
|
<p>I have a form that is being generated on the fly in PHP using the below (<code>$theFeatures</code> is a multidimensional array):</p>
<pre><code><?php
foreach($theFeatures as $theKey => $theValues) {
?>
<input type="text" value="<?php echo $theValues['Key']; ?>" name="theFeatures[<?php echo $theKey; ?>]['Key']" size="6" />
<input type="text" value="<?php echo $theValues['Value']; ?>" name="theFeatures[<?php echo $theKey; ?>]['Value']" /> <br />
<?php
}
?>
</code></pre>
<p>This should create two input boxes that look like this:</p>
<pre><code><input value="Type" name="theFeatures[4]['Key']" size="6" type="text" />
<input value="Bird Table" name="theFeatures[4]['Value']" type="text" />
</code></pre>
<p>How can I get the first part of the array ( <code>[4]</code> in the above example ) in jQuery so I can store that as a JavaScript variable and use it else where in my jQuery??</p>
<p>Cheers,</p>
<p>Andy</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,916,007 | 4,916,008 |
jQuery - Open Links In New Tab form submit
|
<p>This method basically open a new web page in new window where the Url comes in <strong>e.result</strong> parameter , Here I want to open the same window in New Tab not in new window.</p>
<pre><code> $("#formMain").attr("action", e.result);
$("#formMain").attr("method", "post");
$("#formMain").attr('target', '_blank');
$("#formMain").submit();
</code></pre>
<p>any suggestion will be highly appreciated</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,903,226 | 1,903,227 |
How do I sort a GridView?
|
<p>ASP.NET <code>GridView</code> sorting: I want to change the sorting direction from ascending to descending when I click the column name. But by default, sorting direction always showing ascending. Am I missing any property setting to toggle sorting direction? Any help greatly appreciated. Thanks.</p>
<pre><code>protected void gridView_Sorting(object sender, GridViewSortEventArgs e)
{
DataTable dataTable = myDataTable(strSQL);
if (dataTable != null)
{
DataView dataView = new DataView(dataTable);
dataView.Sort = e.SortExpression + " " + SortDirection(e.SortDirection);
gridView.DataSource = dataView;
gridView.DataBind();
}
}
//e.SortDirection always showing ascending
</code></pre>
<p>aspx gridview column design for sorting:</p>
<pre><code><asp:BoundField DataField="CREATE_DATE" HeaderText="Create Date" SortExpression="CREATE_DATE" />
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,730,602 | 3,730,603 |
Java: increase the size of Edittextfield
|
<p>trying to increase the size of the edittextfield in java..how can i do that.
Below is my code</p>
<pre><code>final EditText address = new EditText(activity);
if (data.getFavoriteAddress() != null
&& !data.getFavoriteAddress().trim().equals("")) {
address.setText(data.getFavoriteAddress());
} else {
address.setHint(R.string.address);
}
</code></pre>
|
java android
|
[1, 4]
|
3,641,237 | 3,641,238 |
Question regarding adding and overriding functions in existing plugin
|
<p>Below is my my plugin:</p>
<pre><code>(function($) {
$.fn.myPlugin = function(options) {
var opt = $.extend({}, $.fn.myPlugin.defaults, options);
this.foo()
{
alert('test');
}
}
$.fn.myPlugin.defaults = {
};
});
</code></pre>
<p>Now I want to extend it without touching the original plugin i.e I want the full feature of existing plugin + the new features which I want. Below are the new things I need:</p>
<p><strong>First</strong>:
Name of the new plugin "myPlugin2"</p>
<p><strong>Second</strong>:
The "foo" fuction of the exisiting plugin should be overrided in the new plugin with this:</p>
<pre><code>function foo() {
alert('test2');
}
</code></pre>
<p><strong>Third</strong>:
I need to add one more method to my new plugin say function foo2(){} . </p>
<p>Can you help me in achieving this?</p>
|
javascript jquery
|
[3, 5]
|
462,233 | 462,234 |
what are the pros and cons of declare and use method local class in java?
|
<p>i have seen many developers using <code>method local class</code> (i don't mean anonymous class) in their code.</p>
<p>for example (in android):</p>
<pre><code>private void myFunc()
{
class Worker extends AsyncTask<Void, Void, Void>
{...}
new Worker();
}
</code></pre>
<p>what are the pros and cons when doing this for both design and run time?
is it bad to use local class when the method is called many times?</p>
|
java android
|
[1, 4]
|
1,459,775 | 1,459,776 |
Access JavaScript variable from HTML element attribute
|
<p>Is there a way to access a JavaScript variable from an attribute from an HTML element?</p>
<p>For example:</p>
<pre><code><a href="#" id="id1" my-attr="test">click here</a>
<script type="text/javascript">
var test="hello world!";
$("#id1").click(function() { alert($(this).attr('my-attr')) });
</script>
</code></pre>
<p>What I want to happen is the alert to show "hello world!" but obviously instead it shows "test"</p>
<p>I know I can accomplish this if I use eval(), I was just wondering if there was another way. Some type of JavaScript reflection or something?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
4,218,071 | 4,218,072 |
Can't call page method from JQuery?
|
<p>I have a page called AddNews.aspx and in codebehind a web method called AddNews(Parameters)..</p>
<p>AddNews.aspx page is inherited from a master page.. So i used contentplaceholder.</p>
<p>I have a button..It's id is btnSave.</p>
<p>Here is jquery code:</p>
<pre><code>$(function() {
$("[id$='_btnSave']").click(function() {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
data: $.toJSON(veriler),
url: "AddNews.aspx/AddNews",
dataType: "json",
success: function(result) {
$("#result").html('News added');
},
error: function() {
alert('Problem');
}
});
});
});
</script>
</code></pre>
<p>Button click trigger now.. But it doesnt call Web Page Method.. What's the problem?</p>
|
asp.net jquery
|
[9, 5]
|
39,471 | 39,472 |
How to display a message on the first press of a button?
|
<p>I need to display the message with first time the button is pressed only. If I press the button again, it will redirect me. How to do in javascript? </p>
<p>I have submit button, first time press button it will show the message. Pressing the same button the next time should NEVER SHOW the message, it should forward to the next page.</p>
<p>Please show me how to do this in javascript?</p>
|
javascript jquery
|
[3, 5]
|
4,232,358 | 4,232,359 |
get value of an attribute of the clicked element
|
<pre><code><ul id='langs'>
<li data-val='en'>english</li>
<li data-val='fr'>francais</li>
<li data-val='it'>italiano</li>
</ul>
</code></pre>
<p>when the user clicks on any of these <code><li></code> I want to <code>alert()</code> it's data-val attribute value</p>
<p>anybody knows how?</p>
|
javascript jquery
|
[3, 5]
|
448,244 | 448,245 |
on does ot handle event like live in jQuery
|
<p>I have a page that at run time I add some control based on situations.</p>
<p>I write this code for <code>mouseover</code> event for <code>TDs</code> in my table:</p>
<pre><code>$(".TableEntry .EntryCell").live("mouseover", function () {
var parent = $(this).parent();
parent.css("background-color", "C4F7C3");
});
</code></pre>
<p>and it works fine.but according to jQuery doc:</p>
<blockquote>
<p>the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live().</p>
</blockquote>
<p>I use <code>on</code> or <code>delegate</code> like this code but it does not works:</p>
<pre><code>$(".TableEntry .EntryCell").on("mouseover", function () {
var parent = $(this).parent();
parent.css("background-color", "C4F7C3");
});
</code></pre>
<p>how I can add event handler dynamically using <code>on</code> or <code>delegate</code>?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,538,173 | 1,538,174 |
How to dynamically set the maxlength property of bound textbox from database field length
|
<p>I have an asp.net 4.0 c# web application. I am using listview and formview controls with templates on my forms. I am trying to control the maxlength property of my bound textboxes without hard coding the field sizes into my aspx pages. I would like to when I first load the application fill some kind of local object or array with the column lengths of my fields and then use those values to dynamically set the maxLength field of textboxes.
There are so many methods out there to try and I am not sure what is the most efficient.
My sql to get the schema info is </p>
<pre><code>SELECT TOP (100) PERCENT sys.sysobjects.name AS TableName, sys.syscolumns.name AS ColumnName, sys.systypes.name AS DataType,
sys.syscolumns.length
FROM sys.sysobjects INNER JOIN
sys.syscolumns ON sys.sysobjects.id = sys.syscolumns.id INNER JOIN
sys.systypes ON sys.syscolumns.xtype = sys.systypes.xtype WHERE (sys.sysobjects.xtype = 'U') AND (sys.systypes.name <> 'sysname')
ORDER BY TableName, sys.syscolumns.colid
</code></pre>
<p>how can i store this locally so I don't have to keep querying the server and I can I set this dynamically using c#</p>
<p>I am a semi newbie so as much detail as can be provided would be appreciated.</p>
|
c# asp.net
|
[0, 9]
|
5,787,682 | 5,787,683 |
Incorrect syntax near ''. Unclosed quotation mark after the character string ' '
|
<p>I'm just wondering if someone could point me in the right direction here, I think i've been looking at it for too long so can't see the mistake.</p>
<p>The following code:</p>
<pre><code>SqlCommand updateStyle = new SqlCommand("UPDATE [Lorenz].[dbo].[Layout] SET [bgColour] = '" + bgColour + "' , [textColour] = '" + txtColour + "WHERE <[LoweredUserName] ='" + currentUser + "' ", connection);
updateStyle.ExecuteNonQuery();
</code></pre>
<p>Is giving the error:</p>
<p>Incorrect syntax near 'admin'.
Unclosed quotation mark after the character string ' '.</p>
|
c# asp.net
|
[0, 9]
|
5,861,319 | 5,861,320 |
window.setInterval - more than expected
|
<p>Could you guys explain more deeply window.setInterval functionality? I've been asked myself several questions while running that snippet:</p>
<pre><code>var i = 0;
window.setInterval(function(){
$('#show').html($('.questions :eq('+i+')'));
}, 1000);
</code></pre>
<p>So, i think that window.setInterval is awesome because it automatically increment <code>i</code> var, displays all divs that nested in <code>.questions</code> before goes new iteration, and stops when last div in <code>.questions</code> is reached.</p>
<p>But the main question if it is possible to change function from outside, for example remove <code>$('.questions :eq('2')')</code>, before new iteration?</p>
<p>thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,989,741 | 3,989,742 |
schedule two tasks subsequently in android
|
<p>i want to perform 2 tasks.
First should repeat once in every 10min
Second should repeat every minute.
Example
Opening a website in first task
Opening another website in second task.
Thanx in advance</p>
|
java android
|
[1, 4]
|
4,980,468 | 4,980,469 |
Jquery fadein after an update panel has ran
|
<p>I'm having trouble figuring out how to fade in some divs that I fade out when clicking on a checkbox. It brings back the new results but they pop up straight away. This is the code I am using to fade out.</p>
<p>any ideas how I can run the same thing but fadein after after an update panel?</p>
<pre><code> $(document).ready(function () {
$('input[type=checkbox]').click(function () {
var _this = $(this);
$(".gradientBoxesWithOuterShadows").fadeOut('slow $(".gradientBoxesWithOuterShadows").fadeOut', function () {
});
});
</code></pre>
|
jquery asp.net
|
[5, 9]
|
4,240,487 | 4,240,488 |
Easy to understand and follow books on jQuery and javascript?
|
<p>I would like to know your opinion of a good jQuery and JavaScript book. There are just too many of them [when I try to search]. Please suggest some really good books which I could buy.</p>
<p>My current knowledge on these technologies - Close to Zero.</p>
<p>Thanks in advance,
Rahul</p>
|
javascript jquery
|
[3, 5]
|
5,013,240 | 5,013,241 |
how to handle this ThreadAbort Exception..?
|
<p>i got this exception when i done the code given below..</p>
<p>"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack." </p>
<p>--code--</p>
<pre><code>try
{
if (retVal == 0)
Response.Redirect("Success.aspx");
}
catch(Exception error)
{
Response.Redirect("errorpage.aspx");
}
finally{
}
</code></pre>
<p>from searching in net i found it to be a bug and if its success then we should end response... ie " Response.Redirect("Success.aspx", false); ".it works fine.. is this a good method or there is any other efficient method to handle this exception please help....</p>
|
c# asp.net
|
[0, 9]
|
4,873,865 | 4,873,866 |
Best way to save a little amount of data
|
<p>I'm currently developing an Android application where OAuth will be in use. In order to use OAuth, I need to be able to save the consumer's private key to access the protected resources. My question is, where would I want to save this tiny piece of data? I know that for most Android applications, data would be stored in a SQLite database. But for only a little bit of information, a string containing random letters and numbers, would SQLite be the best way to go? Or would it just be better to write the data to a file and save it on the file system? I don't know what the best practice for this would be, so hopefully I'll be able to get some insight.</p>
<p>Thanks a bunch guys!</p>
|
java android
|
[1, 4]
|
5,058,315 | 5,058,316 |
Set php priority on execution
|
<p>I have a problem, in php form I have two functions calls, one php function and another javascript one. These functions are called on a submit form. The php function is called on form submit and the javascript one is called "onclick" when the submit button is pressed.</p>
<p>How could I reach that javascript function will be executed before php function?</p>
|
php javascript
|
[2, 3]
|
4,835,521 | 4,835,522 |
Find the clicked li number
|
<p>I have a standard list...</p>
<pre><code> <ul>
<li><a href="#">blah 1</a></li>
<li><a href="#">blah 2</a></li>
<li><a href="#">blah 3</a></li>
<li><a href="#">blah 4</a></li>
</ul>
</code></pre>
<p>And my jQuery:</p>
<pre><code>$('ul li a').live('click', function() {
var parent = $(this).parent('li');
});
</code></pre>
<p>What I want to find out is the parent li's position in the list of the clicked link e.g. clicking on blah 3 would give me 2, blah 4 would give 3 etc.</p>
<p>Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
3,695,306 | 3,695,307 |
Hover acting weird in IE
|
<p>Have a look at this HTML code:</p>
<pre><code><div class="overlay">
<a href="#">1</a>
<a href="#">1</a>
<a href="#">1</a>
<a href="#">1</a>
<a href="#">1</a>
</div>
</code></pre>
<p>and this jQuery code:</p>
<pre><code>$('div.overlay').mouseenter(function() { clearTimeout(thumbsAway); });
$('div.overlay').mouseleave(function() { clearTimeout(thumbsAway); $('ul.thumbs').animate({top: '520px'}, 750); });
</code></pre>
<p>The problem is that in IE, hovering on any child element will also trigger mouseenter/mouseleave. How can I prevent this?</p>
|
javascript jquery
|
[3, 5]
|
1,035,888 | 1,035,889 |
Equivalent to PHP's include in C#
|
<p>What is the equivalent command to PHP's include() in C# ? </p>
<p>For example, PHP's include is used as so : include("ex.php");</p>
<p>Can I do the same in C#?</p>
|
c# php
|
[0, 2]
|
3,982,297 | 3,982,298 |
Java to C# code converter
|
<p>Are there any converters available that converts Java code to C#?</p>
<p>I need to convert the below code into C#</p>
<pre><code>String token = new String("");
URL url1 =new URL( "http", domain, Integer.valueOf(portnum), "/Workplace/setCredentials?op=getUserToken&userId="+username+"&password="+password +"&verify=true");
URLConnection conn1=url1.openConnection();
((HttpURLConnection)conn1).setRequestMethod("POST");
InputStream contentFileUrlStream = conn1.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(contentFileUrlStream));
token=br.readLine();
String encodedAPIToken = URLEncoder.encode(token);
String doubleEncodedAPIToken ="ut=" + encodedAPIToken;//.substring(0, encodedAPIToken.length()-1);
//String doubleEncodedAPIToken ="ut=" + URLEncoder.encode(encodedAPIToken);
//String userToken = "ut=" + URLEncoder.encode(token, "UTF-8"); //URLEncoder.encode(token);
String vsId = "vsId=" + URLEncoder.encode(docId.substring(5, docId.length()), "UTF-8");
url="http://" + domain + ":" + portnum + "/Workplace/getContent?objectStoreName=RMROS&objectType=document&" + vsId + "&" +doubleEncodedAPIToken;
String vsId = "vsId=" + URLEncoder.encode(docId.substring(5, docId.length()), "UTF-8");
url="http://" + domain + ":" + portnum + "/Workplace/getContent?objectStoreName=RMROS&objectType=document&" + vsId + "&" +doubleEncodedAPIToken;
</code></pre>
<p>Thanks in advance</p>
|
c# java
|
[0, 1]
|
4,851,545 | 4,851,546 |
Why isn't this second table not visible?
|
<p>I have two tables in a page like this:</p>
<pre><code><table style="width:800px">
<tr>
<td style="width:400px;">
<table id="currencies"
style="border-spacing: 5px; padding: 3px; margin: 2px" />
</td>
<td style="width:400px;">
<table id="changers"
style="border-spacing: 5px; padding: 3px; margin: 2px" />
</td>
</tr>
</table>
</code></pre>
<p>I use jqgrid to extend these. One is the master table while the other is the detail. The problem however is the second table (id = "changers") is not being displayed in the page. I inspected the javascript from the browser and it has only one <code><td></code> element within the table row. This problem goes away if I put them in separate tables like so:</p>
<pre><code><table id="currencies"
style="border-spacing: 5px; padding: 3px; margin: 2px" />
<table id="changers"
style="border-spacing: 5px; padding: 3px; margin: 2px" />
</code></pre>
<p>I'm totally stuck on this. Any help is appreciated.</p>
|
javascript jquery
|
[3, 5]
|
3,974,592 | 3,974,593 |
ExtJs integration with asp.net : examples
|
<p>Pls share any known good examples of ExtJS framework with asp.net</p>
|
asp.net javascript
|
[9, 3]
|
4,133,665 | 4,133,666 |
Jquery - Truncate Text by Line (not by chart-count)
|
<p>I need a Jquery script to truncate a text paragraph by line (not by chart count).</p>
<p>I would like to achieve an evenly truncated text-block. It should have a "more" and "less" link to expand and shorten the text paragraph. My text paragraph is wrapped in a div with a class, like this:</p>
<pre><code><div class="content">
<h2>Headline</h2>
<p>The paragraph Text here</p>
</div>
</code></pre>
<p>The closest solution i could find on SOF is the one below (but it`s for textarea element and does not work for me):
<a href="http://stackoverflow.com/questions/556767/limiting-number-of-lines-in-textarea">http://stackoverflow.com/questions/556767/limiting-number-of-lines-in-textarea</a></p>
<p>Many thanks for any tips.
Ben</p>
|
javascript jquery
|
[3, 5]
|
1,207,776 | 1,207,777 |
What could C# learn from Java?
|
<p>I've been a "Microsoft developer" ever since I started programming... I started out by learning QBasic then ASP & Visual Basic and finally I moved on to learn VB.NET, ASP.NET and C# which is now my primary language. Still I've always wanted to learn something like Java or C++ to see how what the "other side" is like, and to learn the pros and cons of each platform. The only problem is that I never found the time or opportunity to pick up another language.</p>
<p>My basic understanding is that Java and C# have a lot of similarities as well as a lot of differences. Coming from C# I'm mostly interested in what C# could learn from Java, or put another way, what I'm missing out on.</p>
|
c# java
|
[0, 1]
|
327,799 | 327,800 |
Select first word in a container
|
<p>maybe this is easy or I overlooked it</p>
<p>but if i have:</p>
<pre><code><div class='test'>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</div>
</code></pre>
<p>how can i select the first word of it? [in this example 'Fusce']</p>
|
javascript jquery
|
[3, 5]
|
3,857,815 | 3,857,816 |
JSON check if no data is available
|
<p>I am using this code to get data from json.</p>
<pre><code>$.each(data.id, function(index, value){
output += '<li>'+value.title+'</li>';
}
$('#listview').html(output).listview('refresh');
</code></pre>
<p>Sometimes there are no records to display.</p>
<p>How can I know if there are no records and display an alert example: alert('No records'); ?</p>
|
javascript jquery
|
[3, 5]
|
5,716,852 | 5,716,853 |
how to get data from string in javascript
|
<p>I have such string <code>test1/test2/test3/test4/test5</code>
How can I get those tests in separate variables or in array or smth using javascript or jquery ?</p>
|
javascript jquery
|
[3, 5]
|
5,335,330 | 5,335,331 |
Get independent HTML from $.ajax()
|
<p>Assume that in</p>
<pre><code>$.ajax({
url: 'page1.html',
data: {},
success: function (data) {
$(data) //return an array of nodes
},
dataType: 'html'
});
</code></pre>
<p><code>$(data)</code> returns an array of nodes:</p>
<pre><code>[<div id="a">,
<div id="b">, //3 elements
<div id="c">]
</code></pre>
<p>and I want to get the HTML of the div that has an <code>id</code> of <code>"b"</code>. I tried </p>
<pre><code>$(data).find("#b");
</code></pre>
<p>but it returns a blank array. (<code>[]</code>) So how can I select it? Please help.</p>
|
javascript jquery
|
[3, 5]
|
3,774,430 | 3,774,431 |
How to check the value given is a positive or negative integer?
|
<p>Lets say i have the value 10 assigned to a variable;</p>
<pre><code>var values = 10;
</code></pre>
<p>and i want to run a specific function if the value is a positive</p>
<pre><code>if(values = +integer){
//do something with positive
} else {
//do something with negative values
}
</code></pre>
<p>How would this be achieved?</p>
|
javascript jquery
|
[3, 5]
|
3,258,249 | 3,258,250 |
Keep .click() function after partial data update
|
<p>I'm using a table for a coordinate system, and with a function in each td element to update the field value. </p>
<pre><code>[ ][ ][X][ ]
[ ][X][X][X]
[X][ ][ ][ ]
</code></pre>
<p>When I click an empty element, I want it to set the value to "X" in my database, by getting new partial data from my rails app (and sending GET-variables along), and then re-render the table. This works just fine using my rails app, however ONLY once. It seems like the jQuery function .click() only runs once. The function looks as following: (<em>generated via. coffeescript</em>)</p>
<pre><code>$(document).ready(function() {
$(".field").click(function(e) {
$.get("http://localhost/dinners?ap="+$(this).attr('id'), function(data) {
$("#dinner_table").html(data);
});
});
});
</code></pre>
<p>This will run just fine, and once I click an element, it will render new data in the table - but only once! If I redefine the .click() function after I swap the HTML in the function, it allows me to click (and update) twice, etc. </p>
<p>I'm pretty sure this is a basic question, but no luck with the searches so far.</p>
|
javascript jquery
|
[3, 5]
|
2,595,044 | 2,595,045 |
The type or namespace name 'Class1' could not be found (are you missing a using directive or an assembly reference?)
|
<p>Using VS2012 , asp/c#</p>
<ul>
<li>Created New Website empty project</li>
<li>created new asp file</li>
<li><p>created new c# class file, dialog comes up saying I need to have this class in App_Code folder, I said yes ok.</p>
<pre><code>Website
Default.aspx
Default.aspx.cs
App_Code
Class1.cs
</code></pre></li>
</ul>
<p>My default.aspx.cs file calls (creates instance) Class1.cs. Below error happens when I put this website in remote server. my localhost server website is coming up.</p>
<p>Compiler Error Message: CS0246: The type or namespace name 'Class1' could not be found (are you missing a using directive or an assembly reference?)</p>
<p>Source Error:</p>
<pre><code>Line 11: protected void Page_Load(object sender, EventArgs e)
Line 12: {
Line 13: Class1 cls = new Class1();
Line 14: cls.getValue();
Line 15: }
</code></pre>
|
c# asp.net
|
[0, 9]
|
423,105 | 423,106 |
Is is possible to call a function after window.location has loaded new URL?
|
<p>I'd like to be able to call a jquery function once window.location has completed loading a URL. Is this possible? I can't seem to find anything online about this.</p>
<p>for instance:</p>
<pre><code>if(parseInt(msg.status)==1) {
window.location=msg.txt;
alert("This URL has finished loading")
}
</code></pre>
<p>Thanks,
-Paul</p>
|
javascript jquery
|
[3, 5]
|
4,126,486 | 4,126,487 |
Detect if new window if opend using javascript
|
<p>Creating a small chat application where user can start chat by clicking on chat button next to user's profile.</p>
<p>Once anyone will click on chat button a popup window will appear. Now I want to detect dynamically if this popus is still open or closed. </p>
<p>If popup is opened= Display new message alert in notification.</p>
<p>if popup is closed = Do not alert new message in notification (As chat window is already opened)</p>
<p>This is what I tried:</p>
<pre><code> <a href="#" onclick="popitup("http://domain.com/chat/2")">Chat with user 2</a>
<a href="#" onclick="popitup("http://domain.com/chat/1")">Chat with user 1</a>
</code></pre>
<pre class="lang-js prettyprint-override"><code>// on document ready
setInterval(function(){
chkAlerts();
}, 10000);
var newwindow = null;
function popitup(url) {
if ((newwindow == null) || (newwindow.closed)) {
newwindow = window.open(url,'Buy','width=950,height=650,scrollbars=yes,resizable=yes');
newwindow.focus();
}
else {
newwindow.location.href = url;
newwindow.focus();
}
}
function chkAlerts(){
if ((newwindow == null) || (newwindow.closed)) {
//Do something
alert('now window is closed show alerts');
}
}
</code></pre>
<p>With this code I am always getting </p>
<pre><code>alert('now window is closed show alerts');
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,499,221 | 5,499,222 |
Store a bunch of inputs on page into a javascript array?
|
<p>I have a bunch of inputs on a page, ie:</p>
<pre><code><input name="user[name]" />
<input name="user[phone]" />
<input name="user[email]" />
</code></pre>
<p>And what I'd like to do, is on submitting the form is grab all those variables of the user array and store them in a javascript array.</p>
<p>Ie, I would think something like this would work:</p>
<pre><code>$('submit').click(function(e){
e.preventDefault;
$.each($('input[name=user*') as var) {
var user[] = this.input value etc;
}
});
</code></pre>
<p>But thats because I don't know much about javascript arrays.</p>
<p>How is this sort of thing achieved?</p>
|
javascript jquery
|
[3, 5]
|
4,014,898 | 4,014,899 |
I Need An App For My Ecommerse WebSite - Looking For Background Info
|
<p>I have an eCommerce website that serves a small business. Customers are asking for a mobile app. I built the website myself (html, javascript, VB.net, ASP.net) and I'm constantly tweaking it as we are a new concept and sort of feeling our way forward. I'm not really a programmer - I just taught myself what I needed to know to get what I needed. I know nothing about apps so any info is helpful.<br>
Some fundamental questions I have: </p>
<p>If I have the website and an app this means that any changes I make to the site (options, features) I will then need to make those changes in the app which means doubling my time spent writing code. Or am I going to have separate apps for android and iPhone which means three times the coding???</p>
<p>What language would the apps be written in? I guess I could get someone to write the app and then I could learn from their code and do the ongoing changes myself.</p>
<p>What other things should I be considering???</p>
<p>Any and all feedback is greatly appreciated.</p>
|
android iphone
|
[4, 8]
|
4,799,292 | 4,799,293 |
Android TextView
|
<p>Hi I'm new to Android Programming and I'm trying to make a simple program that changes the text by clicking a button. Here's my code:</p>
<pre><code>public class HelloAndroidActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button button_scan = (Button) findViewById(R.id.button_scan);
button_scan.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
buttonBeenPressed();
}
});
}
public void buttonBeenPressed(){
final Button button_scan = (Button) findViewById(R.id.button_scan);
TextView tv_barcode = (TextView)findViewById(R.id.textview_barcode);
if (tv_barcode != null){
tv_barcode.setText("been pressed.");
} else {
button_scan.setText("it's null dawg.");
}
}
}
</code></pre>
<p>And my XML:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button android:text="Scan" android:layout_height="wrap_content" android:layout_width="match_parent" android:id="@+id/button_scan"></Button>
<TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="TextView" android:textAppearance="?android:attr/textAppearanceLarge" android:id="@+id/textview_barcode"></TextView>
</LinearLayout>
</code></pre>
<p>However the TextView is returning NULL and i don't know why. Any suggestions? Thanks.</p>
|
java android
|
[1, 4]
|
2,401,803 | 2,401,804 |
javascript negative number in pull down
|
<p>When I click "EDIT" link on a specific user it is suppose to tell me how many vacation days he/she has left... the Edit link is like this:</p>
<pre><code>print "<a href=\"javascript:editUser('$data[uid]','$data[vacationdays]')\">Edit</a>\n";
</code></pre>
<p>So when i click EDIT on ADMIN account:
javascript:editUser('Admin','-3.0') is the actual values </p>
<p>The javascript:</p>
<pre><code><script language="javascript">
function editUser(uid, vacationdays) {
document.userForm.uid.value = uid;
document.userForm.vacationdays.value = vacationdays;
document.location.href = "#AddEdit";
}
</script>
</code></pre>
<p>The website PHP/HTML:</p>
<pre><code>Vacation days: <select name="vacationdays" id="vacationdays" />
<?php
for ($i=-30.5;$i<30.5;$i+=0.5)
echo "<option value=\"$i\">$i</option>\n";
?>
</select>
</code></pre>
<p>The problem is only with negative numbers (-1 or -2...etc) not showing up in the form pull down menu. Positive numbers show up no problem.</p>
<p>Example positive number:
<img src="http://i.stack.imgur.com/inzr6.png" alt="enter image description here"></p>
<p>Example negative number: <img src="http://i.stack.imgur.com/jMnAN.png" alt="enter image description here"></p>
<p><em><strong></em> i dont want to be able to select a negative values from the pull down.. but if the value is negative i just want it to show once and when you click on the pull down you can only select positive numbers **</strong></p>
<p>If i change the pulldown to a TEXTFIELD it works perfectly fine with negative numbers...weird?</p>
|
php javascript
|
[2, 3]
|
3,743,610 | 3,743,611 |
is there a difference between a struct in c++ and a struct in c#?
|
<p>is there a difference between a struct in c++ and a struct in c#?</p>
|
c# c++
|
[0, 6]
|
1,809,347 | 1,809,348 |
rename javascript object in order to use a php array
|
<p>I never used javascript, but I need it for my project.
I would like to use a php array which is called abc[] inside a javascript function.</p>
<p>Currently the working javascript code is:</p>
<pre><code>if(document.form1.checkbox[i].checked)
</code></pre>
<p>I would like to use the abc[] array instead of checkbox</p>
<p>This doesn't work, because the [] of the php array name mix with the [i] of the javascript code...but it shows what I would like to achieve:</p>
<pre><code>if(document.form1.abc[][i].checked)
</code></pre>
<p>Is it possible to define abc[] as xxx variable in javascript or use any other method to get this working?</p>
<pre><code>if(document.form1.xxx[i].checked)
where xxx=abc[]
</code></pre>
|
php javascript
|
[2, 3]
|
3,089,069 | 3,089,070 |
Porting concurrent java classes to c#
|
<p>I'am trying to port high_scale_lib by Cliff Click<br>
<a href="http://sourceforge.net/projects/high-scale-lib/" rel="nofollow">http://sourceforge.net/projects/high-scale-lib/</a><br>
to c# but there is some java classes i can't find c# equivalent for it like </p>
<pre><code>AtomicLongFieldUpdater
</code></pre>
<p>and what is the sun.misc.Unsafe type in java is it the same as pointer in c# or IntPtr ?<br>
and my last question are all java objects are nullable ?</p>
|
c# java
|
[0, 1]
|
3,966,431 | 3,966,432 |
Android - to listen the phone state
|
<p>In my application, I need to set a phoneStateListener so that when the connectivity is off,I am able to cache the required updations in a hashtable.I know how to do that using phoneStateListener in a single activity.But can you suggest how can I do it an efficient way other than repeating the same in all activities?. I am a novice in both Java and android.I thought about doing inheritance,But all my classes are already inheriting another class.So how can I implement this without using inheritance?</p>
|
java android
|
[1, 4]
|
5,611,218 | 5,611,219 |
Server side method call by jquery error
|
<p>this way i am calling my server side code....my code as follows.</p>
<pre><code>$(function () {
$('#btnSubmit').click(function () {
$.ajax({
type: "GET",
url: "MyPage.aspx?id=201/GetData",
data: {},
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
}
,
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
}
});
return false;
});
});
</code></pre>
<p>i doubt i am getting error because url is wrong url: "MyPage.aspx?id=201/GetData"</p>
<p>i think it should be url: "MyPage.aspx?id=201"</p>
<p>2) i have another question that what different type of value can be set for dataType property of jquery ajax call.</p>
<p>dataType can be html or text? when dataType would be html then what would be right contentType? and the same way when</p>
<p>dataType would be text then what would be right contentType?</p>
<p>3) when dataType will be text or html then can i call my custom server side function like url: "MyPage.aspx/GetData",</p>
<p>4) when dataType will be text or html then how to return data from server side function. then can i write code like</p>
<p>when datatype is text then do i need to return like below one</p>
<pre><code>[System.Web.Services.WebMethod]
public static string GetData()
{
return "Hello";
}
[System.Web.Services.WebMethod]
public static string GetData()
{
response.write("Hello");
}
</code></pre>
<p>when datatype is html then do i need to return like below one</p>
<pre><code>[System.Web.Services.WebMethod]
public static string GetData()
{
return "<div>Hello</div>";
}
[System.Web.Services.WebMethod]
public static string GetData()
{
response.write("<div>Hello</div>");
}
</code></pre>
<p>do i need to set response.content type.</p>
<p>please guide in detail.......thanks</p>
|
jquery asp.net
|
[5, 9]
|
1,645,471 | 1,645,472 |
JQuery Novice To Ninja
|
<p>Does anyone know were to get the source code sample files for the book Jquery Novice to Ninja</p>
|
javascript jquery
|
[3, 5]
|
4,651,272 | 4,651,273 |
How do I use RegisterClientScriptBlock to register JavaScript?
|
<p>ASP.NET 2.0 provides the <code>ClientScript.RegisterClientScriptBlock()</code> method for registering JavaScript in an ASP.NET Page.</p>
<p>The issue I'm having is passing the script when it's located in another directory. Specifically, the following syntax does not work:</p>
<pre><code>ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName", "../dir/subdir/scriptName.js", true);
</code></pre>
<p>Instead of dropping the code into the page like <a href="http://msdn.microsoft.com/en-us/library/aa479390.aspx#javawasp2_topic7" rel="nofollow">this page</a> says it should, it instead displays <code>../dir/subdir/script.js</code> , my question is this:</p>
<p>Has anyone dealt with this before, and found a way to drop in the javascript in a separate file? Am I going about this the wrong way?</p>
|
javascript asp.net
|
[3, 9]
|
4,154,302 | 4,154,303 |
update query slider position based on value from textbox
|
<p>how can i update slider's position if slider's value differs from value from a textbox ?</p>
<pre><code>$("#slider").slider({
max: 30000,
min: 1000,
step: 1000,
range: true,
animate: true,
values: [1000, 15000],
slide: function(even, ui)
{
$("#edit-field-price-value-min").val(ui.values[0]);
$("#edit-field-price-value-max").val(ui.values[1]);
}
});
</code></pre>
<p>as you can see i am changing with the slider the values on some textbox but i want it vice versa also</p>
<p>i'd like to be using a if statement so that at any moment if the values from text box would change the slider would as well</p>
<p>is it possible to do it onload maybe ?</p>
<pre><code><div id="slider"></div>
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
4,679,654 | 4,679,655 |
ASP.NET: Global hook in Response?
|
<p>Is there any way to intercept all ASPX Page Responses? I'd like to intercept all the pages served and inject a small JavaScript at the end of each. </p>
|
asp.net javascript
|
[9, 3]
|
5,025,671 | 5,025,672 |
jquery cant get drag item id in Sortable
|
<p>i am having problem in getting the id of the dragged item in "sortable", can you please help me out in this. </p>
<pre><code><script>
$(document).ready(function(){
$("#div1,#div2,#div3").sortable({
revert: true,
accept: '.draggable',
connectWith: [".sortable_div"],
receive: function(e, ui) {
var item_id = $(this).attr("id");
var drag_id = $(ui.item).attr('id')
alert('alert:'+item_id+' of '+drag_id);
}
}).disableSelection();
});
</script>
<div id="div1" class="sortable_div">
<span id="span1" class="draggable"></span>
</div>
<div id="div2" class="sortable_div">
<span id="span2" class="draggable"></span>
</div>
<div id="div3" class="sortable_div">
<span id="span3" class="draggable"></span>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
566,687 | 566,688 |
insert checkbox before link?
|
<p>html</p>
<pre><code><ul class="navmore">
<li><a href="link">Link</a></li>
<li><a href="link">Link</a></li>
</ul>
</code></pre>
<p>jquery in footer</p>
<pre><code>$(".navmore li a").each(function(){
var $this = $(this);
$('<input type="checkbox">').insertBefore($this);
});
</code></pre>
<p>html should become</p>
<pre><code> <ul>
<li><input type="checkbox"><a href="link">Link</a>
<li><input type="checkbox"><a href="link">Link</a>
</ul>
</code></pre>
<p>I currently don't get any checkbox with that code</p>
|
javascript jquery
|
[3, 5]
|
4,804,404 | 4,804,405 |
find sister element
|
<pre><code><div class="videoItem">
<div class="innerVideoItem">
<a><div class="overlayBg"></div></a>
<a><img class="overlayPlay"><img></a>
</div>
</div>
<script>
$(".overlayPlay").hover(function(){
// How do I find overlayBg here?
});
</script>
</code></pre>
<p>How do I get access to .overlayBg without using <code>$(".overlayBg")</code>?</p>
|
javascript jquery
|
[3, 5]
|
194,112 | 194,113 |
Advice needed from experts about ASP.NET UserControl usage
|
<p>I need some advice here. I have a bunch of 10 products and every product has <strong>atleast 200 different pages</strong> associated with it, with varying details about the product. That makes around 2000 pages. </p>
<p>The structure of each page is as follows:</p>
<p>**Product Name<br>
Details About the product ( 500 words or more)</p>
<p>ProductImage | PurchaseDetails**</p>
<p>When a product page loads, I have to read the productname and display a box at the end of the page. This box should pick up an Productimage and PurchaseDetails that corresponds to the productname. For eg: if there is a product called 'AceShampoo', there is an image associated with it called 'aceshampoo.jpg'. Now I cannot read either the image or the description from the database, since it is not stored there. Only the ProductName and Details come from the DB.</p>
<p>My question to experts:</p>
<p>How and where do I store the ProductImage and the PurchaseDetails for fastest and best performance. Also since there are around 200 pages associated with each product, I would want a way where I can cache this and depending on the parameter i.e productname, change the values.</p>
<p><strong>Update:</strong> Some products do not have an image or purchase details. So I want to display no details or rather not show it to the users.</p>
<p>How do I go about it. A sample code with explanation would help this novice understand it better.</p>
<p>Thank you for reading this post.</p>
|
c# asp.net
|
[0, 9]
|
1,731,845 | 1,731,846 |
setTimeOut is not waiting for proper delay time
|
<p>I have two buttons play and stop. When I click play I want the images to run like a slideshow.
I am using <code>setTimeout()</code> and having it wait 5 seconds before running.</p>
<p>When play is clicked, the code runs fine , waiting for 5 seconds and then displaying the next image, but when I click stop , and then click play again, it stops waiting the correct interval.Instead of waiting for 5 seconds before running, it waits for one second for the first two images and then 5 seconds for the next, again for one second for the next two and so on..</p>
<p>Why is it running correctly the first time and then breaking on retry?</p>
<p><strong>Code:</strong></p>
<pre><code>var stop = false;
playClickfunction() {
showImages();
}
showImages() {
//code to display image for all no of images
//and user can stop on any no of image..
if(!stop)
setTimeout(showImages, 5000);
}
stopClickfunction() {
stop = true;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
756,832 | 756,833 |
How to rewrite the Jquery dynamic selection box script for 5 selection boxes?
|
<p>I am trying to create dynamic selection boxes with Jquery.</p>
<p>Due to requirements, I have 5 selection boxes with similar Class contents e.g. Class A, Class B, Class C, etc. I have another 5 Student selection boxes besides each of the Class selection boxes. </p>
<p>So the idea is that when I select a class selection box, javascript will check on the selection and proceed to send the selection value using GET action, and return the contents for my Student selection box.</p>
<p>I already have a working script. But it is only working for one Class selection box, and if I need to have it running for the rest of the 4 Class selection boxes, I will have to create 4.js script with the different values. </p>
<p>May I know is there any way that I could just use 1 js and works for all the 5 Class selection boxes? Maybe a loop, or etc?</p>
<p>Working js for 1 selection box:</p>
<pre><code>function class_change() {
$('#class1').change(update_students);
// the rest of the class sel boxes are named as #class2 #class3, etc.
}
function update_students() {
var class = $('#class1').val();
var seat = $('#seat1').val();
$.get('getStuds.php?seatno='+seat+'&class='+class, showStudents);
}
function showStudents(result) {
$('#show_student1').html(result);
}
$(document).ready(class_change);
</code></pre>
<p>Thank you very much.</p>
|
javascript jquery
|
[3, 5]
|
5,549,230 | 5,549,231 |
class of a DOM and jQUery
|
<p>I sometimes see that there is something like this:</p>
<pre><code><input name="star2" type="radio" class="star 1"/>
<input name="star2" type="radio" class="star 2"/>
</code></pre>
<p>is it possible in jQuery to let one class to handle these two class? Because basically they have the same parent class, which is star? If it is possible, how can I do that? Using regular expression?</p>
|
javascript jquery
|
[3, 5]
|
1,456,209 | 1,456,210 |
How to get the refreshed database on the same page before starting with the comparison?
|
<p>I am saving/updating data through a page and on the same submit, I need to compare the updated data with some other data. But it compares the new data only after the page is refreshed once. If not, it compares with the old data. How to get the refreshed database on the same page before starting with the comparison ??</p>
|
php javascript
|
[2, 3]
|
2,938,044 | 2,938,045 |
Combine js functions for input and textarea elements
|
<p>So I need to add tooltips for some input fields and textareas. Currently, I have it setup like this:</p>
<pre><code>$(document).ready(function(){
$('input').focus(function(){
var p = $(this);
var position = p.position();
var input_name = $(this).attr('id');
var name = '#'+input_name+'_help';
$('#apply_tooltip').css("left", position.left - 310 );
$('#apply_tooltip').css("top", position.top -15 );
$(name).show();
$('#apply_tooltip').show();
});
$('input').blur(function(){
$('.tooltip_inner').hide();
$('#apply_tooltip').hide();
});
$('textarea').focus(function(){
var p = $(this);
var position = p.position();
var input_name = $(this).attr('id');
var name = '#'+input_name+'_help';
$('#apply_tooltip').css("left", position.left - 310 );
$('#apply_tooltip').css("top", position.top -15 );
$(name).show();
$('#apply_tooltip').show();
});
$('textarea').blur(function(){
$('.tooltip_inner').hide();
$('#apply_tooltip').hide();
});
});
</code></pre>
<p>This works, but obviously there is probably a more efficient solution than simply duplicating the functions... Is there anyway to target both input fields and textareas with the same functions?</p>
|
javascript jquery
|
[3, 5]
|
4,132,585 | 4,132,586 |
JQuery update if at bottom of DIV
|
<p>I have this function, which in itself works fine, however it scrolls down whenever i scroll up which is not intended.
I want it to run the function ONLY if the scrollbar of the div (overflow) is at the bottom, which makes it possible to scroll up without it scrolling back down preventing the view of older messages.</p>
<pre><code>function opdaterPost(til, fra){
$('#beskeder_vis').load('calls/opdater_post.php?til=' + til + '&fra=' + fra);
$("#beskeder_vis").animate({ scrollTop: $("#beskeder_vis").prop("scrollHeight") }, 1500);
}
</code></pre>
<p>Here's a jsfiddle showing the chat box
<a href="http://jsfiddle.net/w989Y/" rel="nofollow">http://jsfiddle.net/w989Y/</a></p>
|
javascript jquery
|
[3, 5]
|
1,377,084 | 1,377,085 |
Why is this animate marginTop function is not working like I expect?
|
<p>Still trying to figure this out from yesterday.</p>
<p>I am trying to scroll an element up 50 pixels at a time by animating it's "marginTop" property. Problem is, on each click of my trigger, the element "resets" and animates from 0. Can anyone explain this confusing behaviour to me?</p>
<p>Look at my alerts here</p>
<pre><code>$(document).on("click",".scroll-control",function(e){
e.preventDefault();
var newMarginTop = parseInt($('.scroll-frame').css('marginTop'));
alert (newMarginTop); // returns 0
newMarginTop = newMarginTop - 50;
alert (newMarginTop); // returns -50
$('.scroll-frame').animate({"margin-top": newMarginTop},1000);
var newMarginTop = parseInt($('.scroll-frame').css('marginTop'));
alert (newMarginTop); // returns 0 <<< ??? Why not -50 ???
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,469,610 | 2,469,611 |
JQuery - What method can I use to get this code to run without clicking
|
<p>Ok this example code contains a button. Forget about the button, it does not exist, cannot be referenced and cannot be edited.</p>
<p>The buttons dont exist in this example - they merely represent another process. However the fields still need to be updated from values. Sorry I couldn't explain it better. </p>
<p>Answer:
<a href="http://jsfiddle.net/piezack/X8D4M/56/" rel="nofollow">http://jsfiddle.net/piezack/X8D4M/56/</a></p>
|
javascript jquery
|
[3, 5]
|
5,763,722 | 5,763,723 |
How to Set timer function
|
<p>I am doing online Exam Management, I have set a time duration for an exam to 5 min.</p>
<p>When student attend this test, timer starts decreasing.</p>
<p>I made this timer using javascript.</p>
<p>What the problem is if the student refresh the page timer starts from first. How can I make the time to be static if page refreshed.</p>
|
php javascript
|
[2, 3]
|
4,649,433 | 4,649,434 |
countdown timer in js
|
<p>I am javascript impaired - I need to build a countdown script that counts down 45 minutes and appends the remaining time into the title bar or the users browser, as well as when the time is up will operate a function like an alert message.</p>
<p>I wish I had code to start with.</p>
|
javascript jquery
|
[3, 5]
|
1,322,469 | 1,322,470 |
jQuery - Trying to append each new option to select
|
<p>I'm trying to append every new <code><option></code> to the <code>select</code> field, but I seem to be getting multiples after the first submission. </p>
<p>Any help is appreciated.</p>
<pre><code><input id="name" placeholder="name">
<input id="phone" placeholder="phone">
<button id="submit">Submit</button>
</code></pre>
<p>and
</p>
<pre><code>$("button").on("click", function(){
userData.name = $("#name").val();
userData.phone = $("#phone").val();
users.push(userData);
var len = users.length;
for (var i = 0; i < len; i++) {
$("<option value=" + users[i].phone+ ">" + users[i].name + "</option>").appendTo(select);
}
});
</code></pre>
<p>Heres a fiddle : <a href="http://jsfiddle.net/Buttery/5dQhj/3/" rel="nofollow">http://jsfiddle.net/Buttery/5dQhj/3/</a></p>
<p>Currently outputs</p>
<pre><code>Terry
Gus
Gus
Foo
Foo
Foo
</code></pre>
|
javascript jquery
|
[3, 5]
|
6,019,001 | 6,019,002 |
File upload using jquery not working
|
<p>I'm trying to make a really simple file upload using jQuery, without having to download 3rd party plugin / scripts.</p>
<p>Here is my code:</p>
<p>HTML </p>
<pre><code> <form enctype="multipart/form-data" action="" method="POST" name="form">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
<?php _e('Choose a file to upload') ?>: <input name="uploadedfile" class="uploadedFile" type="file" />
<input type="submit" class="button uploadImage" value="<?php _e('Upload File') ?>" />
</form>
</code></pre>
<p>PHP</p>
<pre><code><?php
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');
$uploaddir = WP_CONTENT_URL.'/uploads'.$_POST['current_path'];
$uploaddir = str_replace('/','\\', $uploaddir);
$uploadfile = $uploaddir .'\\'. basename($_FILES['uploadedfile']['name']);
echo $uploadfile;
?>
</code></pre>
<p>JS</p>
<pre><code> //File upload
jQuery('.uploadImage').live('click',function() {
var current_path = jQuery('#currentPath span').html();
var new_dir = jQuery(this).find('span').html();
// Load new content in browser window
jQuery.ajax({
type: "POST",
url: "../wp-content/plugins/wp-filebrowser/uploader.php",
dataType: 'html',
data: {current_path: current_path, new_dir: new_dir},
success: function(data){
alert(data);
},
error: function(){
alert('Page load failed.');
}
});
});
</code></pre>
<p>The problem is that I can't get info on <code>$_FILES['uploadedfile']['name']</code>. Is this because the form is never submitted?</p>
|
php jquery
|
[2, 5]
|
5,471,699 | 5,471,700 |
Trigger Ajax on first click only
|
<p>I want to call ajax only on the first click to save bandwith coz the data is huge. Below is my code</p>
<pre><code>$('.id-list').click(function() {
$.ajax({
type: "POST",
url: "timesheet.php?action=idlist",
async: false,
success: function(rdata) {
$('.id-list').removeClass('id-list') //remove the class
}
})
})
</code></pre>
<p>Inspecting the element, <code>class="id-list"</code> was removed, but when i click it again, it triggers the ajax call again which I dont want to happen.</p>
<p>Is there any way to implement this?
Thanks.</p>
|
javascript jquery
|
[3, 5]
|
612,489 | 612,490 |
jQuery : Resizing the layouts
|
<p>I want re-sizable feature like <code>jsFiddle</code> : <a href="http://jsfiddle.net/" rel="nofollow">link.</a> If i explain in my own words there are four layouts<br>
<code>[1. HTML, 2. javascript, 3. CSS & 4.Result]</code> and we can re-size the layout inwards & outwards. I have been tried to make resizable using jQuery but failed to do like jsFiddle.</p>
<pre><code> my example: CSS
#parent { position:relative; width 100%; height:100%;}
#left {position:absolute;left:0; width:48%;height:100%; border:1px dashed; }
#right {position:absolute;right:0; width:48%;height:100%; border:1px dashed; }
<div id = "parent">
<div class="resize" id = "left"> </div>
<div class="resize" id = "right"> </div>
</div>
js: $(function() { $('.resize').resizable( { handlers: 'n,e,s,w' } );
});
</code></pre>
<p>in example, there are two layout <code>left & right</code>, are equals in size. when i resize any div then other div should change it's size too but it doesn't make any difference in size while jsFiddle does. </p>
|
javascript jquery
|
[3, 5]
|
1,888,551 | 1,888,552 |
Need to implement a grid in android
|
<p>I need to implement a grid that will show the position of some physical objects. I want to interact with the objects: I want to be able to send commands or request their "health" status (the objects happen to be sensor nodes).
<br><br>The size of the grid is given by the user but is always square (<code>width=length=a</code>).<br><br></p>
<p>Any ideas will be appreciated. </p>
<p>Creation of a custom view might be an option. If so share your thoughts on this.</p>
<p>The grid that I am talking about should look like this
<a href="http://1.bp.blogspot.com/_NWSHay-_Gtk/R8hsDLaG9XI/AAAAAAAAAKU/DO6Ltp8v7zY/s1600-h/grid.gif" rel="nofollow">http://1.bp.blogspot.com/_NWSHay-_Gtk/R8hsDLaG9XI/AAAAAAAAAKU/DO6Ltp8v7zY/s1600-h/grid.gif</a>
where my objects are expected to be situated in the nodes of the grid.</p>
|
java android
|
[1, 4]
|
2,073,264 | 2,073,265 |
keep user input text in inputbox after submit
|
<pre><code><input name="KeywordBox" class="BasicSearchInputBox" type="text" value="Keyword Search..."/>
<div class="searchBtnHolder"><a class="searchButton" href="#" type="submit"><span>Search</span></a></div>
</code></pre>
<p>I need to keep the user input text in the inputbox even after submit. When user submits, what happens is the value of inputbox is grabbed and added to the URL as querystring like mysite.com/index.aspx?kwd=userinput..</p>
<p>But it would be nice if we could keep what the user typed in so they know what they typed in and don't have to wonder!! Using jquery, is it possible? Can we not grab the value back from the url and set it back in the inputbox??</p>
|
javascript jquery
|
[3, 5]
|
1,959,086 | 1,959,087 |
what's the jquery plugin that inserts text in a textbox, and it disappears upon focus?
|
<p>what's the jquery plugin that inserts text in a textbox, and it disappears upon focus?</p>
|
javascript jquery
|
[3, 5]
|
1,450,799 | 1,450,800 |
Python function return to jQuery var
|
<p>I've a python script that returns something. In a html page, I use jQuery to send a GET request to this script (with $.get()). I want the "return" of python script in a jQuery/javascript var. Is it possible with jQuery function? Without use JSON or other.</p>
|
jquery python
|
[5, 7]
|
1,542,634 | 1,542,635 |
Jquery next adjacent selector with $(this)
|
<p>How could i use the adjacent selector "+" with the $(this). </p>
<p>I would need a help with the commented lines with //this doesnt work:</p>
<pre><code>$(".ExpandCollapse").click(function () {
if ($(this).nextUntil('.Collapsable').is(':visible'))
{
//this doesnt work
$(this + ".Collapsable").hide();
}
else
{
//this doesnt work
$(this + ".Collapsable").show();
}
});
</code></pre>
<p>Could you give me a hand?</p>
<p>Thanks a lot in advance.</p>
<p>Best Regards.</p>
<p>Jose</p>
|
javascript jquery
|
[3, 5]
|
2,655,456 | 2,655,457 |
Dictionary object accessed by concurrent users in Asp.Net
|
<p>In Asp.Net page i have a static dictionary object where values can be added and retrieved, When 100's of concurrent users access the page is there any chance my dictionary object may get locked / throw error ?</p>
<p>User can
1) Add new value if it does not exist
2) Retrieve existing value. They cannot modify / delete</p>
|
c# asp.net
|
[0, 9]
|
5,465,895 | 5,465,896 |
how to show jQuery Model dialog box through Asp.Net ajax UpdateProgress
|
<p>How can i show the jQuery
<em>model dialogBox</em> in the <em>ProgressTemplate</em> of UpdateProgress (Asp.net Ajax)
I have downloaded the latest jquery. Have included it in file.
I want to know what else need to be done.
I want a fade effect in the entire screen with the dialog showing an animated .gif image.
Can any one guide in this regard.</p>
|
jquery asp.net
|
[5, 9]
|
5,713,550 | 5,713,551 |
Passing a method from another class
|
<p>I want to call a method from one class to another, don't know if that's possible without extends the class that contains the method. I've tried to import the package, that way I thought the method should be allow to use since it's a public method but that was not sucesfull..</p>
<p>tried to use this <a href="http://thedevelopersinfo.wordpress.com/2009/10/15/passing-data-between-activities-in-android/" rel="nofollow">link</a> as reference, but I didn't understand it (since is an app for android..)</p>
<p>A pseudo-code to exemplify</p>
<pre><code>class 1
class 2
class 2:
import package.class 1;
class 1.this.method(); -> Error: No enclosing instance of the type class 1 in is acessible in scope
</code></pre>
|
java android
|
[1, 4]
|
861,757 | 861,758 |
if(pause == null) { doesn't work
|
<p>I use <code>if(pause == null)</code> to do something when <code>pause</code> is <code>null</code>. But I get the error</p>
<p><code>the operator == is undefined for the argument type(s) long,null</code> </p>
<p>Here is the code,</p>
<pre><code>public class Timer extends CountDownTimer {
long pause = (Long) null;
public Timer(long startTime, long interval) {
super(startTime, interval);
}
@Override
public void onTick(long millisUntilFinished) {
content.setText("Tijd over: " + millisUntilFinished / 100);
}
public void onPause(long millisUntilFinished) {
if(pause == null) {
pause = millisUntilFinished;
content.setText("Tijd over: " + millisUntilFinished / 100);
this.cancel();
}
else {
this.start();
}
}
@Override
public void onFinish() {
content.setText("Tijd is op!");
}
}
</code></pre>
<p>This class isn't finished, so ignore the rest of the code.</p>
|
java android
|
[1, 4]
|
5,867,102 | 5,867,103 |
Load another asp.net page into current page
|
<p>Using ASP.NET with C#, I would like to load the content of another page into my current page. </p>
<p>I have a main div <code>id="maindiv"</code> on one page with a header above it. The header contains clickable links that route to the same url with a get variable like <code>http://www.mainpage.com&page=nextpage</code>. I would like to use the page get variable in a switch case to load from a specified page into maindiv. I can do the switch case bit fine, but how do I load the response from another page?</p>
|
c# asp.net
|
[0, 9]
|
3,627,943 | 3,627,944 |
Clearing message jQuery delay setTimeout
|
<p>How could I clear the field message after a couple seconds using delay jQuery function instead of setTimeout? The code below will clear value immediately.</p>
<pre><code> var $this = $(this),
mid = $this.find("#emid"),
contents = $this.find("#equestion");
if(contents.length<30){
contents.css('color','red')
.val('Error Message')
.delay(5000)
.val('');
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,254,460 | 1,254,461 |
Substitute for the .delay() function for jQuery 1.3 and making a jQuery loop?
|
<p>Is there a substitute for the .delay() function in jQuery 1.3? I know in jQuery 1.4 you can simply use the .delay() function to delay a function from taking place for X amount of seconds but is there someway I can do the same thing but in 1.3?</p>
<p>Also I need to make a looped function in jQuery so after the function has been executed, it will execute again. Is there any possible way of doing this in jQuery 1.3?</p>
<p>I'm stuck in jQuery 1.3 and in my predicament I cannot update to 1.4 so please do not answer by telling me to update unless that is my only option here. Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,655,424 | 1,655,425 |
Calculating the time between two clicks in Javascript
|
<p>I want to calculate the time between two clicks of an attribute with javascript but I don't know how.</p>
<p>For example;</p>
<pre><code><a href="#">click here</a>
</code></pre>
<p>if the user clicks more than once -let's say in 5 seconds- I want to display an alert. I'm using jQuery if that helps. I don't know much about javascript but I've been coding a small project in my free time.</p>
|
javascript jquery
|
[3, 5]
|
5,896,798 | 5,896,799 |
Javascript file - change source at runtime from web.config
|
<p>I have this in my code:</p>
<pre><code><script type="text/javascript"
src="path?key=1234567890">
</script>
</code></pre>
<p>I added this in web.config:</p>
<pre><code><appSettings>
<add key="key" value="1234567890"/>
</code></pre>
<p></p>
<p>How to implement it in the above code?</p>
|
javascript asp.net
|
[3, 9]
|
1,328,665 | 1,328,666 |
jQuery Ajax call No element found issue
|
<p>I am getting a javascript error on firefox 3.5, when trying to call an ajax method.</p>
<p>Please find the error below:</p>
<pre><code>XML Parsing Error: no element found Location: moz-nullprincipal:{1a2c8133-f48f-4707-90f3-1a2b2f2d62e2} Line Number 1, Column 1:
^
</code></pre>
<p>this is my javascript function:</p>
<pre><code>function Update(Id) {
$.ajax({
type: "GET",
url: ROOT_URL + "/sevice/udates.svc/Update?Id=" + Id,
success: function(response) {
},
async: false
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,942,571 | 3,942,572 |
Script files returning 404 Error
|
<p>I'm using ASP.Net and whenever I create a script file or try to include a script file like jQuery they aren't working. I am doing just a regular localhost server and none of the scripts are working. Upon further examination using firebug I look at whats being referenced in those scripts and it shows html code for a 404 error. I know the scripts and files are there and I can navigate directly to them in the browser but for some reason I can't reference them in my page. </p>
<p>Here is a screenshot:</p>
<p><img src="http://img517.imageshack.us/img517/8058/404z.png" alt="404 Error"></p>
<p><img src="http://img202.imageshack.us/img202/174/4042.png" alt="alt text"></p>
|
asp.net javascript
|
[9, 3]
|
2,353,846 | 2,353,847 |
Communication between to sessions wih example
|
<p>In asp.net application. Suppose there are two sessions are available If one session Request sends to server then How server will response to both sessions means (first ans second both session)? Like chatting application. </p>
|
c# asp.net
|
[0, 9]
|
5,113,600 | 5,113,601 |
Iterate through a root directory and get all files in it?
|
<p>hi
i am creating a application and i want to know the each and every file which is present under that one folder .i.e. how can i iterate through a root directory and get the each files visit at list once.</p>
|
c# asp.net
|
[0, 9]
|
6,029,302 | 6,029,303 |
Jquery chaining a click event does not trigger
|
<p>My hover events are triggered, if I removed the hovered events, click still does not get triggered. What could be the problem?</p>
<pre><code>items = '<li></li>';//some html content
list.html(items);
list.show().children().
hover(function () {
alert('hover');
}, function () {
alert('gone');
}).
click(function () {
alert('clicked'); //this is never reached when I click a list item.
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.