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 |
|---|---|---|---|---|---|
552,399
| 552,400
|
android hello world app help
|
<p>i am learning android apps and i made this app and it doesnt work</p>
<pre><code> package com.android.test;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button button = (Button) findViewById(R.id.Button01);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(HelloWorld.this, "Hello World", Toast.LENGTH_SHORT).show();
}
});
}
}
</code></pre>
<p>but it doesnt work!!! please tell me what is wrong and help me to solve it!1</p>
|
java android
|
[1, 4]
|
3,134,535
| 3,134,536
|
how to get a text box with the value selected in select box
|
<p>hi
This is my view page here i have a select box</p>
<pre><code><tr>
<td>Chidren</td>
<td>:</td>
<td><select style="font-family: verdana; min-width: 52px;" id="ddlChildren"
name="ddlChildren" class="required" onChange="return Check_Adult('dd1Age')" >
<option value="">children</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option></select>
</td>
</tr>
</code></pre>
<p>with the value from select box if the value is one then i need to create a text box
if the value is two then i need to create two ,,, and respectively
In my Check_Adult javascript function ,,I did this</p>
<pre><code> function Check_Adult()
{
alert('hi');
var Child= document.getElementById('ddlChildren').value;
alert(Child);
if(Child == 1)
{
var tbox = document.createElement('input');
tbox.setAttribute('type', 'text');
var frm = document.forms[0];
frm.appendChild(tbox);
frm.appendChild(tbox2);
var sel = document.createElement('select');
sel.setAttribute('type', 'text');
var frm = document.forms[0];
frm.appendChild(sel);
}
}
</code></pre>
<p>But the text box is not created how to create it?</p>
|
php javascript
|
[2, 3]
|
1,921,291
| 1,921,292
|
How to write blinking in more elegant way
|
<p>The aim: to write a js (using jquery) that will perform 2 blinking of the row.</p>
<p>What I currently have is</p>
<pre><code>var $second_row = $('table tr:eq(1)'),
target_color = 'PaleGreen',
original_color = $second_row.css('background-color');
$second_row.css('background-color', target_color);
scheduleOriginalColor();
function scheduleTargetColor() {
setTimeout(function() {
$second_row.css('background-color', target_color);
scheduleOriginalColor(true);
}, 500);
}
function scheduleOriginalColor(stop) {
setTimeout(function() {
$second_row.css('background-color', original_color);
if (!stop) {
scheduleTargetColor();
}
}, 500);
}
</code></pre>
<p><a href="http://jsfiddle.net/zerkms/ecfMU/1/" rel="nofollow">http://jsfiddle.net/zerkms/ecfMU/1/</a></p>
<p>But it looks ugly and I'm sure there is a better way of writing the same.</p>
<p>Any proposals?</p>
<p><strong>UPD</strong>: there is my second attempt, a bit more clear: <a href="http://jsfiddle.net/zerkms/ecfMU/2/" rel="nofollow">http://jsfiddle.net/zerkms/ecfMU/2/</a></p>
<pre><code>var $second_row = $('table tr:eq(1)'),
target_color = 'PaleGreen',
original_color = $second_row.css('background-color');
setRowColor(target_color, 500);
setRowColor(original_color, 1000);
setRowColor(target_color, 1500);
setRowColor(original_color, 2000);
function setRowColor(color, timing) {
setTimeout(function() {
$second_row.css('background-color', color);
}, timing);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,186,584
| 5,186,585
|
Problem with page loading with jquery. Please help
|
<p>The site is built to load the content without reloading the whole page. Currently it's using address jquery plug-in to do this (http://www.asual.com/jquery/address/) but sometimes it's not working as intended.</p>
<p>For example; When user clicks on example2 rather than changing to
<a href="http://www.example.com/example/example2-en.html" rel="nofollow">http://www.example.com/example/example2-en.html</a>,
it changes to
<a href="http://www.example.com/example/example-en.html#/|example/example2-en.html" rel="nofollow">http://www.example.com/example/example-en.html#/|example/example2-en.html</a>.
Thereafter it's not possible to change it.</p>
<pre><code>var links = $('a[href^=http://'+location.host+'][href$=.html]').not('#languages ul li a');
links.address(function(){
return $(this).attr("href").replace(example.HREF, '|');
});
</code></pre>
<p>This is the code i have used to reload the page. please help me to get this solved.</p>
|
php jquery
|
[2, 5]
|
4,629,228
| 4,629,229
|
Eval function is C#
|
<p>I need some help in understanding what the Eval bit does (Just started learning C#.net):</p>
<pre><code><asp:Image
ID="Image1"
ImageUrl='<%# Eval("Name", "~/UploadImages/{0} %>'
...
</code></pre>
<p>The image is in a datalist repeater which has been binded to a folder containing images files.</p>
<p>I'm confused with the "Name" and {0}.. what is the significance of these and in what situation can I change them.</p>
|
c# asp.net
|
[0, 9]
|
1,250,917
| 1,250,918
|
ValidatorCalloutExtender not showing when validated control resides in jQuery dialog
|
<p>I have a form which is displayed in a jQuery dialog box. This form contains an ASP.Net RequiredFieldValidator and uses the AjaxToolkit's ValidatorCalloutExtender to display the error message.</p>
<p>If the form is displayed outside of the Dialog box then the ValidatorCalloutExtender works fine, but when used inside the dialog box the ValidatorCalloutExtender does not show on the screen. Is it possible that the Dialog's Z-Order is causing the callout to be hidden behind the dialog?</p>
|
jquery asp.net
|
[5, 9]
|
420,968
| 420,969
|
is Python PHP polyglot a good design?
|
<p>We have Python middle-tier for our Web App . Now we need to render 3 different HTMLs...</p>
<ul>
<li>for older browsers (simple read-only interface)</li>
<li>for HTML5 browsers (LOT more complex than older browsers)</li>
<li>for mobile website (simple XHTML-MP)</li>
</ul>
<p>Now, we need to keep the Python middle-tier completely independent of any HTML -- just pure business logic.</p>
<p>So, we think we should use a PHP layer on top of Python to generate these HTMLs. PHP would talk to Python via SOA.</p>
<p>First -- is this a good idea? And if not, can you suggest a better design?</p>
<p>Second, if this is a feasible design -- do you think PHP+Python is good (maintainable) mix. If not, how about replacing the PHP layer by yet another Python layer.</p>
<p>Just remember that our middle-tier needs to be COMPLETELY isolated from any HTML thingy :)</p>
<p>-- <strong><em>UPDATE</em></strong> --</p>
<p>The reason we're inclined to using PHP is...</p>
<ul>
<li>PHP itself is just a template engine embedded into HTML -- and it is SO easy to generate complex HTML with it. On the other hand, Python is more of a general purpose language and generating HTML with it will require us to use a third party library which will entail maintenance/upgrade/security hassles. Generating HTML is a sort of raison d'être for PHP.</li>
<li>Secondly, Python support for Nginx is NOT as good as PHP.</li>
</ul>
|
php python
|
[2, 7]
|
5,161,102
| 5,161,103
|
append in word document using c#
|
<pre><code>//Text to word file
StringBuilder strBuilder = newStringBuilder();
strBuilder.Append("<h1 title='Header' align='Center'>Writing To Word Using ASP.NET</h1> ".ToString());
strBuilder.Append("<br>".ToString());
strBuilder.Append("<table align='Center'>".ToString());
strBuilder.Append("<tr>".ToString());
**strBuilder.Append("<td style='width:100px;color:green'>Date :<asp:Label ID='lbl_dte' runat='server' Text=>Labe2</asp:Label></td>".ToString());**
strBuilder.Append("<td style='width:100px;color:red'>India</td>".ToString());'
kstrBuilder.Append("</tr>".ToString());
strBuilder.Append("</table>".ToString());
// string strPath = Request.PhysicalApplicationPath + "\\document\\Test.doc";
string strPath = filename;
//string strTextToWrite = TextBox1.Text;
FileStream fStream = newFileStream (strPath,FileMode.Append);
fStream.Close();
StreamWriter sWriter = newStreamWriter(strPath);
sWriter.Write(strBuilder);
sWriter.Close();
</code></pre>
<p>I add a asp label <code><asp:Label ID='lbl_dte' runat='server' Text=>Labe2</asp:Label></code></p>
<p>Can I get the contol of label in code behind(c# asp.net)?</p>
|
c# asp.net
|
[0, 9]
|
3,489,087
| 3,489,088
|
Need Help for better practice Jquery codes
|
<p>I am trying to make my jquery codes look better here. My functions are working correctly but I was wondering if anyone can make my codes less ugly. Thanks a lot!</p>
<p><strong>HTML</strong> </p>
<pre><code><div class='image_layout'>
<a href='#'><img src=' a.jpg '/></a>
<br><p class='credits'>hahahah
<br>Agency: Agency1
<br>Picture ID: 5 </p>
</div>
</code></pre>
<p><strong>jQuery</strong></p>
<pre><code>$('#image_layout').on('hover', 'img', function() {
$(this).parent().next().next().fadeIn('fast');
})
$('#image_layout').on('mouseout', 'img', function() {
$(this).parent().next().next().fadeOut('fast');
})
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,549,164
| 5,549,165
|
Adding textmessages together depending on sender from an ArrayList [Android]
|
<p>Okay, keep in mind that I'm new to Android and I'm simply put not any good at java.</p>
<p>I've got a method that checks through a list of sms's and add's sms messages that starts/ends with specified characters to an arrayList. </p>
<pre><code>public boolean checkForKey(Object[] smsList) {
//Go through sms list searching for key, add each that starts/ends with correct characters to an arrayList..
//do something productive
String str = "";
for(int i= 0; i < smsList.length; i++){
SmsMessage sms = SmsMessage.createFromPdu((byte[])smsList[i]);
String body = sms.getMessageBody().toString();
if(body.startsWith("-?-") || body.endsWith("-?!-")){
msgList.add(sms);
}
}
if(msgList == null){
return false;
}
return true;
}
</code></pre>
<p>So basically what I want to do is pair together messages from a specified sender, I'll give an example as I'm not great at getting my point across:</p>
<p>David sends these two messages:</p>
<p>-?-
blajaheiuhfahiufeihuhiuhfuheuaiifahhafhbehb</p>
<p>and</p>
<p>kahefkhafkehauiefhiuahfeiuhaiefuhauiehiafhe
-?!-</p>
<p>so I want to put them together into a single string.</p>
<p>Any thoughts on how to do this? </p>
<p>Okay, so updating my thoughtline,</p>
<pre><code>String address = sms.getOriginatingAddress();
if(body.startsWith("-?-")) { //|| body.endsWith("-?!-")){
str = body;
// msgList.add(sms);
}
if(body.endsWith("-?1-")) {
str += body;
}
</code></pre>
<p>So say that str is equal to the first half of the message (key in my case), now I want to add the second half by finding the message that ends with -?!- and has the same address (sender)- how can I do this? I mean make sure they have the same sender?</p>
|
java android
|
[1, 4]
|
6,030,611
| 6,030,612
|
File streaming in PHP - How to replicate this C#.net code in PHP?
|
<p>I'm writing an interface to a web service where we need to upload configuration files. The documentation only provides a sample in C#.net which I am not familiar with. I'm trying to implement this in PHP.</p>
<p>Can someone familiar with both languages point me in the right direction? I can figure out all the basics, but I'm trying to figure out suitable PHP replacements for the FileStream, ReadBytes, and UploadDataFile functions. I believe that the RecService object contains the URL for the web service. Thanks for your help!</p>
<pre><code> private void UploadFiles() {
clientAlias = “<yourClientAlias>”;
string filePath = “<pathToYourDataFiles>”;
string[] fileList = {"Config.txt", "ProductDetails.txt", "BrandNames.txt", "CategoryNames.txt", "ProductsSoldOut.txt", "Sales.txt"};
RecommendClient RecService = new RecommendClient();
for (int i = 0; i < fileList.Length; i++) {
bool lastFile = (i == fileList.Length ‐ 1); //start generator after last file
try {
string fileName = filePath + fileList[i];
if (!File.Exists(fileName))
continue; // file not found
}
// set up a file stream and binary reader for the selected file and convert to byte array
FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fStream);
byte[] data = br.ReadBytes((int)numBytes); br.Close();
// pass byte array to the web service
string result = RecService.UploadDataFile(clientAlias, fileList[i], data, lastFile); fStream.Close(); fStream.Dispose();
} catch (Exception ex) {
// log an error message
}
}
}
</code></pre>
|
c# php
|
[0, 2]
|
1,888,719
| 1,888,720
|
Validating a text field containing a float is a valid percentage value?
|
<p>I have a form text field that has a KeyUp event. On KeyUp I'm ignoring anthing but numbers, the period, backspace, delete and cursor keys. So, the only thing in the field can be a number or period.</p>
<p>I need to verify these things (number will become a % not over 100.00%):
-The text field string is a valid number (which should always be true unless someone puts two '.'s in).
-The text field string has a max of 2 decimal places
-If the text field string has a decimal point, it has something after (1 or 2 decimal places, not just a period at the end)
-The number is not larger than 100 (<= 100) </p>
<p>examples (what I need to verify):</p>
<pre><code> 95 is true (valid, decimal places not required)
95. is false (don't need a '.' with no decimal place after)
95.0 is true
95.00 is true
95.000 is false (3 decimal places not valid) 100 is true
101.01 is false (over 100)
101 is false (over 100)
</code></pre>
<p>I've seen some things that do several pieces of that list, but I'm not smart enough to modify the regex to get exactly what I need. Thanks for any help!</p>
|
javascript jquery
|
[3, 5]
|
298,999
| 299,000
|
authenticate to a 3rd party site with jquery?
|
<p>I have a simple login form that lets users log into my website. Once logged in, there is a 3rd party site that I link which users can access and run searches on (its a database resource that we are partnered with). The problem is in order to access that 3rd party database they first have to log in to THAT site with a simple passphrase (which is the same for every user) and get a cookie. </p>
<p>I'd like to simplify the whole process by running a jquery $get call to that 3rd party website when users sign in to my website so that they are authenticated with that 3rd party cookie and can seamlessly accesses the 3rd party database. Is that possible?</p>
|
javascript jquery
|
[3, 5]
|
478,266
| 478,267
|
Text Comparison using jQuery or PHP
|
<p>I have 2 strings as an example and want to see if the TEXT of both the strings are EXACT.If the STRING doesnt matches it should show which is the STRING or a sentence that is missing from the original string.</p>
<p>Is it possible in jQuery ? Any code ?</p>
<p>I tried to use lot of Online Text comparison Tools but none of them says that the following strings are exact and there is no difference, need to ignore Paragraph </p>
<p>Text 1</p>
<blockquote>
<pre><code>In this chapter, you learn some real time-savers. If you are tired of defining
the same layers, along with units, grid, snap, and ltscale, for each new
drawing, read on. You are about to learn how to create your own template
drawings. With templates, you can begin each new drawing with setups
you have defined and saved in previous MEMA sessions, or with a
variety of predefined setups included in the software.
In addition, you learn to reshape the grid using the LIMITS command
and to copy, move, and array objects on the screen so that you
do not have to draw the same thing twice. We begin with the LIMITS
command, because we want to change the limits as part of defining
your first template.
</code></pre>
</blockquote>
<p>Text 2 </p>
<blockquote>
<pre><code>In this chapter, you learn some real time-savers. If you are tired of defining the same layers, along with units, grid, snap, and ltscale, for each new drawing, read on. You are about to learn how to create your own template drawings. With templates, you can begin each new drawing with setups you have defined and saved in previous MEMA sessions, or with a variety of predefined setups included in the software.
In addition, you learn to reshape the grid using the LIMITS command and to copy, move, and array objects on the screen so that you do not have to draw the same thing twice. We begin with the LIMITS command, because we want to change the limits as part of defining your first template.**
</code></pre>
</blockquote>
|
php jquery
|
[2, 5]
|
1,656,166
| 1,656,167
|
How can I create edit text in lua scripting while developing using corona SDK?
|
<p>I want user input simply to take that values for further programming procedures..somebody help me out.</p>
|
java android
|
[1, 4]
|
1,581,015
| 1,581,016
|
How to get the id value from check box?
|
<p>1 naga naga123</p>
<p>2 Tamil tamil123 </p>
<p>3 vinod vinod123 </p>
<p>4 naveen naveen123 </p>
<p>5 jakkir jakkir123 </p>
<pre><code>save edit delete
UserID:
UserName:
Password:
</code></pre>
<p>I have check box at the end of each row. When I click the check box and select edit the values should get displayed in the text boxes corresponding to userId, userName & Password.</p>
<p>My js code for edit is</p>
<pre><code> function Edit(){
var i=dwr.util.getValue("userId");
LoginManagement.selectId(i,function(login){
dwr.util.setValues({userId:userId, userName:login.userName,
passWord:login.passWord});
});
}
</code></pre>
<p>My js code for checkbox is </p>
<pre><code> function Intialize(){
LoginManagement.getLoginDetails(function(loginList){
var x = "";
for(var i=0; i<loginList.length; i++){
var login =loginList[i];
x += "<tr><td>"+login.userId+"</td><td>"+login.userName+"</td><td>"+login.passWord+"</td><td><input type = 'checkbox' id = 'cbid"+login.userId+"'</td></tr>";
}
$("#loginTable").html(x);
});
}
</code></pre>
<p>How should i get the id value in edit so that if i click the button it should display the values corresponding. Any suggestion please?</p>
|
javascript jquery
|
[3, 5]
|
2,241,075
| 2,241,076
|
How to pass dynamic id text box value to another page without refreshing with jquery and php
|
<pre><code>$('.btncomment').click(function () {
var id = $(this).attr('id');
$.post('SaveTopicInformation.php', {
tid: commentform.(topic_ + id).value,
topicdetail: commentform.(topicdetail_ + id).value,
userid: commentform.(user_ + id).value
});
});
</code></pre>
<hr>
<p>I have to pass the 3 text box value to another page. First of all, I display the all the record from database. then, I have comment link for each row. I like to give comment and save the comment for eache record. I use by jquery and php. please help me out. I can't finger out how to pass dynamic text box's value by bynamic name.</p>
|
php jquery
|
[2, 5]
|
3,558,901
| 3,558,902
|
jquery post going in loop
|
<p>I've this code which I'm using to post a message on 'Enter' key press, but it's going on loop and instead of posting one message it's posting it multiple times randomly.</p>
<p>This is the function I'm calling in on <code><input id='txtsendmsg" + i + "' placeholder=\"Write a comment...\" onkeypress='PostMessage(event,"+i+");' class='msgtxt'></input></code> any help would be appreciated.</p>
<pre><code>function PostMessage(event,key) {
$('#txtsendmsg'+key).on("keypress", function (e) {
if (e.which == 13) {
var msgid = $(this).siblings('.msgid').val();
var msgtxt = $(this).val();
$.ajax({
url: "student_post_login.aspx/funPostMessage",
data: 'postd=' + "Y" + '&msgid=' + msgid + '&msgtxt=' + msgtxt,
success: function (data) {
if (data) {
displayData();
}
},
failure: function (response) {
alert("Faliure:");
},
error: function (response) {
alert(response);
}
});
e.preventDefault();
}
});
}
</code></pre>
|
c# jquery asp.net
|
[0, 5, 9]
|
332,639
| 332,640
|
jQuery Validation: Validate dynamicly generated fields only on the first field
|
<p>Yes, I know this question has been asked a few times before. But I am confused with the answers. I thought I would have to somehow 'refresh' or use live to add the validation each time I add a new input field.</p>
<p>Also I checked out the <a href="http://jquery.bassistance.de/validate/demo/dynamic-totals.html" rel="nofollow">demo</a> and I think I am missing something. I don't really see any code that adds validation each time a new field gets added. </p>
<p>This is a simplified version of my code:</p>
<pre><code>$(function(){
$('#testform').validate();
var input1 = $('<input type="text" class="required" />'):
var input2 = $('<input type="text" class="required" />'):
var input3 = $('<input type="text" class="required" />'):
$('#testform').append(input1)
.append(input2)
.append(input3);
});
</code></pre>
<p>My html looks something like this:</p>
<pre><code><form id='testform'>
<input type='submit' value='submit' />
</form>
</code></pre>
<p>For some reason validation only works on the first element. If you fill in text it works on the onblur event. But the form will submit once the first input field has text.</p>
<p>Actually I think just found the answer while typing this but I'll add this question anyway in case others run into the same problem. If this is a problem I'll remove it right away.</p>
|
javascript jquery
|
[3, 5]
|
1,211,521
| 1,211,522
|
Disable link if current image is shown
|
<p>How can I disable the thumbnail link if the current image is begin shown?</p>
<pre><code><script type="text/javascript">
$(function() {
$(".image").click(function() {
var image = $(this).attr("rel");
$('#image').hide();
$('#image').fadeIn('slow');
$('#image').html('<img src="' + image + '"/>');
return false;
});
});
</code></pre>
<h2> </h2>
<pre><code><a href="#" rel="<%= image.photo.url(:small) %>" class="image">
<%= image_tag(image.photo.url(:thumb)) if image.photo %>
</a>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,398,484
| 2,398,485
|
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]
|
3,647,273
| 3,647,274
|
Attributes.Remove does not work
|
<pre><code>ddlFromCurrency.Attributes.Remove("class");
</code></pre>
<p>I want to remove <code>class="xx"</code> from html element with Attributes.Remove but not wokrking. <code>Attributes.Add</code> works but <code>Attributes.Remove</code> doesn't. Any idea why?</p>
|
c# asp.net
|
[0, 9]
|
3,849,070
| 3,849,071
|
Control browser type
|
<p>In .aspx page, I want to control the browser type and if it is IE 6 , I want to show a message.</p>
<p>How can I do it?</p>
|
c# asp.net
|
[0, 9]
|
3,512,767
| 3,512,768
|
Sending bulk mail in background
|
<p>I have called thread in master page on page load and called EMail function and it as follows :</p>
<pre><code>Page_load()
{
CreatingThread();
}
protected void CreatingThread()
{
Thread tSendMails;
tSendMails = new System.Threading.Thread(delegate() { EmailQueueSettings(); });
tSendMails.IsBackground = true;
tSendMails.Start();
}
protected void EmailQueueSettings()
{
// Function to get emails which are not sent ;
// looping it and sending it one by one
// Function to send mails
// Updating the status after mail is sent
}
</code></pre>
<p>Mails are going but to the same user multiple times mails are sent to them.</p>
<p>Is it possible assign different thread and different mails when a page is loaded next time? </p>
|
c# asp.net
|
[0, 9]
|
2,597,485
| 2,597,486
|
Cons of external JavaScript file over inline JavaScript
|
<p>What are some of the disadvantages of using an external JS file over including the JS as a part of the ASPX page?</p>
<p>I need to make an architectural decision and heard from coworkers that external JS does not play nice sometimes.</p>
|
asp.net javascript
|
[9, 3]
|
1,556,840
| 1,556,841
|
Variable ends up undefined after using $.get
|
<p>This seems like an incredibly simple issue but I have no idea why I'm getting undefined. I'm using jQuery to fetch data off a PHP script - specifically a string which the PHP file echoes. Here's the code:</p>
<pre><code><script type="text/javascript">
var map1;
$.get("script.php", function(data)
{
map1 = data;
});
alert(map1);
</script>
</code></pre>
<p>Now if I alert(map1), it ends up being undefined... why exactly is this the case? I thought by declaring map1 outside $.get, it would fix the problem but that's not the case. If I alert(map1) inside the $.get function, it ends up fine and the variable holds a string (as opposed to being undefined). So the question is... what's going on with map1? And how can I stop it from being undefined / going out of scope / whatever is happening to it?</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
2,163,980
| 2,163,981
|
Python performance vs PHP
|
<p>I am an experienced PHP developer, and I would want to know what of both languages is better for web development.</p>
<p>I understand that there are a lot of factors to evaluate; but focusing in execution time, in your own experience making connections to a mysql server, parsing and concatenating strings, and making several echoes (or prints), what language would you recommend me? </p>
<p>I cite this specific situations because are common for me, and I don´t calculate fibonnaci sequences neither prime numbers, like are showed in several benchmarks.</p>
<p>Thanks you a lot. </p>
|
php python
|
[2, 7]
|
1,960,271
| 1,960,272
|
getting a clicked elements id with jquery
|
<p>I have a series of Delete icons displays as such:</p>
<pre><code>echo '<img id="'.$items['id'].'" src="images/delete.png" />';
</code></pre>
<p>Where <code>$items['id']</code> is a reference to the id of the DB item I would like that icon to delete.</p>
<p>How can I access this id in jquery when the item is clicked so I can then call a:</p>
<pre><code>$.get('ajax/delete.php', { id: $('#id').val() },
function(data) {}
</code></pre>
<p>Or something of the sort.</p>
|
javascript jquery
|
[3, 5]
|
2,083,982
| 2,083,983
|
Limitation of String in android
|
<p>Is there any limitation in string in android.
I am getting a response after an http request which is a much bigger string.
My problem is that I am not getting the entire string.
what may be the reason?
I am using this code</p>
<pre><code>response = httpclient.execute(httppost);
String responseBody = EntityUtils.toString(response.getEntity()); // response string
GlobalClass.printLine("Response >> " + responseBody);
</code></pre>
|
java android
|
[1, 4]
|
4,340,858
| 4,340,859
|
Show more and Show less - JavaScript
|
<p>Initially I want to display 6 lists and on click, show more and show less will function.</p>
<p>What's the problem and how can be it done in a proper manner?</p>
<p>JS fiddle - <a href="http://jsfiddle.net/dKMEp/1/" rel="nofollow">http://jsfiddle.net/dKMEp/1/</a></p>
|
javascript jquery
|
[3, 5]
|
5,979,809
| 5,979,810
|
JavaScript isNaN function
|
<p>I am using isNan functionto check if entered value is a number:</p>
<pre><code>if(isNaN(num)) {
alert('I am not a number');
}
else {
//
}
</code></pre>
<p>However, if entered value is, for example, "5748hh" it is understandable like a number and return <code>false</code>. What is wrong?</p>
|
javascript jquery
|
[3, 5]
|
6,021,581
| 6,021,582
|
how to convert a string received from jquery to c# dynamic object?
|
<p>how can i convert a string which is a json object to dynamic in my c# WEBMETHOD..so that i can use it retrieve data.</p>
<p>example
my ajax call</p>
<pre><code> function do_save_data()
{
$.ajax({
type:"POST",
url:"../mymethods/test.aspx/SaveUser",
data:"{'profile':'"+objrecieved+"'}",
contentType:"application/json; charset=utf-8",
success:function(msg){}
});
}
[WebMethod]
public void save data(object profile)
{
JavaScriptSerializer _myserliaser=new JavaScriptSerializer();
dynamic data=(dynamic)_myserliaser.DeseralizeObject(profile);
//problem here is it is taking it as a string.hence when it try
string name=data.name.ToString();
//error 'string' does not contain a definition for 'name'
}
</code></pre>
<p>can anyone please tell me how to handle object that comes from ajax call as string and put it into dynamic and get its details
Thanks in advance</p>
|
c# jquery
|
[0, 5]
|
5,594,902
| 5,594,903
|
Detect before user closes/changes mobile browser tab
|
<p>Is it possible to detect before the user changes tab or closes the tab on a mobile browser. </p>
<p>I tried</p>
<pre><code>$(window).bind('beforeunload', function () {
// AddToCart(123, 123, 123, 123);
return "Message";
});
</code></pre>
<p>but that did not work.</p>
<p>Any help would be great.</p>
<p>Thanks</p>
|
javascript android jquery iphone
|
[3, 4, 5, 8]
|
3,596,053
| 3,596,054
|
Javascript: How to intercept window.location change
|
<p>I need a way to attach some pre-processing to each assignment of the window.location. Is there a way to do this. I basically need to serialize some info, that will be used in the new location.</p>
|
javascript jquery
|
[3, 5]
|
1,748,344
| 1,748,345
|
Append a <br/> tag to a value inside a textarea jquery
|
<p>How would you append a <br/> tag on a value inside a textarea, it only appends it after a keypress of SHIFT+ENTER, </p>
<p>here is my code to append on the text area and it does not work??</p>
<p><code>$('#textarea').append("<br/>");</code> i think there are still something lacking.</p>
<p><a href="http://jsfiddle.net/ctyQZ/32/" rel="nofollow"><strong>DEMO</strong></a></p>
<p>Thank you. . .</p>
|
javascript jquery
|
[3, 5]
|
848,761
| 848,762
|
jQuery disable/re-enable validators on a page
|
<p>When I need to disable/re-enable validator I usually use jQuery code like so:</p>
<pre><code> ValidatorEnable($('[id*=DueDateRequiredValidator]')[0], false);
</code></pre>
<p>and to re-enable it back:</p>
<pre><code> ValidatorEnable($('[id*=DueDateRequiredValidator]')[0], true);
var validator = $('[id*=DueDateRequiredValidator]')[0];
validator.isvalid = true;
ValidatorUpdateDisplay(validator);
</code></pre>
<p>And it works. But now I need to disable/re-enable a large number of validators, but only a subset of validators, not entire set on a page. There's too many of them to refer each validator by "id".</p>
<p>I tried something like this but it didn't work, don't know why:</p>
<pre><code> $.each(Page_Validators, function(index, validator) {
if ( validator.CssClass == "noinjuries" )
{ ValidatorEnable(validator, false); }
});
</code></pre>
<p>What's the best way to do this, if any? </p>
|
asp.net jquery
|
[9, 5]
|
2,446,041
| 2,446,042
|
Retrieving objects between classes
|
<p>I always get tied up with small things like this... I need to access an objects properties created in class 'Login' from my welcome page class 'Default'. When I try to reference the class so that I may access the object, VS 2010 doesn't list it as available like it normally would, and forcing the request just returns an error.</p>
<p>My <code>Login</code> Class is defined like so:</p>
<pre><code>public abstract class Login : System.Web.UI.UserControl
{
...
private void Login_click(object sender, EventArgs e)
{
MyObject myObject = new MyObject();
myObject.property1 = "something";
}
}
</code></pre>
<p>And then i wish to access <code>myObject</code> from my default class, like this:</p>
<pre><code>public class Default : System.Web.UI.Page
{
...
private void Page_load(object sender, System.EventArgs e)
{
string someLocalVar = Login.myObject.property1;
}
}
</code></pre>
<p>Where <code>property1</code> is a property set in the Login class. This does not work, however, and VS doesn't even recognize the Login class; instead it treats it as a reserved word of some sort. These two files are in the same project, so that shouldn't be an issue in the <code>using</code> section. I've accessed variables in this manner between other classes before, just not this time for some reason.
Thanks!</p>
|
c# asp.net
|
[0, 9]
|
2,106,217
| 2,106,218
|
What does the jQuery function $('#myelement').is('*') do?
|
<p>What does the following code do:</p>
<p><code>$('#myelement').is('*')</code> </p>
<p>What does the asterisk signify? Since there is only one element, <code>#myelement</code>, I can't understand the point of using <code>is()</code>, which checks if an element matches a set of elements?</p>
|
javascript jquery
|
[3, 5]
|
5,894,787
| 5,894,788
|
Fragment Dialog without Title issue
|
<p>i'm trying to create a fragment dialog and need the full space to display information. so i want to disable the titlebar. But after i disabled it the isn't maximized in width anymore.</p>
<pre><code>public class ArticleSearchFragment extends DialogFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(STYLE_NO_TITLE, getTheme());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.article_search, container, false);
...
}
</code></pre>
<p>And the XML:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<AutoCompleteTextView
android:id="@+id/searchField"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Ean / Name / Produkt Nummer"
android:completionThreshold="1" />
<Button
android:id="@+id/cancel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/cancel" />
</LinearLayout>
</code></pre>
|
java android
|
[1, 4]
|
2,590,537
| 2,590,538
|
Replace Single Quotes in Javascript or JQuery
|
<p>i have an Html String in which i have some elements having single quotes.When i put this inside a $('varHtml'); Since the varHtml already contains some single quotes it qives an error, Can Somebody help me how to Escape the single quotes in the varHtml</p>
<p>Thanks in Advance</p>
<p>Thomson</p>
|
javascript jquery
|
[3, 5]
|
3,303,423
| 3,303,424
|
What is gained when you .extend() an obj prototype with itself
|
<p>I was looking at some code, and just to make sure I wasn't losing my mind with missing the obvious as this looks like to me, there is nothing gained. Seems like a wasteful usage of $.extend() but perhaps someone can shed some light on something I might be missing with inheritance.</p>
<p>So, we have this.</p>
<pre><code>_letsCreateNameSpace('US.somenew.obj');
//this is based on S.stoyanov namespace pattern, what this _letsCreateNameSpace does.
</code></pre>
<p>then I seen this in some code, and it didn't make sense to me.</p>
<pre><code>US.somenew.obj = function(){
// some this var assignments.
this.blah = $foo;
}
// this usage of extend escapes me. I don't see a need at this point here.
$.extend(US.somenew.obj.prototype, {
// a bunch of new methods
}
</code></pre>
<p>I do not see at all the benefit of using $.extend() instead of just the following, as there is no extending anything but itself.</p>
<pre><code> US.somenew.obj.prototype = {
// a bunch of new methods
}
</code></pre>
<p>there is no 'deep' extend or anything.. just looks like a verbose way of extending a prototype for no reason.</p>
<p>Am I missing something? Is there some "forest behind the tree's" methodology I am missing here?</p>
|
javascript jquery
|
[3, 5]
|
641,836
| 641,837
|
Is it possible to hide a web based game jQuery code from the user?
|
<p>I know some of you just feel it is as a completely wrong question but I have a few requirements of such kind that's why I am asking this question. I understand that javascript is downloaded by the browser on client side so it's very difficult to hide that.</p>
<p>So now i have a game code completely written in jquery and i want that the user is not able to see the complete code because:</p>
<ol>
<li><p>The owner of the games doesn't want to show the game code to the user.</p></li>
<li><p>If a clever user reads the code carefully then he/she might be able to solve the puzzle(it's a puzzle game).</p></li>
</ol>
<p>So, is it good enough to use google closure compiler or yui compressor to make the code unreadable & secure for the above requirements?</p>
<p>If you think that it's not possible to do this in the situation then please suggest me any other way of doing this. Do I need to completely rewrite the game code into a server side language then convert it to js using some tool?</p>
|
javascript jquery
|
[3, 5]
|
5,007,034
| 5,007,035
|
UTC string is added on XML Conversion
|
<p>It seems my java.util.date variable is being formatted in a way I can't control.</p>
<p>In code I have a Date variable to hold the value so it looks like this.</p>
<p>Date X;</p>
<p>Date DD = new Date();
X = DD;</p>
<p>X looks great as milliseconds right up to the point where I serialize it out. The date appears correctly in my XML with a UTC at the end. For example:</p>
<p>2012-12-03 12:12:12:345 UTC</p>
<p>So I'm not sure about the UTC string at the end. When I send this to a db is it going to throw an exception. I don't mind leaving the UTC in there if it's not going to mess with anything but I have not seen this before so was wondering...?</p>
<p>JB</p>
|
java android
|
[1, 4]
|
244,482
| 244,483
|
how to get the value to td inside list in javascript
|
<p>I have a listview in asp.net it appears in html like this </p>
<pre><code><li id="l3" class="add" onclick="hilite()" style="">
<table id="tbl" style="width: 100%;">
<tbody>
<tr style="width: 100%;">
<td class="border2" style="width: 50%;"> 1011 </td>
<td class="border2" style="width: 50%;"> Name 3 </td>
</tr>
</tbody>
</table>
</li>
</code></pre>
<p>now i want to get all the table value via javascript on button click li contains table inside table tr and td presented i want td value of each list for sorting.
and also i tried like this</p>
<pre><code>function sortUnorderedList(ul, sortDescending) {
if (typeof ul == "string")
ul = document.getElementById(ul);
var lis = ul.getElementsByTagName("li");
var vals = [];
for (var i = 0, l = lis.length; i < l; i++)
vals.push(lis[i].innerHTML);
vals.sort();
if (sortDescending)
vals.reverse();
var contentArray = new Array();
for (var i = 0, l = lis.length; i < l; i++) {
lis[i].innerHTML = vals[i];
alert(lis[i].innerHTML);
var x = lis[i].innerHTML.getElementById('lsttable1').rows[0].cells;
alert(x[0].innerHTML);
}
}
</code></pre>
<p>in <code>alert(x[0].innerHTML);</code> i got table then how should i take the td value of each li</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,426,388
| 3,426,389
|
Limiting a textarea to a fixed number of chinese characters
|
<p>I had been given a requirement from client saying limit the textarea – 200 characters in English, it is approximate 66 Chinese characters for UTF8.</p>
<p>I wonder how do I check them whether it is chinese character or english character and calculating them in the sense of maximum length ?</p>
|
php javascript
|
[2, 3]
|
1,897,460
| 1,897,461
|
How to offset window top 50%
|
<p><a href="http://jsfiddle.net/motocomdigital/dKDJz/6/" rel="nofollow">http://jsfiddle.net/motocomdigital/dKDJz/6/</a></p>
<p>I'm trying to fix position a div to top 50% off my window height. Which I can do fine with CSS.</p>
<p>But the original position of this 'div.slider-button' is absolute positioned further down the page. But as the page scrolls down, and when the 'div.slider-button' reaches the 50% offset top position, my <code>.fixed</code> class should be added.</p>
<p>Currently my script below, adds the <code>.fixed</code> class when my div reaches window top position.</p>
<p>I need the script to add my <code>.fixed</code> class when my 'div.slider-button' reaches 50% of the window height.</p>
<pre><code>var $window = $(window),
$button = $(".slider-button"),
offsetbut = $button.offset();
$window.scroll(function() {
if ($window.scrollTop() > offsetbut.top ) {
$button.addClass('fixed');
} else {
$button.removeClass('fixed');
}
});
</code></pre>
<p><br /> </p>
<pre><code>.fixed {
position: fixed !important;
top: 50% !important;
}
</code></pre>
<p>See jsfiddle here <a href="http://jsfiddle.net/motocomdigital/dKDJz/6/" rel="nofollow">http://jsfiddle.net/motocomdigital/dKDJz/6/</a></p>
<p>You can see when the arrow reaches the top, it snaps to the middle, the arrow just needs to reache the middle of the window and stick.</p>
|
javascript jquery
|
[3, 5]
|
4,395,657
| 4,395,658
|
How to animate text using JavaScript
|
<p>I want to implement animated text i.e. moving the text from bottom (half of the page) to the top like marquee. I don't get any good code. Does any one know how this is implemented in JavaScript or jQuery or DHTML? </p>
<p>Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
2,417,903
| 2,417,904
|
jQuery v 1.4.2 and 1.6.2 ajax calls
|
<p>fiddles: <a href="http://jsfiddle.net/protocosmos/Mh275/4/" rel="nofollow">http://jsfiddle.net/protocosmos/Mh275/4/</a> and <a href="http://jsfiddle.net/protocosmos/HyLmS/6/" rel="nofollow">http://jsfiddle.net/protocosmos/HyLmS/6/</a>
- The first one works using jQuery 1,4,2
- The latter doesn't, is there something wrong with my code or is it just jQuery's?</p>
<p>EDIT:
updated fiddles, added 1.4.2 version on first, thanks</p>
|
javascript jquery
|
[3, 5]
|
3,403,210
| 3,403,211
|
Opening ASP.Net pages in Java application
|
<p>Currently we have a Java application and .Net application running in two servers.
We have a requirement to call a set of pages developed in Asp.Net into a Java application. </p>
<p>Follows the brief explanation:
1. Suppose there is a running java application.
2. On click of a link (Say "Edit Profile") from Java app, a set of pages supposed to start from ASP.Net.
3. On this call, some data need to be passed from Java app to Asp.Net app to authenticate and start the *Task (set of pages doing a particular task).</p>
<p>Your inputs for the below will be much appreciated.
1. How do we pass the data from Java to .Net in a secured manner (Other than Query String) and open the .aspx page after authentication. Means how do we know that the calling site (in this case Java app) is authorized to access the set of pages from Asp.Net app?
2. How to return the *Task result to Java app back from .Net.</p>
|
java asp.net
|
[1, 9]
|
3,317,843
| 3,317,844
|
How to catch checked status from a plugin while we are tweeking checked status outside plugin using a custom jQuery code
|
<p>I wrote some custom code in order to make a check box "checked". While I have a plugin which uses the checked status as written below:</p>
<pre><code>this.checkboxContainer.find('input[type=checkbox]').click(function () {
self.filter()
});
</code></pre>
<p>But as you can see it only works on click event. I tried this below but it looks like it does not do any thing. </p>
<pre><code>this.checkboxContainer.find('input[type=checkbox]').filter()
</code></pre>
<p>Can any one please guide me.</p>
|
javascript jquery
|
[3, 5]
|
2,580,466
| 2,580,467
|
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]
|
3,507,055
| 3,507,056
|
A quick question about keypress and jQuery
|
<p><code>$(document).keydown(function(e) {</code></p>
<p>Well, that's my code - I was wondering if it is possible to have something like:</p>
<p><code>$(document).not('#pinkElephant').keydown(function(e) {</code></p>
<p>(Except, that doesn't work...)</p>
<p>Any Ideas?</p>
<p>Thanks very much!</p>
<p>p.s. All that function has inside it, is a <code>switch</code> statement.</p>
<p><strong>[edit]</strong> Hey guys n gals - I cannot <code>return false;</code> because the element I need to type in is an <code><input></code> text, so the keyboard still needs to return here. </p>
<p>It's really confusing me :(</p>
|
javascript jquery
|
[3, 5]
|
3,323,800
| 3,323,801
|
Make html code disappear with placeholder?
|
<p>I have a simple table</p>
<pre><code><table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
</code></pre>
<p>and a link</p>
<pre><code><a href=#>Click me</a>
</code></pre>
<p>Is it possible to make the whole block of html code disappear all in once after clicking the link in c#? I was thinking about a placeholder but i'm not sure</p>
|
c# asp.net
|
[0, 9]
|
1,219,190
| 1,219,191
|
Interval is starting twice after cleared
|
<p>I am trying to create an interval and send request. It will start with click and stop with click. Starting and stopping working great. But after stopping the interval when you pressed the button again to start it, interval starts twice. After stopping it and start it again, it starts 3 interval.</p>
<p>Here is my code:</p>
<pre><code>var running=0
var pathArray = window.location.pathname.split( '.html' );
var pathArray = pathArray.reverse();
var pathArray = pathArray .join('');
var pathArray= pathArray .split('/');
var bidnum=pathArray[3];
$(document).ready(function(){
$('body').append("<div id=\"cdjs\" style=\"position: absolute; top: 30px; background-color: gray; box-shadow: 0px 0px 0px 3px; left: 30px;\">Click to start</div>");
$('#cdjs').click(letswin);
});
function checkandbid(){
if(running==1){
$.get("http://www.bigibid.com/LiveResponder/LR.bid?_as="+bidnum, function(data){
Marray = data.split("'te':'")
time = Marray[1].split("'")
time = time[0]
$('#cdjs').html(time);
if(time < 2 && able==1){
able=0;
$('#ctl00_ContentPlaceHolder1_ibBid').click();
}else{
able=1;
}
});
}
}
function letswin(){
if(running==1){
running=0
clearInterval(IntRun);
delete IntRun;
$('#cdjs').html('Click to start');
}else if(running==0){
running++
delete IntRun;
clearInterval(IntRun);
var IntRun = setInterval(checkandbid, 300);
}
}
function bidders(){
}
</code></pre>
<p>And here is the <a href="http://jsfiddle.net/LKZcT/8/" rel="nofollow">jsFiddle</a></p>
|
javascript jquery
|
[3, 5]
|
5,387,598
| 5,387,599
|
jQuery .text('') on multiple nested elements
|
<p>I wanted to remove all text from html and print only tags. I Ended up writing this:</p>
<pre><code>var html = $('html');
var elements = html.find('*');
elements.text('');
alert(html.html());
</code></pre>
<p>It only out prints <code><head></head><body></body></code>. Was not that suppose to print all tags. I've nearly 2000 tags in the html.</p>
|
javascript jquery
|
[3, 5]
|
1,311,341
| 1,311,342
|
Spinner Contents in Android
|
<p>When you work with spinners in android, do you have to use a spinner adapter if you set the array in a spinner to a string array declared in strings.xml?</p>
|
java android
|
[1, 4]
|
4,358,867
| 4,358,868
|
how to implement infinite scroll masonry
|
<p>I have used masonry js for showing content on my site.</p>
<p>I want to implement infinite scrolling functionality using this file.</p>
<p>I have see this demo </p>
<p><a href="http://masonry.desandro.com/demos/infinite-scroll.html" rel="nofollow">http://masonry.desandro.com/demos/infinite-scroll.html</a></p>
<p>but i can't understand how I can implement this demo in my website.</p>
<p>This is my website</p>
<p><a href="http://www.techmodi.com/demo/lookandpin_demo/" rel="nofollow">http://www.techmodi.com/demo/lookandpin_demo/</a></p>
<p>I have used these js files,</p>
<p>1) jquery-ui.min.js</p>
<p>2) jquery.masonry.min.js</p>
<p>Please give me solution if anyone have.</p>
<p>Thanks</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,817,045
| 4,817,046
|
How do you store the visibility of a form into a variable in jquery?
|
<p>how do we check whether a input box is visible or not....then store its state into variable to be outpu via alert ?</p>
<p>right now i'm using and i think it wrong. can any body help ?</p>
<pre><code><input type="hello" name="hello" value="" style="visibility:hidden"/>
function testhideinput(){
var $input_state = $('input:text[name=hello]').is('visibility');
alert($input_state);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,529,675
| 2,529,676
|
How to create Multi language website in aspx with database
|
<p>How to create Multi language website in aspx where database store translations? I search many articles but there is not uniq solution.</p>
<p>Anyone have good isea or know any good article?</p>
|
c# asp.net
|
[0, 9]
|
1,222,113
| 1,222,114
|
Make the scrollbar fixed to bottom even while appending content to it
|
<p>For better understanding I am trying to implement chatbox with smooth transition of previous (upper) chat messages.</p>
<p>Here is the <a href="http://jsfiddle.net/eEEGE/" rel="nofollow">http://jsfiddle.net/eEEGE/</a></p>
<p>When I click "Add" I want all the number 1 - 9 slide up and append 10-12 below it.</p>
<p>Or in other word I want the scrollbar always scrolled fix at bottom.</p>
<p>I know that I can reposition the scrollbar after appending but then I will not able to see sliding animation.</p>
<p>Code Reference</p>
<pre><code>$(document).ready(function(){
// set the default scroll bar to bottom of chat box
$(".chat-list").scrollTop($(".chat-list")[0].scrollHeight);
$("button").click(function(){
$('.chat-list li:last-child').append('10<br/>11<br/>12');
$('.chat-list li:last-child').show('slow');
});
});
<ul class="chat-list">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li style="display:none"></li>
</ul>
<button>add</button>
.chat-list{
height:100px;
overflow:auto;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,545,980
| 3,545,981
|
How to delete sub folders and files if resides using asp.net c#
|
<p>I want to delete all sub folders and files residing in the sub folder of specified path.</p>
<p>I am new to C# coding please help me. </p>
<p>Suppose I have the path: "C:\Files\aaa-426962\15-02-2013\index.html" </p>
<p>If I specify "C:\Files\aaa-426962" then all sub folders and files residing under "C:\Files\aaa-426962" should be deleted.</p>
<p>Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
4,024,922
| 4,024,923
|
Android Demo's aren't appearing in simulator
|
<p>I'm trying to get my feet wet with Android development. I downloaded Eclipse, and setup the ADT. When I create a project from existing source, I choose the demo projects (API Demo) and compile + run. The simulator pops up but I can't seem to find the API Demo application. How can I get this up and running?</p>
|
java android
|
[1, 4]
|
2,625,260
| 2,625,261
|
Gridview PageIndex not changing on page_Load event
|
<p>I'm trying to change pageindex on page_Load event but its not working.
I can change page by clicking links in the page after page loaded.
If this info necessary GridView in UpdatePanel.</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
/*...Some Codes...*/
//I'm trying to change page like this.
GridView1.PageIndex = Index;
GridViewPageEventArgs ea = new GridViewPageEventArgs(GridView1.PageIndex);
GridView1_PageIndexChanging(sender, ea);
}
protected void GridView1_PageIndexChanging(object sender,GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,176,623
| 5,176,624
|
How do i use captcha in the asp.net application for test input in simple way
|
<p>I'm working on asp.net web application where I need to use CAPTCHA to test input enter into textbox please let me know very simple way to implement CAPTCHA in asp.net.</p>
|
c# asp.net
|
[0, 9]
|
1,917,211
| 1,917,212
|
Dropdown Menu is not working properly
|
<p>I used dropdown menu in our site its worked in all browser but in IE6 it's not working properly. so tell me solution. this site is in wordpress.</p>
<p>Thanks
Abhay</p>
|
php javascript
|
[2, 3]
|
3,660,536
| 3,660,537
|
Jquery 'addClass' sometimes fails but css does not
|
<p>in some cases, this will not work:</p>
<pre><code>("#id").addClass("class");
</code></pre>
<p>whereas this will:</p>
<pre><code>("#id").css('color','Blue');
</code></pre>
<p>why would it fail and how to add class otherwise?</p>
|
javascript jquery
|
[3, 5]
|
4,250,918
| 4,250,919
|
<h2> background-color is not changing with Jquery?
|
<p>I have an h2 element with an id of title and I have the following script:</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("#title").css("background-color","red");
)};
</script>
</code></pre>
<p>The background-color is not changing though and I can't figure out why?</p>
<pre><code><html>
<head>
<title>Table Sorter</title>
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.tablsorter.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#title").css("background-color","red");
)};
</script>
</head>
<body>
<h2 id="title">Table Sorter</h2>
</body>
</html>
<script type="text/javascript">
$(document).ready(function()
{
$("#title").css("background-color","red");
$("#myTable").tablesorter();
}
);
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,161,919
| 2,161,920
|
How can I call aspx content page methods from usercontrol? ASP.NET, C#
|
<p>How can I call aspx content page methods from usercontrol?</p>
|
c# asp.net
|
[0, 9]
|
2,381,831
| 2,381,832
|
Transferring data from PC to Android Mobile
|
<p>I'm new to Android programming.
I have to send continuous data from my PC(bluetooth enabled) to an Android phone using Bluetooth.
I have written a Java code to generate some random numbers.
how do i send it to the phone without manually transferring it. i.e i want the java code to send a particular a particular text file/ integer stream to the phone.
Please help. Thank u! </p>
|
java android
|
[1, 4]
|
4,482,666
| 4,482,667
|
My ellipsis function is taking the wrong string
|
<p>I have an ellipsis function in php to truncate my string.</p>
<pre><code>$HashTagText = "#apple, #ball #cat , #dog";
</code></pre>
<p>the ellipsis function gives results like - <code>#apple, #ball #c...</code><br/></p>
<p>It shows OK but when I click on <code>#c...</code> then the link passes <code>#c...</code> value instead of <code>"cat"</code> after I click on <code>"#c..."</code> string.</p>
<p>jQuery code</p>
<pre><code>$(".thumb_hash a").click(function(){
var HashIdbase = $(this).attr('id');
HashId = HashIdbase.replace( /,/g, "" );/* remove comma from right side*/
$('.loading').show();
$.post("<?php echo site_url('hashSearchFromLightbox');?>",{HashId:HashId},function(data){//store in session
window.location = "<?php echo site_url('home')?>";//refresh controller
});
});
</code></pre>
<p>my ellipsis function</p>
<pre><code> function ellipsisCheck($text, $max=100, $append='&hellip;')
{
if (strlen($text) <= $max) return $text;
$out = substr($text,0,$max);
return $out.$append;
}
</code></pre>
<p>function used in span class="thumb_hash" </p>
<pre><code> $HashTagText1=ellipsisCheck($HashTagText,27);
$ExpHashTagText=explode('#',$HashTagText1);
foreach ($ExpHashTagText as $value)<br/>
{
if($value !=null)
{
echo "<a href='#' id='$value'>#".$value."</a>";
}
}
</code></pre>
<p>I need that when I click on dotted string(#c..) then it take value "cat" for storing insession variable.</p>
|
php javascript
|
[2, 3]
|
4,015,495
| 4,015,496
|
Download text as a file from a webpage
|
<p>I'm downloading text from a website and I want to have the user be able to save it as a file. So, I have the following code that does just that.</p>
<pre><code>protected void DownloadFile(string fileName, string content)
{
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
Response.ContentType = "text/plain";
Response.Write(content);
Response.End();
}
</code></pre>
<p>The problem I am having is that I get an exception after this code runs. I believe it's due to the fact that I call Response.End(). So, every time a user downloads a file it redirects them to the generic error page because all generic exceptions redirect to that page.</p>
<p>Any ideas on how I can write text out to a file and not get this error? If I remove Response.End() I get my text and then the rest of the HttpResponse text, but I don't get the error. </p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
5,332,934
| 5,332,935
|
Running a program on a server
|
<p>I want to build an Android application that downloads an XML file from a web server and displays its contents in a readable format.
My problem is generating that XML file. Basically I want to run a program, say, every 30 minutes that downloads a web page (as that data is not easily accessible), parses it, generates said XML file and puts it somewhere for the Android application to download.
Now, I was writing a Java application to do this, but it came to me: where am I going to run this? I thought of having a laptop permanently running at home, but there must be a better alternative.
I have online hosting, but it is very simple. It does not even include SSH.</p>
<p>Any ideas?</p>
<p><strong>Edit:</strong> as per your suggestions, I checked and yes, my cPanel does have a "Cron Jobs" section. I will now investigate it. Thank you so much for your help.</p>
|
java android
|
[1, 4]
|
4,233,860
| 4,233,861
|
How to implement secured login/logout in asp.net applications
|
<p>Please suggest me a suitable way to implement a secure login/logout in c# asp.net applications?</p>
|
c# asp.net
|
[0, 9]
|
3,634,339
| 3,634,340
|
Getting textbox value in javascript code after onchange
|
<p>On my page, I'm using textbox with calendar extender to get the date value.
I've added <code>onchange="ValidateStartDate();"</code> to the textbox.</p>
<pre><code> <asp:TextBox ID="TextBoxStartDate" runat="server" ForeColor="Red"
onchange="ValidateRsmStartDate();">
</asp:TextBox>
<asp:CalendarExtender ID="CalendarExtenderStartDate"
TargetControlID="TextBoxStartDate"
BehaviorID="ceStartDate"
PopupButtonID="CalendarExtenderStartDatePopup"
Format="MM/dd/yyyy" runat="server">
</asp:CalendarExtender>
<img class="Spacer" id="CalendarExtenderStartDatePopup" src="Images/Calendar.png"
alt="Start Date" />
</code></pre>
<p>My javascript function:</p>
<pre><code>function ValidateStartDate() {
var txtDate = document.getElementById('<%=TextBoxStartDate.ClientID %>');
alert(txtDate.innerHTML);
}
</code></pre>
<p>But on <code>alert()</code>, I get no value at all.</p>
|
javascript asp.net
|
[3, 9]
|
1,374,745
| 1,374,746
|
Can not change value in textbox when edit
|
<p>In the Page-Load method I set value for textbox like this</p>
<pre><code>txtid.Value = pro.getId().ToString();
txtmodel.Text = pro.getModal();
txtname.Text = pro.getName();
cbCategory.SelectedValue = pro.getCategory();
txtprice.Text = pro.getPrice().ToString();
txtDescription.Text = pro.getDescription();
</code></pre>
<p>and when I submit to edit the Product I get value</p>
<pre><code>string id = txtid.Value.ToString();
string modal = txtmodel.Text.ToString();
int category = int.Parse(cbCategory.SelectedValue);
string name = txtname.Text.ToString();
string description = txtDescription.Text.ToString();
</code></pre>
<p>and I try to change value different with the original but when I bug it's still keep original value and save to database.</p>
|
c# asp.net
|
[0, 9]
|
256,995
| 256,996
|
How to alter prettyPhoto description HTML?
|
<p>hello i want to modify the "description html" of the prettyPhoto i dont think there is a callback available when prettoPhoto lightbox is "shown" (but a callback for close exist)</p>
<p>what do you guys recommend? </p>
|
javascript jquery
|
[3, 5]
|
1,239,000
| 1,239,001
|
Jquery change CSS class on clicking
|
<p>I am working on a project i am having some anchors like tab, each have some CSS class, the selected tab have separate css class. I am clicking on tab and i want to change its CSS class to selected css class i have done this functionality but i am having some problems with it is that previously selected tab also having same class, how can i change the previous selected tab to unselected class,Below is my code</p>
<pre><code>$(".btn").each(function ()
{
$(this).click(function () {
$(this).removeClass("course-btn-tab").addClass("course-btn-tab-selected");
});
});
<div class="course-Search-tabs">
<a href="#" class="course-btn-tab-selected btn" id="a">A</a>
<a href="#" class="course-btn-tab btn" id="b">B</a>
<a href="#" class="course-btn-tab btn" id="c">C</a>
<a href="#" class="course-btn-tab" id="d">D</a>
</div></code></pre>
|
javascript jquery
|
[3, 5]
|
3,654,259
| 3,654,260
|
Create a simple, simple, Game Engine
|
<p>I'm on my way with my first game, all design and that stuff are done, just coding left.
I have successfully watched tutorials around the world wide web with information about Graphics and how to create a successfully thread-synchronization within it. </p>
<p>Like now I have a SurfaceView-class and a Thread-class. The thread-class have this constructor to receive the Game Engine from my SurfaceView-class.
Simple code from Thread-class constructor:</p>
<pre><code> public Thread(SurfaceHolder localsurfaceHolder,
Context context,
Handler handler,
SurfacefView localEngine) {
surfaceHolder = localsurfaceHolder;
this.handler = handler;
this.context = context;
engine = localEngine;
}
</code></pre>
<p>From my SurfaceView-class in the surfaceCreated-method:</p>
<pre><code>thread = new GameThread(getHolder(), context, new Handler(), this);
</code></pre>
<p>And there is my code that will start trigging the thread when the surface is created.</p>
<p>Now to the <strong>real deal</strong>. Shortly I want a game engine that is totally separated from the view. The problem is; how to achieve this? How should the GameEngine-class constructor look like and where shall I put the drawing/calculations-methods? What does the GameEngine?</p>
<p>Now my GameEngine-class look like:</p>
<pre><code>package com.myname.mygame;
public class GameEngine {
//If im right, a constructor for the engine should be placed here
//How and which parameters shall I change and send with from the view
}
</code></pre>
<p>Thanks in advance!</p>
|
java android
|
[1, 4]
|
2,952,490
| 2,952,491
|
why jquery/javascript code get conflict with other jquery/javascript?
|
<p>While using jquery or javascript code most of the time i have to face the problem of jquery or javascript conflict.</p>
<p>Still i haven't got the reason why this stuff get conflict with other code?</p>
<p>Any one have any idea about this?</p>
<p>And any solution so that next time this issue will not occur while project development.</p>
<p>I have one solution to stop the conflict of jquery files that is,</p>
<pre><code> <script>
var j$=jQuery.noConflict();
</script>
</code></pre>
<p>but all the time this code is not working.</p>
|
javascript jquery
|
[3, 5]
|
2,688,443
| 2,688,444
|
How to distinquish concurrent progress bar requests on server side in asp.net
|
<p>I implemented progress bar to show completing status to users when video processes in background. it works well on single instance. but mixed it up when two concurrent video process started.</p>
<p>When two video processes initiated by two different users at same time, both users will see mixed progress status sometimes from video process 1, sometimes from another.</p>
<p>Video process on server side initiated with static variable.</p>
<pre><code>public static MediaHandler _mhandler = new MediaHandler();
</code></pre>
<p>Progress indication sent to page via</p>
<pre><code>[WebMethod]
public static string GetProgressStatus()
{
return Math.Round(_mhandler.vinfo.ProcessingCompleted, 2).ToString();
}
</code></pre>
<p>Progress request sent by progress bar after every few seconds.</p>
<p>Now my question is how i can set mediahandler object which can target only one instance at a time. </p>
<p>e.g progress bar 01 shows status of video process 01 only</p>
<p>and</p>
<p>progress bar 02 shows status of video process 02 only</p>
|
c# asp.net
|
[0, 9]
|
4,932,628
| 4,932,629
|
LINQ - return random value does not work
|
<p>I have this class in my infrastructure that suppose to return random image. It always returns same image. I have exactly same code used in different place on my website and it works. Any ideas?</p>
<p><a href="http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql">This</a> question is where I got the info for getting random value. I don't understand why it works on one place and not another though...</p>
<p>Background.cs</p>
<pre><code>public static class Background
{
public static string Get()
{
photoBlogModelDataContext _db = new photoBlogModelDataContext();
var image = _db.Images.OrderBy(x => Guid.NewGuid()).FirstOrDefault();
return image.Small; // Always same value?
}
}
</code></pre>
<p>Same code on another page that works where I loop through my gallery and choose random image from it</p>
<pre><code><img src="@Url.Content("~/content/uploads/" + item.Images.OrderBy(x => Guid.NewGuid()).FirstOrDefault().Small)" alt="" />
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,595,111
| 5,595,112
|
How to add number with animation
|
<p>I want to add number in existing number like stopwatch, My function is adding number perfectly but I want to add animation like stopwatch, I tried but I did not get any clue to get it done. Here's a <a href="http://jsfiddle.net/uyG92/" rel="nofollow">working demo</a></p>
<pre><code>$('a').click(function() {
var val = parseInt($(this).text());
var currentVal = parseInt($('#price').text())
var cal = parseInt(val-currentVal)
var club = parseInt($('#price').text()) + cal
var bb = $('#price').text(club)
})
})
</code></pre>
<p>HTML </p>
<pre><code><a href="#">10000</a>
<a href="#">12000</a>
<a href="#">15000</a>
<div id="price">10000</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,327,498
| 2,327,499
|
DRY attribute selection
|
<p>Say I have an element on the page:</p>
<pre><code><div data-name='foo'>
</code></pre>
<p>What's the best way to get the attribute value? Is there anything more DRY than <code>$('[data-name]').attr('data-name')</code> or <code>$('[data-name]').data('name')</code>?</p>
|
javascript jquery
|
[3, 5]
|
1,559,363
| 1,559,364
|
Force request to a URL on a different domain
|
<p>I need to make a request to a page on a different domain when a user clicks a link in order to keep the session alive on that domain. I don't care about the response data (except <em>maybe</em> the status code so I can make sure the page hasn't gone down). I tried issuing a request via <code>$.ajax</code> but the same-origin policy is disallowing it.</p>
<p>What's the best way to make request go through?</p>
<p>Should I write an iframe to my page? A script tag? Is there an option in <code>$.ajax</code> that will make it work?</p>
<p><strong>Edit:</strong> I also need to know when the request gone through so that I can do some stuff afterwards (i.e., I'd like a callback).</p>
<hr>
<p>Adding <code>dataType: 'jsonp'</code> sort of makes it work, except that I don't want it to execute whatever the site returns, which it seems to do. The page I'm requesting is a regular old HTML page, but it triggers some stuff on their server that keeps the session alive.</p>
|
javascript jquery
|
[3, 5]
|
3,811,995
| 3,811,996
|
Avoid multiple event listeners from .focus
|
<p>I currently have a textbox that I am invoking a keyboard stroke on focus:</p>
<pre><code>$myTextBox.on('focus', function(e){
$(document).keydown(function(e){
if(e.which==13)
e.preventDefault()
});
$(document).keyup(function(e){
if(e.which ==13)
alert("hey");
});
});
</code></pre>
<p>If I click on this multiple times pressing 'enter' once will cause many alerts, how can I avoid this so that only it is only invoked once. </p>
|
javascript jquery
|
[3, 5]
|
1,701,255
| 1,701,256
|
Rijndael.CreateDecryptor() crashes the IIS worker thread (but only in IIS 7.5 64bit)
|
<p>We have an app that works great on IIS 6 and IIS 7. As soon as we go to Windows 2008 R2 with IIS7.5 we get an IIS crash. The worker thread actually dies and leaves a message in the event viewer:</p>
<pre><code>Fault bucket , type 0
Event Name: APPCRASH
...
Problem signature:
P1: w3wp.exe
P2: 7.5.7600.16385
P3: 4a5bcd2b
P4: mscorwks.dll
...
</code></pre>
<p>I have traced it down to a single line of code that can produce the crash:</p>
<pre><code>var b = Rijndael.CreateDecryptor();
</code></pre>
<p>Is there some specific way to use this in a 64-bit environment? </p>
|
c# asp.net
|
[0, 9]
|
4,248,757
| 4,248,758
|
Android Pros: How to wrap PayPal's MPL?
|
<p>I have no Java experience and prefer Visual Basic; I've found a very nice translation IDE called Basic4android (www.basic4android.com). It works by interpreting a scripting language that's similar to Visual Basic and then using it to generate and compile native Java code. Rather ingenious, if you ask me. In fact I believe I found it from a reference here on StackOverflow.</p>
<p>I'm having some trouble wrapping PayPal's Mobile Payments Library:</p>
<p>www.x.com/community/ppx/xspaces/mobile/mep (scroll down for the HTML Tutorial)</p>
<p>I need to do it in a way that promotes the library's functionality so that B4A can in turn expose it to the Android device (emulator in this case). I've made some halting progress so far, but now I'm stuck on NullPointerExceptions occurring deep within the MPL.</p>
<p>The saga is pretty well described in a thread at their forum:</p>
<p><a href="http://www.basic4ppc.com/forum/additional-libraries-official-updates/8819-looking-download-link.html" rel="nofollow">http://www.basic4ppc.com/forum/additional-libraries-official-updates/8819-looking-download-link.html</a></p>
<p>Here's my wrapper and the generated code—download <a href="http://www.x.com/servlet/JiveServlet/download/205349-19237/Java%20Source.zip" rel="nofollow">here</a>—as only licensed users may access downloads in that particular forum section.</p>
<p>The latest NullPointerException occurs a few calls down from the initWithAppID function. The JD-GUI decompiler reports an internal error when it gets to the com.paypal.android.b.b class, so it doesn't appear to be possible to know exactly what's going on down there.</p>
<p>I'm certain this can be done; I just need to know how to open the proper communication channel between the device and the MPL.</p>
<p>I'm new at Java and I'm new at Android. Quite a combination, wouldn't you say?</p>
|
java android
|
[1, 4]
|
3,375,253
| 3,375,254
|
Is it possible to combine different paths into a view or an object?
|
<p>I created a drawing using different paths, but how can I move the entire drawing? How can I selected and move it around? Here is the main part of my onDraw method:</p>
<pre><code>Path theSymbol = new Path();
theSymbol.moveTo(0.0F, 0.0F);
theSymbol.lineTo(0.0F, 50.0F);
theSymbol.lineTo(16.666666F, 58.333332F);
theSymbol.lineTo(-16.666666F, 75.0F);
theSymbol.lineTo(16.666666F, 91.666664F);
theSymbol.lineTo(-16.666666F, 108.33333F);
theSymbol.lineTo(16.666666F, 124.99999F);
theSymbol.lineTo(-16.666666F, 141.66666F);
theSymbol.lineTo(0.0F, 150.0F);
theSymbol.lineTo(0.0F, 200.0F);
theSymbol.offset(100.0F, 20.0F);
canvas.drawPath(theSymbol, paint);
</code></pre>
<p>That's how I draw a resistor to the screen (It works). Now I want some way of making all those paths be an object, something that I can select and move.</p>
<p>I have been looking at some projects like <a href="http://code.google.com/p/sriracha" rel="nofollow">Sriracha</a>, but I can't find how they are doing their element drawings. </p>
<p>I have also searched countless times, but all I get is "moving something on a path". Maibe I am searching for the wrong thing or this is not the way to do this kind of things.</p>
<p>I wold really appreciate if someone can point me in the right direction. </p>
|
java android
|
[1, 4]
|
2,646,080
| 2,646,081
|
Bundle jQuery with widget
|
<p>Let's say I want to provide a widget like Youtube does to embed their player in an external page. For this widget, I rely on a certain version of jQuery. How can I bundle jQuery with my widget so that it is available to my widget JS code, but that it doesn't interfer with other jQuery versions included in the external page?</p>
<p>Do you have any pointers how to do that? Basically, I'm looking for a way to load jQuery into a specific namespace.</p>
|
javascript jquery
|
[3, 5]
|
2,662,075
| 2,662,076
|
How to execute alert after trigger click event
|
<p>I am trying to execute the alert message after the execution of the trigger event. My code :</p>
<pre><code> $(".addpage").trigger("click").queue(function () {
alert($(".page:first-child").attr("id"));
});
</code></pre>
<p>But here problem is the alert is executing before completing the trigger event function. What i am doin wrong here?</p>
|
javascript jquery
|
[3, 5]
|
412,034
| 412,035
|
Are there any advantages of using ASP over PHP?
|
<p>I've been working with PHP for server-side applications however, I recently found out about ASP and I was thinking about learning it. What are the advantages and disadvantages of using ASP over PHP and what are some situations where you'd need ASP or PHP that the other couldn't do it?</p>
|
php asp.net
|
[2, 9]
|
3,516,717
| 3,516,718
|
jQuery iframe upload. Handle network errors
|
<p>This code works, except now I need to handle network errors.</p>
<p>For example if the network is turned off while a file is uploading. I need to handle errors like these.</p>
<p>How can I proceed?</p>
<pre><code>var name = 'iframeUpload';
var cur = $(this);
var iframe = $('<iframe name="' + name + '" id="' + name + '" style="display: none" />');
$("body").append(iframe);
cur.attr("action", "upload/test");
cur.attr("method", "post");
cur.attr("enctype", "multipart/form-data");
cur.attr("encoding", "multipart/form-data");
cur.attr("target", name);
cur.attr("file", $(this).val());
cur.submit();
$('#' + name).load(function () {
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
234,805
| 234,806
|
how to show progress bar uploading file
|
<p>I use this code "<a href="http://stackoverflow.com/questions/10832415/large-files-will-not-get-uploaded-to-server-from-my-android-app">Large files will not get uploaded to server from my android app</a>" to upload my files server and now looking for the opportunity how to display progress bar.</p>
<p>-Best</p>
|
java android
|
[1, 4]
|
4,826,418
| 4,826,419
|
jquery .net not firing the function $.ajax
|
<p>im using jquery in asp.net, if i try to use $.ajax functionality, i got this</p>
<ol>
<li>if i use it in a separate page it works..</li>
<li>when i put it in an ascx and put the ascx out of <code><form runat="server" ></code>... tags it works</li>
<li>if i put it between <code><form></code> tags , jquery works but it doesnt fire <code>$.ajax</code> event</li>
</ol>
|
c# jquery
|
[0, 5]
|
4,608,142
| 4,608,143
|
Lock screen with out Thread.sleep or giving some amount of time in jquery
|
<p>Hi all I am having a requirement where I have to show loading image when I perform any operation. I have gone through several blogs and articles, but all of them are doing some thing like giving some amount of time in Jquery or the scripts used, or using <code>Thread.Sleep</code> method.</p>
<p>Is it possible to do with out these two. Means I don't know how much time it takes to load a page, until and unless the page get loaded I would like to show the waiting screen for the user.</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
2,193,386
| 2,193,387
|
Get last string from URL with jQuery
|
<p>Im trying to get the last string from a URL for example...</p>
<pre><code>http://www.mywebsite/blog/this-post
</code></pre>
<p>I want to use jQuery to get 'this-post'
Ive the following...</p>
<pre><code>$('img.gigthumb').each(function(){
var foo = $(this).parent().attr('href').split('/');
$(this).attr('src','/lic/wp-content/uploads/2012/01/'+foo[1]+'.jpg');
})
</code></pre>
<p>only it doesn't work and I presume thats because I have multiple '/' within the URL, any idea how to target just the last? </p>
<p>Hope this makes sense! </p>
|
javascript jquery
|
[3, 5]
|
5,882,108
| 5,882,109
|
How can I add mouse click event to Web TextBox in c#
|
<p>How can I add mouse click event to Web TextBox in c#</p>
|
c# asp.net
|
[0, 9]
|
1,677,640
| 1,677,641
|
jquery selector slow when 1000+ elements with 450Mhz machine
|
<p>I got something like this which contains about 1000 dom elements</p>
<pre><code> <table id="tableId">
<tr class="selected"><td>Text 1</td></tr>
<tr><td>Text 2</td></tr>
...
<tr><td>Text 500</td></tr>
</table>
</code></pre>
<p>problem is that i need to do something like this:<br /></p>
<pre><code>y = new selected tr;
$("#tableId").find("tr").removeClass("selected").eq(y).addClass("selected");
</code></pre>
<p>The problem here is the selector itself who takes about 600ms to process which is kinda too long for the things we are doing.</p>
<p>The machine im using uses a browser <strong>opera10</strong> and has only <strong>450Mhz</strong> running on linux!<br/>
Do you guys think that the problem comes from the machine being that slow? </p>
<p>Is there a way to improve the selector ?</p>
|
javascript jquery
|
[3, 5]
|
4,511,006
| 4,511,007
|
drag and scroll script
|
<p>I'm trying to make a scrolling calendar script using jquery (similar to the one on an iPad) </p>
<p>So, I want to record the yPosition of the mousedown and the mouseup and move a div accordingly. I tried recording the mouse positions using two variables, one to be recorded on the mousedown event and one to be recorded on a mouseup event... </p>
<p>but right now the problem is that the variable value is not carried through, so on the mouseup the value of the mousedown is back to 0. what would I do to carry the value?</p>
<p>Thanks a lot in advance! </p>
<p>The code is below:</p>
<pre><code>jQuery(document).ready(function(){
var yStart = 0;
var yEnd = 0;
$("#year").mousedown (function(e){
var yStart = e.pageY;
$(".yStart").text (yStart +"ho"+ yEnd);
}).mouseup (function(e){
var yEnd = e.pageY;
$(".yEnd").text (yStart +"ho"+ yEnd);
});
if (yStart>yEnd) {
$("#year ul").animate({top:'-='+liHeight},"fast");
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,321,278
| 4,321,279
|
How to make a live activity feed display like IBFX Connect?
|
<p>What are the basics of making a live activity like the one here:
<a href="https://www.ibfxconnect.com/" rel="nofollow">https://www.ibfxconnect.com/</a>
?</p>
<p>I have two specific questions:</p>
<p>I want to have the effect of new things coming in the feed and old things being pushed down as it shows. How?</p>
<p>And what are the basic mechanics of a timer that binds the data?</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.