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 |
---|---|---|---|---|---|
3,290,479 | 3,290,480 | jquery loaded, but not executing proper UI function | <p>I have a validation script, and I'm tying to check if the first name field is left blank. I originally just changed the background color of the field and that worked, but now I want to use jquery to fade in a highlight. This is the code so far.</p>
<pre><code>var x = document.forms['getinfo']['fname'].value;
var validated = true;
if (x==null || x =="") {
//document.getElementById('trfname').style.background="#FF9999";
document.getElementById('trfname').style.borderRadius = '7px';
$("trfname").effect("highlight", {}, 3000);
validated = false;
}
</code></pre>
<p>As you can see I commented out the old javascript code that worked and I'm trying to use the jquery highlight function. It's not working and I was wondering if anyone had some input. I've checked if Jquery loads properly and it does, so it's not that. I also included the jquery-ui library, to no avail.</p>
| javascript jquery | [3, 5] |
226,234 | 226,235 | how to unselect all my checkbox | <p>I'm trying without success to unselect all my checkbox picks</p>
<p>by pressing any button that in my java android program with this code</p>
<pre><code>public void onListItemClick(ListView parent, View v, int position, long id)
{
parent.setItemChecked(position, parent.isItemChecked(position));
}
@Override
protected Dialog onCreateDialog(int id, Bundle args){
switch(id){
case 1:
return new AlertDialog.Builder(this)
.setIcon(R.drawable.ic_launcher)
.setTitle("This is a dialog with some simple text...")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton)
{
Toast.makeText(getBaseContext(),"OK clicked!", Toast.LENGTH_SHORT).show();
}})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton)
{
Toast.makeText(getBaseContext(),"Cancel clicked!", Toast.LENGTH_SHORT).show();
}
})
.setMultiChoiceItems(items, itemsChecked, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
Toast.makeText(getBaseContext(),items[which] + (isChecked ? " checked!":" unchecked!"),Toast.LENGTH_SHORT).show();
}
})
.create();
}
return(null);
}
</code></pre>
<p>how to select all and unselect all ?</p>
| java android | [1, 4] |
4,992,691 | 4,992,692 | Specific Disadvantages of PHP compared to Python via code examples? | <p>There appears to be an overwhelming acceptance that php is a "poorly designed" language as compared to python.</p>
<p>As I have limited experience I am not able to fully understand this conceptually or practically...I'm still in the
"Php works fine so far" camp...but id like to be educated.</p>
<p>I am specifically interested in their use in web development
Can people give examples along with simple code to show why php can be problematic in important
practical scenarios?</p>
<p>Relevant answers that are fundamentally not related to code are welcome as well...</p>
| php python | [2, 7] |
1,809,279 | 1,809,280 | How do I know a particular event.keyCode corresponds to a character and not a command key (such as arrows, tab or enter) | <p>I'm using javascript/jQuery.. on the <code>keydown</code> of an <code>input[type='text']</code> I receive a key code. I need to determine whether it's a character code or a command code because I need to know whether the input will change. I cannot use the <code>change</code> event as this event is postergated until the element loses focus.</p>
| javascript jquery | [3, 5] |
3,467,657 | 3,467,658 | window.print() refreshes page in iframe when I click cancel | <p>I have a an iframe inside my website with the following jquery code in it:</p>
<pre><code>$(document).ready(function() {
$('#print_button').click(function() {
window.print();
});
});
</code></pre>
<p>The problem: When I click the print button, the print dialog opens correctly. Printing works correctly as well. But when I click the cancel button in the print dialog it closes but it also refreshes content in the iframe.</p>
<p>How can I avoid this behaviour?</p>
| javascript jquery | [3, 5] |
2,112,573 | 2,112,574 | jQuery prepending textarea | <p>HTML</p>
<pre><code><textarea id="photo-42-9" class="comment_box">Write a comment...</textarea>
</code></pre>
<p>jQuery code that doesn't work, what am I missing?</p>
<pre><code>$('#photo-42-9').prepend("<div>blah</div>");
</code></pre>
<p><strong>EDIT</strong>
Corrected the ids mismatch, still doesn't work though</p>
| javascript jquery | [3, 5] |
4,514,926 | 4,514,927 | how to play mp3 file by streaming using jquery | <p>Dear all,
How can i play an Mp3 file using jquery.At backend level i m using servlets/jsp.PLease suggest any other possible way to play mp3 file in a website.</p>
| javascript jquery | [3, 5] |
2,597,040 | 2,597,041 | Killing application (killProcess) blocked by DefaultHttpClient.execute execution | <p>I'm writing an application which at start up posts a message to the server and waits for the response. To achieve this I'm using DefaultHttpClient.execute method with response time set to default. The whole operation is triggered as a separate thread which is set as a daemon thread, because I don't want for the application to be blocked when user decide to close it too fast (while still waiting for the server response). Still, when I try to kill an application through android.os.Process.killProcess call there is a significant delay, which I'm guessing is related with DefaultHttpClient.execute mechanism (not-daemon thread execution?). Is there a way to kill my connection just after killProcess call?</p>
| java android | [1, 4] |
1,668,188 | 1,668,189 | How to use WebRequest to post data and get response from a webpage | <p>I need to implement an application to post request to a given url and get response.</p>
<p>What are the best methods to post request to a given url and get response?</p>
<p>Please help.</p>
| c# asp.net | [0, 9] |
3,971,922 | 3,971,923 | google+ page vs profile | <p><br /> I have an Asp.net webpage where I would like to display google plus information of the users. The google plus IDs are stored in a database. Is there a way (javascript/C#/VB) to determine if a google plus ID is related to a page or a profile? because I have to include different g:plus codes for them. I searched the google developers page but couldn't find anything related to this. Thanx folks!</p>
| javascript asp.net | [3, 9] |
5,305,586 | 5,305,587 | How do you capture an event for a URL dropped on an input box | <p>I have a web form with a text input box for a url. When I drag a url from the browser's (I'm using firefox but i'd like it to work in others too if possible) address bar to the input box it inserts the url text into any pre-existing text. I want the url to overwrite any existing text instead. </p>
<p>I'm thinking I could capture some event and ease any existing text before adding the dropped text. </p>
<p>If it's possible to set up using jQuery that's nice, otherwise in simple javascript.</p>
<p><strong>Edit</strong></p>
<p>This seems to work:</p>
<pre><code>$("#myinput").bind("drop", function(e) {
e.currentTarget.value = "";
return true;
});
</code></pre>
<p>I'm not sure what browsers support this event but if it's most modern ones then it should be fine.</p>
| javascript jquery | [3, 5] |
338,611 | 338,612 | asp.net Dropdown Disable Issue | <p>I have a ASP.Net webpage with following <strong>edit</strong> rules</p>
<ol>
<li>Normal user can edit only blank fields</li>
<li>Admin user can edit all fields ( No Issue!!)</li>
</ol>
<p>To accomplish this, I tried to "<strong>Disable</strong>" all fields which have a value using javascipt,
but on postback all the disabled fiels lost its state . So I change to <strong>Readonly=true</strong> . Now all textboxes are working as expected. But the Dropdowns can still editable even though the readonly is true . </p>
<p>How can i accomplish this without losing the control`s value on postback ?</p>
<p>Thanks in advance . </p>
| javascript asp.net | [3, 9] |
4,492,804 | 4,492,805 | How to get character from number of buttons that buttons added in GridView using Tag and position in Android | <p>Buttons added in GridView programmatically the total number of buttons depend on word length. Each button contains a letter of word, i want to get that letter when click the button using tag,
how can i get?
here is the code:</p>
<pre><code>public View getView(final int position, View convertView, ViewGroup arg2) {
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.buttonlist, null);
}
final Button btn= (Button)v.findViewById(R.id.letterbtn);
btn.setText(word[position]+"");
btn.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{
btn.setTag(btn);
Object tag=btn.getTag();
btn.setVisibility(View.GONE);
function(position);
}
});
</code></pre>
| java android | [1, 4] |
506,611 | 506,612 | Dynamically add controls javascript Asp.net C# | <p>I am trying to add controls on asp.net c# page, when user clicks on add another. I am using table and want to append controls in that table. Also let me know, How I will get controls values in code behind once form is submitted to server. </p>
| javascript asp.net | [3, 9] |
2,845,013 | 2,845,014 | Flash Message - jQuery | <p>In my Rails application I have flash messages and I would like it so that each time there is a flash message, it scrolls down from the top (all the content goes lower) stays for a few seconds and the slides back up.</p>
<p>How can I do this with jQuery?</p>
<p>Do I toggle the height?</p>
<h3>Update</h3>
<p>Sometimes the message will be injected into the HTML which means that the <code>slideDown</code> won't work since the DOM has already loaded, how can I have it so jQuery looks for <code>.message</code> and then applies the <code>slideDown</code> and <code>slideUp</code>?</p>
| javascript jquery | [3, 5] |
4,380,120 | 4,380,121 | PHP not support double | <p>Hi I have written one function which is giving diff out put in PHP and JAVA. Please help me to get same output in PHP too. below are that functions written in both languages.</p>
<p>function in JAVA </p>
<pre><code>public String getLat(String v_str, String strNS){
try
{
double lat = Integer.parseInt(v_str.substring(0, 2));
//System.out.println("lat="+lat);
double lat2 = Float.parseFloat(v_str.substring(2));
lat2 = lat2*10000;
lat2 = lat2/60*10000;
lat2 = lat2/100000000;
//System.out.println("lat2="+lat2);
lat += lat2;
if(strNS.equals("S"))
return ("-"+lat);
else
return (""+lat);
}
catch(Exception e){}
return ("");
}
</code></pre>
<p>CALL : getLat("5224.09960","N");</p>
<p>OUTPUT: 52.40165999730428</p>
<p><strong>function in PHP</strong></p>
<pre><code>$deg_coord = '5224.09960';
$lat = (int)(substr($deg_coord,0,2));
$lat2 = (substr($deg_coord,2));
$lat2 = $lat2*10000;
$lat2 = $lat2/60*10000;
$lat2 = $lat2/100000000;
echo $lat += $lat2;
exit;
</code></pre>
<p>OUTPUT:52.40166</p>
| java php | [1, 2] |
1,560,357 | 1,560,358 | How to send Push Notification Message to iPhone using Java? | <p>I want to send a Push Notification message to particular iPhone device using Java.</p>
<p>I dont have any idea how to do this.</p>
<p>I have googled on this, they have suggested to use "PayLoad" class but not getting this class from any jar files.</p>
<p>Please anybody can guide me to send the push notification message to iPhone suing Java? </p>
| java iphone | [1, 8] |
763,780 | 763,781 | Hide and Show Label and Button | <p>I have 2 labels and 2 text boxes and 1 buttons displayed.</p>
<p>When the page loads the <code>Name</code> and <code>Button</code> (will be initially displayed). Later when i click on the <code>Button</code> i need to display the <code>age</code> <code>label</code> and <code>textbox</code>. How can i do this ?</p>
<pre><code><ol>
<li>
<asp:Label runat="server" AssociatedControlID="Name">
User name
</asp:Label>
<asp:TextBox runat="server" ID="Name" Width="167px" />
<asp:Button ID="Button1" runat="server" Text="Button" />
</li>
<li>
<asp:Label runat="server" AssociatedControlID="age">age</asp:Label>
<asp:TextBox runat="server" ID="age" TextMode="age" Width="240px" />
</li>
</ol>
</code></pre>
<p>code for button press</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
}
</code></pre>
| c# asp.net | [0, 9] |
11,735 | 11,736 | Passing password in session | <p>I am trying to set the password <code>textbox</code> back to the text entered before a <code>checkbox</code> is and has <code>AutuoPostback</code>.</p>
<pre><code>Session["passwordText"] = txt_Password.Text;
</code></pre>
<p>This is on my pageLoad and then I have tried to add(below) in my <code>CheckedChanged</code> but it says Method <code>Add</code> has 2 parameters and is invoked with 1 argument? What should i include with <code>passWord</code>.</p>
<pre><code>var passWord = Session["passwordText"].ToString();
txt_Password.Attributes.Add(passWord);
</code></pre>
| c# asp.net | [0, 9] |
1,412,322 | 1,412,323 | Generate DropDownList from code behind | <p>Hi I am generating a DropDownList in my code behind file </p>
<pre><code> protected DropDownList CountryList()
{
DropDownList ddl = new DropDownList();
XDocument xmlDoc = XDocument.Load(Server.MapPath("Countries.xml"));
var countries = from country in xmlDoc.Descendants("Country")
select new
{
Name = country.Element("name").Value,
};
foreach (var c in countries)
{
ddl.Items.Add(c.Name);
}
return ddl;
}
</code></pre>
<p>I had dreams on then having <%= CountryList() %> on my aspx page. But when I do this it prints the string - "System.Web.UI.WebControls.DropDownList".</p>
<p>Can I make this way of doing it work or do I have to setup a ContentPlaceHolder and then add the DropDownList to the content?</p>
<p>Cheers</p>
| c# asp.net | [0, 9] |
3,688,701 | 3,688,702 | Operators not working? | <p>ok i did according to your suggestion but somewhat it looks amatuerish ha.. cos it repeats the same thing for each percentage group: css and message. I am wondering if there is another way to change it? If not, i am ok with this..</p>
<p>if (69 < percentDiscount && percentDiscount < 101) {</p>
<pre><code> $(this).find("#percentoff").html('&gt; 70% off');
$(this).find("#percentoff").addClass('badge70');
}
else if (49 < percentDiscount && percentDiscount < 70) {
$(this).find("#percentoff").html('&gt; 50% off');
$(this).find("#percentoff").addClass('badge50');
}
else if (29 < percentDiscount && percentDiscount < 50) {
$(this).find("#percentoff").html('&gt; 30% off');
$(this).find("#percentoff").addClass('badge30');
}
else if (19 < percentDiscount && percentDiscount < 30) {
$(this).find("#percentoff").html('&gt; 20% off');
$(this).find("#percentoff").addClass('badge30');
}
</code></pre>
| javascript jquery | [3, 5] |
5,957,838 | 5,957,839 | Jquery - JSON.stringify, array is empty | <p>i hope somebody can help me, the array value is empty in the post. </p>
<pre><code>$(function start() {
c_all = new Array('#div { font-color:#ff0000; border:1px solid #00ff00; }', '#div_2 { font-color:#ff0000; }', '.line2 { font-color:#00ffff; }');
css(c_all);
});
function css(x) {
values = new Array();
for (i = 0; i < x.length; i++) {
c0_selector = '' + x[i].match(/^.*{/) + '';
c0_selector = c0_selector.replace(/\s*/g, '');
c0_selector = c0_selector.replace(/{/, '');
x[i] = x[i].replace(/^.*{/, '');
x[i] = x[i].replace(/}/, '');
c0_arr = x[i].split(';');
values['' + c0_selector + ''] = new Array();
$('#log').append(''+c0_selector+'<br />');
for (i2 = 0; i2 < c0_arr.length; i2++)
{
values[''+c0_selector+''][i2] = c0_arr[i2].split(':');
$('#log').append(''+c0_arr[i2]+'<br />');
}
}
$.ajax({
type: 'post',
data: JSON.stringify(values),
contentType: 'application/json',
dataType: 'json'
});
}
</code></pre>
<p>working example -> <a href="http://www.jsfiddle.net/V9Euk/448/">http://www.jsfiddle.net/V9Euk/448/</a></p>
<p>Thanks in advance!
Peter</p>
| javascript jquery | [3, 5] |
5,624,809 | 5,624,810 | Which one is better performance to use for .click in the below list | <blockquote>
<p>Please vote for me which one in the below list is better?</p>
</blockquote>
<p>I have HTML:</p>
<pre><code><div id="container">
<button class="btn">Click Here 1</button>
<button class="btn">Click Here 2</button>
<button class="btn">Click Here 3</button>
<button class="btn">Click Here 4</button>
<button class="btn">Click Here 5</button>
<button class="btn">Click Here 6</button>
<!-- A lot of buttons -->
<button class="btn">Click Here n - 2</button>
<button class="btn">Click Here n - 1</button>
<button class="btn">Click Here n</button>
</div>
</code></pre>
<p>And Javascript with jQuery is:</p>
<h3>Case 1.1:</h3>
<pre><code>$(".btn").click(function(e){
//@todo something here
});
</code></pre>
<h3>Case 1.2:</h3>
<pre><code>var doSomething = function(e)
{
//@todo something here
}
$(".btn").click(doSomething);
</code></pre>
<h3>Case 2:</h3>
<pre><code>$("#container").click(function(e){
if( $(e.target).is(".btn") )
{
//@todo something here
}
});
</code></pre>
<p>I am confused a litle bit what are different between them?</p>
| javascript jquery | [3, 5] |
5,813,810 | 5,813,811 | Using jquery.SerialScroll how do I force a start on a particular page without effect | <p>Im using the jquery plugin <a href="http://flesler.blogspot.com/2008/02/jqueryserialscroll.html" rel="nofollow">SerialScroll</a>. I want it, when initialised, to start on a particular page (ie a list item n numbers in) without the transition effect. And therafter when next or prev is invoked to scroll with the transition effect.</p>
<pre><code>$('#screen').serialScroll({
target:'#sections',
items:'li', // Selector to the items ( relative to the matched elements, '#sections' in this case )
prev:'img.prev',// Selector to the 'prev' button (absolute!, meaning it's relative to the document)
next:'img.next',// Selector to the 'next' button (absolute too)
axis:'xy',// The default is 'y' scroll on both ways
navigation:'#navigation li a',
duration:700,// Length of the animation (if you scroll 2 axes and use queue, then each axis take half this time)
cycle: false,
onBefore:function( e, elem, $pane, $items, pos ){
e.preventDefault();
if( this.blur )
this.blur();
$('.prev').add($('.next')).show();
if( pos == 0 )
$('.prev').hide();
else if( pos == $items.length-1 )
$('.next').hide();
},
onAfter:function( elem ){
}
});
</code></pre>
<p>I suppose I could put it another way how do I suspend /resume the duration variable while I run</p>
<pre><code>$('#sections').trigger('goto',[page_index]);
</code></pre>
<p>Thanks in advance</p>
| javascript jquery | [3, 5] |
2,489,433 | 2,489,434 | Mapping the event position to the text position in non text-fields | <p>Is there a way to map an event such as a click-event on this element</p>
<pre><code><div>Just normal text</div>
</code></pre>
<p>to the position in the contained text ( "You just clicked the 6th character", when hitting the 'n' )?</p>
| javascript jquery | [3, 5] |
4,133,952 | 4,133,953 | Hilighting div tag in Masterpage on redirection to content page | <p>I have a link in Master page within a div tag. I want to highlight the div when I am clicking the link, in order to redirect to some content page. </p>
<p><strong>I have written the following code:</strong></p>
<pre><code><li>
<div id="div_test" runat="server">
<asp:LinkButton ID="lnk_test_menu" Font-Underline="false"
ForeColor="Black" runat="server" Text="Test Link"
CausesValidation="false" onclick="lnk_test_menu_Click1" >
</asp:LinkButton>
</div>
</li>
</code></pre>
<p><strong>Code in the cs page:</strong></p>
<pre><code> protected void lnk_test_menu_Click1(object sender, EventArgs e)
{
div_test.Attributes.Add("class", "testSelected");
Response.Redirect(Test.aspx");
}
</code></pre>
<p>The div in the master page is not being selected on redirection. </p>
<p>Could anybody help me on this?</p>
| jquery asp.net | [5, 9] |
5,952,164 | 5,952,165 | Determine final size of element wrapper before jQuery effect (e.g. slideDown) | <p>Can anyone tell me if (and how) jQuery determines the final size of an element that is animated with the built-in effects functions like <code>slideDown()</code>?</p>
<p>To give a practical example <a href="http://jsfiddle.net/GgCLa/" rel="nofollow">http://jsfiddle.net/GgCLa/</a>:</p>
<p>CSS:</p>
<pre><code>#wrapper { display: block; }
#wrapper p {
display: none;
}
#wrapper p:first-child {
display: block;
}
</code></pre>
<p>HTML:</p>
<pre><code><div id="wrapper">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur et quam urna, ultrices commodo odio.</p>
<p>Nulla at tellus augue, varius dignissim nunc. Donec mattis
est quis sem iaculis scelerisque. .</p>
</div>
<input type="button" name="button" id="button" value="Clickey" />
</code></pre>
<p>JAVASCRIPT:</p>
<pre><code>$(document).ready(function() {
$("input").toggle(
function() { $("#wrapper p:last").slideDown("fast"); },
function() { $("#wrapper p:last").slideUp("fast"); }
);
});
</code></pre>
<p>Is there a way to determine the final height of the wrapper before the animation has completed?</p>
| javascript jquery | [3, 5] |
4,526,285 | 4,526,286 | Repeatedly adding image size before the file extention | <p>I'm having a problem and I can't seem to find the reason for the issue I'm a little new to both JavaScript and jQuery. </p>
<p>but by using the below and then resize the page instead of simply adding the size of the image to the image src is is added repeatedly e.g responsive_Course_2_2_large_large_large_large_large_large.png instead of Responsive_Course_2_2_large.png</p>
<pre><code>$(window).resize(function () {
if ($(window).width() < 600) {
if (ImageSize != 'stand') {
$.each(imgIds, function (index, value) {
Image_src = $('#' + value).attr('src');
Image = Image_src.replace(/(\.[\w\d_]+)$/i, '$1');
$('#' + value).attr('src', Image);
$('#' + value).attr("ImageSize", 'stand');
});
$('#PageContentRow').attr('style', 'background-image:Url(../img/' + pageID + '_back.png)');
}
}
else if ($(window).width() > 960 && $(window).width() < 1280) {
if (ImageSize != 'large') {
$.each(imgIds, function (index, value) {
Image_src = $('#' + value).attr('src');
ImageLarge = Image_src.replace(/(\.[\w\d_]+)$/i, '_large$1');
$('#' + value).attr('src', ImageLarge);
$('#' + value).attr("ImageSize", 'large');
});
$('#PageContentRow').attr('style', 'background-image:Url(../img/' + pageID + '_back_Large.png)');
}
}
else {
$.each(imgIds, function (index, value) {
Image_src = $('#' + value).attr('src');
Image = Image_src.replace(/(\.[\w\d_]+)$/i, '$1');
$('#' + value).attr('src', Image);
$('#' + value).attr("ImageSize", 'stand');
});
$('#PageContentRow').attr('style', 'background-image:Url(../img/' + pageID + '_back.png)');
}
});
</code></pre>
| javascript jquery | [3, 5] |
2,964,571 | 2,964,572 | Authentication token storage | <p>I want to secure every call to my web service via a token.</p>
<p>first the user is authenticated and a authentication token is generated then the token is added to the http runtime and finally the token is then sent to the client (asp.net c# pages)</p>
<p>here is the problem: i want to send the token to every subsequent service call i make. so the question is how do i find out where the token is stored on the client or could i somehow make it store on the client.</p>
<p>any help with be highly appreciated.</p>
| c# asp.net | [0, 9] |
649,128 | 649,129 | Android ProgressDialog delayed before showing up | <p>I'm using the ProgressDialog in android to prevent the user from, say, pressing a button multiple times while a long task is updating the UI. </p>
<p>My problem is that the ProgressDialog does not seem to show up after awhile, as it seems to be another thread. </p>
<p>In my experiment I called this ProgressDialog show() in an EditText's text changed listener. It still allows me to type in multiple characters in a short period before showing up.</p>
<p>Is there a way I can detect that the ProgressDialog has already started?</p>
<p>Edit 1:
This was done on a real device. The code is simply this:</p>
<pre><code> editText.addTextChangedListener( new TextWatcher() {
...
public void onTextChanged(CharSequence s, int start, int before, int count) {
ProgressDialog lock = new ProgressDialog(UIClass.this);
lock.show();
}
...
});
</code></pre>
<p>My first assumption was that this would show the dialog immediately after the first character I type, but when I tested by typing multiple characters in a short period it was still possible, and the locking only starts after the 2nd or 3rd character. I am assuming that this is because the ProgressDialog is another thread. I wish to know how to make it properly lock the UI at the exact point I am interested in.</p>
| java android | [1, 4] |
964,299 | 964,300 | how to add three condition at Jquery | <p>I want to use three condtions in my <code>if</code> statement. Here is my code:</p>
<pre><code><script>
jQuery(document).ready(function() {
var num_one; var num_two; var num_three;
$("#control").attr("disabled", "disabled");
$('#col-1 li').click(function(){ num_one = true; getState();});
$('#col-2 li').click(function(){ num_two = true; getState();});
$('#col-3 li').click(function(){ num_three = true; getState();});
function getState(){
if ((num_one == true) & (num_two == true) & (num_three == true)) {
$("#control").removeAttr("disabled");
}
}
/*$('#col-1 li').click(function(){$("#control").removeAttr("disabled");*/
});
/**$("#enableBtn").click(function() {
$("#clearBtn").removeAttr("disabled");
});**/
</script>
</code></pre>
<p>It was working when I used just two conditions: <code>if ((num_one == true) & (num_two == true))</code> but when I add a third condition it does not work. How can I add three conditions together in an if statement?</p>
| javascript jquery | [3, 5] |
305,923 | 305,924 | performClick not triggering | <p>I am trying to trigger a click on the Carousel. I want that if I press the forward button, it automatically triggers the click on the carousel and then move forward. The manual click (physical touch) is working but performClick() is not. The code is as follows</p>
<pre><code>//************* Forward Button: Select Objects *************
Button forwardButton = (Button)this.findViewById(R.id.ForwardButton);
forwardButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(NewFieldTrip.this, SelectObjects.class);
//ImagePosition = (int)carousel.getSelectedItemId();
carousel.performClick();
i.putExtra("SelectedScene",ImagePosition);
startActivity(i);
}
});
carousel.setOnItemClickListener(new CarouselAdapter.OnItemClickListener(){
@Override
public void onItemClick(CarouselAdapter<?> parent, View view,
int position, long id) {
Toast.makeText(NewFieldTrip.this, "Select Position=" + position, Toast.LENGTH_SHORT).show();
ImagePosition = position;
}
});
</code></pre>
<p>A helping hand would be great :)</p>
<p>EDIT:</p>
<pre><code>public void scrollToChild(int i){
CarouselImageView view = (CarouselImageView)getAdapter().getView(i, null, null);
float angle = view.getCurrentAngle();
if(angle == 0)
return;
if(angle > 180.0f)
angle = 360.0f - angle;
else
angle = -angle;
mFlingRunnable.startUsingDistance(-angle);
}
</code></pre>
| java android | [1, 4] |
1,459,197 | 1,459,198 | Apply a JavaScript function to the parent of the element | <p>I was just refreshing my JavaScript/Jquery skills and I thought of making a basic todo app. I've figured out how to create elements with input from the user via a textbox. All these list elements have a delete task link. I want it such that when a user click on that link it deletes the respective list item.</p>
<p><a href="http://dl.dropbox.com/u/26335627/Projects/Todo%20App/index.html" rel="nofollow">http://dl.dropbox.com/u/26335627/Projects/Todo%20App/index.html</a></p>
| javascript jquery | [3, 5] |
231,559 | 231,560 | How to add a class on the right column div when no content is displayed on the left column | <p>I have the following example:</p>
<p><a href="http://jsfiddle.net/zidski/4wJJf/1/" rel="nofollow">http://jsfiddle.net/zidski/4wJJf/1/</a></p>
<p>So if was to remove the content for the left div and jquery would then add a class to the right div.</p>
<p>How can this be done?</p>
| javascript jquery | [3, 5] |
3,016,728 | 3,016,729 | Hide a div without specificing the id or class | <p>I have been searching on a question like this but I cant find it.</p>
<p>I have structure that looks like this:</p>
<pre><code><div id="productholder@(item.ProductId)" class="productholder">
<img src="@Html.DisplayFor(modelItem => item.Image)" alt="" />
<div class="productinfo">
<h2>@Html.DisplayFor(modelItem => item.Name)</h2>
<p>@Html.DisplayFor(modelItem=> item.Description)</p>
<br />
</div>
<div class="productprice">
<h2>@Html.DisplayFor(modelItem => item.price):-</h2>
<input type="button" value="Ta bort" class="b" data-ProductImageId='@item.ProductImageId'>
</div>
</div>
</code></pre>
<p>What I want to do is that when somebody click on the button that has <code>class="b"</code> the whole div tag should get hidden with <code>.hide()</code> the problem is that I have 10 of these div tags that look the same so I cant specify a div tag, because its important that just the div tag inside the button that i clicked gets hidden.</p>
<p>I guess I need to use parent or something like that?</p>
<p>I have tried the following jquery scripts:</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$(".b").click(function () {
$("div:eq(0)").hide();
});
});
</script>
</code></pre>
<p>But I figure out it wont work beacuse it will hide the whole div wrapper.</p>
<p>Any kind of solution is appreciated!</p>
| javascript jquery | [3, 5] |
55,771 | 55,772 | JavaScript function not working | <p>using string buffer in java i append javascript for example</p>
<pre><code>StringBuffer sb1=new StringBuffer();
sb1.append("<script type=\"text/javascript\">\n function callauto(){ ");
sb1.append(" var get_deci"+i+"=eval("+c_c+ "&&"+splitvalue_text[0]+"=="+d_d+"?true:false);");
sb1.append("if(get_deci"+i+"){ alert(\"ok\");}");
sb1.append("}</script><script>callauto();</script>");
</code></pre>
<p>using ajax i get the stringbuffer and display the stringbuffer using servlet printwriter in browser
but above js function callauto not works value <code>c_c,splitvalue_text[0],d_d</code> are generated dynamically.
if above condition satisfies it returns true then it shows alert. </p>
| java javascript | [1, 3] |
847,660 | 847,661 | How to find file size in javascript or jQuery | <p>I have a fileupload control, I want to validate the size of the file to 50kb before the done button is clicked.</p>
<p>I did some research on the internet and got this code</p>
<pre><code><script>
function A() {
var oas = new ActiveXObject("Scripting.FileSystemObject");
var d = document.a.b.value;
var e = oas.getFile(d);
var f = e.size;
alert(f + " bytes");
}
</script>
</code></pre>
<p>I am using IE9 but this code is not working for me.
I am getting error on the line</p>
<pre><code>var oas = new ActiveXObject("Scripting.FileSystemObject");
</code></pre>
<p>How to solve this error?</p>
| javascript asp.net | [3, 9] |
5,240,366 | 5,240,367 | EditText cropping characters while editing | <p>I'm working on an application for Samsung Galaxy 5 with Android 2.2-update1 that has various EditText fields and I noticed that all EditText fields below the middle of the screen is not repainted correctly when the user is typing: all the characters appear chopped, leaving their half top plain white. I've tested this on other devices and this problem does not happen on them.
Any clues on why this happen and/or any workaround for this for the Galaxy 5?</p>
<p>EDIT: This issue happens with the API Demos that comes with the Android SDK. To reproduce this error execute the demo and then follow: App-> Search-> Invoke Search -> click on App Data and start writing, only the lower half of each character will be rendered on screen.</p>
<p>Thanks!</p>
| java android | [1, 4] |
3,911,284 | 3,911,285 | Parsing using mrss | <p>I'm trying to parse an mrss feed using jquery but am having some difficulty targeting the child element.</p>
<p>Code:</p>
<pre><code>$(xml).find("item").each(function(){
var $item = $(this);
alert($item.find("media\\:thumbnail").text();
});
</code></pre>
<p>MRSS Structure:</p>
<pre><code><media:thumbnail url="http://somewebsite.com/someimage.jpg" />
</code></pre>
<p>UPDATE
The solution $item.find("media\:thumbnail").attr("url") works very well in Firefox but running the code in Chrome reveals an undefined value. Can someone suggest a workaround.</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
2,729,363 | 2,729,364 | Search array for object property then hide first occurence of found object | <p>I have an array of objects that I've created using Javascript. The objects are map layers and have various properties associated. Upon creation they are pushed into an array. Below is a simplified example</p>
<pre><code>var activeLayers = [];
var mapLayer1 = new mapLayer();
mapLayer1.name = 'roads';
mapLayer1.class = 'infrastucture';
mapLayer1.type = 'line';
activeLayers.push(mapLayer1);
var mapLayer2 = new mapLayer();
mapLayer2.name = 'cities';
mapLayer2.class = 'infrastucture';
mapLayer2.type = 'point';
activeLayers.push(mapLayer2);
var mapLayer3 = new mapLayer();
mapLayer3.name = 'counties';
mapLayer3.class = 'boundaries';
mapLayer3.type = 'polygon';
activeLayers.push(mapLayer3);
var mapLayer4 = new mapLayer();
mapLayer4.name = 'zoningDistricts';
mapLayer4.class = 'political';
mapLayer4.type = 'polygon';
activeLayers.push(mapLayer4);
</code></pre>
<p>What I want to do is force my map to not allow more than one layer of type==polygon to be displayed at the same time. I would like to iterate through the array 'activeLayers' and if type==polygon.length > 1 then I would like to remove the oldest from the map. Removing a layer from the map is accomplished with a function of</p>
<pre><code>mapLayer3.hide();
</code></pre>
<p>In the above array mapLayer3 is a polygon and was added before mapLayer4 and would be hidden from the map. </p>
<p>Thanks for taking a look. </p>
| javascript jquery | [3, 5] |
109,063 | 109,064 | If in jquery does not work | <p>I wrote this script, but it doesn't work in way I wanted:</p>
<pre><code>$(document).ready(function(){
if ($('#map_container').find('#point').length == 0 ) {
$("#map_container").click(function (e) {
var relativeXPosition = (e.pageX - this.offsetLeft);
var relativeYPosition = (e.pageY - this.offsetTop);
//alert('left: '+relativeXPosition+', top: '+relativeYPosition);
$("#map_container").append('<img id="point" src="<?=url::base();?>images/city.png" alt="" />');
$("#point").css({ top: (relativeYPosition) + 'px', left: relativeXPosition + 'px', position: 'absolute' })
});
}
});
</code></pre>
<p>It should put only one img with id="point", but when I click map_container two times I get two img's, why this if does not work?</p>
| javascript jquery | [3, 5] |
4,975,607 | 4,975,608 | jquery calendar issue | <p>I have a start and stop textbox field which triggers jquery calendar. I want to know whether it is possible to achieve when I select a date on the start, will populate the same on the stop?</p>
| javascript jquery | [3, 5] |
2,334,698 | 2,334,699 | javascript return function's data as a file | <p>I have a function in javascript called <code>"dumpData"</code> which I call from a button on an html page as <code>**onlick="dumpData(dbControl);"*</code> What it does is return an xml file of the settings (to an alert box right now). I want to return it to the user as a file download. Is there a way to create a button when click will open a file download box and ask the user to save or open it? (sorta of like right-clicking and save target as)...</p>
<p>Or can it be sent to a php file and use <code>export();?</code> Not sure how I would send a long string like that to php and have it simple send it back as a file download.</p>
<p>Dennis</p>
| php javascript | [2, 3] |
3,122,888 | 3,122,889 | Opening ASP.Net pages in Java application | <p>Currently we have a Java application and .Net application running in two servers.
We have a requirement to call a set of pages developed in Asp.Net into a Java application. </p>
<p>Follows the brief explanation:
1. Suppose there is a running java application.
2. On click of a link (Say "Edit Profile") from Java app, a set of pages supposed to start from ASP.Net.
3. On this call, some data need to be passed from Java app to Asp.Net app to authenticate and start the *Task (set of pages doing a particular task).</p>
<p>Your inputs for the below will be much appreciated.
1. How do we pass the data from Java to .Net in a secured manner (Other than Query String) and open the .aspx page after authentication. Means how do we know that the calling site (in this case Java app) is authorized to access the set of pages from Asp.Net app?
2. How to return the *Task result to Java app back from .Net.</p>
| java asp.net | [1, 9] |
1,351,067 | 1,351,068 | finding an HtmlGenericControl | <pre><code> System.Web.UI.HtmlControls.HtmlGenericControl div = (System.Web.UI.HtmlControls.HtmlGenericControl)pnl.Controls[0].FindControl("divMessage");
</code></pre>
<p>i am trying to find <code>divMessage</code> somethign like the above but i am getting null...:</p>
<p>below is how my div resides.</p>
<pre><code> <mobile:Panel ID="pnl" Runat="server">
<mobile:DeviceSpecific ID="device" runat="server">
<ContentTemplate>
<div id="divMessage" runat="server">test.....</div>
</ContentTemplate>
</mobile:DeviceSpecific>
</mobile:Panel>
</code></pre>
| c# asp.net | [0, 9] |
389,353 | 389,354 | Jquery Auto Complete in asp.net | <p>i want to use jquery ui auto complete plugin in asp.net.
this is my behind code :</p>
<pre><code> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim locations As String() = New String() {"Las Vegas", "Los Angeles", "Tampa", "New York", "s", "sss"}
Dim jsArray As String = GetJSArrayForVBArray(locations)
Me.ClientScript.RegisterArrayDeclaration("usernames", jsArray)
End Sub
Private Function GetJSArrayForVBArray(ByVal vbArray As String()) As String
Dim myResult As New StringBuilder()
For Each item As String In vbArray
With myResult
.Append(",'" & item & "'")
End With
Next
If (myResult.Length > 0) Then
Return myResult.ToString().Substring(1)
Else
Return ""
End If
End Function
</code></pre>
<p>this is html code :</p>
<pre><code> <script type="text/javascript">
$(function () {
var availableTags = new Array();
$("#tags").autocomplete({
source: availableTags
});
});
</script>
<label for="tags">Tags: </label>
<input id="tags" />
</code></pre>
<p>what is the problem?
it does not work.
when i filling array in aspx page it works but when i want to fill in behind code not.
thanks.</p>
| asp.net jquery | [9, 5] |
1,400,253 | 1,400,254 | how to turn a function from function(element) syntax to $(element).function() syntax | <p>I have a function that accepts the element it needs to operate on as a parameter <code>element</code></p>
<pre><code>function changeColor(element){
$(element).find('.middleBox').each(function(){
$(this).//do some stuff that does not matter now;
});
}
</code></pre>
<p>and I call it this way </p>
<pre><code>changeColor($(document)); //this applies it to the whole document
changeColor($('#sectionOne')); //this applies it to only part of the document
</code></pre>
<p>I want to change it from the format where it accepts its object as a param to this format. How do I do it</p>
<pre><code>$('#sectionOne').changeColor();
$(document).changeColor();
</code></pre>
| javascript jquery | [3, 5] |
2,376,171 | 2,376,172 | Update ASCX from ASPX using delegates | <p>I am trying to separate all DB calls required by ASCX.cs to call only from ASPX.cs, I am trying it with delegate and events.</p>
<p>my ASCX.cs has </p>
<pre><code>namespace x.xx.xy.xyy.xyyy
{
public partial class PaymentItem : UserControlBase
{
public delegate void Handler(Dictionary<string, string> keyvalues);
public event Handler aPICall;
}
}
</code></pre>
<p>my ASPX.cs has</p>
<pre><code>namespace x.xx.xz.xzz.xzzz
{
public partial class PaymentItemPopUp
{
protected global::x.xx.xy.xyy.xyyy.PaymentItem ucPaymentItem;
protected void Page_Load(object sender, EventArgs e)
{
this.ucPaymentItem.aPICall += new PaymentItem.Handler(ServiceAPICAll);
}
protected void ServiceAPICAll(Dictionary<string, string> keyvalues){
}
}
}
</code></pre>
<p>I am getting 'Object reference not set to an instance of an object' when compiler hits the following line
this.ucPaymentItem.aPICall += new PaymentItem.Handler(ServiceAPICAll);</p>
<p>I suppose the issue from the following line </p>
<p>protected global::x.xx.xy.xyy.xyyy.PaymentItem ucPaymentItem;</p>
<p>any idea?</p>
| c# asp.net | [0, 9] |
2,821,814 | 2,821,815 | jQuery Singleton | <p>I have something like in a file say test.js:</p>
<pre><code>(function($){
$.test= function(){
alert('test');
}
})(jQuery);
jQuery.test();
</code></pre>
<p>Now if test.js is loaded twice in my page i.e. src=test.js in two different locations, it gives alert twice. I want it to be like a singleton. Any ideas on how to achieve this?</p>
| javascript jquery | [3, 5] |
1,038,186 | 1,038,187 | Which Form of Java should I learn before getting into Android Developing? (J2ME, J2SE, J2EE, servlet adn etc.) | <p>I want to take Java course for developing Android applications. I have all the necessary tools. But wanna ask before proceeding for course, Which Form of Java should I learn before getting into Android Developing? (J2ME, J2SE, J2EE, servlet adn etc.). What are the things which I should learn in that form?</p>
| java android | [1, 4] |
3,260,188 | 3,260,189 | How to reset phone default launcher programatically? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6761553/clear-application-defaults">clear application defaults</a> </p>
</blockquote>
<p>I built a home screen replacement app. The first time users click home after installing it they see a window with all home screen apps and can choose one to be the default app for the home intent.</p>
<p>Once this action is done, to my knowledge the only way to reset launchers is to go to the app settings and click clear all data. It's not very easy to do and I don't want my users to delete all my app's data just to remove it as a launcher.</p>
<p>How can I reset launchers programatically so I add this code to an onclick?</p>
| java android | [1, 4] |
118,739 | 118,740 | Best way of getting a a series of custom fields into an array? | <p>I've a series of custom fields attached to certain pages. These fields are named slide1, slide2, side3, slide4, slide5, slide6. </p>
<p>These are images which are going to be used as a slideshow (I'm using jflow slider for this - <a href="http://net.tutsplus.com/articles/news/using-the-wonderful-jflow-plugin-screencast/" rel="nofollow">http://net.tutsplus.com/articles/news/using-the-wonderful-jflow-plugin-screencast/</a> )</p>
<p>(I don't want to call them all 'slide' and put them in an custom field array because there may be captions for each slide, and when both slides and captions are custom field arrays, the order may not match up)</p>
<p>Now, sometimes there will be only 3 slides entered (slide1 to slide3), and sometimes all 6 slides (slide1 to slide6).</p>
<p>Not being very PHP savvy, I wonder what the best way best way to stick these custom fields into a PHP array, and then iterate thru them to print out the code, which looks a bit like the below?</p>
<pre><code><div id="slides">
<div><img src="qwerty.jpg">
</div>
<div><img src="foo.jpg">
</div>
<div><img src="test.jpg">
</div>
</div>
</code></pre>
<p>The code to print, for instance slide1's image, would be something like:</p>
<pre><code><img src="<?php echo wp_get_attachment_url($slide1); ?>">
</code></pre>
| jquery php | [5, 2] |
3,637,802 | 3,637,803 | How do I allow to check only one checkbox out of four in UserControl? | <p>I have created a User Control with 4 check boxes(server control).I want to allow to check only one checkbox out of four.</p>
<p>The user control is loaded on page dynamically.I page may have multiple same UserConrol.</p>
<p>How do I do it using Jquey or Javascript?</p>
| javascript asp.net jquery | [3, 9, 5] |
1,110,059 | 1,110,060 | Using column two radio buttons in DataGrid | <p>I created two template column in DataGrid.I assigned radio buttons to those columns.I created single selection by calling a javascript function for the first radio button.
But,I cant't do single selection by calling a javascript function for the second radio button.Also,I can't run independently of each other.</p>
<pre><code> <asp:TemplateColumn HeaderText="">
<ItemTemplate>
<input type="radio" runat="server" id="rd1" onclick="SelectOne(this,'DataGrid')" VALUE="rd1"
NAME="RadioGroup1" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<input type="radio" runat="server" id="rd2" onclick="test(this,'DataGrid')" VALUE="rd2"
NAME="RadioGroup2" />
</ItemTemplate>
</asp:TemplateColumn>
</code></pre>
<p>Javascript Code:</p>
<pre><code> <script language="javascript">
function SelectOne(rd1,DataGrid)
{
all=document.getElementsByTagName("input");
for(i=0;i<all.length;i++)
{
if(all.type=="radio")
{
var count=all.id.indexOf(DataGrid+'__ctl');
if(count!=-1)
{
all.checked=false;
}
}
}
rd1.checked=true;
}
</script>
</code></pre>
| javascript asp.net | [3, 9] |
3,375,671 | 3,375,672 | Javascript Accordion | <p>I have a strange bug I cant quite figure out, I've built an accordion slider that shows short content intially and when clicked then shows the long content. </p>
<p>At any one time only 1 tab should be open but when 2 opens the short content dissapears. </p>
<p>ive attached a fiddle, can anybody see whats wrong? Is it because they all shgare the same class? </p>
<p><a href="http://jsfiddle.net/2v44c/" rel="nofollow">http://jsfiddle.net/2v44c/</a></p>
| javascript jquery | [3, 5] |
5,370,493 | 5,370,494 | Get info about computer to which Android device is connected | <p>I have the problem. When Android device connected to computer through USB, I need to get information about this computer(such IP, Host Name or something like this). Is it really to get?</p>
<p>Thanks.</p>
| java android | [1, 4] |
2,260,591 | 2,260,592 | Changing value of custom select option - Javascript | <p>I need assistance changing the value of a custom-select box. I cannot use JQuery because I already have a change() function hooked up to it.</p>
<p>How can I change the value of the select box in Javascript?</p>
<p>This is my custom select function:</p>
<pre><code>$.fn.customSelect = function() {
if ( $(this).length ) {
$(this).find('select').attr('selectedIndex',-1).change(function() {
var optionText = $(this).find('option:selected').text();
$(this).siblings('label').text(optionText)
});
}
</code></pre>
<p>};</p>
<p>I have tried:</p>
<pre><code>var field = document.getElementById('test5');
field.value = '2';
field.focus();
</code></pre>
<p>This will select the option, but it will not show up as the default option (hopefully you guys can understand this haha).</p>
<p>Any possible solutions?</p>
| javascript jquery | [3, 5] |
2,956,225 | 2,956,226 | Swapping images using jQuery in sequence | <p>I'm trying to use jQuery to swap the background image of an element in set sequence to create an animation where each image is a different frame and it should iterate through the frames until it reaches the last frame and then return to the beginning again.</p>
<p>My code is as follows:</p>
<pre><code>$spinner_currentFrame = 1;
function UpdateSpinner(target, numFrames)
{
$spinner_currentFrame = ($spinner_currentFrame) + 1;
if($spinner_currentFrame > numFrames) {
$spinner_currentFrame = 1;
}
$(target).css("background-image", "frame-" + $spinner_currentFrame + ".jpg");
}
$(document).ready(function()
{
$spinner_loadingAnim = setInterval(function ()
{
UpdateSpinner('#spinner', 300);
},
24);
});
</code></pre>
<p>The reason I'm not using a sprite is because I have a few hundred images and the frames have been exported from Flash like <code>frame-1.jpg, frame-2.jpg</code>. However my code isn't reporting any errors but the background image isn't been added... Any ideas? Suggestions?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
231,610 | 231,611 | Nothing happens when using Regex in asp.net | <p>Regex really does nothing if i run this code:
input contains: "geeeeekdldn" </p>
<pre><code>Regex.Replace(input, @"g(.|\n)*?n", string.Empty);
</code></pre>
<p>normally after regex the value of input is "" but i still get "geeeeekdldn"
can someone help me please</p>
| c# asp.net | [0, 9] |
2,117,580 | 2,117,581 | Simulate a document.body click event | <p>I am having a big of an issue.
I have some third party js includes and they popup some info on a button click, that is in an iframe. Of course, I don't have access to this iframe. But the 3rd party captures clicks and closes the iframe popup. So the behaviour is like so -</p>
<p>I am a user, I click on this "3rd party button, an iframe popups up anchored bottom right". Now, if click anywhere on the main parent page (my page), the iframe closes.</p>
<p>Here is the problem. I have some custom form fields/spans etc.... in which I capture the clicks before they bubble up so the document.body never get that "click".</p>
<p>How can I fake this out? I tried "mousedown" and that seems to propagate up. So I then said something like:</p>
<pre><code>jQuery(document.body).mousedown(function(){
jQuery(document.body).click();
})
</code></pre>
<p>so, no matter what is mousedown, I try to say there is a click happening. BUT that doesn't work. Not sure why? If I attach that click onto a div and alert - it alerts, but perhaps "natively" it isn't the same.</p>
<p>Any ideas of to truly simulate a body click event when/if the element clicked on has had its native clicked event captures before it can bubble up?</p>
<p>EDIT: I have tried various things.
ie:</p>
<pre><code><div id="captureclick"></div>
<script>
jQuery(document.body).mousedown(function(){
jQuery("#captureclick").click();
})
</script>
</code></pre>
<p>I also tried:
jQuery's trigger function trigger('click');</p>
<p>Not working. I haven't tried using a button as the "click traget", yet.
Thanks.</p>
| javascript jquery | [3, 5] |
1,184,199 | 1,184,200 | Android: Javascript to rotate an image using Angle | <p>I'm creating one application in android to rotate an image using angle in html file.
I need JavaScript to rotate the single image in html page. Could anybody post the code please.</p>
<p>My code is </p>
<pre><code><div>
<img id="Rose" src="Rose.jpg" style="margin:20px 80px;align:left"></img>
</div>
</code></pre>
| javascript android | [3, 4] |
3,333,452 | 3,333,453 | Change font-size on mouse over, revert to original on mouse leave | <p>I'm trying to write a function that changes the font-size of an element when the mouse enters it, and revert it back to its original font-size when the mouse leaves it. This is what I have:</p>
<pre><code> $(".month").hover(function(){
var size = $(this).css("font-size");
$(this).stop().animate({
fontSize: start_font + font_off,
opacity: '1'
}, 200);
},function(){
$(this).stop().animate({
fontSize: size,
opacity: '1'
}, 200);
});
</code></pre>
<p>It changes the font size on mouse in, but when the mouse leaves, it just stays the same size. (I did an alert(size) after the font-size change, and it holds the correct value.) What am I doing wrong here?</p>
| javascript jquery | [3, 5] |
1,242,576 | 1,242,577 | Android for Dummies code error | <p>In <em>Android app Development for Dummies</em> and I am getting an error after the last bit of code.</p>
<blockquote>
<p>The method <code>setListAdapter(ArrayAdapter<String>)</code> is undefined for the type <code>ReminderListActivity</code> </p>
</blockquote>
<p>The code is as follows:</p>
<pre><code>package com.dummies.android.taskreminder;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class ReminderListActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.reminder_list);
String[] items = new String[] { "Foo", "Bar", "Fizz", "Bin"};
ArrayAdapter<String> adapter =
new ArrayAdapter<String>(this, R.layout.reminder_row, R.id.text1, items);
setListAdapter(adapter);
}
}
</code></pre>
| java android | [1, 4] |
541,342 | 541,343 | Anyone know of javascript for this drop down navigation? | <p>I'm a beginner to web design, does anyone know of a script that has this EXACT drop down navigation style?</p>
<p><a href="http://behance.vo.llnwd.net/profiles4/172375/projects/4109265/b262ce1df694cced3f3fa5fe3cb8dc97.jpg" rel="nofollow">http://behance.vo.llnwd.net/profiles4/172375/projects/4109265/b262ce1df694cced3f3fa5fe3cb8dc97.jpg</a></p>
| javascript jquery | [3, 5] |
5,226,474 | 5,226,475 | JavaScript window.location navigation fails in Android WebView | <p>I've decided to develop an Android app using HTML and jQuery, since I'm more comfortable with those technologies.</p>
<p>I have a situation where when a user clicks a button in the app, some JavaScript code is executed, and then the user is navigated to a new (locally stored) page. This works fine in my browser, but the navigation fails when I run it in Android. I've done some test to verify that JavaScript is working properly.</p>
<pre><code>$('li').live( 'click', function() {
localStorage.setItem('someData', JSON.stringify(data_containaer));
window.location = './quiz.html';
});
</code></pre>
<p>Any help appreciated, thanks!</p>
| android jquery | [4, 5] |
3,935,928 | 3,935,929 | jQuery keyup value of input | <p>i need to display value of <code><input></code> into the <code><span></code> and when label become empty, change value of span to "Video title". But always i type something into the <code><input></code> and then delete it, the <code><input></code> still have "" value so <code><span></code> display nothing. Thanks for help. (And sorry for my bad english) </p>
<p>Here is my code:</p>
<pre><code>$("#newVideoName").keyup(function(){
var newVideoName = $("#newVideoName").val();
if(newVideoName == ""){
$("#newVideoNameLabel").html("Video title");
}
});
<input type="text" id="newVideoName">
<span id="newVideoNameLabel"></span>
</code></pre>
| javascript jquery | [3, 5] |
4,616,324 | 4,616,325 | check if value exists in mulitdimensional array and return boolean | <p>I have seen many posts about searching nested arrays in javascript but none of them have a way to tell if an item does not exist in the array.</p>
<p>this may sound confusing so here are some examples:</p>
<p>I have 2 arrays <code>oldArray</code> and <code>newArray</code></p>
<p>structured like this:</p>
<pre><code>array(
[0]=>array([name]:"name"
[location]:"location")
[1]=>array([name]:"name2"
[location]:"location2")
)
</code></pre>
<p>both arrays are structured this way.</p>
<p>I need to be able to know which names exist in the old array and not in the new and vice versa.</p>
<p>here is what I have tried:</p>
<pre><code> var name= oldArray[key]['name'];
for (var key in oldArray) {
for(var i= 0, len = newArray.length; i < len; i++){
if(newArray[i]['name'] == name){
//push to array
}
else{
//push to different array
}
}
}
</code></pre>
<p>this way I will have an array that contains all names that exist in both arrays and an array that only contains names that exist in the oldArray..</p>
<p>this doesn't seem to work because it is a 1 to 1 comparison. the first array is correct but the array that should only contain the names that exist in the old array is not correct.</p>
| javascript jquery | [3, 5] |
2,025,441 | 2,025,442 | jquery hide image then fadein | <p>I've not any experience with jquery or java script - sorry!</p>
<p>I have an aspx page with a flash animation. If flash is not available then it displays a static image instead. I'd like the image to fade in. Currently this doesn't work. I've even tried just hiding the image using $(imgConnect).hide(); but that doesn't work either! The page is in a web app and I'm developing in VS 2010. I did add some sample jquery in another page of the same web app and that worked ok, using the same jquery library reference.</p>
<p>Can anyone please help?</p>
<pre><code><div id="flash">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="197" id="myFlashContent">
<param name="movie" value="intro.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="intro.swf" width="600" height="197">
<!--<![endif]-->
<img id="imgConnect" src="images/letsconnect.png" alt="Let's Connect" title="Let's Connect" />
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
$("imgConnect").hide().fadeIn("slow", function () { });
</script>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</code></pre>
| jquery asp.net | [5, 9] |
5,160,070 | 5,160,071 | Fingertip drawing applications on Android? | <p>I'm a new user to this interesting forum! </p>
<p>I want start developing an application for android and before starting i want learn about some android features... </p>
<p>The first android feature is how to correlate finger motion on the screen with java... </p>
<p>Are there any source code examples that show how to draw with your finger on an android screen? </p>
<p>Can you suggest a good place for me to download an example? </p>
<p>thanks</p>
| java android | [1, 4] |
421,886 | 421,887 | Changing style of context menu in Android | <p>In one Android activity I have added a context menu to an <code>ImageView</code> with only one menu item: 'Close' (in order to hide the image).
However, the context menu does not look precisely nice when shown, expanding a big white rectangle occupying almost all the wide of the screen. Is there a way to reduce the size of this rectangle to cover only the word 'Close'?. This is my main question, but any pointer to how to change other styles of the context menu will be appreciated (e.g., the background color, or the text font/color). Thanks !</p>
| java android | [1, 4] |
818,296 | 818,297 | XMLHttpRequest cannot load file. Origin null is not allowed by Access-Control-Allow-Origin | <pre><code> $.getJSON('test1.json', function(data)
{
for (i in data.conferences) {
var item = data.conferences[i];
array1.push({
cid:item.id,
confName: item.cname,
confStart:item.start
}); }
});
</code></pre>
<p>I use the function for getting values from java to jquery. In chrome and opera shows same error, but it works on IE and mozilla.<br>
Give me a solution for that please.</p>
<blockquote>
<p>XMLHttpRequest cannot load file:///C:/Users/winnova1/Desktop/tree/conferences/test1.json. Origin null is not allowed by Access-Control-Allow-Origin.<br>
Uncaught TypeError: Cannot read property 'conferences' of null </p>
</blockquote>
| javascript jquery | [3, 5] |
5,256,499 | 5,256,500 | Using dropzone.js in asp.net | <p>Since few days i m trying to implement multiple file upload with drag and drop interface.
I have searched a lot and at last found my exact requirement from
<a href="http://www.dropzonejs.com/" rel="nofollow">http://www.dropzonejs.com/</a></p>
<p>I tried same steps from above site.
but, I am unable to implement this dropzone functionality in my aspx page.</p>
<p>anyone please help me.</p>
<p>Thanks advance</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
4,566,287 | 4,566,288 | in override page_load, additional part should before or after base.OnLoad(e)? | <p>I inherit a basepage and override its method page_load,do sth myself in it,what I want to ask : the method I wrote should before base.OnLoad(e) or after it,which is better ? any difference between different location?</p>
<pre><code>protected override void OnLoad(EventArgs e)
{
this.GenerateIEIcon();
this.GenerateHeader();
this.GenerateJavascript();
base.OnLoad(e);
}
</code></pre>
<p>or</p>
<pre><code> protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
this.GenerateIEIcon();
this.GenerateHeader();
this.GenerateJavascript();
}
</code></pre>
| c# asp.net | [0, 9] |
147,392 | 147,393 | Turn camelCaseWords from data attribute into "Camel Case Words" | <p>I have a set of links with custom HTML5 data attributes like this one: <code>data-test="justExample"</code></p>
<pre><code><a href="#" data-test="somethingSpecial">
This should output "Something Special"
</a>
</code></pre>
<p>I want to return this value as <code>"Just Example"</code> instead of "<code>justExample"</code>.</p>
<p>Feel free to edit <a href="http://jsfiddle.net/28NpS/" rel="nofollow">this jsfiddle</a> I created.</p>
| javascript jquery | [3, 5] |
3,202,065 | 3,202,066 | ASP.Net, populate grid record by record | <p>I have a GridView on the page and some search option on top of the page and a search button,
When user click Search button, get first record and bind the grid and show to the user.
Now start getting remaining records (5 at a time) and add to the grid until entire search result.
Is that possible with asp.net and jQuery, If yes, please suggest me how can I achieve it.</p>
| jquery asp.net | [5, 9] |
4,248,084 | 4,248,085 | Displaying label control depending on condition | <p>I have three pages on my site. Page 1 is home page. When user visits the site, i display label control to user in Page 1. When the same user goes to page 2 , 3 and returns back to page 1, i do not want the label to show again. How can i do this?</p>
| asp.net jquery | [9, 5] |
4,691,049 | 4,691,050 | Javascript calendar not working | <p>My JavaScript calender is working in IE but it is not working in Mozilla.</p>
<p>My code:</p>
<pre><code> <table>
<tr style="height: 5px;">
<td>
<asp:TextBox ID="txtBorderedDate" runat="server" CssClass="TextBoxMandatory" Enabled="false"></asp:TextBox>
</td>
<td class="FieldButton_bg" style="height: 5px;">
<a onclick="javascript:showCalendarControl(ctl00_SaralConetentPlaceHolder_txtBorderedDate);" href="#">
<img src="../Images/iconCalendar.png" style="width: 20px; height: 20px; vertical-align: bottom;" border="0" />
</a>
</td>
</tr>
</table>
</code></pre>
| asp.net javascript | [9, 3] |
3,318,568 | 3,318,569 | jQuery on list item hover, show delete button for that individual item | <p>Below is a preview of what I have:</p>
<hr>
<p><img src="http://i.stack.imgur.com/RiF2B.jpg" alt="enter image description here"></p>
<hr>
<p>On the right is when I hover. What I want is for the delete icon to only show for that hover item.</p>
<pre><code><script>
$(document).ready(function(){
$(".removeService").hide();
// Deleting an Individual Service
$("#dashboard ul li span").hover( function() {
$(".removeService").show();
});
});
</script>
</code></pre>
<p>This is probably a very simple fix, but if anyone could point me in the right direction I would really appreciate it.</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
3,077,236 | 3,077,237 | how to get parameter like mysite.com/myaction/#someanchor with php and javascript | <p>For example I hide comments by default. </p>
<p>So if I find #comments I will be know that I need to show them up. </p>
<p>Is that possible to catch with php or javascript on page load?</p>
| php javascript | [2, 3] |
2,822,702 | 2,822,703 | Search Criteria in PHP | <p>JAVASCRIPT</p>
<pre><code>function ShowContent(id) {
if(id.length < 1) { return; }
document.getElementById(id).style.display = "block";
}
</code></pre>
<p>PHP</p>
<pre><code>$test = mysql_query('SELECT userid,testid,testname FROM test_table WHERE userid = 9 ORDER BY name');
TestName : <select>
while($row=mysql_fetch_array($test))
{
$testname = $row['testname'];
$testid = $row['testid'];
echo '<option value='.$testid.'>'.$testname.'</option>
}
</select>
echo '<div id="testid" style="display:none;">
echo '<table>
<tr><th>USERID</th</tr>
<tr><th>TESTNAME</th></tr>
<tr><th>MARKS</th></tr>
publishtest = mysql_query('SELECT id,userid,publishtest,marks FROM publish_table WHERE userid= 9 GROUP BY id');
while($row=mysql_fetch_array($publishtest))
{
$userid = $row['userid'];
$testid = $row['id']; /*This is test id*/
$testname = $row['publishtest']; /* This is test name*/
$marks = $row['marks'];
echo '<tr><td>'.$userid.'</td>
<td>'.testid.'</td>
<td>'.testname.'</td>
<td>'.$marks.'</td>
</tr>
}
echo '</table>';
echo '</div>';
</code></pre>
<p>I need when I select test from select tag, then div should be displayed of that testid. I want either in javascript, jquery</p>
| php javascript jquery | [2, 3, 5] |
4,142,266 | 4,142,267 | typeof jQuery.data() buggy? | <p>I'm tracking a mysterious problem in my code. This "bug" happens within an <code>event handler</code> that was bound via jQuery's <code>.delegate()</code>:</p>
<pre><code>my.$table_body.delegate('.wf-dropdown', 'change', function(e){
parent_row_element = $(e.target).closest('tr')[0];
if( typeof $.data(parent_row_element, 'changed') == 'undefined' )
$.data(parent_row_element, 'changed', {});
$.data(parent_row_element, 'changed').wf_id = e.target.value;
// .. more code
});
</code></pre>
<p>You don't need to know where some of those variables are defined and what they are for, the mysterious thing happens on the check for the <code>undefined</code> value.
I obviously check if there already is an object attached to the <code>parent_row_element</code> and if not, create it. It seems like <code>typeof $.data(anything)</code> fails in a way I cannot describe really. If a debugger like Firebug is attached, it evaluates to <code>undefined</code> correctly and everything works fine, without debugger, the assignment to <code>.wf_id</code> always throws because the object is undefined, because it was not created.</p>
<p>It works perfectly if I use this statement:</p>
<pre><code>if(!$.data(parent_row_element, 'changed') )
$.data(parent_row_element, 'changed', {});
</code></pre>
<p>That's why I guess that this is a bug. Or do I overlook something here ?</p>
<p>I could reproduce this behavior:</p>
<p><strong>throws an error on click, typeof is used</strong><br>
<a href="http://www.jsfiddle.net/5cEVf/" rel="nofollow">http://www.jsfiddle.net/5cEVf/</a></p>
<p><strong>works fine, no typeof</strong><br>
<a href="http://www.jsfiddle.net/5cEVf/3/" rel="nofollow">http://www.jsfiddle.net/5cEVf/3/</a></p>
| javascript jquery | [3, 5] |
1,435,265 | 1,435,266 | jQuery access to this event in new object | <p>I want to get access to the data-global-id value in the following markup and I am not sure how to do this due to scoping.</p>
<p>For example:</p>
<pre><code><div data-global-id="168" class="remove-as-favorite">remove as favorite</div>
$('.remove-as-favorite').on('click',function(){
var global_id=$(this).data('global-id');
// this works
alert('here i am in something: ' + global_id);
// this doesn't work
event_handler.remove_as_favorite();
});
// want to access the data-global-id value in here; how to get access to this?
event_handler={
remove_as_favorite: function(){
// how to get access to this here; assuming this refers to event_handler
var global_id=$(this).data('global-id');
alert("here i am global_id:" + global_id);
}
}
</code></pre>
<p>thx</p>
<p>** edit 1 **
<img src="http://i.stack.imgur.com/BmOtP.png" alt="enter image description here"></p>
| javascript jquery | [3, 5] |
4,638,136 | 4,638,137 | How to properly execute C# file over local network? | <p>Overview</p>
<p>C# File - Users PC<br/>
PHP Server - Hosts Webpages for application</p>
<p>Server and Users PC on local network</p>
<p>I have a c# file that reads weight from a USB scale. How would I trigger this file to run so it feeds into my program. The problem is I am using PHP to host our webpage/application so its not running client side and the scale is not hooked up to the server but to the clients PC. </p>
<p>The C# script would have to be on the clients in order to read the scale so how would I trigger this to happen?</p>
<p>Is this even possible and if not what would be a better way?</p>
<p><br/><b><strong>Important Edit</strong></b><br/>
I was able to run the Scale Script (C#) when I wanted by having PHP and C# use TCP sockets.</p>
<p>The C# would listen for PHP to send something and when it did it would read the scale and send this information back to PHP becuase PHP was listening for a response. Mixed in with a little Ajax and it updates in the web browser. </p>
<p>Gave Chris Credit because he was the most helpful with answering my questions</p>
| c# php javascript | [0, 2, 3] |
1,907,978 | 1,907,979 | jQuery: Move JavaScript to the bottom of the page? | <p>We are developing large ASP.NET applications with lot of dynmically created pages containing ASCX controls. We use a lot of jQuery everywhere.</p>
<p>I have been reading that it would make sense to move the inline JavaScript code to the bottom of the page as it could delay the loading of the page when it's included "too early".</p>
<p>My question is now: <strong>Does this still make sense when working with jQuery?</strong> </p>
<p>Most of the code is executed in the ready handler, so I would expect that is does not slow down the loading of the page.
In my case the multiple Usercontrols <strong>ASCX have all their own jQuery</strong> bits and pieces, and it would not be easy to move that all down in the rendered page.</p>
| javascript asp.net jquery | [3, 9, 5] |
5,059,473 | 5,059,474 | Change Font Style (bold, Italic, bold italic) in C# | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5607280/change-font-style-in-c">change font style in c#</a> </p>
</blockquote>
<p>HI there I want to change the font style of a label to either bold, italic, etc.. using a dropdownlist in an aspx page. Please let me know what I'm doing wrong here, because nothing seem to work.</p>
<p>My Code:</p>
<pre><code>public void button_click(object sender, EventArgs e)
{
var select= font1.SelectedItem.Value;
if(select=="Bold")
{
// I have the following methods of doing this; None works for me.
label1.Style["Font-Weight"]="bold";
//I also tried this:
label1.Font = new Font(label1.Font, FontStyle.Bold);
//and this:
this.label1.Font= new Font(this.label1.Font, FontStyle.Bold);
}
}
</code></pre>
<p>When using .Font I get errors for invalid arguments, that the arguments for Font must be like this: Font(string, float). Also, keep in mind that the method of putting the actual size in the argument list is not what i want to do. Like this</p>
<pre><code>label1.Font=new Font("Arial", 16, FontStyle.Bold);
//I don't want to change the font family or sixe of the label's text
</code></pre>
<p>So thats what I have, I'm in a jam. Please enlighten me. Thanks</p>
| c# asp.net | [0, 9] |
3,275,333 | 3,275,334 | jQuery $() function | <p>I am new to javascript and jquery so I am wondering what does </p>
<pre><code>$('#someid a')
</code></pre>
<p>referring to?</p>
<p>and when does the function $.get get called? (since I feel the code after $.get is called before $.get</p>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
3,073,931 | 3,073,932 | Gridview sorting and paging events are not firing in embedded .ascx controls | <p>I have a gridview that's inside a .ascx control that's dynamically embedded into another .ascx control, which is then called by a web form. The gridview will initially bind, but when any paging/sorting/command events are then triggered, I can't get any breakpoints inside the events to kick off. Additionally, when I look at the code-behind in the now-blank page, I see the old data sitting there. </p>
<p>Any idea what on earth is going on here? For edification, the .ascx page with the control is excerpted.</p>
<p>Parent .ascx control:</p>
<pre><code><asp:ScriptManager ID="smIndex" runat="server" EnablePartialRendering="true" EnableScriptLocalization="true" EnableScriptGlobalization="true" />
</code></pre>
<p>
</p>
<p>Child .ascx control:</p>
<pre><code><asp:UpdatePanel ID="upAddAdj" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="gvAddAdjVenList" runat="server" AllowPaging="true" AllowSorting="true" Width="100%" AutoGenerateColumns="false" Font-Size="9px" Font-Names="Verdana" PageSize="10" EnableSortingAndPagingCallbacks="false" DataKeyNames="ID" PagerSettings-Mode="NumericFirstLast" OnRowDataBound="gvAddAdjVenList_RowDataBound" Visible="true">
</code></pre>
<p>In the child.ascx code-behind:</p>
<pre><code>gvAddAdjVenList.DataBind();
gvAddAdjVenList.Sorting += new GridViewSortEventHandler(gvAddAdjVenList_Sorting);
gvAddAdjVenList.PageIndexChanging += new GridViewPageEventHandler(gvAddAdjVenList_PageIndexChanging);
</code></pre>
<p>Thanks!</p>
<p>valkyrie</p>
| c# asp.net | [0, 9] |
4,206,526 | 4,206,527 | programmatically sending text message - set expiration | <p>Is it possible to set a text message's (SMS/MMS) expiration date programmatically, or is there a way to send a message that automatically deletes itself through java on android? </p>
<p>I can't seem to find any examples other than applications/websites that work as a middle man, and I would prefer for the end user (receiver) not be required to have the application installed.</p>
| java android | [1, 4] |
4,004,315 | 4,004,316 | Multi language for a Website (php and javascript) | <p><br />
i try to build a language selection for my Website.</p>
<p>I use php and Javascript.</p>
<p>My idea is to create for every language a php file.</p>
<p><strong>For example: lang_en.php</strong></p>
<pre><code><?php
$lang = array();
$lang[1] = "Everything is ok!";
$lang[2] = "Please select a Number.";
?>
<script language="JavaScript" type="text/javascript">
lang = new Array();
lang[1] = 'Hello, please select a Button.';
lang[2] = 'Are you sure?';
</script>
</code></pre>
<p>But i am not sure, is this a good solution? Or is there a better way?</p>
<p>Thanks in advance!<br />
Peter</p>
| php javascript jquery | [2, 3, 5] |
2,846,073 | 2,846,074 | How to create sql connection with c# code behind, access the sql server then conditionally redirect? | <p>This is a question from an experienced beginner!</p>
<p>Using ASP.NET 4 C# AND SQL server,</p>
<p>I have a connection string in web.config to myDatabase named "myCS".
I have a database named myDB.
I have a table named myTable with a primary key named myPK</p>
<p>What are the NECESSARY lines of code behind (minimal code) to create a SQL connection, then select from myTable where myPK=="simpleText"</p>
<p>it will probably include:</p>
<pre><code>sqlconnection conn = new sqlconnection(??? myCS)
string SQLcommand = select * from myDB.myTable where myPK==myTestString;
sqlCommand command = new SqlCommand(SQL,conn);
conn.Open();
booleanFlag = ????
conn.Close();
conn.Dispose();
</code></pre>
<p>then</p>
<pre><code>If ( theAnswer != NULL ) // or (if flag)
{
Response.Redirect("Page1.aspx");
}
else
{
Response.Redirect("Page2.aspx");
}
</code></pre>
| c# asp.net | [0, 9] |
140,670 | 140,671 | How to work with jQuery and remain agnostic to its version? | <p>We're developing a snippet that is embedded in 3rd party sites, and uses jQuery.</p>
<p>The snippet checks if the site already has jQuery loaded. If so, it uses that library, otherwise it loads our own copy (currently jQuery 1.4.4, we're migrating to the latest soon).</p>
<p>There are breaking changes in jQuery. One such change, for example is the <a href="http://stackoverflow.com/questions/5874652/prop-vs-attr">change in semantics</a> of <code>attr()</code>, and introduction of <code>prop()</code>.</p>
<p>Are there some guidelines to working with jQuery in a way that will be as backward compatible as possible? Even when we migrate to latest, we still want to use an existing jQuery library if it exists instead of loading a new copy, to save load time and resources.</p>
| javascript jquery | [3, 5] |
5,236,639 | 5,236,640 | Fade in/out sound playing in 2 different Divs | <p>JQuery has nice visual fadeIn/fadeOut functions that work on different elements such as <code>div</code>. I need the same thing for sound.</p>
<p>More precisely, if two YouTube iFrame API players are playing from within 2 different <code>div</code>, is there a way to fadeIn/fadeOut the sound between them?</p>
| javascript jquery | [3, 5] |
2,845,734 | 2,845,735 | How do you Record physical file downloads, or a percentage of a file download? | <p>I would like to record every time a registered user clicks a link and downloads a file from a site. At the moment I am recording every time the link is pressed however this provides no information on if the file is <strong>actually physically downloaded</strong>? and moreover a download percentage if the file is not fully downloaded.</p>
<p>Does anyone know how I would go about recording a <strong>physical download</strong>?</p>
<p>Is this possible? If not through PHP Javascript/Jquery? I am quite lost, all help is greatly appreciated. Thank you.</p>
<p>link</p>
<pre><code><a href="download.php">download</a>
</code></pre>
<p>file</p>
<pre><code>security/user check - record to database....
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="somefile.pdf"');
readfile('somefile.pdf');
</code></pre>
| php javascript jquery | [2, 3, 5] |
2,535,821 | 2,535,822 | Language switcher using global resources | <p>I have multiple langauges setup under app_globalresources and would like to add a language switcher to the master template. I have the files named Default.resx and Default.fr.resx.</p>
<p>Currently it is setup to auto using on the page:</p>
<pre><code>UICulture="auto" Culture="auto"
</code></pre>
<p>Any help is much appreciated.</p>
<p>Dave.</p>
| c# asp.net | [0, 9] |
3,062,303 | 3,062,304 | check if username/email is already exist using javascript | <p>i have a simple question.</p>
<p>how can i check if the username or email they entered is already exist..</p>
<p>i have this code,</p>
<pre><code> if(document.RegForm.user.value =="")
{
alert("User Name Please?");
valid=false;
}
</code></pre>
<p>that's my code for username, i don't know what code i will add to check if user name is already exist.. :-(</p>
<p>hmm.. also this is for the email:</p>
<pre><code> var emailExp= /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
strEmail=document.RegForm.eadd.value;
if(strEmail.search(emailExp)==-1)
{
alert("A Valid Email Address Required");
valid=false;
}
</code></pre>
<p>what code will i add? to check if email is already exist. help me please .. :-(
thank you so much guys.. </p>
| php javascript | [2, 3] |
1,050,559 | 1,050,560 | jQuery: Getting "secondary" class | <p>I'm using jQuery to loop through some elements in a document. These elements are of type <code><tr></code> with class <code>.input-row</code>. Some of the elements can also have a secondary class (for example <code>.input-area</code>).</p>
<p>I use <code>$(".input-row").each()</code> to loop through the elements, but how can I determine if the <code>$(this)</code>-element has a "secondary" class and if so, get the name of this?</p>
| javascript jquery | [3, 5] |
3,695,604 | 3,695,605 | Confusing Javascript quotes | <p>In the jQuery docs mostly every string is "declared" using single quotes. Including the <a href="http://jqueryui.com/demos/datepicker/#option-dateFormat" rel="nofollow" title="documentation">documentation</a> for jQuery UI.</p>
<p>So why doesn't this</p>
<pre><code>$(".datepicker").datepicker({ dateFormat: 'dd.mm.yy' });
</code></pre>
<p>work, but this</p>
<pre><code>$(".datepicker").datepicker({ dateFormat: "dd.mm.yy" });
</code></pre>
<p>does? When using single quotes, the datepicker ignores my <code>dateFormat</code> setting.</p>
<p>(Ignore my silly habit of using double-quotes in the jQuery selector, but single quotes everywhere else :P )</p>
| javascript jquery | [3, 5] |
1,911,405 | 1,911,406 | Change Text using jQuery | <p>I have a script that is pulling in news from Yahoo on a certain subject. It renders the title of the news feed like this: </p>
<pre><code><div class="header-title">subject - Yahoo! News Search Results</div>
</code></pre>
<p>I would like to change this to read differently. Since this is inserted via JS I thought I could change this with jQuery. </p>
<p>I attempted this: </p>
<pre><code>$('.header-title').text('Subject News');
</code></pre>
<p>that did not work, I then attempted this: </p>
<pre><code>$('.header-title').empty();
$('.header-title').text('Subject News');
</code></pre>
<p>that also did not work. </p>
<p>Both of the above methods look as if they had no effect on the text.</p>
<p>I am not sure what to do to remove the old text and replace with my text.</p>
<p>Note: All of my code is inside jQuery's Document Ready IE: </p>
<pre><code>$(function(){
//Code Here
});
</code></pre>
| javascript jquery | [3, 5] |
3,042,600 | 3,042,601 | Tracking the success and failure of product download | <p>I want to track the complete/success and failure of product download for my ecommerce site.i m using asp.net handler which i called throuh jquery ajax.i wrote a code. but the downoad dialog box is not popped up and i still don't know the success and failure statistics.i need to update my databse based on the returning json data (true for success/false for failure) from asp.net handler .Anyone help me out. The link i referred is</p>
<p><a href="http://www.codeguru.com/csharp/csharp/cs_data/article.php/c17133/Tip-File-Download-in-ASPNET-and-Tracking-the-Status-of-Success-or-Failure-of-Download.htm" rel="nofollow">http://www.codeguru.com/csharp/csharp/cs_data/article.php/c17133/Tip-File-Download-in-ASPNET-and-Tracking-the-Status-of-Success-or-Failure-of-Download.htm</a></p>
| jquery asp.net | [5, 9] |
176,961 | 176,962 | Javascript / jQuery - How to convert Media and Image data into binary text format | <p>I need to send a image/media through json, for that conversion needs to be done into text format. How can I achieve that through jQuery/ Javascript?</p>
| javascript jquery | [3, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.