Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
5,081,373 | 5,081,374 |
Android and IOException - strange error
|
<p>I'm trying to write a basic application with http get request. Eclipse validated my code, but when I using IOException in Android console I have this strange messages:</p>
<pre><code>trouble writing output: null
[2009-07-29 17:22:49 - myapp] Conversion to Dalvik format failed with error 2
</code></pre>
<p>And my application doesn't load into the emulator. This is my code:</p>
<pre><code>HttpHost target = new HttpHost("google.com", 80);
HttpGet get = new HttpGet("/");
String result = null;
HttpEntity entity = null;
HttpClient client = new DefaultHttpClient();
try {
HttpResponse response=client.execute(target, get);
entity = response.getEntity();
result = EntityUtils.toString(entity);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (entity!=null){}
try {
entity.consumeContent();
} catch (IOException e) {}
}
return result;
</code></pre>
<p>Anyone knows what is the problem?</p>
|
java android
|
[1, 4]
|
3,070,382 | 3,070,383 |
.offset().top returning the wrong value
|
<p>I'm having a bizarre issue that I don't know how to solve and was wondering if you guys could help.</p>
<p>A bit of background: I have been asked to create a system where subpages of a page in wordpress are loaded on the end of that page in an infinite scroll. This is working correctly. </p>
<p>They also want the top nav links to load all content upto and including the page they clicked and then scroll to it. </p>
<p>If I scroll down (loading the pages) and then click a top nav link the scroll works correctly. However if I load NO further pages before clicking one of the links, the pages will load, and the scroll will start, but will only get some of the way before stopping. This is due to an incorrect value being given by offset().top. My question is why ?</p>
<pre><code>function ajaxloadnscroll(index) {
//If the page has already been loaded then just scroll to it
if (pages[index].loaded) {
$('html, body').animate({
scrollTop: $("#" + pages[index].name).offset().top
}, 2000);
return;
}
//Loop through pages up to one clicked.
for (i = 0; i <= index; i++) {
current = i;
if (!pages[current].loaded) {
$.ajax({
url: pages[i].url,
async: false,
context: document.body,
success: function(data) {
if (data) {
$("#tempload").before(data);
pages[current].loaded = true;
if (current == index) {
$('html, body').animate({
scrollTop: $("#" + pages[current].name).offset().top
}, 2000);
}
}
}
});
}
}
//Increment current in order to load next page object on scroll.
current++;
return false;
}
</code></pre>
<p>Any help you could give me on this issue would be really appreciated!</p>
|
javascript jquery
|
[3, 5]
|
3,364,232 | 3,364,233 |
Postback problem on a submit button !
|
<p>I have a page that has 4 tables. Initially when the page is loaded, it shows 1 & 2. Thats working fine. On Post back(When Submit is clicked), it should show 3 &4. Even thats working fine(code shown here). When the submit is clicked again, it has to call updatePaymentInfo() and redirect.. Is there something to write as a condition to call UpdatepaymentInfo() because when submit is clicked, it is taking as an other postback and showing me 3 &4 again. </p>
<pre><code>protected void imgbtnSubmit_Click(object sender, ImageClickEventArgs e)
{
try
{
if (Page.IsPostBack)
{
trtest.Visible = false;
trCCandBilling.Visible = true;
trtest2.Visible = true;
}
else
{
UpdatePaymentInfo();
Response.Redirect(ApplicationData.URL_MERCHANT_ACCOUNT_HOME, true);
}
}
}
</code></pre>
<p>Thanks guys!!</p>
|
c# asp.net
|
[0, 9]
|
1,847,747 | 1,847,748 |
Call Javascript function from Gridview RowDeleting event
|
<p>I need to call a javascript alert from an if condition inside a gridview in the gvLocations_RowDeleting section. </p>
<p>Code is as follows:</p>
<pre><code>protected void gvLocations_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
if (CheckIfLocationExists(ID) == true)
{
//need to call javascript function sendmessage() here??
}
}
</code></pre>
<p>I have a javascript function in the .aspx file as follows</p>
<pre><code><script type="text/javascript">
function sendmessage()
{
alert("Area is associated with this location already");
}
</script>
</code></pre>
<p>I know this is an easy move but for some reason Im having trouble. Can someone help? thanks in advance. Stack Overflow rocks!</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,073,039 | 4,073,040 |
TitlePageIndicator selected line footer to header
|
<p>I'm using the TabPageIndicator from Jake Wharton
My question: Is there any way to transform the tab footer line in a "header line"?
I'm using the indicator below the ViewPager and it would be nice to have the "selected line" on the top of my tab title.</p>
<p>Thanks in advance</p>
|
java android
|
[1, 4]
|
5,066,114 | 5,066,115 |
C#-like named argument in javascript?
|
<p>Is it possible to use named argument in javascript?</p>
<p>E.g.</p>
<blockquote>
<p>void method (int a, int b);</p>
<p>method(a:1, b:2);</p>
</blockquote>
|
c# javascript
|
[0, 3]
|
5,329,685 | 5,329,686 |
Display dates of a month or year for which the day name is Friday, in Java or JavaScript?
|
<p>How can I display the dates in a month or year for which the name of the day is Friday, in Java or JavaScript?</p>
<p>For example, for the month of December 2011, the code would display:</p>
<ul>
<li>2/12/2011</li>
<li>9/12/2011</li>
<li>16/12/2011</li>
<li>23/12/2011</li>
<li>30/12/2011</li>
</ul>
|
java javascript
|
[1, 3]
|
4,645,635 | 4,645,636 |
Expected behavior when an request for a collection will have zero items
|
<p>Let's say you are given the following...</p>
<pre><code>List<Thing> theThings = fubar.Things.All();
</code></pre>
<p>If there were nothing to return, what would you expect fubar.Things.All() to return?</p>
<p>Edit:
Thanks for the opinions. I'll wait a bit and accept the entry with the most ups.</p>
<p>I agree with the responses so far, particularly those suggesting an empty collection. A vendor provided an API with several calls similar to the example above. A vendor who did $4.6 million in revenue via their API(s) last year, BTW. They do something I fundamentally disagree with -- they throw an exception.</p>
|
java c#
|
[1, 0]
|
3,460,315 | 3,460,316 |
Understand JQuery Snippet code
|
<p>Can anyone help me understand what this code snippet is doing? I'm maintaining a website and I think this is the source of a problem I am having. </p>
<pre><code>function cust_addToCart(itemid, itemqty, options, viaajx, loadingf, callback) {
var url = "/app/site/backend/additemtocart.nl?buyid=" + itemid + "&qty=" + itemqty;
document.location.href = url;
}
$('#itemlist .addtocart-lnk').click(function() {
$(this).next().find('.addtocart').click();
return false; //Would this return a # for a link?
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,655,391 | 2,655,392 |
If condition in a return statement
|
<p>I need to make a if statement with in a function that returns multi-values. I tried this but it's not working. </p>
<pre><code>a(this).attr('src', function(i, current){
if ( i == 'http://www.old.com'){
return current.replace('http://www.old.com','http://www.new.com');
}
else if ( i == 'http://www.older.com'){
return current.replace('http://www.older.com','http://www.new.com');
}
else ();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
919,872 | 919,873 |
Referencing functions from within functions inside a JavaScript object
|
<pre><code>var Page = {
data: null,
Load: function () {
this.Populate;
},
Populate: function () {
}
};
$(document).ready(Page.Load);
</code></pre>
<ol>
<li>Why can't I reference <code>Page.Load</code> as a function in <code>ready()</code> eg <code>.ready(Page.Load())</code></li>
<li>Why can't I call <code>this.Populate()</code> from the Load function, I just get <code>this.Populate()</code> is not a function.</li>
</ol>
|
javascript jquery
|
[3, 5]
|
3,079,162 | 3,079,163 |
JS to jQuery to the fullest
|
<p>I have this:</p>
<pre><code>function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
} else {
request_type = new XMLHttpRequest();
}
return request_type;
}
var http = createObject();
var nocache = 0;
function insert() {
document.getElementById('insert_response').innerHTML = "To Sek .. "
var bID= encodeURI(document.getElementById('bID').value);
var kommentar= encodeURI(document.getElementById('kommentar').value);
nocache = Math.random();
http.open('get', 'insert.php?bID='+bID+'&kommentar=' +kommentar+'&nocache = '+nocache);
http.onreadystatechange = insertReply;
http.send(null);
}
function insertReply() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('insert_response').innerHTML = response;
if ($("#box[value=1]").length > 0) { window.parent.showMessage("Video Is OK"); }
}
}
</code></pre>
<p>And i want to "shorten" the code, and make it use jQuery to the fullest. eg, i have heard of serialize(); instead of using http.open etc.., but how should i use it in this case? </p>
<p>And do i really need all that in createobject() to make the http?</p>
|
javascript jquery
|
[3, 5]
|
3,042,595 | 3,042,596 |
How to get Custom Property from ASP.NET Textbox using javascript?
|
<p>I have created a custom text box with property "key"(ASP.NET C#).I want to get the value of this property "key" using java script.How can I do this?</p>
|
asp.net javascript
|
[9, 3]
|
2,296,855 | 2,296,856 |
Jquery automatically form submit, but returns nothing
|
<p>I'm using Keith Jquery Countdown 1.5.8 for doing the countdown and the ticking time is working perfectly for every user. i have 2 forms in a single php file (let's say multiform.php) but the form submits nothing when the countdown reaches zero.</p>
<p>Here is my jquery code :</p>
<pre><code><script type="text/javascript">
$(function () {
$('#defaultCountdown').countdown({until: <?php echo($usertime); ?>,
onExpiry: function() {
$('#quizform').submit();
}
});
});
</script>
</code></pre>
<p>and some of my multiform.php codes are :</p>
<pre><code><?php
if($choice==1) {
?>
...
<form action="submit.php" method="post" name="quizform" id="quizform">
...
...
<input type="submit" name="save_1" value="Save" />
</form>
<?php
} else {
?>
...
<form action="submit.php" method="post" name="quizform" id="quizform">
...
...
<input type="submit" name="save_2" value="Save" />
</form>
</code></pre>
<p>and submit.php consists of :</p>
<pre><code>if(isset($_POST['save_1'])) {
...do part 1
}
else {
...do part 2
}
</code></pre>
<p>The form submits nothing, none of those text input values submitted to "submit.php". It returns blank.
Am i doing wrong ?</p>
|
php jquery
|
[2, 5]
|
5,139,403 | 5,139,404 |
Turning text into executable statements
|
<p>This is a question out of curiousity for java or c++, I wanted to ask if it is possible to turn any text input into some executable statements?</p>
<p>For example say I have a text file with info like: </p>
<p>"class: Abc,
Param: 32"</p>
<p>Now say in C++ or Java I want to read that file and do something like:</p>
<pre><code>new Abc(32);
</code></pre>
<p>How would I do that? Its easy enough to read the value Abc but how do say create a class Abc? Is there a standard way to do that? in both C++ and Java?</p>
<p>Main curiosity came from those persistance mechanisms in Java that store object properties in XML file and create an object by reading that XML file, how do they do that? Is that seperate from what I am asking for above?
EDIT: This is different from the standard java serialization, i've seen this as solutions for long term persistence where object implementation can change and instead of serializing they store properties including execution statements in XML files which are used to create an object at runtime. </p>
|
java c++
|
[1, 6]
|
5,409,037 | 5,409,038 |
Are there any FOSS libraries that are the result of ripping bits out of Android for plain Java?
|
<p>Before you jump, yes i have heard of the recent project to make Android proper run on a plain JRE. This question is not about Android the platform but rather about leveraging the great stuff thats in there, and may be useful in parts, eg the bitmap/graphics stuff.</p>
<p><em>PS</em> Yes lets ignore the obvious bits that dont make sense such as telephony etc.</p>
|
java android
|
[1, 4]
|
3,643,404 | 3,643,405 |
reload div with javacript containing php content
|
<p>I have seen a lot of questions like this, but they don’t seam to answer my question.</p>
<p>I have a php page with this structure:</p>
<pre><code><?php
include 'header.php';
include 'content.php';
include 'footer.php';
?>
</code></pre>
<p>In the header.php I have a function that counts some rows in a database</p>
<pre><code>$show =$mysql->count('someparam', $foo['bar']);
if ($show > 0) {
echo $show;
}
</code></pre>
<p>Thats all good. Now in the content.php file the user can do operations that changes this $show value in the header. But I need to reload the page to see the updated $show number.</p>
<p>I want to solved this with javascript, but cant figure out how to do it.</p>
<p>I tried solving it with a javascript reload on timer, like this:</p>
<pre><code><script>
function render (){
$('.customer-database').html(.customer-database)
}
window.setInterval(render, 500);
</script>
</code></pre>
<p>the $show counter is inside the div class costumer-database. This is not working because I need to put html code in after the html(, but I don’t want to put HTML code in, I simply want to reload it.. Is this possible?</p>
<p>I am open to any suggestions both javascript and php.</p>
|
php javascript
|
[2, 3]
|
5,682,974 | 5,682,975 |
How to call PHP page with Javascript & jQuery when user clicks on a href link?
|
<p>In a PHP Project I have hyperlink :</p>
<pre><code><a href="addid.php?id='. $Id . '">| Name |</a>';
</code></pre>
<p>When a user click on the link I need to add the selected "id" to session</p>
<p><strong>addid.php Code :</strong></p>
<pre><code>session_start();
$_SESSION['id'] = $_GET['id'];
</code></pre>
<p>I need to accomplish this without reloading the page (need to add the "id" to session in background).</p>
<p>How to call <code>addid.php</code> with Javascript & jQuery?</p>
<p>NOTE: I tried this code, but it does load the <code>addid.php</code> in browser</p>
<pre><code>$('a').click(function(){
$.ajax();
return false;
});
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
2,908,638 | 2,908,639 |
Any jQuery "typewriter" plugins which support line breaks + callback functions?
|
<p>Recently I've went through half a dozen jQuery plugins which do "typewriter" effects on text but none of them seem to support line breaks. If you're not sure what this is, I mean something like this:</p>
<p><a href="http://haydndemos.awardspace.co.uk/typewriter1.html" rel="nofollow">http://haydndemos.awardspace.co.uk/typewriter1.html</a></p>
<p>Basically I have text in a paragraph element and there's line breaks. However whenever I get one of the typewriter plugins working on my paragraph element, the typewriter plugin doesn't type out line breaks and so everything is in one big line which wraps to the next line. For example, suppose this was the text I wanted the typewriter to type out:</p>
<p>test1<br />
test2<br />
test3</p>
<p>It ends up typing out:</p>
<p>test1 test2 test3</p>
<p>Also, some other typewriter plugins were unreliable as they only did typewriter text on li/ul elements, not paragraph elements.</p>
<p>The closest I got was this, which does support line breaks, but it isn't free:</p>
<p><a href="http://codecanyon.net/item/fancy-typewriter-jquery-plugin/full_screen_preview/158664" rel="nofollow">http://codecanyon.net/item/fancy-typewriter-jquery-plugin/full_screen_preview/158664</a></p>
<p>(I know for a fact this supports line breaks because I saved the webpage and modified the paragraph, however the Fancy Typewriter script only works locally and not when on a server, so it's probably copyright protected... plus I don't want to violate any copyrights.)</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
4,679,870 | 4,679,871 |
Javascript/Jquery Convert string to array
|
<p>i have a string </p>
<pre><code>var traingIds = "${triningIdArray}"; // ${triningIdArray} this value getting from server
alert(traingIds) // alerts [1,2]
var type = typeof(traingIds )
alert(type) // // alerts String
</code></pre>
<p>now i want to convert this to array so that i can iterate</p>
<p>i tried </p>
<pre><code>var trainindIdArray = traingIds.split(',');
$.each(trainindIdArray, function(index, value) {
alert(index + ': ' + value); // alerts 0:[1 , and 1:2]
});
</code></pre>
<p>how to resolve this?</p>
|
javascript jquery
|
[3, 5]
|
2,178,973 | 2,178,974 |
How to fetch content from a webpage?
|
<p>I want to fetch div content from a webpage and to use it in my page.</p>
<p>I have the url <a href="http://www.freebase.com/search?limit=30&start=0&query=cancer" rel="nofollow">http://www.freebase.com/search?limit=30&start=0&query=cancer</a><br />
I want to fetch div content with id artilce-1001. How can I do that in php or jQuery?</p>
|
php jquery
|
[2, 5]
|
5,867,330 | 5,867,331 |
Is it possible to set height and width of image which was assigned to a label dynamically
|
<p>Hi all i am using the code below to append image to a <code>label</code> text </p>
<p><code>lblPopUp.Text = "<img src='Popup(Images)/notfound.png' />&nbsp;&nbsp;&nbsp;&nbsp; Access Denied,Contact Administrator";</code></p>
<p>This results me as follow when loaded</p>
<p><img src="http://i.stack.imgur.com/IuNII.jpg" alt="enter image description here"></p>
<p>Is it possible to change some what as below so that text and image should look similar</p>
<p><img src="http://i.stack.imgur.com/4N7a9.jpg" alt="enter image description here"></p>
|
c# asp.net
|
[0, 9]
|
3,498,452 | 3,498,453 |
Jquery inside foreach loop
|
<p>I have this jquery code in a foreach loop. Basicaly the variable $perf gets a new value with every loop. How can I use jquery to display the different $perf value with each loop? Is it possible?</p>
<pre><code> foreach ($perfs as $perf):
<script type="text/javascript">
$(document).ready(function(){
var performerName = $(".transparency").data('title');
var divcontent = $(".transparency").html();
if ( divcontent == '&nbsp;' ){
$(".transparency").html(''+performerName+'');
}
});
</script>
<div class="transparency" data-title="<? echo $perf; ?>">&nbsp;</div>
endforeach;
</code></pre>
|
php jquery
|
[2, 5]
|
1,403,430 | 1,403,431 |
Using a Details View, is there any way during Page_Load (or anywhere) to only display non-null fields?
|
<p>I've been receiving help with a program I've been working on from you guys (and I really appreciate it as I'm fairly new to <code>ASP.NET</code>), but now I'm stuck again.<br>
I've got my <code>List<Products></code> that contains one Product object with 17 properties(representing the fields). Some of these properties may be null(well actually, I already coded it so that if the field in the database was null, convert the properties to either "" or -1). </p>
<p>Is there any way to only create fields for the properties that aren't <code>null</code> in my Details View using <code>ASP.NET/C#</code> or do I have to use <code>Javascript</code> or something else? I can provide what I have thus far if necessary.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,251,494 | 1,251,495 |
Querying Servers
|
<p>I want to query few game servers.</p>
<p>I have made a server refresher in Java which queries each server in a loop one by one.</p>
<p>Will changing to C++/C or PHP make querying faster or should i stick to Java ??</p>
<p>UDP Packets are sent / received to query a server.</p>
<p>Also, is there any faster way to do this other than one by one in loop.</p>
<p>Worst case time(when all servers offline ) is 200ms X number of servers . (2s is timeout for each). which becomes large when server list is huge.</p>
|
java php c++
|
[1, 2, 6]
|
5,932,872 | 5,932,873 |
Remove HTML element using Javascript in android
|
<p>I am using <code>Webview</code> to display the html page and i am successfully able to hide my html element but my problem is it hide after taking some time i want to hide when page load every time in <code>webview</code> Please help me out.</p>
<p>my code is as follows :</p>
<pre><code> @Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
wv.loadUrl("javascript:(function() { " +
"document.getElementsByTagName('a')[0].style.display = 'none'; " +
"})()");
}
</code></pre>
|
javascript android
|
[3, 4]
|
354,187 | 354,188 |
Refresh GridView After Data is Deleted From DetailView Using C#
|
<p>When user select any record from the GridView then my DetailView is updated based on the selection of the GridView. So what I am trying to do is that when I delete anything from the DetailView then I want to refresh the GridView so basically I don’t want to show still the deleted record in the GridView. I have tried to resolve this issue by doing the data bind after my connection and SQL statement but it does not refresh it. One thing to note is that I am using a Accordion pane but both my gridview and the detailview are on the same pane. I am not sure if this is breaking anything. Here is my code:</p>
<pre><code>protected void Refresh_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (e.CommandName.Equals("Delete", StringComparison.CurrentCultureIgnoreCase))
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
SqlDataAdapter da = new SqlDataAdapter("select ID, Name, Address from dbo.MyTable", con);
DataTable dt = new DataTable();
da.Fill(dt);
Gridview1.DataSource = dt;
Gridview1.DataBind();
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,236,031 | 2,236,032 |
How to assign the value of a javascript variable to a php variable
|
<p>I've a form. </p>
<pre><code><form action="inc/genxml.php" method="post">
<input id="nameTxt" name="name" type="text" value="test"/>
<button id="nameSave" class="left">Save</button>
</form>
</code></pre>
<p>And a div element #name</p>
<p>When I click the save button, I want to pass the position of the div #name to the form action file.
To get the position, I'm using jQuery .position().</p>
<p>Something like below. (which just prints out the coordinates)</p>
<pre><code>$('#nameSave').click(
function() {
var pos = $('#name').position();
alert("left: " + pos.left + ", top: " + pos.top );
}
);
</code></pre>
<p>I want to pass the coordinate values (pos.left & post.top) to the form action file (in this case to the file genxml.php).</p>
<p>How should I do that?</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,946,584 | 1,946,585 |
$(document).click(): does not fire alerts
|
<p>Might be simple but I can find a reasonable explanation for that</p>
<pre><code>$(document).ready(function(){
$(document).click(function () {
alert('ok');
});
});
</code></pre>
<p>Does not fire the alert();
I am using the newest google chrome. Does browser put some restriction for that as there is in ajax callback functions?</p>
<p><strong>Edit 1:</strong> Code is within <code>$(document).ready();</code></p>
|
javascript jquery
|
[3, 5]
|
2,934,162 | 2,934,163 |
Web Apps for cross platform mobile software development?
|
<p>I am a C++ programmer interested in developing applications for Android as well as the iPhone platform. I have explored both these platforms by writing simple applications in Java (Android) and Objective-C (iphone). But the fact is that I am not comfortable with either of these languages, and it bothers me that I have to write 2 very different versions of the same application to support both platforms. (And then what do I do to run it on a Nokia phone?)</p>
<p>Is using web technologies (JavaScript/HTML/CSS) a viable solution for
writing apps which will run on multiple mobile platforms? I have heard
of <a href="http://www.appcelerator.com/" rel="nofollow">Appcelerator</a> and <a href="http://phonegap.com/" rel="nofollow">PhoneGap</a>, but I am not sure how mature
these products are. I'd appreciate any feedback from folks who have
used web apps as a solution for developing cross platform mobile apps. </p>
|
iphone android
|
[8, 4]
|
3,511,981 | 3,511,982 |
asp.net threads: attributable to the user that started them
|
<p>(asp.net 2.0, C#)</p>
<p>I need to implement threading that will be:</p>
<ol>
<li>Attributable to the user that started the thread (e.g. on a callback, I could use an ID or the name of a thread to look up the thread that the user previously started). </li>
<li>If the thread is finished, the callback should be able to look up the thread and know it is finished. </li>
<li>Finally, the thread would need to automatically terminate if it is active for, say, more than a minute.</li>
</ol>
<p>I've read quite a bit and I now know that I need to personally manage the threads (e.g. I can't use the asp.net thread pool) because of requirement (1) I listed above. I notice that the Thread class in C# has an ID property; can that ID be used to implement requirement (1) (I don't know if that ID will always be unique, etc)? </p>
<p>Btw, I understand that asp.net can terminate threads at certain points. Basically, any time the user's Session is wiped out, my thread is useless anyway. If the thread does fail or does get terminated for whatever reason, that's fine because the task will be restarted. Mostly I'm concerned with finding some way where the user can look up the thread that was started .. can this be accomplished by storing the ID property in Session? Also, if so, how do I go about using that property to actually find the thread? If not, what is the recommended way to do what I'm asking. Thanks.</p>
|
c# asp.net
|
[0, 9]
|
4,003,675 | 4,003,676 |
jquery reset conditional filter
|
<p>I have 2 dropdown lists on my webform and using jquery trying to filter/reset filter 2nd dropdown elements based on 1st dropdown selection.</p>
<pre><code>$(document).ready(function()
{
$('#dropdown1').change(function(e)
{
switch ($(this).val())
{
case "4":
//this removal works
$('#dropdown2').filter(function()
{
return ($(this).val() == 16);
}).remove();
break;
.................
default:
//how would I restore filter here?
}
}
});
</code></pre>
<p>Removing part works, so it filters item with no problem, but I have difficulty restoring the filter on dropdown 2 if something else is chosen in dropdown 1. I was trying to use <code>.hide()</code> and <code>.show()</code> instead of <code>.remove()</code> but it doesn't seem to work on IE6 at least.</p>
|
asp.net jquery
|
[9, 5]
|
2,823,315 | 2,823,316 |
Seperate Values which are saved in one column
|
<p>i have one column. In that column is saved the fullname(firstname, surname) of a Person. Sometimes it is saved like</p>
<pre><code>Michael, Myers
</code></pre>
<p>and sometimes the name is saved like</p>
<pre><code>Michael Myers
</code></pre>
<p>without a comma between them. </p>
<p>If i load the column and save it to a variable it looks of course like: <code>Michael, Myers</code> or <code>Michael Myers</code>.</p>
<p>The Question is: If i load the column from the database, how can i save the the firstname and the surname independently of each other in different variables. </p>
|
c# asp.net
|
[0, 9]
|
945,152 | 945,153 |
Developing a algorithm to produce matches for android game?
|
<p>I have a class that is responsible for creating matches that the user has to complete. After the user completes the match another random match is then loaded..</p>
<p>For example, user has to match cards..Red, blue, green. User does this and competes the match.</p>
<p>Next match is load user must now complete match cards..green, blue, red.
Etc etc</p>
<p>So now the game will be level based so some how i need to incoporate the level number into the algorithm. I am also using levels to add new matches the user has to do and the more complicated the matches become.</p>
<p>So my question is, how do i develop a algorithm to produce items to the user..</p>
<p>Here is a scenerio:</p>
<p>The user starts the game on level one. During level 1 there is only 3 match cards that can be used..The game generates 6 rounds of matches for the user. Once complete on to level 2. In level two a new card is added. Now the game can use 4 cards to create match challengers for the user. The game generates 6 rounds with those for cards all randomized, and then the user is on the next level..</p>
<p>Hope this all makes sense. So now i just need to develop a algorithm for this. Which is why i am reaching out for help.</p>
<p>Thank you.</p>
|
java android
|
[1, 4]
|
3,202,328 | 3,202,329 |
How to harness control of my JQuery coded sliding divs?
|
<p>Essentially I have 4 divs that take turns sliding in and sliding out with delays and then it recalls the function. Like so:</p>
<pre><code>$(document).ready (function bradslide(){
$("#slide1").delay('1000').slideDown('1000').delay('6000').slideUp('1000');
$("#slide2").delay('9000').slideDown('1000').delay('6000').slideUp('1000');
$("#slide3").delay('17000').slideDown('1000').delay('6000').slideUp('1000');
$("#slide4").delay('25000').slideDown('1000').delay('6000').slideUp('1000', 'swing', bradslide);
}
);
</code></pre>
<p>Let me say that this works fine, but that I am open to cleaning it up or making it easier or more up to standard if suggestions are made.</p>
<p>However my question is this: How can I arrange this so that the end user can manipulate the animation. This slides through the divs on its own, but ideally I would like to have a couple buttons to click to go backward or forwards (I think you get the idea).</p>
<p>Any suggestions of how or where to begin would be greatly appreciated. I imagine I might have to scrap this little piece of code as it stands. Thanks in advance guys.</p>
|
javascript jquery
|
[3, 5]
|
2,929,690 | 2,929,691 |
how to get correct ClientID
|
<p>update:
asp.net</p>
<pre><code><asp:RadioButtonList runat="server" ID="rbl" RepeatDirection="Horizontal">
<asp:ListItem Text="None" Value="0" Selected="True" Enabled="true" />
<asp:ListItem Text="Float" Value="1" Selected="False" Enabled="true" />
<asp:ListItem Text="Float1" Value="2" Selected="False" Enabled="true" />
<asp:ListItem Text="Center" Value="3" Selected="False" Enabled="false" />
</asp:RadioButtonList>
</code></pre>
<p>when i view the source this is what it is rendering:</p>
<pre><code>$('#ctl00_ctl00_ContentMain_rbl').hover(
function (){
$('#div1').dialog({title: "some title"});
$('#div1').dialog('open');
}
);
</code></pre>
<p>the correct clientid is: <code>ctl00_ctl00_ContentMain_rbl_0, ctl00_ctl00_ContentMain_rbl_1, ctl00_ctl00_ContentMain_rbl_2</code></p>
<p>the code does not work and it did not give me the correct ClientID name when i try to read it... what is the other way round for this problem, define class name ???</p>
<pre><code> $('#<%= rbl.ClientID %>').hover(
function (){
$('#div1').dialog({title: "Float Images Left"});
$('#div1').dialog('open');
} );
</code></pre>
|
jquery asp.net
|
[5, 9]
|
4,215,473 | 4,215,474 |
Event for add/edit/delete Contact in android
|
<p>Is there any event for add/edit/delete in Contact List?</p>
|
java android
|
[1, 4]
|
3,632,409 | 3,632,410 |
Change the html of span through javascript
|
<p>I am developing an asp.net web app in which I am using a span tag </p>
<pre><code><span id = "ptxtAgree" > <%: data.Agree %></span>
</code></pre>
<p>and I want to update the span text through javascript and in script I am writing </p>
<pre><code> $("#ptxtAgree").text(msg);
</code></pre>
<p>If I am writing the empty span then its value is updated but by using this <code><%: %></code> it is not possible.</p>
<p>Sorry for poor English</p>
<p>regards </p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
5,569,491 | 5,569,492 |
Android Hardware (mobile )
|
<p>i want to connect Sony Ericsson xperia x10 (android mobile) to the eclipse (emulator)
i was able to connect htc mobile to the eclipse.but i could not connect the sony mobile to the eclipse.can you please help me? </p>
|
java android
|
[1, 4]
|
3,475,929 | 3,475,930 |
Why my 'else' do not work?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2076988/why-does-id-return-true-if-id-doesnt-exist">Why does $(‘#id’) return true if id doesn’t exist?</a> </p>
</blockquote>
<p>I have a very simple js function:</p>
<pre><code>function refresh(ltr) {
if (board.find('p:contains("' + ltr + '")')) {
board.find('p:contains("' + ltr + '")').show();
} else {
alert('Hello.');
}
}
</code></pre>
<p>Obviously I pass a string to ltr, it works fine if it contains the string but if not it do not fire the alert... </p>
<p>Do you know why?</p>
|
javascript jquery
|
[3, 5]
|
460,204 | 460,205 |
Separate click event for first three td and last td not working in Dom change
|
<p>I am having four column in my table. When we click one of the first three td that will do one operation and when we click last td that will do other kind of operation.
I did like this</p>
<pre><code>$('#items_list tr td').not('#items_list tr td:last-child').click(function() {
// Do something
}
$("#items_list tr td:last-child").click(function() {
// Do something
}
</code></pre>
<p>But those not working when Dom change. I try to use .live(), but the disadvantage of li is
Chaining methods is not supported. Any one can guide me?</p>
|
javascript jquery
|
[3, 5]
|
921,707 | 921,708 |
How to apply validation on radio button user controls using java script
|
<p>Having more than one radio button user controls generate dynamically how to applying validation on those radio button and different controls generate dynamically. </p>
|
javascript asp.net
|
[3, 9]
|
839,431 | 839,432 |
How to select elements within boundary?
|
<p>I'm trying to figure out a way to select elements that are overlapped (and contained, completely covered up) within an absolutely positioned div.</p>
<p>I basically need to select elements within a certain pixel boundary. How can this be done using jQuery?</p>
|
javascript jquery
|
[3, 5]
|
2,456,907 | 2,456,908 |
Using Power Manager
|
<p>My app sets an alarm. While waiting for the alarm my phone closes the screen. When the alarm sounds the screen is dark so I press the power key and the screen lights up but I now have to touch the Lock button to access the app interface. I would prefer that the Lock has been disposed off when the user responds to the alarm so I tried to use the power manager. The alarm receiver starts a new activity so I initialised the power manager in the onCreate for this activity. However this causes a force close error. I call the power manager as follows </p>
<pre><code> PowerManager pm = (PowerManager)cText.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK , TAG);
wl.acquire();
</code></pre>
<p>Any suggestions please.</p>
|
java android
|
[1, 4]
|
2,456,768 | 2,456,769 |
jQuery (or regular Javascript) execute function when page is loaded AFTER back button is pressed
|
<p>I've seen this on a lot of websites, but I can't figure out exactly how to do it:</p>
<p>When a function is executed, the URL changes to whatever.com/page/#something and then when that url is accessed, the function is executed again. I know how to make that work when the page is first loaded, but I can't figure out how to make the function occur again when the "back" button is pressed.</p>
<p>(e.g. if I have a tabbed system set up, I start on site.com/#tab1, go to site.com/#tab2, and click the back button so that tab 1 shows up on the page again)</p>
<p>How does that work?</p>
|
javascript jquery
|
[3, 5]
|
5,549,611 | 5,549,612 |
jQuery anchor preventDefault
|
<p>Using jQuery, how do I get the value from a textbox and then load a new page based on the value?</p>
<p>For example, lets say the textbox contains "hello" on page1.php, how do I change the default behavior of an anchor tag to now load the following</p>
<p>page2.php?txt=hello</p>
<p>I have the following so far:</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("a.mylink").click(function(event){
alert("link clicked");
event.preventDefault();
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,407,211 | 5,407,212 |
Targeting the last PARENT table-row (tr), not the CHILD table-row (tr)
|
<p>I'm attempting to target the last parent table row within a table that has children table-row elements inside of it. I've tried the below jQuery to target the :last pseudo, however, like expected, it is targeting the absolute last table-row element within the targets parent table.</p>
<pre><code>$('table[id*="dgRegistrantList"]').find('tr:last').addClass('EventRegLastAttendee')
</code></pre>
<p>I've put together a jsFiddle with the HTML block I'm attempting to target with the jQuery, I hope it is helpful!
<a href="http://jsfiddle.net/jodriscoll/LZA7e/" rel="nofollow">http://jsfiddle.net/jodriscoll/LZA7e/</a></p>
<p><img src="http://i.stack.imgur.com/fJ7zT.gif" alt="Green = Target; Red = Ignore">
The Green table-row is the one I would like to target, however, the one highlighted in Red is the obvious one receiving the class.</p>
<p>This system can generate a variant of table rows depending on the users selection prior to this "Step". For a full example of what I'm working with, visit: <a href="http://secure.massgeneral.org/event-form" rel="nofollow">http://secure.massgeneral.org/event-form</a> (I'm working with Step 2).</p>
<p><strong>Please be aware that the HTML I'm working with is produced by a CMS software that I as the customer, do not have access to changing. Hence the purpose of this jQuery exercise.</strong></p>
|
javascript jquery
|
[3, 5]
|
4,696,501 | 4,696,502 |
Decoding strings in PHP
|
<p>I am working on a PHP application that has to parse strings being sent by another program. the problem is that some strings have octal characters and some other escapes in the middle.</p>
<p>So instead of "script>XYZ", I am getting:</p>
<p><code>\103RI\120T>XYZ%6En \151\156 d%6Fcu\155%65n..</code></p>
<p>And I need to print back this string decoded... I tried using octdec, url_decode, etc, but one only works with one char and the other doesn't decode octal... Anyone have suggestions?</p>
|
php javascript
|
[2, 3]
|
1,216,450 | 1,216,451 |
change TextBox text after button click in Facebox plugin
|
<p>I have a problem:
My facebox has a button and textbox(asp.net server controls)
I want when i click the button to change the textbox text
here is my aspx code:</p>
<pre><code><div id="FaceDiv" style="display:none" >I'm your facebox<br />
<asp:Button ID="ShowButton" runat="server" Text="Show text" OnClick="ShowButton_Click" />
<asp:TextBox ID="ShowTextBox" runat="server" ></asp:TextBox>
</div>
</code></pre>
<p>My jQuery code:</p>
<pre><code>$('#A2').click(function(e) {
jQuery.facebox({ div: '#FaceDiv' })
});
</code></pre>
<p>Code behind:</p>
<pre><code>protected void ShowButton_Click(object sender, EventArgs e)
{
ShowTextBox.Text = "I m ur text show";
}
</code></pre>
<p>When i click the button ,nothing happens.</p>
<p>I have looked for a solution trou google, I've found that if u change:</p>
<pre><code>$('body').append($.facebox.settings.faceboxHtml)
</code></pre>
<p>to:</p>
<pre><code>$('form').append($.facebox.settings.faceboxHtml)
</code></pre>
<p>it works.But i doesn't work for me.</p>
<p>Help,cause i wonna use facebox.fyi,in facebook,when u see friends popup,u can do next,prvious,search.i want something like that.Thanks.</p>
|
jquery asp.net
|
[5, 9]
|
5,806,140 | 5,806,141 |
How to do undetectable redirect
|
<p>I want to be able to go from one site to another but not as a redirection. In other words I want to fake that I inserted a particular link directly to my browser input field instead of clicking the link on my page.</p>
<p>So I've tried "HTML meta refresh", JavaScript redirection and PHP header() redirection. I was doing redirection from www.mysite1.com to www.mysite2.com, and in all those cases I could see in Google Analytics (of mysite2.com), that visitor came from www.mysite1.com. And my goal is to hide the redirection source which is www.mysite1.com in this case.</p>
<p>I'm sure it is possible but, don't really know where to start.</p>
|
php javascript
|
[2, 3]
|
4,691,586 | 4,691,587 |
Scan PDF files and upload it through php
|
<p>How can I upload pdf files after scanning it through scanner feeder ? I am using <a href="http://www.chestysoft.com/ximage/default.asp" rel="nofollow">OCX</a>
plugin to upload images to server, but in the application I am working on, I have to upload PDF document to server. Can you suggest me plugin or library even if is not free, I will be very thankful.</p>
|
php javascript
|
[2, 3]
|
5,401,120 | 5,401,121 |
ExpandableListView's onChildClick - Relations?
|
<p>I have an ExpandableListView where each group has two child rows (one for deleting the group and one for editing the group):</p>
<pre><code>Item 1
Edit
Delete
Item 2
Edit
Delete
Item i
..
</code></pre>
<p>Im having problems in the onChildClick method registering under which item (Item1/Item2/Itemi), delete or edit is clicked. The child_row.xml file looks like this:</p>
<pre><code> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/editDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dip"/>
</LinearLayout>
</code></pre>
|
java android
|
[1, 4]
|
709,027 | 709,028 |
How to run through each checked checkbox with a classname using JavaScript without jQuery
|
<p>Is there an immediate equivalent in javascript for the below jquery code?</p>
<pre><code>$('.checkbox').each(function() {
if ($(this).is(':checked')) {
//logic here
}
});
</code></pre>
<p>I'm trying to run through all the checkboxes on a page with <code>class = 'checkbox'</code> - the client doesn't want to use jQuery, so I need an alternative for the above.</p>
<p>I'm hoping I can avoid writing a long function from scratch to do this and simply use something built-in to JavaScript, but it's looking like it's not possible.</p>
|
javascript jquery
|
[3, 5]
|
5,110,595 | 5,110,596 |
Dynamically set value of input box
|
<p>I have an aspx page with an input textbox control for which i want to set a value. I want it so that the value dynamically changes based on the current text of the textbox when the form is submitted. Does anyone know how to do this without jquery?</p>
|
javascript asp.net
|
[3, 9]
|
5,615,298 | 5,615,299 |
Json output for android
|
<p>i am using this <a href="http://p-xr.com/android-tutorial-how-to-parse-read-json-data-into-a-android-listview/" rel="nofollow">tutorial</a> </p>
<p>please guide me how can i customized it for my mysql table which is like this
<img src="http://i.stack.imgur.com/3ufhY.png" alt="enter image description here"></p>
<p>i am unable to understand how to get this sort of out from my table . </p>
<pre><code> {"earthquakes": [
{
"eqid": "c0001xgp",
"magnitude": 8.8,
"lng": 142.369,
"src": "us",
"datetime": "2011-03-11 04:46:23",
"depth": 24.4,
"lat": 38.322
},
{
"eqid": "2007hear",
"magnitude": 8.4,
"lng": 101.3815,
"src": "us",
"datetime": "2007-09-12 09:10:26",
"depth": 30,
"lat": -4.5172
}
<--more -->
]}
</code></pre>
<p>i am using php . Thanks </p>
|
php android
|
[2, 4]
|
4,913,089 | 4,913,090 |
onTouchEnd not working for Android Froyo 2.2?
|
<p>The following html when opened in the default browser on Android 2.2 registers touchstart and touchmove events properly, but not touchend events. Any idea why?</p>
<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
</head>
<body>
<div id="a" onTouchStart="touchstartFunction(event);"
onTouchMove="touchmoveFunction(event);"
onTouchEnd="touchendFunction(event);"
style="width:300px ; height:300px;background:red;"></div>
<script>
function touchstartFunction(event){
event.preventDefault();
var touch = event.touches[0];
document.getElementById('touchMoveTextbox').value = "Touch start at " + touch.pageX + "x" + touch.pageY;
}
function touchmoveFunction(event){
event.preventDefault();
var touch = event.touches[0];
document.getElementById('touchMoveTextbox').value = "Touch move at " + touch.pageX + "x" + touch.pageY;
}
function touchendFunction(event){
event.preventDefault();
var touch = event.touches[0];
document.getElementById('touchMoveTextbox').value = "Touch end at " + touch.pageX + "x" + touch.pageY;
}
</script>
<input type='textbox' size="30" id='touchMoveTextbox' >
</body>
</html>
</code></pre>
|
javascript android
|
[3, 4]
|
1,204,284 | 1,204,285 |
Trying to set value on hidden parameter on click of submit button in form
|
<p>Trying to set a parameter on a hidden field on click of submit button.</p>
<pre><code> $('.delete').on('click', function() {
$('#id').val('1000');
});
</code></pre>
<p>This is the hidden field:</p>
<pre><code> <input type="hidden" name="itemId" id="id" />
</code></pre>
<p>And this is one of my submit buttons:</p>
<pre><code> <input type="submit" value="Delete item" class="delete" />
</code></pre>
<p>However at the server the itemId field is empty.</p>
|
javascript jquery
|
[3, 5]
|
5,122,920 | 5,122,921 |
Adding, Removing and Adding Element again removes its Event
|
<p>I have a hyperlink with an ID when clicked will perform a certain event using JQuery. JQuery records the existence of this link on document load. Some time during the course of the users visit. I remove that link and the re-add it later. However, that even is not fired off again when that link is clicked after it has been removed and added.</p>
<p>Why is the case and how can I remedy it? Something to do with event binding?? Or shall I just add an onclick attribute?</p>
|
javascript jquery
|
[3, 5]
|
2,717,154 | 2,717,155 |
asp.net cache css and script but not the page
|
<p>In my master page in the Page_Load method, I have this line:</p>
<pre><code>Response.Cache.SetCacheability(HttpCacheability.NoCache);
</code></pre>
<p>Basically, I don't want to cache the page. I do want to cache the .js and .css files but when I reload the page, these files don't get loaded from the browser cache but instead get reloaded.</p>
<p>What do I need to fix?</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
2,676,552 | 2,676,553 |
can php variables be defined inside a javascript code
|
<p>The code:</p>
<pre><code>if( 4 > 1 ) {
alert('ok');
<?php $mode = true;?>
} else {
alert('not-ok');
<?php $mode = false;?>
}
var_dump($mode);
</code></pre>
<p>This alerts OK, but the <code>var_damp()</code> shows <code>bool(false)</code></p>
<p>Why is var_dump showing that $mode is false?</p>
|
php javascript
|
[2, 3]
|
1,430,973 | 1,430,974 |
Is there an event that fires when an element's `class` attribute changes?
|
<p>I have a <code><ul></code> element on my page with a few children. A <code>class</code> attribute will be added to these children at some point, </p>
<p>Before</p>
<pre><code><ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</code></pre>
<p>After</p>
<pre><code><ul>
<li class='classname'>1</li>
<li>2</li>
<li>3</li>
</ul>
</code></pre>
<p>I would like to bind to an event that will fire whenever the <code>li</code> element's class changes, so I can handle it accordingly. Is there such an event?</p>
|
javascript jquery
|
[3, 5]
|
147,888 | 147,889 |
Android radio button custom attributes
|
<p>I have a 4 static radio buttons.
I want to add custom attributes to radio buttons.</p>
<pre><code>RadioButton btn_radio1= (RadioButton)findViewById(R.id.btn_radio1);
//I just can change id of element,than get it.
btn_radio1.setId(44);
</code></pre>
<p>Thanks.</p>
<p>---UPDATED
XML</p>
<pre><code><RadioButton android:id="@+id/btn_radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TEST" />
</code></pre>
|
java android
|
[1, 4]
|
1,585,197 | 1,585,198 |
bind callback parameter
|
<p>I have this code to set "State Machine" in view of a javascript application:</p>
<pre><code> var Events = {
bind: function(){
if ( !this.o ) this.o = $({});
this.o.bind(arguments[0], arguments[1])
},
trigger: function(){
if ( !this.o ) this.o = $({});
this.o.trigger(arguments[0], arguments[1])
}
};
var StateMachine = function(){};
StateMachine.fn = StateMachine.prototype;
$.extend(StateMachine.fn, Events);
StateMachine.fn.add = function(controller){
this.bind("change", function(e, current){
console.log(current);
if (controller == current)
controller.activate();
else
controller.deactivate();
});
controller.active = $.proxy(function(){
this.trigger("change", controller);
}, this);
};
var con1 = {
activate: function(){
console.log("controller 1 activated");
},
deactivate: function(){
console.log("controller 1 deactivated");
}
};
var sm = new StateMachine;
sm.add(con1);
con1.active();
</code></pre>
<p>What I don't understand at this point is where the <strong>current</strong> parameter in <strong>bind</strong> function comes from (That is: <code>this.bind("change", function(e, current){...}</code>). I try to log it on firebug console panel and it seems to be the controller parameter in StateMachine.fn.add function. Could you tell me where this parameter comes from?
Thank you.</p>
|
javascript jquery
|
[3, 5]
|
3,669,966 | 3,669,967 |
Why does jQuery.ready run when the page isnt ready?
|
<p>so often i put jquery document ready functions at the bottom of my html, just to have it run before all the elements of the page are loaded. i'm tired of my functions not working because resources arent finished loading on the page, jquery.ready keeps saying the elements are done loading when they arent! who wants to set a 300ms timeout just so that their functions wait a little after jquery.ready?</p>
|
javascript jquery
|
[3, 5]
|
3,236,838 | 3,236,839 |
Maximum stack size over reached
|
<pre><code> var myArray = [];
$('#students_targeted option:selected,
#cc_students_targeted option:selected').each(function(){
myArray.push(data);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,381,365 | 3,381,366 |
JQuery UI Timepicker is not open when click the text field
|
<p>I have one question regarding to JQuery UI Timepicker. I have multiple text fields.</p>
<pre><code><input type="text" style="width: 31px;" id="timepicker.[1]" name="mon1" readonly="true"/>
<input type="text" style="width: 31px;" id="timepicker.[2]" name="mon2" readonly="true"/>
<input type="text" style="width: 31px;" id="timepicker.[3]" name="mon3" readonly="true"/>
</code></pre>
<p>I have called the jquery function using this.</p>
<pre><code>$('#timepicker\\.\\[1\\]').timepicker();
$('#timepicker\\.\\[2\\]').timepicker();
$('#timepicker\\.\\[3\\]').timepicker();
</code></pre>
<p>They are working. when i clicked first text field, the timepicker shows up. the same behavior goes to the second timepicker. But when i clicked third textfield, it won't show up. I have to click outside the textfield first and then click again on the third text field,after that the timepicker shows up. The same goes to the rest of text field (I have many textfields). What is the problem and may i know how to solve it?</p>
<p>Thanks guys,appreciate it....</p>
|
php jquery
|
[2, 5]
|
4,708,802 | 4,708,803 |
URL of current script in JavaScript
|
<p>How can I find out the URL of the JS file that was called?</p>
<p>Let's say the JS file (which is part of a library) and the HTML file (which is the application) are on a different server. To find out the URL of the HTML file is easy. But how can I find out the server name and path of the JS files' server within the JS file itself? (Edit: There is a loader which invokes other JS files of thsi library in the same directory structure)</p>
<p>Preferably a JQuery or pure JS solution.</p>
<p><strong>Edit:</strong></p>
<p>After I learned from your answers and comments I decided it would be cleaner to actually move the loader code to the first server, where also the html lives, which avoids the problem. </p>
|
javascript jquery
|
[3, 5]
|
1,809,328 | 1,809,329 |
Is there a way to play the role of Javascript with any other language like C#?
|
<p>Is there a way to play the role of Javascript with any other language like C#? One way came up in my head is, having silverlight installed, using C# instead of Javascript for all the client side scripting (Though C# is not a scripting language). Is it possible?</p>
<p>I am not talking about something like GWT(Java) or Script#(C#). Probably the question can be stated as- "With silverlight installed, can I do everything supported by Javascript(like DOM manipulation etc) with C#?" Hope it's clearer.</p>
|
c# javascript
|
[0, 3]
|
1,356,127 | 1,356,128 |
Javascript code execution going inside if condition even though condition is false
|
<p>This is one of the weirdest behavior I have seen. Following is the js code snippet:</p>
<pre><code>else if ($("*[id$=ddlDefaultPurpose]").val() == 2) {
if ($("*[id$=ddlJobCategory]").val() == -1) {
ShowMessageStrip(errorJobCategory);
formIsValid = false;
}
//else if (!TryParseSalaryOffered($("*[id$=txtCurrentSalary]").val())) {
// ShowMessageStrip(errorCurrentSalary);
// formIsValid = false;
//}
}
</code></pre>
<p>Now when the code executes, <code>$("*[id$=ddlJobCategory]").val()</code> is not equal to -1. And this can be seen clearly in Firebug. Now what happens is that the after the evaluating the condition, the code should come out, but instead it goes to the line <code>formIsValid = false</code>. It skips the <code>ShowMessageStrip(errorJobCategory)</code>. </p>
<p>Why could this be happening?</p>
|
javascript jquery
|
[3, 5]
|
1,773,198 | 1,773,199 |
click function for retrieving div
|
<p>how can i retrieve find out which button click is from which div.
Basically i have multiple div</p>
<pre><code><div id="rare1">
<input type=button value="OK" id=btn>
</div>
<div id="rare2">
<input type=button value="OK" id=btn>
</div>
<div id="rare3">
<input type=button value="OK" id=btn>
</div>
</code></pre>
<p>i have a function</p>
<pre><code>$("#btn").click(function(){
$("#rare"+i+" #btn").attr("disabled", "true");
}
</code></pre>
<p>this way i can disable the latest button being added.
how can i select which ever button is click on different div id and select the correct btn to disable?</p>
<p><strong>so sorry forget to add something i want to retrieve the div id that clicked the button too.</strong> </p>
|
javascript jquery
|
[3, 5]
|
2,417,975 | 2,417,976 |
Putextras not working
|
<p>I have multiple variables to pass from one activity to another. </p>
<p>I have this in the first activity:</p>
<pre><code>public void onClick(View v) {
switch(v.getId()){
case R.id.bStartGame:
Intent i = new Intent(StartScreen.this, GameScreen.class);
Bundle extras = new Bundle();
extras.putString("Name 0", sName0);
extras.putString("Name 1", sName1);
extras.putString("Name 2", sName2);
.
.
.
i.putExtras(extras);
StartScreen.this.startActivity(i);
finish();
break;
</code></pre>
<p>In the second activity, I have this:</p>
<pre><code> Intent i = getIntent();
Bundle extras = i.getExtras();
String name0 = extras.getString("Name 0");
TextView test = (TextView) findViewById(R.id.tvTEST);
test.setText(name0);
</code></pre>
<p>However, the textview shows nothing when I do this. How can I fix this?</p>
<p>EDIT: In the first activity I have:</p>
<pre><code> name0 = (EditText) findViewById(R.id.etName0);
sName0 = name0.getText().toString();
</code></pre>
<p>and the same for all the other names with their relevant references.</p>
<p>Also, just for clarification, name0 is the edittext, sName0 is the string and "Name 0" is the key.</p>
|
java android
|
[1, 4]
|
3,527,247 | 3,527,248 |
How can i pass values to the method of class?
|
<p>I have this class </p>
<pre><code> class Registration {
function registration() {
print_r($_REQUEST);
$fname = htmlspecialchars(trim($_POST['fname']));
$lname = htmlspecialchars(trim($_POST['lname']));
}
$obj_reg = new registration();
}
</code></pre>
<p>I am getting the values from <code>$.post</code> method of jquery ,here its how</p>
<pre><code>sUrl='http://localhost/Temp/registration.php'
tsQueryStr='f_name=rjseh&l_name=rjseh&badge_name=rjseh';
$.post(sUrl,tsQueryStr, function(data){
alert(data);
});
</code></pre>
<p>But these values are not printing inside class method
I am using core-php</p>
<p>please help,</p>
|
php jquery
|
[2, 5]
|
1,249,318 | 1,249,319 |
Java applet on a site to take a screenshot?
|
<p>I want to do the following:</p>
<ol>
<li>Create a java applet without display and put it on my site. </li>
<li>When the user enters, he allows the applet to run and for him nothing changes (he does not see any screen from that applet). </li>
<li>When he clicks on a button, I want an onclick event to send the applet a message so it will take a screenshot of the clients screen. </li>
<li>Then, send the screenshot as encoded byte data back to javascript and I using AJAX will send it back to the server. </li>
<li>At the end on the server I will build an image from that data and save a .png or any other format on the server (using PHP).</li>
</ol>
<p>I need guidance in all of those stages.
Thanks a lot in advance.</p>
<p>EDIT:
The question is how it can be done and whether it can be done. When writing those stages I don't really know if it possible but I need somehow to take a screenshot of the clients page in my site.</p>
|
java php javascript
|
[1, 2, 3]
|
966,353 | 966,354 |
How to get the day difference b/w two dates without using any platform library in java?
|
<p>I have a question:
Create a function that returns day difference between two dates (inclusive), without using any
function provided by the platform or external library. The function must work for all dates in the range of 1st January, 1901 through 31st December 2999, inclusive. For example, there are 5 days in the range bounded by 15th March, 2004 and 19th March, 2004.
Please help me to solve this..thanks.</p>
|
java android
|
[1, 4]
|
3,036,963 | 3,036,964 |
Javascript Memory Usage
|
<p>In the following code: </p>
<pre><code>$(document).ready(function() {
var content = "";
for (var i = 0; i < 1000; i++) {
content += "<div>Testing...</div>";
}
$("#Load").click(function() {
$("#MyDiv").empty();
$("#MyDiv").append(content);
return false;
});
});
</code></pre>
<p>Load is a simple link and MyDiv is a simple div. In each major browser I tested this in, when I click on the link multiple times, I see the memory usage go up in Task Manager. In IE, it goes up slightly each time and stays up. In FF, it goes up each time, but once in a while comes down (I think this means that the memory is being reclaimed or garbage collected - a good sign). In Chrome, it goes up significantly each time and stays up. </p>
<p>First, is this code cleaning up the DOM correctly? If so, why does the memory usage increase with every click? </p>
<p>Note: I tried to make the example as simple as possible, but similar to the problem I am having in my app. </p>
|
javascript jquery
|
[3, 5]
|
3,235,201 | 3,235,202 |
allow only Arabic Letters in textbox using JavaScript
|
<p>I have aspx page that have TextBox control for " User Arabic Name"
I want to Allow user to type only arabic letters in textbox using JavaScript</p>
|
javascript asp.net
|
[3, 9]
|
5,363,667 | 5,363,668 |
How to get all CheckBoxes using C#?
|
<p>In <code>Asp.net</code>. how can I access every <code>checkbox</code> exists in the page using <code>C#</code> code ?</p>
|
c# asp.net
|
[0, 9]
|
744,315 | 744,316 |
Dropdowlist in Gridview footer not populating
|
<p>I have the following code for populating a dropdownlist in my gridviews footer.</p>
<pre><code> if (!IsPostBack)
{
GridViewRow FooterRow = (GridViewRow)grdTime.FooterRow;
if (FooterRow != null)
{
QuartersTableAdapter Quarters = new QuartersTableAdapter();
DropDownList ddMonStart = (DropDownList)FooterRow.FindControl("ddMonStart");
ddMonStart.DataSource = Quarters.GetQuarters();
ddMonStart.DataTextField = "QuarterHour";
ddMonStart.DataValueField = "QuarterHour";
ddMonStart.DataBind();
}
}
</code></pre>
<p>Now I have done this in another application, and it works fine, but in this instance, nothing it being bound to the dropdown list, because FooterRow is never not Null.</p>
<p>Anyone know why footerRow may not be available?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
3,717,066 | 3,717,067 |
How to run a javascript function before postback of asp.net button?
|
<p>I'm using Javascript to create a DIV element and open up a new page by using onclientclick. This works great. Now, I need to write to it from the server side and this element must be created before it is posted back.</p>
<p>How do I get the javascript to execute before the postback?</p>
<p>Currently, I have to press the button twice because the element doesn't exist to write too on the first click.</p>
<p>To be clear, I need this to execute before the "OnClick" of the button.</p>
<p>Update: It looks like the Javascript function is called before the postback but the element is not updated until I run the second postback. Hmm</p>
<p>Update: Unfortunately it is a bit more complicated then this.</p>
<p>I'm creating a div tag in javascript to open a new window. Inside the div tag, I'm using a databinding syntax <%=Preview%> so that I can get access to this element on the server side. From the server side, I'm injecting the code.</p>
<p>I'm thinking this may be a chicken-egg problem but not sure.</p>
<p>UPDATE!</p>
<p>It is not the Javascript not running first. It is the databinding mechanism which is reading the blank variable before I'm able to set it.</p>
<p>Hmm</p>
|
asp.net javascript
|
[9, 3]
|
1,372,907 | 1,372,908 |
Post elements that is not in the form tag?
|
<p>I have code like so:</p>
<pre><code><form enctype="multipart/form-data" method="POST" action="blabla.php" class="addToCart">
<input type="button" onclick="addToCartMulti();" value="Add Tracks to Cart" id="addToCart" name="addToCart">
</form>
</code></pre>
<p>Outside of the form tags, I have tracklisting:</p>
<pre><code><ul>
<li><input type="checkbox" checked onclick="onSongClick(this);" id="trackNr_1" name="trackSelect" class="trackSelectionCheck"> 1. Train Love</li><li>
.....
</ul>
</code></pre>
<p>I want to be able to post the form and include these other values. I have something like this for the JavaScript so far:</p>
<pre><code>function addToCartMulti() {
$("input.trackSelectionCheck").each(function(index) {
var track = $(this).attr("id");
var start = 8;
var end = track.length;
track = track.substring(start,end);
$("form.addToCart").submit();
});
}
</code></pre>
<p>So the problem is that somewhere before this: <code>$("form.addToCart").submit();</code>. I need to add some JavaScript to actually include the other checkboxes so they are posted to the page.</p>
<p>Note: I don't want to use ajax.</p>
|
php javascript
|
[2, 3]
|
288,097 | 288,098 |
Javascript is broken in html page source
|
<p>I have a java web application. I am using jquery in it. I am calling some javascript from my jsp page. I have used EL, jstl tag in my page. Some of jquery variables is assigned from jsp variable. A strange problem occurs randomly. Some of javascript line have broken. I found those from Page Source option of browser. But in the jsp page I have found that no code is broken.
Say I have the following line in jsp</p>
<pre><code>var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?~_";
var term = $.trim(request.term.toLowerCase());
var wordCount = term.split(" ").length;
if (term.length > 0 && iChars.indexOf(term.charAt(0)) == -1) {
// here a jquery ajax call
}
else if (term.length > 0 && iChars.indexOf(term.charAt(0)) != -1) {
$("#simpleSearch-1105 .field").autocomplete("close");
alert("Search word should not start with !@#$%^&*()+=-[]\\\';,./{}|\":<>?~_");
}
</code></pre>
<p>But in the html page source I found the line as follows</p>
<pre><code>$("#simpleSearch-
1105 .field").autocomplete("close");
</code></pre>
<p>The code is broken to two line. For this getting js error. I found no valid reason for that. It seems completely strange to me. Could you guys can give me some clue ? Whats may be the cause ?</p>
<p>Note: I also have firebug installed. First I thought that it may be due to firebug. Then I uninstalled firebug. But still same result.</p>
|
javascript jquery
|
[3, 5]
|
5,986,567 | 5,986,568 |
What is this code in Javascript?
|
<p>On some JS code on some sites I see Javascript code such as this:</p>
<pre><code>SomeName.init = (function () {
// some stuff
})();
</code></pre>
<p>I mean, this is not a jQuery plugin code such as this:</p>
<pre><code>(function( $ ){
$.fn.myPlugin = function() {
// Do your awesome plugin stuff here
};
})( jQuery );
</code></pre>
<p>Then, what is it? and what is the resulting JS object?</p>
|
javascript jquery
|
[3, 5]
|
3,439,555 | 3,439,556 |
ASP.NET Custom Membership, Sessions
|
<p>Howdy,
I recently wrote with the help of you guys a login control which logs in against a custom database. I did this using the "validate" method in my Custom Membership control ...</p>
<p>However I want to set a couple Informations in a Session, I am not able to do that in the Membership Generator ... I have to do it on a page which derives of a "page" however this is where my problem starts:</p>
<p>Where and how can I get Data out of the database which is specifically for that user, after I logged in and lost the username/password?</p>
|
c# asp.net
|
[0, 9]
|
3,248,252 | 3,248,253 |
Master page post back on click of menu item?
|
<p>I have a master page wherein I have menu list. When I click on any of the menu item my entire page gets post back. I do not want this to happen.
Instead I want only the content that needs to be refreshed/change. </p>
<p>Any quick / easy resolution to the above issue? </p>
<p>Please help. </p>
|
c# asp.net
|
[0, 9]
|
1,287,506 | 1,287,507 |
Accessing javascript array from function
|
<p>Okay, so in my <code><head></code> section i have the following:</p>
<pre><code><script>
var userDefaultInfo = '<?=$userInfo;?>';
var jGets = new Array ();
<?
if(isset($_GET)) {
foreach($_GET as $key => $val)
echo "jGets[\"$key\"]=\"$val\";\n";
}
?>
</script>
</code></pre>
<p>Now In my external .JS file, In the $(document).ready() section I can access userDefaultInfo fine, however, I am trying to access jGets, but not directly from there.</p>
<p>in the external .JS file, outside of $(document).ready(); I have the following function:</p>
<pre><code>var sendGET = function () {
var data = $(this).val();
var elementName = $(this).attr("name");
var url = "zephi.php?p=home/support/admin_support.php&"+elementName+"="+data;
jQuery.each(jGets, function(i, val) {
alert(val);
});
alert(url);
window.location = url;
}
</code></pre>
<p>When a user changes a box, this function fires and changes the window location using the data. However, I want to add the data in the variable <code>jGets</code>, but I do not seem to be able to reference it at all in there.</p>
<p>Why is this?</p>
|
php jquery
|
[2, 5]
|
1,115,704 | 1,115,705 |
asp.net,c#.net Read Only Field
|
<p>I have a textbox.Texbox is readonly. And on Page_Load the Texbox automaticlly displayed
with a value from the data base.i have a 'if' loop for check the text box value is null
or not.But i cant retrive the textbox value.What may be the reason for that?
my web page code is</p>
<pre><code><asp:TextBox ID = "text1" runat="server" ReadOnly="true" ></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server" Visible="False">
</asp:DropDownList>`
</code></pre>
<p>code behind</p>
<pre><code>if (text1.Text == "")
{
DropDownList1.Visible = true;
}
</code></pre>
<p>but DropDownList1 is not displayed</p>
|
c# asp.net
|
[0, 9]
|
3,005,612 | 3,005,613 |
How to use SVN (Apache SubverSion) in android project to maintain the version
|
<p>I want to use SVN (Apache SubverSion) on my android project. To maintain version of the application. Can any one please tell me what are the step by step procedure to Install and use the SVN In the project. I am using Eclipse Helios (3.6). </p>
<p>Thanks In advance..</p>
|
java android
|
[1, 4]
|
4,396,869 | 4,396,870 |
What's the difference between $.proxy and the native js 'call' / 'apply'?
|
<p>I believe they both allow you to control the value of 'this', but beyond that, I'm a little unclear and Google/SO isn't helping much so far. Any clarification appreciated. I did find this, but I'm skeptical that it tells the whole story: </p>
<blockquote>
<p>"When I first learned about jQuery's proxy() method, I thought it was
a little silly; after all, Javascript already has call() and apply()
methods for changing execution context. But, once you realize that
jQuery's proxy() method allows you to easily bind() and unbind() event
handlers regardless of context, it becomes obvious just how powerful
this method is.</p>
</blockquote>
|
javascript jquery
|
[3, 5]
|
4,390,417 | 4,390,418 |
changing an elements css position after scrolling down the page
|
<p>I am messing around with some jquery trying to get to grips with it.</p>
<p>I have a ul nav which has a absolute position set but after I scroll the page down by 200 pixels i would like that to switch to position fixed so that the nav always stays on the page.</p>
<p>How would I do this?</p>
<p>below is the example I am working on</p>
<p><a href="http://satbulsara.com/tests/" rel="nofollow">http://satbulsara.com/tests/</a></p>
|
javascript jquery
|
[3, 5]
|
594,554 | 594,555 |
short to byte and byte to short conversion in Android
|
<p>I am developing a software in Android. In a particular portion of software, I need to convert short to byte and re-convert to it to short. I tried below code but values are not same after conversion.</p>
<pre><code> short n, n1;
byte b1, b2;
n = 1200;
// short to bytes conversion
b1 = (byte)(n & 0x00ff);
b2 = (byte)((n >> 8) & 0x00ff);
// bytes to short conversion
short n1 = (short)((short)(b1) | (short)(b2 << 8));
</code></pre>
<p>after executing the code values of n and n1 are not same. Why?</p>
|
java android
|
[1, 4]
|
5,357,513 | 5,357,514 |
Selecting by ID attribute using JQuery in ASP.NET
|
<p>I've just started using JQuery in VS 2008, and so far I like it! But, I'm confused about how I should be using JQuery in order to select asp.net controls on a webpage.</p>
<p>For example, I have the following code (just a mock-up):</p>
<pre><code><asp:textbox id="txtSomeData1" runat="server" text="Some Data!!"></textbox>
</code></pre>
<p>Now, if I want to use JQuery to select the textbox and change it's text to "Some More Data!!", then I would have to do something like:</p>
<pre><code>$('input#ctl00_ContentPlaceHolder1_txtSomeData1').val('Some More Data!!');
</code></pre>
<p>Which, quite frankly, is annoying because I don't want to mess with having to figure out what the id of the control is after it's rendered to the webpage (ctl00_ContextPlaceHolder... blah blah blah).</p>
<p>Is there a way that I can select the textbox without having to use the id of it? Also, I know that you can select by class name, but that doesn't help much if the control that you're selecting doesn't have a class. </p>
<p>Am I just missing something here?</p>
<p><strong>JUST TO REITERATE: I do not want to use a class to select the input tag!! I would like to use the id "txtSomeData1" and not the long id that is rendered to the webpage.</strong></p>
|
asp.net jquery
|
[9, 5]
|
1,446,150 | 1,446,151 |
android - fc without an obvious reason
|
<p>Can someone tell me what is wrong with this code. On my 3 different devices it works totally fine but a lot of my app users are reporting fc when this activity starts</p>
<p>Logcat from every one of then is saying NullPointerException in onCreate</p>
<p>Code:
<a href="http://pastebin.com/E3WyeYdN" rel="nofollow">pastebin</a></p>
<p>And this is how i start this activity</p>
<pre><code> Intent intent = new Intent();
intent.setClass(this,ProfileEditor.class);
intent.putExtra("profileName","");//this is when creating new profile, when editing profile name goes here
startActivityForResult(intent,GET_CODE);
</code></pre>
|
java android
|
[1, 4]
|
2,219,075 | 2,219,076 |
Remove statically added controls at runtime
|
<p><strong>The Scenario:</strong> I have an asp.net website where I show a div popup on page load for taking a few user details. When a user inputs the details, or closes the popup, I set up a flag cookie so that the popup is not displayed again for the user. The div is in the MasterPage so that it is displayed no matter on which page a user lands first time. The div contains an UpdatePanel which has all the controls required for taking the details. This whole functionality is working fine.</p>
<p><strong>The Problem:</strong> Now this div popup is not showing(by setting display:none) on subsequent postbacks(which I want), but the html markup is still loading with the page unnecessarily adding to the page size. What I would idealy want to do is: Check if flag cookie is set. If no, show the popup, else remove the popup's markup from the page.</p>
<p>Now since the div is not a server control, I cannot possibly remove it and the all the controls inside it. So, I thought of removing the UpdatePanel from the page:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["flag"] != null)
{
if (Page.Controls.Contains(updpnl_contact))
{
Page.Controls.Remove(updpnl_contact);
updpnl_contact.Dispose();
}
}
}
</code></pre>
<p>But I guess this tends to work with dynamically added controls only, and since the control is added at Design Time, it is not being removed.</p>
<p>Is there any way I can achieve this?</p>
|
c# asp.net
|
[0, 9]
|
2,607,509 | 2,607,510 |
JavaScript: How do I debug in chrome to find out why this code doesn't work?
|
<p>How do I use the JavaScript console to see why this code:</p>
<pre><code>// Empty info
if ($('.perma-info').text() == '') {
$('.perma-info').remove();
}
</code></pre>
<p>Doesn't work in this page: <a href="http://dev-indiehaz.tumblr.com/post/22897976111/vans-vw" rel="nofollow">http://dev-indiehaz.tumblr.com/post/22897976111/vans-vw</a></p>
<p>I want it so that if the element is empty, I can remove it.</p>
|
javascript jquery
|
[3, 5]
|
858,656 | 858,657 |
Need some suggestion to buys books of javascript and jquery
|
<p>May be this question duplicate or redundant but i want to elaborate my question so:</p>
<p><strong>i have tried looking to google and flipkar,amazon that ...but by just looking at the book you can't really judge how it will be...and it's always good ask someone who has experience...because i can't keep on buying to find good book</strong></p>
<p>I want to buy books on jquery and javascript,and please consider that i am not a experienced in javascript and jquery neither a beginner ...so i want buy a book that has a very high level ....so that all goes above my head...</p>
<p>if some <strong>experienced</strong> one can reply to this it will be helpfull...and all others(less experienced) are also welcome.....</p>
<p>Hoping i will get good answer :)</p>
|
javascript jquery
|
[3, 5]
|
1,197,687 | 1,197,688 |
Parse array of values - jQuery
|
<p>Am calling a webservice from my jQuery to fetch both <code>Staff</code> and <code>Student</code> details. In my web service I have values for Staff as well as Students, and am returning these as array of strings. While returning values am just serializing these two as </p>
<pre><code>[WebMethod(EnableSession = true)]
public string[] fetchStudentStaff(string sectionId)
{
string student;
string staff;
////
////
student = jsonSerialize.Serialize(studentList);
staff = jsonSerialize.Serialize(staffList);
return new string[] { student, staff };
}
</code></pre>
<p>here I've a variable called <code>category</code> for mentioning whether he is a staff or student. and am receiving this in my jQuery part as,</p>
<pre><code> [
[
[
{
"Name": "shanish",
"StudentId": "12",
"Category": "Student",
"Mobile": "8147708287",
"Email": "[email protected]"
}
]
],
[
[
{
"Name": "shanish",
"StaffId": "78",
"Category": "Staff",
"Mobile": "8147708287",
"Email": "[email protected]"
}
]
]
]
</code></pre>
<p>here, I tried using <code>jQuery.parseJSON(data.d)</code> to group the result, but it results <code>null</code>, I need to categorize the result with <code>student</code> and <code>staff</code>, here I have one student and one staff, for the case of 5 student and 2 staffs, I need to store students in a separate variable and 2 staffs in a separate variable.</p>
<p>I dunno how to achieve this, can anyone help me here...Thanks in advance</p>
|
jquery asp.net
|
[5, 9]
|
941,365 | 941,366 |
Passing Control Id from Linkbutton in a gridview
|
<p>How do I pass the Control ID in a gridview that is derived from a stored procedure into a variable. I will use the variable to pass into the database later on to return some results. Thanks.</p>
|
c# asp.net
|
[0, 9]
|
1,780,504 | 1,780,505 |
Using jQuery to echo text
|
<p>Is it possible to use jQuery to echo text in place of a script tag? More precisely, is there a way to accomplish</p>
<pre><code><script type="text/javascript">
document.write("foo");
</script>
</code></pre>
<p>... without the use of <code>document.write</code>? I am not happy about using <code>document.write</code> after reading <a href="http://stackoverflow.com/questions/802854/why-is-document-write-considered-a-bad-practice">this</a>.</p>
<p>I am aware that I could alternatively do this:</p>
<pre><code><span id="container"></span>
<script type="text/javascript">
$("#container").text("foo");
</script>
</code></pre>
<p>However, I'm interested to see if there's a way to do it without using a container element, preferably using jQuery.</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
4,600,696 | 4,600,697 |
How to add fast/slow buttons to show replay on google map
|
<p>hey i m working on google maps i am saving route in an xml file and then showing replay to user.Now i want to add fast,slow,normal buttons to this replay how can i do this
right now i m showing replay using fixed interval</p>
<pre><code>if (i < latlngvar.length - 1)
{
interval = parseInt(document.getElementById('ctl00_ContentPlaceHolder1_hdn_interval').value);
interval = Number(interval) * 100;
setTimeout(test, Number(interval));
}
</code></pre>
|
c# javascript
|
[0, 3]
|
837,394 | 837,395 |
Displaying multi-page/frame TIFF file in ASP.Net 2.0
|
<p>I'm trying to display a multi-page/frame TIFF file on a web page. All I get displayed is the first page.<br>
I can also display any single page in the mutli-page file using SetActiveFrame to select the appropriate page. I just can't display the entire file.<br>
My code:</p>
<pre><code>Response.ContentType = "image/jpeg";
Image image = Image.FromFile("MyTiff.tif");
int frameCount = image.GetFrameCount(Imaging.FrameDimension.Page);
for (int index = 0; index < frameCount; index++)
{
image.SelectActiveFrame(System.Drawing.Imaging.FrameDimension.Page, index);
image.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg);
}
</code></pre>
<p>I also tried making each page a separate image in a collection of images, to completely disassociate each image from the TIFF file, and then saving the collection of images to the web page. This also resulted in only the first image being displayed on the web page.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.