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 |
---|---|---|---|---|---|
4,169,802 | 4,169,803 | How to manipulate a itemtemplate control settings? | <p>I have a gridview and sqldatasource.</p>
<p>I have a template field column and below the textbox control I've added a label with visible = false;</p>
<pre><code>On row updating: I'm getting the control like this:
GridViewRow row = MyGrid.Rows[e.RowIndex];
Label MyLabel = (Label)row.FindControl("MyLabel");
If( //etc )
{
MyLabel.visible = true;
e.cancel = true;
}
</code></pre>
<p>So I'm trying to make the label visible but it doesn't work , nothing happens</p>
| c# asp.net | [0, 9] |
3,738,246 | 3,738,247 | Library to read MANY document-file formats? | <p>I am developing an ASP.NET in which I have a "file upload" control. So, User may upload files of any format like .doc, .pdf, .docx, .txt, .rtf, .ppt, .odt etc.</p>
<p>The program must be able read data from any file of these formats. I dont want to use different third party libraries for each of these file formats. I want one common solution to read all these files.</p>
| c# asp.net | [0, 9] |
383,797 | 383,798 | jQuery/JavaScript: Avoid unique ID's for each row in a table? | <p>I'm not sure if I'm doing this the right way. I have table which I fill with rows that each represent a song in a playlist. Right now, I assign a unique ID per row, and also assign som jQuery.data() to each ID.</p>
<pre><code> html += '\
<tr id="track-' + i + '" class="tracks-row"> \
<td class="track"><a id="play-'+ i +'" class="play"></a><a id="play2-' + i + '">' + song.song_track + '<span class="mix-style">' + song_mix + '</span></a></td> \
<td class="artist">' + song.song_artist + '</td> \
<td class="favourites-holder"><a id="favourite-' + i + '" class="favourites"></a></td> \
' + delete_holder + ' \
</tr> \
';
</code></pre>
<p>So as you can see, each row has an ID like track-1, track-2 etc.</p>
<p>Is there another way to populate a playlist like this without assigning unique ID's to each track, or is this how it's supposed to be done? Each track has some properties like this:</p>
<pre><code> $("#track-" + i).data("song_id", song.song_id);
$("#track-" + i).data("song_artist", song.song_artist);
$("#track-" + i).data("song_track", song.song_track);
$("#track-" + i).data("song_mix", song.song_mix);
$("#track-" + i).data("ps_id", song.ps_id);
</code></pre>
<p>... and also .click events for each track, which allows the user to play, sort, drag etc... It just feels like I'm doing it wrong :)?</p>
| javascript jquery | [3, 5] |
976,094 | 976,095 | Open Source Framework for Brokering of Flat File Oriented Processing | <p>Does anyone have a good framework to recommend that handles the stages of processing of
file oriented transactions. Our scenario is simple - we receive file, validate it, if something wrong we abort and generate report. If file is good, goes to next stage. At some stages some valid data can be extracted and further processed and some that is invalid would be held and errors reported.</p>
<p>One can argue ESB can be used to do this, but I am really looking for something that is just a bit more automated than having a shell scripts and cron jobs.</p>
<p>Does anyone have a good, open source framework to recommend for these file watching, movement and job triggering tasks?</p>
| java python | [1, 7] |
3,496,150 | 3,496,151 | How to rewrite removeChild from JavaScript to jQuery | <p>I have this JavaScript in the head of my page.</p>
<pre><code><script type="text/javascript">
var nojscss = document.getElementById('nojscss');
nojscss.parentNode.removeChild(nojscss);
</script>
</code></pre>
<p>I would like rewrite it in jQuery to run when the page is loading.</p>
<p>I'm pretty new to jQuery do you have an idea how to do it?</p>
| javascript jquery | [3, 5] |
5,273,064 | 5,273,065 | Javascript show/hide - I don't want it to hide the entire element | <p>This is probably a fairly easy question, but I'm new to JavaScript and jquery....</p>
<p>I have a website with a basic show/hide toggle. The show/hide function I'm using is here:
<a href="http://andylangton.co.uk/articles/javascript/jquery-show-hide-multiple-elements/" rel="nofollow">http://andylangton.co.uk/articles/javascript/jquery-show-hide-multiple-elements/</a></p>
<p>So here's my question..... I would really like the first 5-10 words of the toggled section to always be visible. Is there some way I can change it so that it doesn't hide the entire element, but hides all but the first few words of the element?</p>
<p>Here's a screenshot of what I would like it to do:
<a href="http://answers.alchemycs.com/mobile/images/capture.jpg" rel="nofollow">http://answers.alchemycs.com/mobile/images/capture.jpg</a></p>
| javascript jquery | [3, 5] |
3,611,698 | 3,611,699 | Is it possible to show multiple jQuery Fancybox alerts on one page? | <p>Is it possible to show multiple Fancybox alerts on one page i.e. A user triggers one alert, then within the alert, he can trigger another which will appear without closing the first.</p>
<p>Example
<a href="http://www.freepeople.com/index.cfm/fuseaction/products.browse/categoryID/eb344a5e-2eb4-44f2-9bd1-39502a8fe6d1?categoryID=eb344a5e-2eb4-44f2-9bd1-39502a8fe6d1&categoryName=what%27s+new&corsetSize=loose&layoutType=none&showAll=0&startResult=1&overrideActionPersistence=true&refinementCount=1&hasLeftNav=YES&sortType=none&colorFilterSetOptionID=none&action=products.browse&sizes=st" rel="nofollow">Click the zoom icon on the products and then click the 'Tell a friend' link</a></p>
<p>Thanks</p>
| php jquery | [2, 5] |
444,036 | 444,037 | How to substitute variables into JQuery selector? | <p>I have HTML:</p>
<pre><code><li onclick="myselect(mazda3,m3-to);">...</li>
</code></pre>
<p>and function:</p>
<pre><code>var a='';
var b='';
function myselect(a,b){
$('#workcont').empty();
$('#tocont').load('pages/' + a + '.html #' + b);
}
</code></pre>
<p>But it's not work. How to improve it?</p>
| javascript jquery | [3, 5] |
2,471,905 | 2,471,906 | What is reflection in C#? Where do we use this concept in our application? | <p>What is reflection in C#? Where do we use this concept in our applications?</p>
| c# asp.net | [0, 9] |
1,303,406 | 1,303,407 | Javascript dynamic multiple fields addition/removal/sorting | <p>Is there a jQuery plugin like the following one:
<a href="http://vipullimbachiya.com/jQuery/Plugins/MultiField/2/index.htm" rel="nofollow">http://vipullimbachiya.com/jQuery/Plugins/MultiField/2/index.htm</a></p>
<p>but it can also order the multiple fields (move them up or down). So for example if I added another item options (in the demo here: <a href="http://vipullimbachiya.com/jQuery/Plugins/MultiField/2/index.htm" rel="nofollow">http://vipullimbachiya.com/jQuery/Plugins/MultiField/2/index.htm</a>) and then wanted to move the second newly added item options to be the first, and thus subsequently the first becomes the second.</p>
<p>Hopefully this explains what I need.</p>
| javascript jquery | [3, 5] |
1,463,016 | 1,463,017 | Fancybox for .flv | <p>Is there a way to manipulate jquery Fancybox plugin to display flash video files (.flv)? I mean making it behave like Malsup's Media plugin that can handle both .swf and .flv</p>
<p><strong>Putting my question in context:</strong></p>
<p>I have a php file that works dynamically to read the videos:</p>
<pre><code> if($ext=="flv"){
$fileSize = filesize($file);
header("Expires: Mon, 20 Dec 1980 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
# content headers
header("Content-Type: application/x-shockwave-flash");
header("Content-Disposition: attachment; filename=\"" . $path . "\"");
header("Content-Length: " . $fileSize);
}
readfile("$file");
}
</code></pre>
<p>then my markup is as follows</p>
<pre><code> <li><a class="vids" href="viewThumb.php?type=media&amp;name=<?php echo $row['video']?>"><img src="viewThumb.php?type=artist&amp;name=a5339732e90416ee1df65dfe83bfba16.jpg" width="200" height="200"></a></li>
</code></pre>
<p>where $row['video'] is the name returned from an database query.</p>
<p>Now what I want is that when a client clicks on the thumbnail a fancybox with my video would display. It works well with .swf and other extensions explicitly noted in the fancybox documentation but not with .flv.</p>
<p>Help will be greatly appreciated</p>
| php jquery | [2, 5] |
1,565,696 | 1,565,697 | How to get result of #Eval("X") in my C# code? | <p>I have some asp code with an <code>asp:Repeater</code> object.</p>
<p>I am familiar with using <code><%# Eval("field")</code> to print dataitem.field to the HTML code. However, what can I do if I want to get the result of <code>Eval("field")</code> saved to a string literal for further processing?</p>
<p><b>Update</b>: I feel like I owe an apology for not being more specific. As the first answerer suggetss, I am planning to use the result in an <code>ItemTemplate</code>. However, what about field of the current record that are not strings? What if I have some complex type that contains all sorts of weird <em>*</em>* and I want to refer to the fields in my item template, and not as strings?</p>
| c# asp.net | [0, 9] |
2,265,338 | 2,265,339 | test android application error | <p>Now a day I'm completing tutorial and I found this type of error in testApplication.
what should i do?
It's simple HeloAndroidTest application.</p>
<p>Error is</p>
<pre><code>java.lang.RuntimeException: Exception during suite construction
at android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests.testSuiteConstructionFailed(TestSuiteBuilder.java:239)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
at android.test.suitebuilder.TestMethod.instantiateTest(TestMethod.java:87)
at android.test.suitebuilder.TestMethod.createTest(TestMethod.java:73)
at android.test.suitebuilder.TestSuiteBuilder.addTest(TestSuiteBuilder.java:263)
at android.test.suitebuilder.TestSuiteBuilder.build(TestSuiteBuilder.java:185)
at android.test.InstrumentationTestRunner.onCreate(InstrumentationTestRunner.java:373)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3210)
at android.app.ActivityThread.access$2200(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:966)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3647)
at java.lang.reflect.Method.invokeNative(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoClassDefFoundError: com.example.helloandroid.HelloAndroid
at com.example.helloandroid.test.HelloAndroidTest.<init>(HelloAndroidTest.java:13)
... 18 more
</code></pre>
| java android | [1, 4] |
934,762 | 934,763 | Show once popup | <p>Say I wanted to create a popup for my website that only showed once (if the user either filled it out or clicked the "do not display again" button), how would I do so. I am creating the popup and form using javascript and html, passing it in php to a database.</p>
| php javascript | [2, 3] |
3,151,915 | 3,151,916 | What is a good way of achieving this filtering? | <p>I have data like the following:</p>
<pre><code>var data = [{
id: 1,
date: new Date("2010-01-01"),
value: 10
}, {
id: 2,
date: new Date("2010-01-01"),
value: 11
}, {
id: 3,
date: new Date("2010-01-01"),
value: 12
}, {
id: 4,
date: new Date("2010-01-02"),
value: 10
}, {
id: 5,
date: new Date("2010-01-03"),
value: 10
}, {
id: 6,
date: new Date("2010-01-03"),
value: 21
}, {
id: 7,
date: new Date("2010-01-03"),
value: 22
}, {
id: 8,
date: new Date("2010-01-03"),
value: 23
}];
</code></pre>
<p>I am trying to apply two kinds of filters: </p>
<ul>
<li><code>Filter1</code> should give me only those points that differ by 1 in their <code>value</code> field but having the same <code>date</code> field. Therefore, this should return a new dataset containing data records with ids 1,2,3, 6,7,8 (the first three because values are 10,11,12 and last three because values are 21,22,23)</li>
<li><code>Filter2</code> should give me only those points that differ by 1 day in their <code>date</code> field but having the same <code>value</code> field. Therefore, this should return a new dataset containing data records with ids 1,4,5</li>
</ul>
<p>I am currently doing this in C# on the server-side but am looking to see if there is an efficient way to do this in Javascript. Any suggestions?</p>
| javascript jquery | [3, 5] |
739,355 | 739,356 | How to pre select radio button using AlertDialog? | <p>can someone help me with this? I have an AlertDialog box and its working fine, but what I want is when the alertdialog pops up, it will automatically check one of the radio button. </p>
<p>For an example "10 minutes" is checked when the alertdialog box pops up.</p>
<p>How to do that?</p>
<p>Below is my working code.</p>
<pre><code>final CharSequence[] deleteFilesBy = {"5 minutes","10 minutes", "15 minutes"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Delete Files by?")
.setSingleChoiceItems(deleteFilesBy,-1, new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
if(deleteFilesBy[which]=="5 minutes")
{
// do something
}
else if (deleteFilesBy[which]=="10 minutes")
{
// do something
}
else if (deleteFilesBy[which]=="15 minutes")
{
// do something
}
dialog.dismiss();
}
}).setNeutralButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
arg0.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
</code></pre>
<p>PLEASE HELP! </p>
<p>Thanks</p>
<p>RJUY</p>
| java android | [1, 4] |
3,383,162 | 3,383,163 | Call a jquery modal box by server side event | <p>i would like to call a jquery dialog box (so html, css,javascript ) via asp.net Server Side event.
Is it possible ? </p>
<p>Thank you</p>
| asp.net jquery | [9, 5] |
2,216,451 | 2,216,452 | exposing properties from a jQuery plugin attached to multiple elements on a page | <p>It has been suggested to me the following structure is preferred/standard to expose public properties from a jQuery plugin.</p>
<pre><code>(function($) {
$.myPlugin = {
data: {}
};
$.fn.myPlugin = function() {
return this;
};
})(jQuery);
</code></pre>
<p>The above example exposes 'data' through the syntax <code>$.myPlugin.data.</code></p>
<p>If the plugin is attached to multiple HTML elements on a page, then I think $.myPlugin.data becomes invalid as it is the equivalent of a static variable. </p>
<ol>
<li>What is another way to write the plugin so .data is related to the instance of a particular plugin?</li>
<li>How would one reference this property through code external to the plugin? ie. how do you read the property?</li>
</ol>
| javascript jquery | [3, 5] |
825,942 | 825,943 | Attach click handler to dynamically generated anchor tag | <p>I dynamically generate some markup and inject it into the DOM like this:</p>
<pre><code>content+='<td><a class="reportLink" onclick="showReport();return false;" href="'+layerResults.features[i].attributes['Information_External']+'">Info</a></td>';
</code></pre>
<p>I know it would be better to use jQuery to attach the click handler instead of using an inline handler.</p>
<p>The problems are, even using an inline handler and a function like this:</p>
<pre><code>function showReport() {
console.log('stopped');
}
</code></pre>
<p>Still doesn't prevent the link from navigating away from my page. </p>
<p>The second problem is, when I try using </p>
<pre><code>jQuery('.reportLink'.on('click', function(e) {
e.preventDefault();
console.log('clicked');
});
</code></pre>
<p>The event never gets attached. I'm using jQuery 1.7.2.</p>
<p>This is driving me a bit insane as it's a simple task I've done about a zillion times in jQuery <= 1.5.</p>
| javascript jquery | [3, 5] |
1,264,137 | 1,264,138 | how to update a price based on form selections | <p>if you take a look at this site <a href="http://www.graphicfirm.com/product.php?productid=2010" rel="nofollow">http://www.graphicfirm.com/product.php?productid=2010</a></p>
<p>see how the price changes when you select something from the select options? How is this being done?
each select looks something like this</p>
<pre><code><select onchange="javascript: check_options();" name="product_options[326831]" id="po326831">
<option value="564273">No</option>
<option value="564272">Yes (+ $10.00)</option>
</select>
</code></pre>
<p>what i dont understand is that the select options have a value that does not include the price that will be accumulated with the total. I'm guessing that each item such as 564272 is in an associative array with a price associated with it. can someone write me an example? i tried learning whats on that page but the javascript is really messy. I also tried to look up a small example online and i couldnt. if you know can you link me to one? also if this method has a name let me know</p>
<p>thanks</p>
| javascript jquery | [3, 5] |
1,104,454 | 1,104,455 | How and where do i use the i++ operator in C#? | <p>I was wondering if anyone could tell me about the <code>i++</code> operator in C#.</p>
<p>I know it adds one to the int value, but I wouldn't have a clue where to use it, and if its only for loop statements, or can be used in general projects.</p>
<p>If I could get some practical examples of where you might use the <code>i++</code> operator, thank you.</p>
| c# asp.net | [0, 9] |
2,855,277 | 2,855,278 | Drop Down Problems | <p>I am trying to create a drop down list. I have it working but not fully, using this code:</p>
<pre><code>$(document).ready(function(){
$("#zone-bar li em").hover(function() {
var hidden = $(this).parents("li").children("ul").is(":hidden");
$("#zone-bar>ul>li>ul").hide()
$("#zone-bar>ul>li>a").removeClass();
if (hidden) {
$(this).parents("li").children("ul").toggle()
.parents("li").children("a").addClass("zoneCur");
}
});
});
</code></pre>
<p>I managed to make it work so on hover the drop down list will appear, but when you move to select one of the items from the drop down list the drop down list closes. How do I fix that?</p>
<p>It works if I put it to <code>onclick</code> but then you have to click the arrow to close it again. You can see a live example at <a href="http://doctorwhohd.com" rel="nofollow">http://doctorwhohd.com</a> (currently using <code>onclick</code>)</p>
| javascript jquery | [3, 5] |
2,496,612 | 2,496,613 | Is there any jquery plugin to generate a tip image? | <p>The tip text which highlighted in below image serves wells for giving some instruction to first time user. And I notice such pattern several times in different web apps, I guess there must be some javascript libraries to help generating such tip visualize? But I just fail to find the correct keywords to capture them. Any one give some suggestions please? </p>
<p>[1]: <a href="http://farm7.static.flickr.com/6071/6031668602_9c7fcf70be_m.jpg" rel="nofollow">http://farm7.static.flickr.com/6071/6031668602_9c7fcf70be_m.jpg</a> ""</p>
<p>------------------updated----------------</p>
<p>Thx for the suggestions for recommending jquery tooltip plugins. </p>
<p>But other than tooltip widgets, what this questions requests is a more specified “tip plugin” which could be used to generate a transparent tip image which contains simply some words in casual font and an arrow points to parent context. Yes, this is a tooltip but not a ordinary tooltip which comes in the form of a box or bubble.
Traditional tooltip are useful for displaying detail info on the fly, while the tip I mean here performs better to <strong>attract attentions to user for providing some quick tutorial instructions without adding too much visual noises**</strong> </p>
| javascript jquery | [3, 5] |
148,522 | 148,523 | Contact us section | <p>I am having problems with my asp.net application i can run the program with no errors when i fill in the boxes on the contact us section i then get a error saying.</p>
<blockquote>
<p>SMTPException was unhanded by user code</p>
</blockquote>
<p>Here is my code</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class contactUs : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void submitform(object sender, EventArgs e)
{
MailMessage email = new MailMessage()
{
Subject = "Email From CraigavonAquatics Contact Us Section",
Body = commentBox.Text,
IsBodyHtml = false,
From = new MailAddress(emailBox.Text, nameBox.Text)
};
email.To.Add(new MailAddress("[email protected]", "Philip Harrison"));
SmtpClient server = new SmtpClient();
server.Send(email);
msgSuccess.Visible = true;
}
</code></pre>
| c# asp.net | [0, 9] |
4,387,323 | 4,387,324 | Pass var through JQuery load | <p>a very simple question I am sure just the brain isn't working this morning.</p>
<p>I have the folowing code I am using with JQuery and the Google Maps v3 API. I basically am trying to refresh a map with new search results once it has been dragged to a new location. </p>
<pre><code>google.maps.event.addListener(
map, 'dragend', function() {
var newlatlng = map.getCenter();
$('#venue-list-container').load('/maps/geoMap.php?',{latlon: newlatlng});
});
</code></pre>
<p>However I can't find what to use in the parameters after the url to post the newlatlng value (latlon: newlatlng). At the moment it doesn't work</p>
| javascript jquery | [3, 5] |
4,520,506 | 4,520,507 | creating span IDs on the fly for later use in jquery | <p>I have some PHP code which runs a loop, spitting out a button and a span, each time it loops, like this:</p>
<p>(inside loop)</p>
<pre><code>echo "<span id=\"sendbutton\"> <input type=\"button\" event='$eventID' id=\"sendsomeone\" value=\"Send a family member\"/> </span>";
echo "<span id=\"nameshere\"></span>";
</code></pre>
<p>Later in my code, I have jquery that catches one of the button clicks, and does code, then writes back. What I want it to do is to write back to the span immediately following the button that was clicked.</p>
<pre><code>$('#nameshere').append('Hey! this was the button that you clicked!');
</code></pre>
<p>Clearly, in my example, it does not quite work the way I want. Each loop creates a span with an id of nameshere, and so when I click any of the buttons, it appends to the topmost span. I could easily use <code>$eventID</code> as the span ID, but I don't know how to accurately reference it in my javascript.</p>
<p>How can I have it append to the button that was clicked? <code>$(this)</code> perhaps? I just don't know how to use it correctly.</p>
<p>Edit, more info:</p>
<p>My click code looks like this:</p>
<pre><code>$('input:button').click(function() {...}
</code></pre>
<p>Even more info:</p>
<p><strong>I should have asked more clearly. I can make my span ID unique. I just set it to be $eventID. Done. But how do I call that from in jquery?</strong></p>
| php jquery | [2, 5] |
2,896,309 | 2,896,310 | saving the state of a SeekBar | <p>I'm struggling to find the best way to implement my update to the database</p>
<p>The code below is in the adapter for a list view, so each list item has its own seekbar.</p>
<p>The list is of homework assignments so each item has its own degree of completion which I need to persist to a database.</p>
<p>I have a <em>business method</em> which can do the database write, it just needs the id of the assignment and the new progress value.</p>
<pre><code>private void attachProgressUpdatedListener(SeekBar seekBar) {
seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
public void onStopTrackingTouch(SeekBar seekBar) {
// need to update database with new progress here!
}
public void onStartTrackingTouch(SeekBar seekBar) {
// empty as onStartTrackingTouch listener not being used in
// current implementation
}
public void onProgressChanged(SeekBar seekBar, int progress,
boolean fromUser) {
// empty as onProgressChanged listener not being used in current
// implementation
}
});
}
</code></pre>
<p>the problem I'm having is getting a handle to my AssignmentHandler which deals with the database reads / writes. I can pass the assignment_id to my attachProgressUpdatedListener without any issues but I'm not sure this is the best way to go about it as I haven't got / not sure I want an instance of AssignmentHandler instantiated inside the ArrayAdapter.</p>
| java android | [1, 4] |
4,044,586 | 4,044,587 | How to run the main method of an Android Activity class? | <p>I'd would like to examine a private method of an <strong>Android Activity</strong> by executing it within the Activity's <strong><em>public static void main(String[] args)</em></strong> method which I created.</p>
<p>I use <strong>Eclipse ADT</strong> and my naive approach of running the <em>Activity</em> as a <strong>Java application</strong> resulted in:</p>
<blockquote>
<p>A fatal error has been detected by the Java Runtime Environment:<br>
Internal Error (classFileParser.cpp:3174), pid=2936, tid=2980<br>
Error: ShouldNotReachHere()</p>
</blockquote>
<p>So I looked at the <strong>Run Configuration</strong> and found out that <strong>Android 3.1</strong> is the sole entry in the <strong>Bootstrap Entries</strong> section of <strong>Classpath</strong>. I managed to configure the <strong>Build Path</strong> of the project so that the <strong>JRE</strong> is in the <strong>Bootstrap Entries</strong> too. Then I removed the <strong>Android 3.1</strong> entry and added <strong>android.jar</strong> to <strong>User Entries</strong>.</p>
<p>The result of executing the <strong>Run Configuration</strong> is a RuntimeException:</p>
<blockquote>
<p>Exception in thread "main" java.lang.RuntimeException: Stub!<br>
at android.content.Context.(Context.java:4)</p>
</blockquote>
<p><strong>An alternative</strong> of executing some tests would be to fire up a <strong>JUnit</strong> test. But in the case of a <strong>private method</strong> this is cumbersome.</p>
<p>Is there a way to successfully run the main method of an Android Activity class?</p>
| java android | [1, 4] |
441,435 | 441,436 | Why does the position method not return the expected values? | <p>Why does the <code>position</code> method not return <code>[left: 100, top: 10]</code> in this case:</p>
<pre><code><!DOCTYPE HTML>
<html>
<head>
<style>
#parent1 {
width: 300px;
height: 200px;
border: solid 9px pink;
}
#child1 {
position: relative;
left: 100px;
top: 10px;
width: 100px;
height: 100px;
border: solid 5px green;
}
</style>
<script src="http://jquery-local/jquery.all.js"></script>
<script type="text/javascript">
(function ($) {
$(document).ready(function () {
console.log($('#child1').position());
});
})(jQuery);
</script>
</head>
<body>
<div id="parent1">
<div id="child1"></div>
</div>
</body>
</html>
</code></pre>
<p>Is the only way to get the position via the <code>css</code> method? </p>
| javascript jquery | [3, 5] |
4,531,629 | 4,531,630 | JavaScript: Cross-browser "browser plugin" detection | <p>I'm looking for a script that will allow me to detect if a user has Windows Media Player installed, or Quicktime, or Flash, or Silverlight...</p>
<p>Ideally, this would be jQuery plugin, but any script will do.</p>
<p>Do you know of one you can recommend?</p>
| javascript jquery | [3, 5] |
973,146 | 973,147 | onkeyup function with PHP argument | <p>How to add PHP in an onkeyup function?</p>
<pre><code><input type="text" onkeyup="if($_SESSION['user'] == TRUE) do.this else do.that">
</code></pre>
| php javascript | [2, 3] |
5,161,681 | 5,161,682 | Display huge columns in a grid | <p>Is it possible to show more than 500 columns in a grid with a scroll bar?
Or Is there any other way?</p>
| c# asp.net | [0, 9] |
1,556,291 | 1,556,292 | CellClick Event in asp.net | <p>I am new to Asp.net but I want to implement <code>CellClick</code> event for asp's GridView,
like in windows application <code>dataGridView1_CellClick()</code>. </p>
| c# asp.net | [0, 9] |
1,798,365 | 1,798,366 | Wrap each element with html using jQuery | <pre><code><div class="inner">
line 1
line 2
line 3
</div>
$(document).ready(function(){
$('.inner').wrapInner('<p/>');
});
</code></pre>
<p>The current code adds the the <code><p></code> tag around all the elements, is it possible to add the <code><p></code> to each? like </p>
<pre><code><p>line 1</p>
<p>line 2</p>
<p>line 3</p>
</code></pre>
| javascript jquery | [3, 5] |
4,365,004 | 4,365,005 | how to find smallest value of td :contains(textbox) using jquery | <p>How do I get smallest value of the textbox using jquery?
rows means trs which contain multiple tds & tds in turn contains textboxes I want to find the smallest value of each tr</p>
<pre><code> $.each(rows, function () {
$(this).find("input[type='text']") //find smallest value of the textbox
});
</code></pre>
<p>how can I achieve this?</p>
| javascript jquery asp.net | [3, 5, 9] |
4,411,823 | 4,411,824 | javascript to jquery conversion for a code that is working fine for dynamic appearance and disappearance of a text field with radio buttons | <p>guys I tried a lot for this code but nothing come up for conversion from javascript to jquery..</p>
<p>This code is irrelevant cuz u find this in working fiddle.. I added this chunk of code cuz stackoverflow dont allow me to post without a code..</p>
<pre><code><div class="rButtons">
<input type="radio" name="numbers" value="10" onclick="uncheck();" />10
<input type="radio" name="numbers" value="20" onclick="uncheck();" />20
<input type="radio" name="numbers" value="other" onclick="check(this);"/>other
<input type="text" id="other_field" name="other_field" onblur="checktext(this);"/>
</div>
</code></pre>
<p>Check this fiddle</p>
<p><a href="http://jsfiddle.net/gDxqj/" rel="nofollow">http://jsfiddle.net/gDxqj/</a></p>
<p>It is working well. on clicking "other" radio button the text field comes up and on clicking any other radio button it disappears.. This is the function of this script and it is working well..</p>
<p>Now when i tried changing it to jquery code it died.. I can show what code i made in jquery but to no help.. </p>
<p>Fiddle for the same will help a lot..</p>
<p>Thanks in advance..</p>
<p>This is what i did</p>
<pre><code><script>
var $radios = $('input:radio[name=numbers]');
if ($radios.is(':checked') === true) {
$("#other_field").show();
}
else
{
$("#other_field").hide();
}
</script>
</code></pre>
<p>I put it put that in a function and invoke it in "onchange" of radiobutton but not worked</p>
| javascript jquery | [3, 5] |
323,998 | 323,999 | read information off website and store in excel file | <p>I am trying to build this application that when provided a .txt file filled with isbn numbers will visit the isbn.nu page for that isbn number by simply appending the isbn to the url www.isbn.nu/<em>your isbn number</em>.</p>
<p>After pulling up the page, I want to scan it for information about the book, and store that in an excel file. </p>
<p>I was thinking about creating a file stream of the url in Java, but I am not really sure how to extract the information from the html page. Storing the information will be done using the JExcel Java package. </p>
<p>My best guess would be using javascript to extract the information, but I don't know how to call the javascript from my java program.</p>
<p>Is my idea plausible? if not, what do you guys suggest I do. </p>
<p>my goal: retrieve information from an html page and store it in an excel file for each ISBN in a text file. There can be any number of isbn's in a text file. </p>
<p>This isn't homework btw, I am simply doing this for an organization that donates books to Sudan. Currently they have 5 people cataloging these books manually and I am one of them. </p>
| java javascript | [1, 3] |
5,024,928 | 5,024,929 | Increment value to attr using jquery | <p>I want to increment the value of i . The "for" loop does not work. </p>
<pre><code>$("a[href$='.xls']").appendTo(".xl1").attr('id','xl'+i);
</code></pre>
<p>I search all excel files and places them in a container and increment the value of their id.</p>
<p>Thanks
Jean</p>
| php jquery | [2, 5] |
716,183 | 716,184 | Loop Button inside the Loop Div | <p>I'm new here, I'm stuck in problem in which i have to loop my button so that i will be able to put it on my looping div. How will I do that? This is what I got so far:
//my loop</p>
<pre><code>for (i = 0; i < MPreply.recommendation.Length; i++) {
html += "<div class='rec'> ";
html += "</br> <div id = 'from1' value = > Depart From:" + " ";
html += emz + " " + "(" + + ")" + "</div>";
html += "<div id = 'date1' > Schedule:" + " " + flytDate;
html += " , " + convertedString;
html += "</div>" + "<div id = 'to1' >To:" + " " + emz2 + " " + "(" + "" + ")";
html += "</div> </br> </br> </br> ";
html += "<div id = 'RecNo'>" + " " + (i + 1) + " )" + " </br> </br> </div> ";
html += "<div id = 'fare1'> $" + em + " </div> ";
html += " </div> <br/> <br/>";
div_rec.InnerHtml = html;
}
</code></pre>
<p>html:</p>
<pre><code><div id = 'modal' runat="server" >
<div id="dialog" runat="server">
</div>
<input id="_menuitem" type="button" value="Click" runat="server" />
</div>
</code></pre>
<p>Thanks in advance.</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
5,149,274 | 5,149,275 | tag cloud filter | <p>I have a div that contains many spans and each of those spans contains a single href.</p>
<p>Basically it's a tag cloud. What I'd like to do is have a textbox that filters the tag cloud on KeyUp event.</p>
<p>Any ideas or is this possible?</p>
<p>Updated question: What would be the best way to reset the list to start the search over again?</p>
| javascript jquery | [3, 5] |
1,270,744 | 1,270,745 | Sum variable and keep showing and updating it | <p>I have this function, that it's part of my game, and which sends the data to the getScore.php. And in that php I have some code that sends me back the score for every tag that the player enter, like this "100" "50" or "10.
Now I want to grab those scores and sum them and keep showing the player his score (updating), until the game is over.</p>
<pre><code>function showScore() {
$.ajax({
type: "GET",
url: "getScore.php",
data:{
tag: $("#tag").val(),
timecode: curTime,
filename: getFileName(),
gameid: gameID()
}
}).done(function( msg )
{
show3(msg);
});
return false;
};
</code></pre>
<p>The last function is where I show the score, but now I want to change it for sum and show.
How can I do this?!</p>
<pre><code>var score;
function show3(string)
{
document.getElementById('myScore').innerHTML = string;
return string;
}
</code></pre>
| php javascript | [2, 3] |
5,012,861 | 5,012,862 | add class to <a> if href starts with http://www.twitter.com/ | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/303956/jquery-select-a-which-href-contains-some-string">jQuery: Select <a> which href contains some string</a> </p>
</blockquote>
<p>I am working on a little twitter implementation for a website.
The javascript I use exports the code as following:</p>
<pre><code><ul>
<li>twitter message here <a href="http://twitter.com/username/ID">time of twitter</a></li>
</ul>
</code></pre>
<p>Now I like to add a class to the twitter link, so I can give it a different css then normal links inside the tweets.</p>
<p>Anyone got any thoughts how to fix this in a proper way? :)</p>
| javascript jquery | [3, 5] |
3,550,777 | 3,550,778 | ASP.NET MVC displaying user Data such as comments? | <p>hows the best way to display comments/user data from a db using mvc?</p>
<p>do we just do our own for loop and manually display it or? will doing it this way cause paging problems in the future? any best methods or practice? </p>
<p>jquery?</p>
<p>thanks guys.</p>
| asp.net javascript jquery | [9, 3, 5] |
2,928,566 | 2,928,567 | How do I grab the last value in a string | <p>I know I can parse out the int by doing </p>
<pre><code>parseInt($('#count_of_stations').html())
</code></pre>
<p>if the value is like this "2stations" that will return 2 but now I need to get the integers out in this format</p>
<pre><code>one1
two2
three3
four4
five5
</code></pre>
<p>How do i get just the number out</p>
| javascript jquery | [3, 5] |
2,632,004 | 2,632,005 | what is the difference between creating an object through the prototype property vs jquery namespaced objects? | <p>Ok I'll keep this simple what is the difference between using the prototype property to create objects vs jquery namespacing to create objects.</p>
<pre><code> //////////////////////////////////////////
myTestObject.prototype.var1 = null;
function myTestObject()
{
this.var1 = "test me";
}
myTestObject.prototype.action = function()
{
alert("alertme");
};
// to use
var a = new myTestObject();
a.action();
//////////////////////////////////////////
//////////////////////////////////////////
(function()
{
$.myTestObject3 = {
var1 : "test me",
action : _actionMethod
};
function _actionMethod()
{
alert("alertme3");
}
})();
//to use
$.myTestObject3.action();
//////////////////////////////////////////
</code></pre>
| javascript jquery | [3, 5] |
669,740 | 669,741 | redirect to another page if javascript is disabled | <p>i have a alot of functionality implemented through javascript if at any stage the javascript is disabled he should be redirected to another page. mentioning him to enable the javascript and then proceed.
and this functionality should be cross browser compatable
Regard,</p>
| javascript asp.net | [3, 9] |
1,506,188 | 1,506,189 | asp.net ExpressionBuilder: Possible to wire up an event? | <p>I have used ExpressionBuilders here and there within my asp.net markup to return simple data types.</p>
<p>Does anyone have any ideas how an ExpressionBuilder might be used to wire up an event inline? Or can ExpressionBuilders only return literals?</p>
<p>I would like to wire up the OnLoad event (or any event) by creating an ExpressionBuilder (named AutoBind in my example). Any ideas if this can be done?</p>
<pre><code><asp:DropDownList ID="DropDownList1" runat="server"
DataSource='<%# GetRecords() %>'
DataTextField="Name" DataValueField="ID"
OnLoad="<%$ AutoBind: this.DataBind() %>" />
</code></pre>
| c# asp.net | [0, 9] |
1,149,215 | 1,149,216 | can i store datatable for the further refinement | <p>i have a datatable with the results i just want to refine the results using this datatable... i am trying to do it but this datatable is distroyed each time page is refreshed......</p>
| c# asp.net | [0, 9] |
329,381 | 329,382 | Not understanding jQuery and Server side events | <p>I'm having trouble since I'm a jQuery newbie. Let's assume I have a asp.net application with an ImageButton to save some data. I want to process this server side code, and if it is successful then I want to animate / toggle a panel that says success or not.</p>
<p>So for instance for an image button I have:</p>
<p><code><asp:ImageButton ID="ibSave" runat="server" ImageUrl="images/save.gif" ToolTip="Save any changes you have made." CausesValidation="False" /></code></p>
<p>Now I have server side code that does this:</p>
<pre><code> Protected Sub ibSave_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ibSave.Click
'first update the header, then
If IsCorrect() Then
Save()
Else
'do not save
End If
End Sub
</code></pre>
<p>After immediately after this lets say if the save executed then I want using jquery to toggle some sort of image / panel that says it was succesful. If the save didnt happen I want to toggle the panel to say it was not successful.</p>
<p>My issue is how do I call the jQuery function after the server side code has executed? </p>
| jquery asp.net | [5, 9] |
5,707,711 | 5,707,712 | Select every element of a ul li using jquery | <p>I have a menu in form of ul li, and I want to a add different css class to every child of the li.</p>
<p>Here is the javascript code:</p>
<pre><code>$("#menu").ready(function () {
$("#menu ul li").addClass("menu_background1");
});
</code></pre>
<p>css:</p>
<pre><code>.menu_background1 {
background:#FF0;
}
.menu_background2 {
background:#66C;
}
</code></pre>
<p>How should I select every child using jQuery? Every child should have different css class..</p>
| javascript jquery | [3, 5] |
1,369,448 | 1,369,449 | How to set property to Guid in aspx page | <p>I have the following code in one of my aspx pages:</p>
<pre><code><% foreach (Dependency dep in this.Common.GetDependencies(this.Request.QueryString["Name"]))
{ %>
<ctl:DependencyEditor DependencyKey='<%= dep.Key %>' runat="server" />
<% } %>
</code></pre>
<p>When I run it, I get the following error: <pre><strong>Parser Error Message:</strong> Cannot create an object of type 'System.Guid' from its string representation '<%= dep.Key %>' for the 'DependencyKey' property.</pre></p>
<p>Is there any way that I can create a control and pass in a Guid in the aspx page? I'd really hate to have to loop through and create these controls in the code behind just because of that...</p>
<p>NOTE: The Key property on the Dependency object <em>is</em> a Guid.</p>
| c# asp.net | [0, 9] |
4,829,189 | 4,829,190 | Adding a script reference into a page using jQuery | <p>I need to dynamically add a script reference, so I do this:</p>
<pre><code>jQuery('html head').append("<script src='somesource.com/somejs.js'><\/script>")
</code></pre>
<p>and it does't work - I don't get any errors but I can't execute any of the methods defined inside that script.</p>
<p>Any ideas what I am doing wrong?</p>
| javascript jquery | [3, 5] |
4,603,309 | 4,603,310 | Android RelativeLayout change color onClick | <p>How do i change the color of a Relative Layout i use as a clickable on Click like the normal Button?
Like i want a visual feedback the layout was pressed.</p>
<p>I tried it with a selector bound to the background property like this:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="@android:color/black"/>
<item android:state_pressed="true" android:state_enabled="false" android:color="@android:color/black" />
<item android:color="@android:color/white"/>
</selector>
</code></pre>
<p>and used it in the Layouts backround...</p>
<p><code>android:background="@color/layout_selector"</code></p>
<p>but this gives me an Inflate Exception...</p>
<p>Any ideas?</p>
| java android | [1, 4] |
4,077,255 | 4,077,256 | javascript subtracting date numbers from each other | <p>I'm passing a date in this format; YYYY-MM-DD as a php variable to a javascript function.</p>
<p>however when i get it in the js function - its gone ahead and subtracted the numbers</p>
<pre><code>//php
$today = "2013-05-30";
onclick="myjsfunction($today)"
//js
function myjsfunction(today)
{
alert(today);
}
</code></pre>
<p>this give 1978 (2013 minus 5 minus 30) !</p>
<p>anyone know a way round this?</p>
<p>thanks</p>
| php javascript | [2, 3] |
2,558,078 | 2,558,079 | Stuck with a simple slider | <p>OK, I came up with this code</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
var im1 = $("#slider li.first");
function rev(){
console.log('riv 1 is running now');
im1.delay(500).animate({marginTop: "-170px"})
.delay(500).animate({marginTop: "-340px"})
.delay(500).animate({marginTop: "-510px"})
.delay(500).animate({marginTop: "0px"}).trigger('stop');
}
im1.bind('stop',function(){
console.log("rev is called on stop")
rev();
});
console.log("rev is called the first time");
rev();
});
</script>
</code></pre>
<p>What I want to do with this is when the document is ready, I call a function named rev(). What this function does is start an animation which slides 4 images on the slider. And when the animation is finished, I trigger an event called stop.
On the other side, I've defined an event handler which tracks the stop event and runs the function rev() again.</p>
<p>The problem with this is that when the page is load, these functions runs thousands of time before starting the animation and when the limit for callback functions is exceeded (approx after running the function 1709 times), it shows the error on console
"Uncaught RangeError: Maximum call stack size exceeded"</p>
<p>Is there any better way to do this?</p>
| javascript jquery | [3, 5] |
3,957,582 | 3,957,583 | json using jquery | <p>I have a json file. Now I want to read it contents using jquery. One way is to use $.getJSON() method and there some other jquery json methods which could be used but these methods will send request to the server and read the contents and send the contents to the client. Is it possible to read .json file contents without sending request to the server?</p>
<p>Here is my menu.json file which is basically taken from json.org example. I need this for simple demo purpose.</p>
<pre><code>{
"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}
}
</code></pre>
<p><strong>Update</strong></p>
<p>menu.json file is in my file system like this</p>
<pre><code>projectfolder/
index.html
menu.json
</code></pre>
| javascript jquery | [3, 5] |
4,002,439 | 4,002,440 | Commit changes to Group View even after Activity Reload | <p>I have a method to add items to a <code>Group View</code>:</p>
<pre><code>void addItem(String name,String quantity,String value,ViewGroup view_group,int index)
{
LayoutInflater layoutInflater = (LayoutInflater)myAct.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout itemLayout = (LinearLayout) layoutInflater.inflate(R.layout.request_object_list, null);
((TextView)itemLayout.findViewById(R.id.object_name)).setText(name);
((TextView)itemLayout.findViewById(R.id.object_quantity)).setText(quantity);
ImageButton botaoAdd = ((ImageButton)itemLayout.findViewById(R.id.addButton));
ImageButton botaoSubtract = ((ImageButton)itemLayout.findViewById(R.id.subtractButton));
buttons.put(botaoAdd, ((TextView)itemLayout.findViewById(R.id.object_quantity)));
buttons.put(botaoSubtract, ((TextView)itemLayout.findViewById(R.id.object_quantity)));
botaoAdd.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
ImageButton botao = (ImageButton)arg0;
TextView textView = buttons.get(botao);
Integer quantidade = Integer.parseInt(textView.getText().toString());
quantidade++;
textView.setText(quantidade.toString());
}
});
botaoSubtract.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
ImageButton botao = (ImageButton)arg0;
TextView textView = buttons.get(botao);
Integer quantidade = Integer.parseInt(textView.getText().toString());
if(quantidade != 1)
quantidade--;
textView.setText(quantidade.toString());
}
});
((TextView)itemLayout.findViewById(R.id.object_value)).setText(value);
(itemLayout.findViewById(R.id.select_check)).setVisibility(View.VISIBLE);
(itemLayout.findViewById(R.id.select_check)).setId(index);
view_group.addView(itemLayout);
}
</code></pre>
<p>As you can see I have 2 buttons which can make modifications to their respective items on the <code>Group View</code>. Although After reloading the <code>Activity</code>, the items of the Group View are exactly with the same values from when they were initially added. How can I commit the changes?</p>
| java android | [1, 4] |
1,431,134 | 1,431,135 | How to get host domain from asp.net | <p>I am trying to get a fourth level domain by using the Request.Url.Host method but it doesn't seem to be doing the trick.</p>
<p>If the domain is "abc.def.somedomain.com" its only returning up to the third level "def.somedomain.com"</p>
| c# asp.net | [0, 9] |
1,262,186 | 1,262,187 | Android inputType="numberDecimal" brings wrong keyboard up | <p>So i have been playing around with a little game with some mathematical questions. The application gives you, for example, a question like 23 + 47, and that's fine and all, but when it gives you a question like 9/6 the problems appears. Since you input the result in an EditText, i need the correct input type. But! when i do</p>
<pre><code>android:inputType="numberDecimal"
</code></pre>
<p>the soft keyboard it comes up with, is a soft keyboard without seperators, which mean i can't make commas. And it pretty much ruins the game :-)
I have tried things like </p>
<p><code>android:inputType"numberSigned|numberDecimal"</code></p>
<p>i have also tried </p>
<p><code>android:digits="0123456789."</code>
but nothing worked so far. </p>
<p>I just can't get the right keyboard up. </p>
<p>Any suggestions?</p>
| java android | [1, 4] |
1,340,861 | 1,340,862 | how remove or replace string tag with blank in JSON | <pre><code><?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.taxmanntechnologies.com/">[{"INT_ID":"102010000000000015","INT_Section_ID":"102120000000000069", "Section_No":"Section - 16 ","Heading":" Functions of Central Board"}]</string>
</code></pre>
<p>i have This data i want to
remove <code><string xmlns="http://www.taxmanntechnologies.com/"> </String ></code>,<br>
so that i can get JSON Data can any one please tell me how to remove it so that i can parse it. </p>
| java android | [1, 4] |
2,886,907 | 2,886,908 | JQuery, regular update of a DIV section | <p>I want to do display time-changing data on a web page. I use the JQuery framework. I use the following code as a test : display a different random number each second. It does not work. Why ? What is a correct, working way ?</p>
<pre><code><html>
<head>
<title>test</title>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
function refreshRandomNumber() {
var lHtmlBlob = "<p> random = " + Math.random() + "</p>";
$('#random_number').html(lHtmlBlob);
}
setInterval(refreshRandomNumber(), 1000);
});
</script>
</head>
<body>
<div id="random_number"></div>
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
631,142 | 631,143 | rotate square with rotateAnimation | <p>I have a LinearLayout with an ImageView with a square image in the center which I need to apply rotation. Bordering the ImageView on each of its 4 sides is a frame constructed from 4 other views. If I rotate the ImageView 45degrees, does the ImageView get clipped by the other views? How does rotateAnimation respect the boundaries of the ImageView?</p>
| java android | [1, 4] |
2,727,874 | 2,727,875 | How can i set titlebar in middle? | <p>i want to set my tittle bar in center (i mean just text) and i don't want to use <code>Style</code> and <code>Layout</code> , now which method can i use?
Thank you</p>
| java android | [1, 4] |
2,638,886 | 2,638,887 | Google Map Marker + JQuery: Change icon | <p>If I already displayed a google map marker.</p>
<p>How could I change its icon using Jquery?</p>
<p>Thanks in advance.</p>
| asp.net jquery | [9, 5] |
4,783,137 | 4,783,138 | jQuery: Is there a tag like change() that also runs on page load? | <p>I have a set of radio buttons that triggers a jquery function if a specific value is chosen (via .change())</p>
<p>However, in some cases that value will be chosen by default when the page loads. At the moment I have two separate functions - one inside the .change() event, and a conditional that runs on pageload. I'd like to clean this up, so: is there an event which runs both when a value is changed, and at pageload?</p>
<p>Cheers...</p>
| javascript jquery | [3, 5] |
4,235,204 | 4,235,205 | Reload parent window from child window | <p>How can i reaload my parent window from child window using jquery?</p>
<p>Please help.</p>
| javascript jquery | [3, 5] |
5,013,821 | 5,013,822 | what's the difference between the two ways of writting in jquery? | <p>1, <code>$.each(a,f);</code></p>
<p>2,<code>$("a").each(f);</code></p>
<p>i know the last line meaning, which represents all <code><a></code> elements in the document. Then call the each() method then invoke the function <code>f</code> once for each selected element. but i don't know what's the meaning of the first one? and what's the use of it? thank you.</p>
| javascript jquery | [3, 5] |
457,042 | 457,043 | use two jquery version in one page | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page">Can I use multiple versions of jQuery on the same page?</a> </p>
</blockquote>
<p>Hi,</p>
<p>in page i use jquery 1.4.4 version, but one of my script request older versio.
I insert old jquery version and set new name:</p>
<pre><code><script type="text/javascript">var jq132 = $.noConflict(true);</script>
</code></pre>
<p>Then i get error on this line:</p>
<pre><code>jq132("#docs_file ul").sortable({ opacity: 0.6, cursor: 'move', update: function()
</code></pre>
<p>Jus show(Firefox debuger): jq132("#docs_file ul").sortable is not a function</p>
<pre><code>jq132(document).ready(function()
{
jq132(function()
{
jq132("#docs_file ul").sortable({ opacity: 0.6, cursor: 'move', update: function()
{
var order = $(this).sortable("serialize") + '&action=Listings';
jq132.post("order.php", order, function(theResponse){
jq132("#error").html(theResponse);
});
}
});
});
});
</code></pre>
| javascript jquery | [3, 5] |
2,315,115 | 2,315,116 | JavaScript or C# | <p>I'm new to development and want to learn JavaScript and C#, which one do you think would be best to start with. I want to mainly build web apps.</p>
| c# javascript | [0, 3] |
4,032,674 | 4,032,675 | Read file.inputstream twice | <p>I need to read csv file twice. but after first reading:</p>
<pre><code>using (var csvReader = new StreamReader(file.InputStream))
{
fileFullText += csvReader.ReadToEnd();
file.InputStream.Seek(0, SeekOrigin.Begin);
csvReader.Close();
}
</code></pre>
<p>using file in enother function:</p>
<pre><code>public static List<string> ParceCsv(HttpPostedFileBase file)
{
//file.InputStream.Seek(0, SeekOrigin.Begin);
using (var csvReader = new StreamReader(file.InputStream))
{
// csvReader.DiscardBufferedData();
// csvReader.BaseStream.Seek(0, SeekOrigin.Begin);
string inputLine = "";
var values = new List<string>();
while ((inputLine = csvReader.ReadLine()) != null)
{
values.Add(inputLine.Trim().Replace(",", "").Replace(" ", ""));
}
csvReader.Close();
return values;
}
}
</code></pre>
<p>The file.Length is 0.
Can anybody help?</p>
| c# asp.net | [0, 9] |
5,483,019 | 5,483,020 | I am gettin warning "value is returned not all execution path" for jQuery.grep in javascript | <p>I am using following line of code</p>
<pre><code>var selectedMedId = jQuery.grep(privateVariables.medIdData, function (n) {
if (n.DescriptionWithCode.toString().toUpperCase() === description.toString().toUpperCase()) {
return n;
}
});
</code></pre>
<p>I tried following also</p>
<pre><code> var selectedMedId = jQuery.grep(privateVariables.medIdData, function (n) {
return n.DescriptionWithCode.toString().toUpperCase() === description.toString().toUpperCase();
}
});
</code></pre>
<p>And I want get rid of this warning.</p>
| javascript jquery | [3, 5] |
3,192,255 | 3,192,256 | Developing for iPhone or Android? (As a C# developer) | <p>I'd like to start developing for iPhone or Android in my spare time, as a chance to learn something new but also hoping make some extra income. </p>
<p>I'm not sure which is the best development for me to start developing on. I own an iPhone, but I don't have a Mac (which I would need to use the SDK), plus with the iPhone I believe there's an annual charge to develop for it.</p>
<p>As far as I understand Android, the SDK is free and can be used on Windows.</p>
<p>Professionally I develop using .net and C#, which sounds more similar to the Java based Android enviroment.</p>
<p>Another negative I perceive against iPhone is it has a much more crowded App Store, I would think apps get better exposure on Android?</p>
| iphone android | [8, 4] |
466,249 | 466,250 | Conflict between two versions with reading contacts in android | <p>I created an application that reads contacts from the phone and it works fine on platform version of 3.1 but it throws NullPointerException when i run it on 2.3.3 platform.Can anyone show me the reason for this error.</p>
<pre><code>ContentResolver cr = getContentResolver();
Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,null,null, null, null);
while (cur.moveToNext()) {
String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID));
Cursor phones = cr.query(Phone.CONTENT_URI, null,
Phone.CONTACT_ID + " = " + id, null, null);
while (phones.moveToNext()) {
String number = phones.getString(phones.getColumnIndex(Phone.NUMBER));
int type = phones.getInt(phones.getColumnIndex(Phone.TYPE));
System.out.println("Numeber= "+number);
switch (type) {
case Phone.TYPE_HOME:
home=number;
break;
case Phone.TYPE_MOBILE:
mobile=number;
break;
case Phone.TYPE_WORK:
work=number;
break;
case Phone.TYPE_OTHER:
other=number;
break;
}
}
phones.close();
}
</code></pre>
<p>thanks.</p>
| java android | [1, 4] |
5,705,732 | 5,705,733 | Unescape JavaScript's escape() using C# | <p>Are the any functions in C# that handle escape/unescape like JavaScript?</p>
<p>I have a JSON string like this:</p>
<p><code>{"Feeds":[{"Url":"www.test.com","FeedType":"Twitter"},{"Url":"www.test2.com","FeedType":"Youtube"}]}</code></p>
<p>Which looks like this after <code>escape()</code></p>
<p><code>%7B%22Feeds%22%3A%5B%7B%22Url%22%3A%22www.test.com%22%2C%22FeedType%22%3A%22Twitter%22%7D%2C%7B%22Url%22%3A%22www.test2.com%22%2C%22FeedType%22%3A%22Youtube%22%7D%5D%7D</code></p>
<p>In my C# code I would like to unescape this string so that it looks exactly the same as it did before the <code>escape()</code></p>
<p>Is this possible?</p>
| c# javascript asp.net | [0, 3, 9] |
4,432,687 | 4,432,688 | smtpException was unhandled by user code | <p>here is the code.</p>
<pre><code>void sendMail()
{
MailMessage mail = new MailMessage();
mail.To.Add("[email protected]");
mail.From = new MailAddress("[email protected]", txt_name.Text);
mail.Subject = txt_subject.Text;
mail.Body = txt_body.Text;
SmtpClient smtp = new SmtpClient("smtp.gmail.com");
smtp.EnableSsl = true;
NetworkCredential yetki = new NetworkCredential("[email protected]", "11111111");
smtp.Credentials = yetki;
smtp.Send(mail);
Response.Write("mailiniz başarılı bir şekilde gönderilmiştir");
}
protected void btn_gonder_Click(object sender, EventArgs e)
{
sendMail();
}
</code></pre>
| c# asp.net | [0, 9] |
2,284,042 | 2,284,043 | Calling a function defined inside jQuery ready from outside of it | <p>My aspx page:-</p>
<pre><code> <script src="js/jquery-1.4.2.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.8.2.custom.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
//lots of other code here....
function showMessage(){
$("#msgDiv").dialog({
modal: true,
buttons: {
Ok: function() {
$(this).dialog('close');
}
},
resizable: true,
show: "explode",
position: "center",
closeOnEscape: true,
draggable: false
});
}
});
</script>
</code></pre>
<p>Another aspx pop up page which is triggered from the above page</p>
<pre><code><script type="text/javascript">
window.opener.document.getElementById("msgDiv").innerHTML = <%=MessageToShow%>; //works very well for me.
window.opener.document.showMessage(); // I am unable to access it like this?
window.close();
</script>
</code></pre>
<p>Basically I want to call <code>showMessage()</code> from the pop up window. I also have other logics to perform in both pages.</p>
| javascript jquery | [3, 5] |
3,175,279 | 3,175,280 | Jquery hiding is not trigered | <p>Following is my javascript in which I've been trying to show certain div and after the function being performed the div should get hide by itself but i am having this issue that in same function both doesnot work like to show first then after some time interval hide that div but when i put event of show and hiding separately it worked fine. Kindly let me know how can i modify the following code so that after processing the result it should hide that div</p>
<pre><code> function jq(input)
{
if (input == 'abc')
{
$("#show").show(1000);
document.getElementById('sele').options.length = 0;
$('#sele').append('<option value="test">Testing</option>').updateSelect();
$("#show").hide(1000);
}
}
<div id="show" > <img src="ajax-loader.gif" width="16" height="16" /> </div>
</code></pre>
| javascript jquery | [3, 5] |
4,554,464 | 4,554,465 | connected list controls | <p>sorry for my English google translator. I have three connected lists</p>
<pre><code>$( ".listaAvisosConectados" ).sortable({
connectWith: ".listaAvisosConectados",
dropOnEmpty:true,
}).disableSelection();
</code></pre>
<p>Example online: <a href="http://test.vertudemo.com/" rel="nofollow">http://test.vertudemo.com/</a></p>
<p>and I need to implement any element can be added on the red list but that list items can not be green or blue added in opposing lists. Red accepts all. Green only accepts green and blue only blue. </p>
<p>I've tried several ways but cannot do it. </p>
<p>If I put a different class to each list green and red. Red List and add two classes do not work very well. </p>
| javascript jquery | [3, 5] |
1,310,561 | 1,310,562 | e.stopPropagation() and event hover | <p>Is there a way to have both of these work together or do I have to try using the mouseenter and mouseleave instead?</p>
| javascript jquery | [3, 5] |
646,985 | 646,986 | Get independent HTML from $.ajax() | <p>Assume that in</p>
<pre><code>$.ajax({
url: 'page1.html',
data: {},
success: function (data) {
$(data) //return an array of nodes
},
dataType: 'html'
});
</code></pre>
<p><code>$(data)</code> returns an array of nodes:</p>
<pre><code>[<div id="a">,
<div id="b">, //3 elements
<div id="c">]
</code></pre>
<p>and I want to get the HTML of the div that has an <code>id</code> of <code>"b"</code>. I tried </p>
<pre><code>$(data).find("#b");
</code></pre>
<p>but it returns a blank array. (<code>[]</code>) So how can I select it? Please help.</p>
| javascript jquery | [3, 5] |
5,972,456 | 5,972,457 | Print python script output correctly in PHP | <p>i have a php file calls a script and prints the output like this</p>
<pre>
$output=shell_exec('/usr/bin/python hello.py');
echo $output;
</pre>
<p>it prints;</p>
<pre>
b'total 16\ndrwx---r-x 2 oae users 4096 Jul 31 14:21 .\ndrwxr-x--x+ 9 oae root 4096 Jul 26 13:59 ..\n-rwx---r-x 1 oae users 90 Aug 3 11:22 hello.py\n-rwx---r-x 1 oae users 225 Aug 3 11:22 index.php\n'
</pre>
<p>but it should be like this;</p>
<pre>
total 16K
drwx---r-x 2 oae users 4.0K Jul 31 14:21 ./
drwxr-x--x+ 9 oae root 4.0K Jul 26 13:59 ../
-rwx---r-x 1 oae users 90 Aug 3 11:22 hello.py*
-rwx---r-x 1 oae users 225 Aug 3 11:22 index.php*
</pre>
<p>\n characters shouldn't be shown.How can i solve this?</p>
| php python | [2, 7] |
3,704,447 | 3,704,448 | Div auto adjust according to screen resolution | <p>i have design similar to below given link. when i open this link and minimize or maximize the browser then it div box adjust their position accordingly. i am finding the same kind of jQuery or JavaScript. I tried to download it but it is not working in IE 7 and i also want to know name of this kind of jQuery</p>
<pre><code>http://berndkammerer.com/
</code></pre>
| javascript jquery | [3, 5] |
5,015,704 | 5,015,705 | Why does consecutive calls to Server.Transfer change the url? | <p>I'm using <code>Server.Transfer</code> to load the contents of another page when clicking a button. This works as expected and the url stays the same. However, if I try to load a third page at the click of a button in the second page, the url changes to that of the second page. I would expect it to keep the url of the first page.</p>
<p>Example:</p>
<ol>
<li><code>Page1.aspx</code> loads.
<ul>
<li>Url: <code>.../Page1.aspx</code> </li>
<li>Content: <code>Page1.aspx</code></li>
</ul></li>
<li><code>Server.Transfer("~/Page2.aspx")</code> on button click.
<ul>
<li>Url: <code>.../Page1.aspx</code></li>
<li>Content: <code>Page2.aspx</code></li>
</ul></li>
<li><code>Server.Transfer("~/Page3.aspx")</code> on button click
<ul>
<li>Url: <code>.../Page2.aspx</code></li>
<li>Content: <code>Page3.aspx</code></li>
</ul></li>
</ol>
<p>Why does the url change in the third step?</p>
| c# asp.net | [0, 9] |
887,446 | 887,447 | Using Jquery to post single variable | <p>using jquery to post a value to php file but the value is not being posted (COMPANY_NAME). Code below works for multiple values but not when it's changed to post single values? Any tips?</p>
<pre><code>$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
var COMPANY_NAME = $( "#COMPANY_NAME" ),
allFields = $( [] ).add( COMPANY_NAME ),
tips = $( ".validateTips" );
$( "#dialog-form5" ).dialog({
autoOpen: false,
height: 200,
width: 350,
modal: true,
buttons: {
"ok": function() {
var bValid = true;
allFields.removeClass( "ui-state-error" );
if ( bValid ) {
$.post("setCompany.php", {
COMPANY_NAME:$(this).val()
}, function(data) {
if(data=='no')
{ $("#msgbox").fadeTo(200,0.1,function()
{
$(this).html(data).addClass('messageboxerrorAdd').fadeTo(900,1);
});
} else if (data=='wrong') {
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html("fjdhffh").addClass('messageboxerrorAdd').fadeTo(900,1);
});
} else {
$("#msgbox").fadeTo(200,0.1,function()
{
$(this).html(data).addClass('messageboxerrorAdd').fadeTo(900,1);
});
}
});
$( this ).dialog( "close" );
}
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
}
});
});
</code></pre>
| php jquery | [2, 5] |
4,390,890 | 4,390,891 | Using javascript and php together | <p>I have a PHP form that needs some very simple validation on submit. I'd rather do the validation client-side, as there's quite a bit of server-side validation that happens to deal with writing form values to a database. So I just want to call a javascript function onsubmit to compare values in two password fields. This is what I've got:</p>
<pre><code>function validate(form){
var password = form.password.value;
var password2 = form.password2.value;
alert("password:"+password+" password2:" + password2);
if (password != password2) {
alert("not equal");
document.getElementByID("passwordError").style.display="inline";
return false;
}
alert("equal");
return true;
}
</code></pre>
<p>The idea being that a default-hidden div containing an error message would be displayed if the two passwords don't match. The alerts are just to display the values of password and password2, and then again to indicate whether they match or not (will not be used in production code). </p>
<p>I'm using an input type=submit button, and calling the function in the form tag:</p>
<pre><code><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" onsubmit="return validate(this);">
</code></pre>
<p>Everything is alerting as expected when entering non-matching values. I would have hoped (and assumed, based on past use) that if the function returned false, the actual submit would not occur. And yet, it is. I'm testing by entering non-matching values in the password fields, and the alerts clearly show me the values and the not equal result, but the actual form action is still occurring and it's trying to write to my database.</p>
<p>I'm pretty new at PHP; is there something about it that will not let me combine with javascript this way? Would it be better to use an input type=button and include submit() in the function itself if it returns true?</p>
| php javascript | [2, 3] |
5,809,202 | 5,809,203 | Semicolon in url as a separator for query strings | <p>I keep hearing that W3C recommends to use ";" instead of "&" as a query string separator.</p>
<blockquote>
<p>We recommend that HTTP server implementors, and in particular, CGI
implementors support the use of ";" in place of "&" to save authors
the trouble of escaping "&" characters in this manner.</p>
</blockquote>
<p>Can somebody please explain why ";" is recommended instead of "&"? </p>
<p>Also, i tried using <code>";"</code> instead of <code>"&"</code>. (example: <code>.com?str1=val1;str2=val2</code> ) . When reading as <code>Request.QueryString["str1"]</code> i get "<code>val1;str2=val2</code>". So if <code>";"</code> is recommended, how do we read the query strings?</p>
| c# asp.net | [0, 9] |
2,903,655 | 2,903,656 | Fade in Each Thumbnail? | <p>all of my thumbnails have the class .thumb</p>
<p>I'm trying to fade in each at a time like I've seen on some websites but it doesnt seem to be working. My code is below</p>
<pre><code>$('.thumb').eachDelay(function(){
$(this).fadeIn('1000');
}, 100);
</code></pre>
<p>What is wrong here?</p>
<p>Here is a fiddle: <a href="http://jsfiddle.net/NPWGu/" rel="nofollow">http://jsfiddle.net/NPWGu/</a></p>
<p>I've tried a ton of the solutions and havent had any luck yet so hopefully this will help make it easier to understand how I have my code setup</p>
| javascript jquery | [3, 5] |
2,270,222 | 2,270,223 | Masked Input Plugin jquery | <p>I am goting to use this <a href="http://digitalbush.com/projects/masked-input-plugin/" rel="nofollow">plugin</a> for an asp.net textbox.</p>
<p>The textbox is:</p>
<pre><code> <asp:TextBox ID="txtBox" runat="server" Text='<%# Bind("Phone") %>' />
</code></pre>
<p>I want the format is (999) 999-9999 when the textbox is non-empty. But it is null when the textbox is empty.</p>
<p>I want to select different mask by the text.
How is the code like?</p>
<p>I tried below:</p>
<p>Thanks. </p>
<pre><code> jQuery(function($){
if(document.getElementById("<%# txtBox.ClientID %>")).innerText =
$("<%# txtBox.ClientID %>").mask("(999) 999-9999");
else
$("<%# txtBox.ClientID %>").mask("");
});
</code></pre>
<p><strong>UPDATE</strong></p>
<p>The textbox is inside a gridview. It likes:</p>
<pre><code><asp:TemplateField HeaderText="OrgContactPhone" SortExpression="OrgContactPhone">
<EditItemTemplate>
<asp:TextBox ID="txtBox" runat="server" Text='<%# Bind("OrgContactPhone") %>' MaxLength="50">
</asp:TextBox>
</code></pre>
| javascript jquery asp.net | [3, 5, 9] |
2,707,659 | 2,707,660 | JQuery Confirmation Dialog in ASP.Net | <p>Is there any Confirmation Dialog that is made from Jquery where I can use it in ASP.NEt?</p>
<p>a confirmation dialog that has a "Yes" or "No", "Ok", "Ok" or "Cancel" button?</p>
<p>and example, if I click "Ok" button, I can perform a condition in the server code of ASP.net.</p>
<p>another example in the dialog box: "Do you want to save this record to the database?" "Yes" or "No"</p>
| jquery asp.net | [5, 9] |
1,667,874 | 1,667,875 | How to access store certificates from client machine | <p>I am using a web application in which i need to sign a document at client end.client should select the certificate and be able to sign from that certificate.I am using this code to access the store certificates:-
X509Store st = new X509Store(StoreName.My, StoreLocation.LocalMachine);</p>
<p>But this is returning certificates from server.
How to access certificates at client machine.</p>
| c# asp.net | [0, 9] |
2,110,449 | 2,110,450 | cm to inch converter, two textboxes multply a value | <p>I Have a problem to make a cm to foot/inch converter in C#, this is what a got:</p>
<pre><code><asp:textbox id="txtFoot" runat="server"></asp:textbox>
<asp:textbox id="txtInches" runat="server"></asp:textbox>
<asp:Button id="btnAdd" runat="server" text="Count" onclick="btnAdd_Click" />
<br />
<asp:Label ID="lblResult" runat="server"></asp:Label>is<asp:Label ID="lblFootAndInches" runat="server"></asp:Label>cm
<%--I try to get a result "10'1" is 3,939 cm"--%>
protected void btnAdd_Click(object sender, EventArgs e)
{
lblResult = (txtFoot.Text + "," + txtInches.Text) * 0,39; //I would like to get 10,1 * 0,39 = 3,939 (10 foot and 1 inch)
lblFootAndInches = txtFoot.Text + "'" + txtInches.Text + '"'; //I'm looking for a result like 10'1"
}
</code></pre>
| c# asp.net | [0, 9] |
5,894,399 | 5,894,400 | Dropdown options can't access with jquery selector? | <p>I have a drop down in my webpage.It's a aspx page.But i am try to access the drop down from JavaScript.here is my code.
This code is working.</p>
<pre><code>var a = document.getElementById('myDropdown');
alert(a.options.length);
</code></pre>
<p>This code is not working</p>
<pre><code>var a = $('#myDropdown');
alert(a.options.length);
</code></pre>
<p>i am getting the following error.</p>
<pre><code>TypeError: Cannot read property 'length' of undefined
</code></pre>
<p>Any one have any idea.</p>
| javascript jquery asp.net | [3, 5, 9] |
951,753 | 951,754 | Jquery get data from dynamic | <p>Im trying to get some javascript var.
that javascript is render dynamic by click in a button, so when the page loads again i want to get that var data and show it in other place. I cant do nothing in the dynamic javascript.</p>
<p>I try to catch in $(windows).load() but there is not render yet.</p>
<p>is there a way to get a panel after complete loads that var or something???</p>
<p>Thanks All</p>
| jquery asp.net | [5, 9] |
73,530 | 73,531 | jQuery/Javascript: Waiting for an animation to finish | <p>Let me preface this by saying I am new to Javascript, but not to programming. I call <code>fadeOut</code> on a jQuery Object like such:</p>
<pre><code>$(x).fadeOut('fast');
</code></pre>
<p>I have other things that will be fading out and in, but I need them to wait for each other, and I do not necessarily know how many are going to be doing this. <code>x</code> is a string from an array that contains the items that are are fading in or out. In my first attempt I used the callback function in <code>fadeOut</code> like this:</p>
<pre><code>$(x).fadeOut('fast', function(){ foo(modifiedArray); })
</code></pre>
<p>Where <code>foo</code> is the method I want, and modifiedArray is the array minus <code>x</code>. This still didn't make it wait though, so next I tried:</p>
<pre><code>$(x).fadeOut('fast');
while( $(x).css('display') != 'none' ){}
foo(modifiedArray);
</code></pre>
<p>But the loop never ends. How can I make the animation wait before I call <code>foo(modifiedArray)</code> again?</p>
<p>EDIT: Here is the full code</p>
<pre><code>function animateElements(elements){
if (elements.length == 1){
var x = elements[0];
$(x).fadeIn('slow');
}
else{
var x = elements.pop();
$(x).fadeOut('fast');
while( $(x).css('display') != 'none' ){}
animateElements(elements);
}
}
</code></pre>
| javascript jquery | [3, 5] |
5,760,289 | 5,760,290 | javascript:window.location.href opens new tab in firefox and new window (rather as a pop up ) in IE . I want the page to open in the same window | <p>What do I need to change in the line below ? Please help . Thanks :)</p>
<pre><code> lstItems.Attributes.Add("onclick", "javascript:window.location.href='" + Project2.Constants.MySiteURL + "myPage.aspx/" + ID + "';");
</code></pre>
<p>edit:-</p>
<p>i found this solution on SO but dont know how to use it in my case :/</p>
<pre><code>window.open("http://asdf.com", "window_name","location=1,status=1,scrollbars=1,resizable=no,width=650,height=650");
</code></pre>
<p>edit 2 :-</p>
<p>Any Javascript expert in here ?? Please help me out.</p>
<p>edit3 :-</p>
<p>@Headshota:: Its still opening in new tab in firefox and as apop up window in IE :(</p>
<p>edit 4 :-</p>
<p>@ Craig :: What does this mean? "possibly got a misplace target="_blank" somewhere" How do i check for it?? </p>
<p>edit :-</p>
<p>Could someone please help me out with this ? :(</p>
<p>I have tried whatever I could but i just can't get the page to open in the same window. Please someone help me out.</p>
| c# javascript asp.net | [0, 3, 9] |
41,805 | 41,806 | What does (function($) {})(jQuery); mean? | <p>I am just starting out with writing jQuery plugins. I wrote three small plugins but I have been simply copying the line into all my plugins without actually knowing what it means. Can someone tell me a little more about these? Perhaps an explanation will come in handy someday when writing a framework :)</p>
<p>What does this do? (I know it extends jQuery somehow but is there anything else interesting to know about this)</p>
<pre><code>(function($) {
})(jQuery);
</code></pre>
<p>What is the difference between the following two ways of writing a plugin:</p>
<p><strong>Type 1:</strong></p>
<pre><code>(function($) {
$.fn.jPluginName = {
},
$.fn.jPluginName.defaults = {
}
})(jQuery);
</code></pre>
<p><strong>Type 2:</strong></p>
<pre><code>(function($) {
$.jPluginName = {
}
})(jQuery);
</code></pre>
<p><strong>Type 3:</strong></p>
<pre><code>(function($){
//Attach this new method to jQuery
$.fn.extend({
var defaults = {
}
var options = $.extend(defaults, options);
//This is where you write your plugin's name
pluginname: function() {
//Iterate over the current set of matched elements
return this.each(function() {
//code to be inserted here
});
}
});
})(jQuery);
</code></pre>
<p>I could be way off here and maybe all mean the same thing. I am confused. In some cases, <strong>this</strong> doesn't seem to be working in a plugin that I was writing using Type 1. So far, Type 3 seems the most elegant to me but I'd like to know about the others as well.</p>
| javascript jquery | [3, 5] |
794,297 | 794,298 | How to reset background colour after it is changed by jQuery? | <p>First, a jsfiddle...
<a href="http://jsfiddle.net/therocketforever/jYba3/11/" rel="nofollow">http://jsfiddle.net/therocketforever/jYba3/11/</a></p>
<pre><code>// Highlight selected linker link & set all others to default.
$('a.linker').click(function(){
$(this).addClass('selected');
$(this).parent('li').siblings().find('.selected').removeClass('selected');
// Selects a random colour from the 'colors' array by getting a random value
// between 0 and the length of the color array.
rand = Math.floor(Math.random()*colors.length);
$(this).css("background-color", colors[rand]);
</code></pre>
<p>Now a Question,</p>
<p>Firstly this code works almost exactly the way that I would like it to, A user clicks a link, the selected colour is applied to the link text, removed from the others & the background of the link is set to a random color from the array of colours. Cool.</p>
<p>What I would like to know is... How would I make it so that the randomly set background colour is removed from the non selected links (ie. Only the link with the .selected class has the background colour.)</p>
<p>EXTRA CREDIT</p>
<p>Bonas points if the same background colour is never used twice in a row. (ie. If click one sets to yellow, click two is any other colour except yellow. </p>
| javascript jquery | [3, 5] |
3,227,439 | 3,227,440 | is there a way to force event to fire only once on given element (per element, not whole document) when using live()? | <pre><code>$('div.myclass').live('click',function() {
alert('i should respond only once');
});
</code></pre>
<p>I know that there is a <code>one()</code> function with jquery but i can't figure how to integrate this with the code above.</p>
| javascript jquery | [3, 5] |
4,238,649 | 4,238,650 | stop working of function from another function | <p>I have two functions</p>
<pre><code>function1()
{
//...
}
</code></pre>
<p>in <code>function1</code> i make ajax requests and load an image</p>
<p>there is another function - <code>function2</code> where i call <code>function1</code> to load an image.</p>
<p>now, what is the question. </p>
<p>How can i stop propagation of <code>function1</code> before i will call it again in <code>function2</code>?</p>
<pre><code>function2()
{
// ...
// how stop old propogation of function1 here?
function1(); //call function1 again
}
</code></pre>
<p>Thanks</p>
| javascript jquery | [3, 5] |
945,556 | 945,557 | Android - first run preference initialization | <p>I have next situation:
After installing application it has to init settings from server. And while itis not has right preferences it has to wait. I have several receivers and service - I dont want to check for initialization in every action in these components - I think there have to be better solution. Can somebody help me with it? :)</p>
| java android | [1, 4] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.