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,207,165 | 4,207,166 |
Storing different types of arguments in HashMap
|
<p>I am using following code:</p>
<pre><code>public boolean initialSetupDone;
public Currency defaultCurrency;
public String userId;
final String kProfileSetupDoneKey = "kProfileSetupDone";
final String kDefaultCurrencyKey = "kDefaultCurrency";
final String kUserIdKey = "kUserIdKey";
</code></pre>
<p><code>String</code> values are the keys while others are the values.</p>
<p>Please tell me how can i store these values as <code>HashMap</code>. I have tried to do it with <code>Dictionary</code>, but can't find any good way to do it.</p>
<p>How can i do that </p>
<p>Best Regards</p>
|
java android
|
[1, 4]
|
3,166,966 | 3,166,967 |
Retrieve the app package and version in Android
|
<p>I'm implementing an error report system in my app, </p>
<p>how can I retrieve programmatically the package of my app and its version? </p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
1,171,892 | 1,171,893 |
Inject Javascript from asp.net code behind files
|
<p>Am I injecting this correctly,</p>
<pre><code> string myScriptName = "EventScriptBlock";
string myScript = string.Empty;
//Verify script isn't already registered
if (!ClientScript.IsClientScriptBlockRegistered(myScriptName))
{
Response.Write('b');
myScript = "\n<script type=\"text/javascript\" language=\"Javascript\" id=\"EventScriptBlock\">\n";
myScript += "alert('hi');";
myScript += "\n\n </script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), myScriptName, myScript);
}
</code></pre>
<p>This is in my page load, but I never see an alert and I have no Javascript errors either.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,625,349 | 4,625,350 |
How to display jquery on more than 1 field?
|
<p>i can not use this keypad plugin on multiple fields. The first one works perfect but the other ones do not work. what do i need to do to make it work on all?</p>
<pre><code><script type="text/javascript">
$(function () {
$('#item_fee').keypad();
});
</script>
</head>
<body>
<tr>
<?
$query="SELECT * FROM item WHERE orderr_reference ='$ref' order by item_name";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$item_fee = mysql_result($result,$i,"item_fee");
?>
<td><input name="item_fee[]" id="item_fee" type="text" value="<?=$item_fee;?>" size="6" /></td>
</tr>
<? $i++; } ?>
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
1,743,881 | 1,743,882 |
Browsed Time Problem
|
<p>I want to display the browsed time of a user, But when i refresh it, it will be again start from 0:0:0.
How can it handle?</p>
<pre><code><?php
$total_mints=($live_match['match_name']) * (60);
?>
<script language="javascript">
display_c(<?=$total_mints?>,'ct');
</script>
<script type="text/javascript">
function display_c(start,div){
window.start = parseFloat(start);
var end = 0 // change this to stop the counter at a higher value
var refresh=1000; // Refresh rate in milli seconds
if(window.start >= end ){
mytime=setTimeout("display_ct('"+div+"')",refresh)
}
else {alert("Time Over ");}
</script>
</code></pre>
|
php javascript
|
[2, 3]
|
440,239 | 440,240 |
Combaining two array into single multi dimensional array in javascript
|
<pre><code>status_name=Array("a","b","c","b","e","f");
status_id=Array( 1, 2, 3, 4, 5, 6);
</code></pre>
<p>How to combine these two arrays and to built multi dimensional array Expected Multidimensional array be like this</p>
<pre><code>[["a", 1],["b", 2],["c", 3],["d", 4],["e", 5],["f", 6]]
</code></pre>
<p>Help me how to use above two array values and built my expected multidimensional array</p>
|
javascript jquery
|
[3, 5]
|
2,425,062 | 2,425,063 |
Blur event stops click event
|
<p>Example code: <a href="http://jsfiddle.net/slolife/PnmxM/" rel="nofollow">http://jsfiddle.net/slolife/PnmxM/</a></p>
<p>I am asking this even though there are a number of similar questions, but I feel that they are not the same.</p>
<p>I have an textbox that when it is blurred, should do something.</p>
<p>I also have a link, that is always visible (that appears to be how the other questions differ) and when clicked, should do something.</p>
<p>My blur handler fires, but the click handler does not.</p>
<p>Is there a proper way to deal with this?</p>
<p><strong>Update</strong></p>
<p>Many people pointed out that the alerts were causing my problem. Thank you. In my real code, I do not have alerts, but instead remove the textbox from the DOM.</p>
<p>So I have updated the fiddle to better reflect that with console.log calls instead of alert() calls. Any additional help is appreciated.</p>
|
javascript jquery
|
[3, 5]
|
2,283,239 | 2,283,240 |
jQuery click event triggering more than once
|
<p>I am having trouble figuring out what is causing the click event to fire more than once in the webapp below. Please visit the url, click on any level [from Ground - 4], and then click on a unit.</p>
<p><a href="http://plaza.foxqa.com.au/touch/index.html" rel="nofollow">http://plaza.foxqa.com.au/touch/index.html</a></p>
<p>That will bring up the Unit Details [price, images etc.]. The images in this page has a click event attached to them which basically enlarges the image. This event keeps stacking up. It will work fine when a unit is clicked for the first time. </p>
<p>Then it will fire twice for the second unit and three times for the third unit and so on. I tried to unbind the click event once the enlarged view is closed but still not working.</p>
<p>Any help would be appreciated.</p>
<p>Edit: Please test this in Google Chrome.</p>
<p>Edit 2: Steps that might help you figure out the problem sooner.</p>
<ol>
<li>Open the components_draft.js in your console.</li>
<li>Add a breakpoint at line 687.</li>
<li>Click on a level on the building</li>
<li>Click on any green coloured unit [or lot].</li>
<li>Once the unit details are displayed, click on the unit plan image.</li>
<li>It gets enlarged.</li>
<li>Click anywhere on the image and it will be minimized. </li>
<li>Go back to step 4 by clicking the close icon.</li>
<li>Repeat 5,6,7.</li>
<li>Now, when the enalrged image is clicked, step through the functions in the console and you will see the click event looping twice for a single click.</li>
</ol>
<p>I know following all of this is a pain but please take some time to analyze it.</p>
|
javascript jquery
|
[3, 5]
|
3,998,202 | 3,998,203 |
Disabled Checkbox is not showing as checked in jQuery
|
<p>All,
I have the following bit of PHP to check a checkbox:</p>
<pre><code><input type="checkbox" name="check_out_gear[]" id="'.$resultsetgear['gear_checkout_id'].'" value="'.$resultsetgear['gear_checkout_id'].'" class="gear_checkout_checkbox" checked disabled>
</code></pre>
<p>That code works fine and the checkbox is checked and it is disabled. I'm checking to see if it at least one checkbox is checked by using the following jQuery:</p>
<pre><code>var fields = jQuery(".gear_checkout_checkbox").serializeArray();
if (fields.length == 0)
{
jQuery.wl_Alert('Please select a piece of equipment that you\'re checking out!','warning','#no_answers','#workform', {sticky:false});
one_selected = false;
}
</code></pre>
<p>When that checkbox is checked and disabled the length is always 0. However as soon as I remove the disabled from the code it has a length of at least 1. Any idea how I can get this code to work with a disabled checkbox?</p>
|
php jquery
|
[2, 5]
|
1,327,436 | 1,327,437 |
jQuery content slider with start/stop/resume functionality
|
<p>Is there a jQuery content slider plug-in out there with start/stop functionality as well as an auto-resume functionality?</p>
<p>I basically want the plug-in to cycle through content and have the ability to pause it. After 5 minutes of it being paused I want the ability to auto-resume the sliding. </p>
|
javascript jquery
|
[3, 5]
|
3,290,423 | 3,290,424 |
Is there a PHP equivalent of "new Array (number)" in javascript?
|
<p>I was trying to convert basic Javascript function into PHP, and I saw that one of the variables was declared <code>var Variable = new Array (13)</code>.</p>
<p>I know that PHP variables are declared like: <code>$variable = array()</code></p>
<p>but what about the "13" in <code>new Array(13)</code>? does that translate to <code>$variable = array(13)</code>? I've tried that but it didn't seem to work.</p>
<p>This in Javascript</p>
<pre><code>var results = new Array (13);
</code></pre>
<p>becomes this in PHP, am I correct?</p>
<pre><code>$results = array(13);
</code></pre>
|
php javascript
|
[2, 3]
|
2,159,565 | 2,159,566 |
jQuery: How do I remove surrounding div tags?
|
<p>In this line...</p>
<pre><code><div class="textwidget">lorem ipsum dolor sit amet</div>
</code></pre>
<p>I'd like to get rid of the surrounding div tags with jQuery so the output looks like this:</p>
<p><code>lorem ipsum dolor sit amet</code></p>
<p>Is this possible?</p>
|
javascript jquery
|
[3, 5]
|
5,565,464 | 5,565,465 |
Max value in array, based on a function
|
<p>I have an array of objects. I want to find the "maximum" of this array based on a function that returns whichever object is bigger when given 2 objects.</p>
<pre><code>function comparison(first, second) {
// ... arbitrary comparison based on properties...
return first; // or second
}
var a = [obj1, obj2, obj3];
var maxObj = ????(comparison);
</code></pre>
<p>What do I fill in here? What's elegant and short?</p>
|
javascript jquery
|
[3, 5]
|
1,826,015 | 1,826,016 |
jQuery: fadeToggle() not change text of link Show / Hide
|
<p>I have a problem with fade toggle, It works when the div is visible to start with and link "Show QR" change to "Hide QR".
Link "Hide QR" should be clicked and div hidden but link of text not change to "Show QR"</p>
<p>html:</p>
<pre><code><a class="emotTab" id="qrshow" href="javascript:void(0);">Show QR</a>
<div id="div_showqr">Content.....</div>
</code></pre>
<p>javasctipt :</p>
<pre><code>$("#qrshow").click(function(){
$("#div_showqr").fadeToggle('slow');
$('#qrshow').text($('#div_showqr').is(':visible')? 'Hide QR' : 'Show QR');
$('#qrshow').text($('#div_showqr').is('display:none')? 'Show QR' : 'Hide QR');
});
</code></pre>
<p>sorry,, my english is bad :(</p>
|
javascript jquery
|
[3, 5]
|
3,263,721 | 3,263,722 |
Is there a way to input values on a web site's text box using a database table values?
|
<p>I have a table with username and passwords that I want to input in Hotmail's username and password box. Is there a way to actually program this? Are you allowed to manipulate text boxes of someone else's webpage? Not for illegal purposes, just to make my job easier and to not have to input values manually one by one. Hotmail is just an example.</p>
|
java php javascript
|
[1, 2, 3]
|
124,185 | 124,186 |
Unwanted automated creation of new instances of an activity class
|
<p>I have an activity (called Sender) with the most basic UI, only a button that sends a message when clicked. In the onClickListener I only call this method:</p>
<pre><code>private void sendSMS(String msg)
{
PendingIntent pi = PendingIntent.getActivity(this, 0,
new Intent(this, Sender.class), 0);
PendingIntent pi = PendingIntent.getActivity(this, 0, myIntent, 0);
SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("1477", null, msg, pi, null);
}
</code></pre>
<p>This works ok, the message is sent but every time a message is sent a new instance of Sender is started on top of the other. If I call sendSMS method three times, three new instances are started. I'm quite new to android so I need some help with this, I only want the same Sender to be on all the time</p>
|
java android
|
[1, 4]
|
1,063,235 | 1,063,236 |
bind but not display items in drop down in c#
|
<p>I have a question here.</p>
<p>I want to bind a drop down in c# with below values</p>
<pre><code>value text
----- ----
1 abc
2 pqr
3 xyz
4 ppp
</code></pre>
<p>however i want to display only items related to 1,2 and 3.</p>
<p>is it possible to bind all values however display not all items</p>
|
c# asp.net
|
[0, 9]
|
5,705,978 | 5,705,979 |
What do I need to do reference a c++ dll from a C# application?
|
<p>The C++ dll is using Win32 to read from and write data to the Serial Port. I need that data in my C# application. Is it simply a case of referencing the dll the way I would any other dll written in C#, import that and then call the methods in it? Or do I need to do something differently?</p>
|
c# c++
|
[0, 6]
|
2,196,461 | 2,196,462 |
js jQuery, always have a number display at least two digits 00
|
<p>I'm using the following to add one to number:</p>
<pre><code><div id="count">00</div>
<div id="count">03</div>
<div id="count">08</div>
<div id="count">12</div>
$('#count').text(function(i,txt) { return parseInt(txt, 10) + 1; });
</code></pre>
<p>I always want there two be 2 places, 00 even if the number is under 10. How can I get the func above, with JS, to always return the 2 00 places? So if the number computes to 3, it injects 03 into #count?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,461,968 | 1,461,969 |
Sequentially Load DIV using Jquery
|
<p>Is it possible to load a series of DIVS using Jquery using a preloader.</p>
<p>For instance, I have a page with 4 divs nested within 1 main div.</p>
<p></p>
<p> </p>
<p>I'd like to load content1, then content2, and so on.</p>
<p>Plus, only 1 div will load at a time in the sequence.</p>
<p>Is this possible with jquery, or anything else?</p>
|
php jquery
|
[2, 5]
|
3,669,027 | 3,669,028 |
validation in asp.net login control
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7213131/validation-problem-in-asp-net-login-control">validation problem in asp.net login control</a> </p>
</blockquote>
<p>I have asp.net login control in my web application. When I give the incorrect username and password and click the login button the failure text will appeared. Then clear the password field then click the login button both failure text and passwordrequirederrormessage validation messages will appeared. But I need only the password requirederrormessage will appeared. Can anyone able to give the solution for that. Thank you</p>
|
c# asp.net
|
[0, 9]
|
5,595,153 | 5,595,154 |
Java v/s PHP, how do this technology stack up for Web Application Development?
|
<p>I am new to Web Programming and I hear that there are many biggies like Java, .Net and PHP for Web Application Development. </p>
<p>I would certainly appreciate if I can get some insights on how this technology stack up in comparison and in what scenarios one would prefer one technology over the other. </p>
<p>Thanks for all guidance in advance. </p>
|
java php
|
[1, 2]
|
1,005,360 | 1,005,361 |
Object reference not set to an instance of object, help needed
|
<p>I have the code below </p>
<p>It throws an error <strong>"Object reference not set to an instance of object"</strong></p>
<pre><code>TextBox rateCenterName = (TextBox)row.FindControl("txtRateCenterName");
cmd.Parameters.Add("@RateCenterName", OleDbType.VarChar).Value = rateCenterName.Text;
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,457,261 | 2,457,262 |
pjs is undefined (processingjs)
|
<p>if i use this:</p>
<pre><code>$(document).ready(function() {
pjs = Processing.getInstanceById("EyeCanvas");
console.log(pjs);
}
</code></pre>
<p>then pjs is always undefined</p>
<p>when i use this:</p>
<pre><code>function test() {
pjs = Processing.getInstanceById("EyeCanvas");
console.log(pjs);
}
</code></pre>
<p>and trigger test() with a button then pjs = D.Processing, as it should be.</p>
<p>I load the scripts in this order:</p>
<pre><code> <script type="text/javascript" src="processing-1.3.6.min.js"></script>
<script type="text/javascript" src="jquery1-7-1.js"></script>
<script type="text/javascript" src="script.js"></script>
</code></pre>
<p>How can i work with pjs without have people to press a button?</p>
|
javascript jquery
|
[3, 5]
|
3,555,153 | 3,555,154 |
Disabling element in jQuery
|
<p>Okay so I want to click an item, then have that item become unclickable, and not execute the jQuery attached to it. I am currently using this </p>
<pre><code>$(clicked_id).prop('disabled', true);
</code></pre>
<p>However that is not working.</p>
<p>Any help is much appreciated!</p>
<p>EDIT:</p>
<p>This is the HTML:</p>
<pre><code><img src="imgs/card.jpg" id="card0" name="card0" onclick="getCard(this.id); ">
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,530,032 | 4,530,033 |
form updated by javascript missing post values
|
<p>I have a form that I ad an element to via JavaScript before it is submitted.</p>
<pre><code> parent.document.getElementById('submitcomment' + id).innerHTML = '<img class="image_real" src="/images/site.png" alt="Mostly Dirty," />
<input class="real" name="freshness" type="text" size="5" maxlength="6" />
<a href="#" onClick="submitComment('+[id]+'); return false;">
<img id="submitcommentimg<?php echo $id; ?>" src="images/check.png" alt="Comment!" border="0"></a>
<div class="submitcommentalert" id="comment_alert_<?php echo $id; ?>" style="display:none">Comment Posted!</div>';
</code></pre>
<p>When the form is submitted it seems to be missing the <code>'freshness' <input> element</code></p>
<p>That is if I try to access <code>$_POST['freshness'];</code> it is empty.</p>
|
php javascript
|
[2, 3]
|
3,262,483 | 3,262,484 |
Why my code to set the checked state of a checkbox with query doesn't work?
|
<p>Why this works</p>
<pre><code> document.getElementById("myCheckbox").checked = false;
</code></pre>
<p>whereas this doesn't with jquery:</p>
<pre><code> $("myCheckbox").attr("checked") = false;
</code></pre>
|
javascript jquery
|
[3, 5]
|
744,398 | 744,399 |
get url with content after hash
|
<p>How can I get url with content after hash ?</p>
<p>window.location return me url without hash :/</p>
<p>for example:</p>
<p>www.mystore.com#prodid=1</p>
<p>window.location return only www.mystore.com</p>
|
javascript jquery
|
[3, 5]
|
4,125,880 | 4,125,881 |
Display vertical-scrollbar for Jquery Mobile for ipad2
|
<p>I trying to create dialog with div area that can scroll in it. Currently I'm not found the best way to do it. Welcome every suggestion :).</p>
|
javascript jquery
|
[3, 5]
|
1,594,491 | 1,594,492 |
Problem occured in IE8 Compatibility view?
|
<p>I am using the Jquery and asp.net pages in my web application. In IE8 compatibility some of control width not getting render properly : dialog open with some auto width but the dialog title width not getting properly width as its content gets. Also some of the drop down list shown with very less width size. </p>
<p>How to solve the problem .....</p>
<p>Thanks..</p>
|
jquery asp.net
|
[5, 9]
|
4,286,199 | 4,286,200 |
How to find and remove attirbutes in cloned item using jquery?
|
<p>I trying to clone a div content with below code.</p>
<pre><code>var clonedItem = $("#cloneableSchoolTab").clone();
clonedItem.find(".clonableSchool").addClass("clonedSchoolTab" + schoolTabCount );
$("#clonedSchoolTabsContainer").append(clonedItem);
</code></pre>
<p>First line gets the whole target item. But, the excecution of second line, the value of <code>clonedItem</code> changed as empty array. I dont know. If i merge the first 2 line, the reasult was same as the above code.</p>
<p><strong>HTML Code:</strong></p>
<pre><code><div id="cloneableSchoolTab" class="schoolInput">
<input type="text" id="schName"/>
<input type="text" id="schDes"/>
</div>
</code></pre>
<p>Any help would be appreciative.</p>
<p>Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
1,357,075 | 1,357,076 |
How to set the value of text inputs in a table in jQuery?
|
<p>I have these text inputs in a table :</p>
<pre><code><td><input type='text' name='arrondi_devis_ht' class='calcul_total' size='8'></td>
<td><input type='text' name='arrondi_devis_ttc' class='calcul_total' size='8'></td>
<td><input type="text" name='marge_pourcent' class='calcul_total' size='5' value='20,0'></td>
</code></pre>
<p>I successfully get their value by performing this :</p>
<pre><code>var prix_unitaire_ht=parseFloat($(this).parents("tr").find('input[name="arrondi_devis_ht"]').val().replace(',','.'));
var prix_unitaire_ttc=parseFloat($(this).parents("tr").find('input[name="arrondi_devis_ttc"]').val().replace(',','.'));
var marge_pourcent=parseFloat($(this).parents("tr").find('input[name="marge_pourcent"]').val().replace(',','.'));
</code></pre>
<p>So i figured i could use a similar mechanism to set their values and tried this : </p>
<pre><code>$(this).parents("tr").find('input[name="arrondi_devis_ht"]').value=new_prix_ht;
$(this).parents("tr").find('input[name="arrondi_devis_ttc"]').value=new_prix_ttc;
$(this).parents("tr").find('input[name="marge_pourcent"]').value=new_marge;
</code></pre>
<p>Yet it does not work and their value remain unchanged. I've tried with .val instead of value, also to assign them an id and to do <code>find("#id").value</code> instead of the above without any result.</p>
<p>Could anyone please tell me what I'm doing wrong ?</p>
|
javascript jquery
|
[3, 5]
|
3,983,274 | 3,983,275 |
How to auto-scroll div content vertically continuously
|
<p>I need to scroll the div which contains images, vertically. Any help or references will be highly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
4,677,639 | 4,677,640 |
echo php results to two separate divs
|
<p>I have one php function that receives drop down variables through javascript. The variables are processed through the function, and the function returns two results. I would like to show one of the results in div 'one' at the top of a page and the other result to display in div 'two' which is at the bottom of the same page. How can I do that?</p>
<p>I am using this jScript function to pass the variables from the drop downs to php page</p>
<pre><code>function getRunners() {
var awayRunner = document.getElementById('awayRunner').value;
var homeRunner = document.getElementById('homeRunner').value;
if(window.XMLHttpRequest) {
xmlhttp13 = new XMLHttpRequest();
}
else {
xmlhttp13 = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp13.onreadystatechange = function() {
if(xmlhttp13.readyState == 4 && xmlhttp13.status == 200) {
document.getElementById("one").innerHTML = xmlhttp13.responseText;
}
}
xmlhttp13.open("GET", "/Modules/process.php?awayRunner=" + awayRunner + "&homeRunner=" + homeRunner, true);
xmlhttp13.send();
</code></pre>
<p>}</p>
<p>in the php page, I have something like this
<pre><code>function getResults($homeRunner,$awayRunner){
process info...
echo $homeResult;
echo $awayResult;
}
getResults($homeRunner,$awayRunner);
?>
</code></pre>
<p>I understand the jScript code above only returns to div "one". how do i incorporate a div "two" into it?</p>
<p>Thank you in advance!</p>
|
php javascript
|
[2, 3]
|
2,950,622 | 2,950,623 |
How to relaunch a application immediately in android after being killed?
|
<p>Hi i make an antivirus and anti theft application on android. I want to relaunch my application immediately after being killed by a task killer. For now, i only use <code>START_STICKY</code> method from service, but it takes a few time to restart my application and service after being killed. My antivirus and anti theft application should be launch immediately because if the owner's mobile phone was lost, an owner still can monitoring where the last location of their mobile phone. Has anyone know how to restart an application on android immediately which is better than <code>START_STICKY</code> method? like a Lookout mobile security?</p>
|
java android
|
[1, 4]
|
226,463 | 226,464 |
Validating DOM Elements
|
<p>I have some input HTML elements which I want to validate whether they are filled up or not. Basically, they are mandatory. I am doing something like this:</p>
<pre><code> var displayNames new Array();
displayNames[0] = "Name";
displayNames[1] = "Address";
displayNames[2] = "Age";
function validForm() {
var Name = document.getElementById(txtName).value;
if(!Name) {
alert(displayName[0] is required);
}}
</code></pre>
<p>How should I make the validations easy in JS?</p>
|
javascript jquery
|
[3, 5]
|
5,804,291 | 5,804,292 |
Need to change div's contents while slider changes
|
<p>My jquery banner needs to some fixes. I have used echo slider for banner. when banner image change to another image, we need to change the content in a div which is not inside the slider's boundary. The Div is separate div (No connection with slider ).</p>
<p>I have tried with the code. i just put if statement based on slider's navigation. </p>
<p>My codes affected the 1st banner image only. it doesnt affect next banner</p>
<p>Help me</p>
<p>Here below my codes</p>
<pre><code><div class="echo-nav">
<a rel="0" class="echo-control active" href="javascript:;">1</a>
<a rel="1" class="echo-control" href="javascript:;">2</a>
<a rel="2" class="echo-control" href="javascript:;">3</a>
<a rel="3" class="echo-control" href="javascript:;">4</a>
<a rel="4" class="echo-control" href="javascript:;">5</a>
<a rel="5" class="echo-control" href="javascript:;">6</a>
</div>
<script>
$(document).ready(function(){
if($('.echo-nav a.active').attr('rel')=='0'){
$('#app_info').text('Some dummy contents for one');
}
else if($('.echo-nav a.active').attr('rel')=='1'){
$('#app_info').text('Some dummy contents for Two ');
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,883,356 | 2,883,357 |
window.opener.doccument.getelementbyid() is not working when popup from iframe
|
<p>I am calling a popup from an iframe and when I click a button the popup should close and show a message in parent iframe. I am using the javascript below</p>
<pre><code>function ClosePopup() {
var fRame = window.opener.document.getElementByID('lblMessage').innerHTML="testMessage";
self.close();
}
</code></pre>
<p>However, when I execute this, an error is returned : <code>getelementbyid is null</code>.</p>
<p>How can I show a message in the parent iframe. Can anyone help me?</p>
|
javascript asp.net
|
[3, 9]
|
1,173,283 | 1,173,284 |
Android Delete Directory Not Working
|
<p>I am trying o delete an entire directory. I have searched and I am using <a href="http://stackoverflow.com/questions/5701586/delete-a-folder-on-sd-card">this</a> code and I am able to delete everything in the directory, but the directory still remains. Here is the exact code I have just in case I am missing something.</p>
<pre><code>public boolean DeletePoint(String JobName, String PointName){
//Delete actual contents and file
File folder = new File(rootSaveFolder "/" + PointName+"/");
boolean returnBool = false;
try{
returnBool = deleteDirectory(folder);
folder.delete();
} catch (SecurityException e){
e.printStackTrace();
}
}
static public boolean deleteDirectory(File path) {
if( path.exists() ) {
File[] files = path.listFiles();
if (files == null) {
return true;
}
for(int i=0; i<files.length; i++) {
if(files[i].isDirectory()) {
deleteDirectory(files[i]);
}
else {
files[i].delete();
}
}
}
return(path.delete());
}
</code></pre>
<p>The string for the file I am deleting is: /mnt/sdcard/test/gg/</p>
<p>I have tried it with out the final '/' and that didn't work either.</p>
|
java android
|
[1, 4]
|
587,902 | 587,903 |
how to write this type of fraction value as shown below?
|
<p><img src="http://i.stack.imgur.com/ZaLxN.png" alt="enter image description here"></p>
<p>Hot to write this type of fraction Value in java or android code as shown above ? Any idea/suggestion will be appreciated.</p>
|
java android
|
[1, 4]
|
4,221,701 | 4,221,702 |
JQuery method execution order?
|
<p>I am trying to use the below to load data from a specific <code><div></code> from a page that contains <code><ul><li></code> structure into a <code><div></code> on this page. What is currently happening is that it "seems" to try and load the menu before the data is there. I say this because my menu pops up on the page first with a <code>NULL</code>, which is the default, and THEN the list I was expecting gets populated into <code><div id="hierarchy"></code> under my empty Fly Out Menu. </p>
<p>I am new to <strong>JQuery</strong> so hopefully this is a simple, ignorant, mistake.</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$('div.ms-quickLaunch').replaceWith('<div id="hierarchy" style="border:solid 1px white; width:0px;"></div>');
});
$(function(){
$('#hierarchy').load('http://wwcshare/icenter/Pages/wwcMenuContent.aspx #menuContent'); // grab content from another page
$('#hierarchy').menu({
autoShow: true,
content: $('#hierarchy').next().html(),
backLink: false,
crumbDefaultText: ' '
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,043,570 | 1,043,571 |
How to develop a Windows 8 Desktop Application
|
<p>How to develop a Windows 8 Desktop Application and how to add this application to windows 8 store?</p>
<p>I am not able to understand how to develop this application and what are the requirements for developing this application.</p>
<p>Provide me link and related information.</p>
|
c# asp.net
|
[0, 9]
|
5,886,339 | 5,886,340 |
How do you dynamically update your Android application?
|
<p>I am new to android development, but I am wondering how an android application like ESPN Scorecenter or maybe a news application dynamically updates without the user having to do this manually. Will changing/updating the apk file automatically change the user's android app or will they have to update the version?</p>
|
java android
|
[1, 4]
|
473,377 | 473,378 |
Uncaught TypeError: Cannot call method 'show' of null
|
<p>I am getting an :Uncaught TypeError: Cannot call method 'show' of null" error in a script which points out the error is somewhere in this area, see below:</p>
<pre><code> // Show the correct more view images and if there are moreviews displayed, display the more views title
if (selectedmoreview !== null && selectedmoreview !== undefined && howMany > 0) {
selectedmoreviewtitle.show();
selectedmoreview.invoke('show');
} else {
if(howMany > 0){ selectedmoreviewtitle.hide(); }
}
spConfig.configureElement(dropdownEl);
</code></pre>
<p>Can anyone help me sort this out and have my functionality working? Some expert advice would be truly appreciated</p>
|
javascript jquery
|
[3, 5]
|
4,073,308 | 4,073,309 |
Using beforeunload and unload together?
|
<p>I heard that Opera doesn't work with beforeunload. And some earlier versions of IE also. So how can I use these together ? If I use below, it runs 2 times (They all work) in Firefox.</p>
<pre><code>$(window).bind('beforeunload', function () {
});
$(window).unload(function () {
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,254,637 | 4,254,638 |
ArrayList Find First and Last Element
|
<p>Good Evening,</p>
<p>I have an ArrayList (instantiated as ld_data) and I iterate forward and back looking / displaying to the user the element data. In this process I need to know when I am at the first element and the last. Detecting when I am at the last element I do as such:</p>
<pre><code>if((index + 1) <= ld_data.size())
{
....
}
</code></pre>
<p>This works because the size property also is the upper bound of the ArrayList. However detecting when I am at the first element is not as easy for me. The best I've been able to figure out is this which seems rather lame....but it works.</p>
<pre><code>if((index - 1) >= (ld_data.size() - ld_data.size()))
{
....
}
</code></pre>
<p>In the C# .NET world we have ArrayList.UpperBound or ArrayList.LowerBound is there something similiar in Java?</p>
<p>JB</p>
<p>EDIT: Further details. So for more information I am bound to a ListView. So when the user has scrolled to the first element of the list I want to show a msg "At start of list" and when they reach the end show "End of list". I know there is a scrollbar that makes this obvious I'm just trying to give an example of what I'm doing. So this check occurs in the "OnScroll" event.</p>
|
java android
|
[1, 4]
|
1,929,408 | 1,929,409 |
Providing Edior with all features available in ms word and need to be save, edit, update, print options
|
<p>I need to provide an editor to the end user with all the features available in ms word and also provide edit, update and save options of the document in asp.net application.</p>
<p>I have tried by using third party controls like telerik, dev express, e-ice blue, etc..., but none of these editors have as many features as a word processor provides.</p>
<p>My Environment
Asp.net 4.0, sqlserver2008, C#, windows7</p>
<p>Please help me out.</p>
|
c# asp.net
|
[0, 9]
|
3,518,533 | 3,518,534 |
How can I replace just the css selector with jQuery?
|
<p>I would like to replace just the <code>height</code> attribute to <code>min-height</code></p>
<p>this is how I would normally change the value, but not sure how to change the attribute </p>
<pre><code> $('.mySelector').css('height','650px')
<div class="mySelector" style="cursor: -moz-grab; width: 1266px; height: 650px;">
</code></pre>
<p>My apologies should have mentioned this earlier</p>
|
javascript jquery
|
[3, 5]
|
4,128,572 | 4,128,573 |
Trapping 404 and 500 errors when using tth DefaultHTTPClient
|
<p>I'm using the <code>DefaultHTTPClient</code> in Android to fetch pages. I'd like to trap 500 and 404 errors returned by the server but all I get is a <code>java.io.IOException</code>. How can I specifically trap those two errors?</p>
<p>Here's my code:</p>
<pre><code>public String doGet(String strUrl, List<NameValuePair> lstParams) throws Exception {
Integer intTry = 0;
while (intTry < 3) {
intTry += 1;
try {
String strResponse = null;
HttpGet htpGet = new HttpGet(strUrl);
DefaultHttpClient dhcClient = new DefaultHttpClient();
dhcClient.addResponseInterceptor(new MakeCacheable(), 0);
HttpResponse resResponse = dhcClient.execute(htpGet);
strResponse = EntityUtils.toString(resResponse.getEntity());
return strResponse;
} catch (Exception e) {
if (intTry < 3) {
Log.v("generics.Indexer", String.format("Attempt #%d", intTry));
} else {
throw e;
}
}
}
return null;
}
</code></pre>
|
java android
|
[1, 4]
|
2,989,848 | 2,989,849 |
Expected behavior when an request for a collection will have zero items
|
<p>Let's say you are given the following...</p>
<pre><code>List<Thing> theThings = fubar.Things.All();
</code></pre>
<p>If there were nothing to return, what would you expect fubar.Things.All() to return?</p>
<p>Edit:
Thanks for the opinions. I'll wait a bit and accept the entry with the most ups.</p>
<p>I agree with the responses so far, particularly those suggesting an empty collection. A vendor provided an API with several calls similar to the example above. A vendor who did $4.6 million in revenue via their API(s) last year, BTW. They do something I fundamentally disagree with -- they throw an exception.</p>
|
java c#
|
[1, 0]
|
2,325,285 | 2,325,286 |
mysql_real_escape_string and jquery
|
<p>Let say i have a column product name and it has value <code>Shoe's</code>.
When i pick that value from db and use <code>mysql_real_escape_string</code> and placed it in html hidden input it becomes <code><input type='hidden' value='Shoe\'s' id='product_name'></code></p>
<p>When i do <code>$('#product_name').val()</code> it return only <code>Shoe\</code> truncating the <code>s</code> or rest of the value after that. The jQuery is assuming an escaped single quote as a closing quote for attr value.</p>
<p>On solution is to use <code>value=""</code> (enclosed in double quotes) but what if value contains a double quote? So the problem persists.
Any help is appreciated.</p>
<p>Thanks!</p>
|
php jquery
|
[2, 5]
|
658,666 | 658,667 |
I don't understand what return does in programming?
|
<p>The question basically says it all. I'm a noob so make it gentle.</p>
|
java c++
|
[1, 6]
|
3,090,551 | 3,090,552 |
Which layout to use for a home replacement application/grid of views?
|
<p>I'm trying to create a home replacement application and I want to know my options, I could use a TableLayout or nested LinearLayouts but the icon size and number of rows and columns of icons can change so I'm looking for something easier to manage, maybe just one layout and have items accomodate automatically somehow. </p>
<p>In HTML div you can use float:left and if you append items on a container they accomodate like this:</p>
<p><img src="http://i.stack.imgur.com/yScMo.png" alt="enter image description here"></p>
<p>Is there a way to do something similar in Java? If not what is the recommended way to create a grid layout?</p>
|
java android
|
[1, 4]
|
5,199,726 | 5,199,727 |
Overwriting paddingLeft in a LinearLayout on Android
|
<p>i am currently making one android application, i moded title bar, so all content for title bar is holded in window_title.xml where i have LinearLayout set: paddingLeft="5dip" . And now i need to load one imageView on the right side of this titleBar how i am able to some kind of overwrite this paddingLeft i cant delete it as it required for text and image on the left but i need it on right too...</p>
<p>Here is current xml:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:gravity="center_vertical"
android:paddingLeft="5dip"
android:background="#222222">
<ImageView
android:id="@+id/header"
android:src="@drawable/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="TextTexast"
android:textSize="10pt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="5dip"
android:textColor="#F7F7F7"
/>
</LinearLayout>
</code></pre>
|
java android
|
[1, 4]
|
3,383,688 | 3,383,689 |
How to encode a string to replace all special characters
|
<p>I have a string which contains special character. But I have to convert the string into a string without having any special character so I used Base64 But in Base64 we are using equals to symbol (=) which is a special character. But I want to convert the string into a string which will have only alphanumerical letters. Also I can't remove special character only i have to replace all the special characters to maintain unique between two different strings. How to achieve this, Which encoding will help me to achieve this?</p>
|
java android
|
[1, 4]
|
1,221,754 | 1,221,755 |
Javascript: Validation for special charaters
|
<p>Im working on some validations and can't seem to wrap my head around checking for special chars, none should be used. Currently I grab the value, make an array and check for uppercase and numbers. I need a way to check for special chars as well. Another small issue I found is that it passes an uppercase when a number is entered. Just looking for some direction on how to tackle this.</p>
<pre><code>$('.tooltip').on({
focusin: function(){ //make
var top = $(this).offset().top
var left = $(this).offset().left + $(this).outerWidth()
$('.tip').remove()
$('body').append("<div class='tip' style='top:"+ top +"px;left:"+left+"px;'><div class='arrow'></div></div>")
$('.tip').animate({width: 'show', opacity: 'show'})
$(tipContent).appendTo('.tip')
},
focusout: function(){ //remove
$('.tip').fadeOut(function(){$(this).remove()})
},
keyup: function(){ if (event.keyCode == 16) return //validate
var val = $(this).val()
validate(val.split(""), val);
},
})
function validate(letters, val){
for (var i = 0; i < letters.length; i++){
if( letters[i] === letters[i].toUpperCase() ) { //uppercase check
console.log(letters[i] + ": " + 'Uppercase Passed');
}else{console.log('Uppercase Failed');
}
if( letters.length >= 9 ) { //min limit
console.log(letters[i] + ": " + 'Minimum Limit Passed');
}else{console.log('Minimum Limit Failed');
}
if( parseInt(letters[i]) > 0 ) { //number check
console.log(parseInt(letters[i]) + ' passed');
}else{console.log('at least 1 char failed');
}
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,251,527 | 2,251,528 |
How do I set up a timer to prevent overlapping ajax calls?
|
<p>I have a page where search resuts are shown both in a grid and on a map (using KML generated on the fly, overlaid on an embedded Google map). I've wired this up to work as the user types; here's the skeleton of my code, which works:</p>
<pre><code>$(function() {
// Wire up search textbox
$('input.Search').bind("keyup", update);
});
update = function(e) {
// Get text from search box
// Pass to web method and bind to concessions grid
$.ajax({
...
success: function(msg) {
displayResults(msg, filterParams);
},
});
}
displayResults = function(msg, filterParams) {
// Databind results grid using jTemplates
// Show results on map: Pass parameters to KML generator and overlay on map
}
</code></pre>
<p>Depending on the search, there may be hundreds of results; and so the work that happens in <code>displayResults</code> is processor-intensive both on the server (querying the database, building and simplifying the KML on the fly) and on the client (databinding the results grid, overlaying big KML files on the map). </p>
<p>I like the immediacy of getting progressively narrower results as I type, but I'd like to minimize the number of times this refreshes. What's the simplest way to introduce an N-second delay after the user stops typing, before running the <code>update</code> function?</p>
|
javascript jquery
|
[3, 5]
|
2,376,755 | 2,376,756 |
Jquery expand from external link
|
<p>I am trying to make it so that when a user clicks on a link from one page, it goes to another page that has a simple jquery collapsed text and expands (un-collapses) the text. My attempt is with the code below:</p>
<pre><code>$(function() {
var elem = $('#expand-4' + location.hash);
$('#expand-4-text').slideToggle('fast', function() {
// Animation complete.
});
$('#expand-4').toggleClass('expand-4-expanded');
});
</code></pre>
<p>It does not work though. Can someone tell me why?</p>
|
javascript jquery
|
[3, 5]
|
3,897,657 | 3,897,658 |
jQuery click.modalEvent
|
<p>Revising code of jQuery.reveal plugin (http://www.zurb.com/playground/reveal-modal-plugin) and trying to understand how it handles the modal behaviour, I see that it binds the closeModal function (that closes the popup) to the event <code>'click.modalEvent'</code>.</p>
<p>But I can't find any information about this event, I don't know if it belongs to javascript itself or if it's part of jQuery</p>
|
javascript jquery
|
[3, 5]
|
5,056,451 | 5,056,452 |
Broadcast a message to all available machines on WiFi
|
<p>my apologies if this is a trivial question.</p>
<p>I've recently begun doing some android programming and I'm writing a simple app that allows you to use your android device as a controller for your windows PC. Specifically it allows the user to do things like turn off the machine, make it sleep, reboot it etc etc. I'm currently using a python library called CherryPy as a server on the windows machine to execute the actual win32api calls to perform the desired function. What i'm not sure about is how to discover (dynamically) which machine on the network is actually hosting the server. Everything is working fine if I hardcode my machines public IP into the android app, but obviously that is far less than ideal. I've considered having the user manually enter their machines public IP in the app, but if there's a way to, say, broadcast a quick message to all machines on the WiFi and check for a pre-canned response that my Python server would send out, that'd be wonderful. Is that possible?</p>
<p>Thanks in advance guys.</p>
|
java android python
|
[1, 4, 7]
|
4,199,061 | 4,199,062 |
Which is better to initialize HTML control values: Javascript or inline server tags?
|
<p>Which is better/more maintainable, using Javascript to initialize the values of the different HTML controls or writing inline <code><% %></code> tags?</p>
<p>The current page I am writing has many HTML controls and I'm afreaid that putting inline ASP would make it too unmaintainable.</p>
|
asp.net javascript
|
[9, 3]
|
2,394,218 | 2,394,219 |
In asp.net, how can I tell what triggered an additional page_load call?
|
<p>Greetings.</p>
<p>Is there a good way to determine what is calling my Page_Load method? I've got a few Componentart WebUI grids that call it, although I've checked all of those (using the gridName.IsCallback property). I've also got an update panel, but I'm not sure how to check if it is the caller.</p>
<p>I'm betting there is a property somewhere that will tell me.</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
617,156 | 617,157 |
Open word document in browser
|
<p>I have successfully done code to display pdf file in browser instead of open "Open/Save" dialog.
Now I stuck on to display word document in browser. I want to display word document in firefox, IE7+, chrome etc.</p>
<p>Can any one help. I am always getting "Open/Save" dialog while displaying word doc in browser.</p>
|
c# asp.net
|
[0, 9]
|
2,159,580 | 2,159,581 |
Display dates not in database, only specific days of the week
|
<p>I have a sql database filled with specific dates for weekly training. We only have weekly training on Tuesdays and Wednesdays. It currently outputs like this:</p>
<pre><code>Training Schedule
Mar 4 - Training Title
Mar 5 - Training Title
Mar 12 - Training Title
Mar 19 - Training Title
</code></pre>
<p>Well now I am being asked to show dates that aren't in the database as well but only Tuesday's and Wednesdays. So basically it has to look like this now.</p>
<pre><code>Training Schedule
Mar 4 - Training Title
Mar 5 - Training Title
Mar 12 - Training Title
Mar 13 - No Training
Mar 19 - Training Title
Mar 20 - No Training
</code></pre>
<p>What is the best way to do this without going in and adding all the 'No Training' dates to the database (because that would take forever). Right now I'm simply just outputting the database results using the following code:</p>
<pre><code>var now = DateTime.Now;
var tableSql = "select * from Training where Date >= " + "'" + now + "'" + " order by Date";
pcm.CommandText = tableSql;
prs = pcm.ExecuteReader();
var rowcount = 0;
while (prs.Read())
{
rowcount++;
%>
<%=Convert.ToDateTime(prs["Date"].ToString()).ToString("MMM d").ToUpper()%> - <%=prs["Title"].ToString().ToUpper() %> <% } %>
<%
prs.Close();
pcn.Close();
%>
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,149,106 | 1,149,107 |
Jquery Notification Popups - jquery and updatepanels
|
<p>Hi i want notifications to popup if the need arises. I am using an asp.net timer which checks if a new message has arrived. The problem i am getting is that the jquery notification does not show up. I am guessing this is something to do with the update panel. Because when i tried calling it from pageload it worked fine. Here is my code;</p>
<pre><code> protected void updateTimer_OnTick(object sender, EventArgs e)
{
Cache Cache = new Cache();
users = Cache.getUserDetailsByUserID(Convert.ToInt32(Page.User.Identity.Name));
if (users._bNewNotification)
{
List<UserNotification> listUserNotification = null;
listUserNotification = Cache.getLatestNotifcationsByUserID(Convert.ToInt32(Page.User.Identity.Name));
foreach (UserNotification userNotification in listUserNotification)
{
StringBuilder jquery2 = new StringBuilder();
jquery2.AppendLine("$.extend($.gritter.options, {");
jquery2.AppendLine("position: 'bottom-left',");
jquery2.AppendLine("fade_in_speed: 100,");
jquery2.AppendLine("fade_out_speed: 100,");
jquery2.AppendLine("time: 3000");
jquery2.AppendLine("});");
Page.ClientScript.RegisterStartupScript(typeof(Page), Guid.NewGuid().ToString(), jquery2.ToString(), true);
StringBuilder jquery1 = new StringBuilder();
jquery1.AppendLine(" var unique_id = $.gritter.add({");
jquery1.AppendLine(" title: 'This is a sticky notice!',");
jquery1.AppendLine(" text: '" + userNotification._NotificationType + "',");
jquery1.AppendLine(" image: 'http://s3.amazonaws.com/twitter_production/profile_images/132499022/myface_bigger.jpg',");
jquery1.AppendLine(" sticky: true,");
jquery1.AppendLine(" time: '',");
jquery1.AppendLine(" class_name: 'my-sticky-class'");
jquery1.AppendLine(" });");
Page.ClientScript.RegisterStartupScript(typeof(Page), Guid.NewGuid().ToString(), jquery1.ToString(), true);
}
users._bNewNotification = false;
users.UpdateNewNotification();
Cache.RemoveUserProfileCacheByUserID(users._USERS_ID);
}
}
</code></pre>
<p>Can someone help me figure out what it is i am doing wrong, thanks</p>
|
c# jquery
|
[0, 5]
|
4,225,980 | 4,225,981 |
jQuery Ajax Call to asp.net webmethod
|
<p>Can any one say
How we can specify a Success Function in Jquery Ajax call.
Suppose I have function like below `function </p>
<pre><code>getComments(data,url,SucessFunction,FailurFunction) {
var list = [data];
var jsonData = JSON.stringify({ list: list });
$.ajax({
type: "POST",
url: url,
data: jsonData,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response, status) {
var List = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
$.each(List, function() {
if (this['Cid'] != "1000")
$('#' + ddlCities).append('<option value="' + this['Cid'] + '">' + this['CityCode'] + '</option>');
else ($('#outerDiv').html(this['City']));
});
}
});
</code></pre>
<p>}
`</p>
<p>In this how can define the success function ,error function</p>
<p>Like </p>
<pre><code>getComments(data,url,SucessFunction,FailurFunction) {
var list = [data];
var jsonData = JSON.stringify({ list: list });
$.ajax({
type: "POST",
url: url,
data: jsonData,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: SucessFunction
}
});
</code></pre>
<p>}</p>
<p>Thanks in advance.</p>
|
jquery asp.net
|
[5, 9]
|
2,451,163 | 2,451,164 |
Can any one tell me the issue of this function .. this function isn't working
|
<pre><code>$(window).unload(function() {
var c = confirm("Are You want to open Foortal.pk");
if (c) {
window.location.replace("http://www.google.com")
return true;
} else {
return false;
}
});
</code></pre>
<p>i don't know about problem</p>
|
javascript jquery
|
[3, 5]
|
2,529,025 | 2,529,026 |
jQuery make loaded file part of DOM
|
<p>I've loaded file in div</p>
<pre><code>$("#div").load("file.txt");
</code></pre>
<p>That file has html images .<br>
I want to access them by $('#div>img') (or other selectors), but nothing happens. If they were in page initially, there are no problems.</p>
<p>How can you access loaded content by jQuery as part of the usual page?</p>
|
javascript jquery
|
[3, 5]
|
1,865,768 | 1,865,769 |
Get elements width and height
|
<p>How can i get <code>height</code> and <code>width</code> of element which doesn't a part of <strong>DOM</strong> yet?</p>
<p><strong>For example:</strong></p>
<pre><code>var t = $('<div style="position:absolute;height:100px;width:100px;background-color:steelblue;" >lalala</div>');
var height = t.height(); // height is 0!
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,082,487 | 4,082,488 |
Split value into percentage with a slider
|
<p>im new to jQuery and searching a way for doing smthing like this:</p>
<p>I have a value [100] and 5 categorys [apple, banana, kiwi, lemon, orange]</p>
<p>What I want is to have for each category a slider (a line with a point on it you can move)</p>
<p>So every category starts with a value of 20 (100 / 5).</p>
<p>When there is more banana than apple and you "slide" banana to the value of 40 the other values should decrase so I've still the full percentage of 100%.</p>
<p>Anyone knows a plugin or has a handy snippet?</p>
<p>Thx in advance!</p>
|
javascript jquery
|
[3, 5]
|
2,738,334 | 2,738,335 |
Can anyone convert this to jQuery?
|
<p>I have the following JavaScript to make use of a modal overlay. Can this be converted to jQuery?</p>
<pre><code> function overlay() {
el = document.getElementById("overlay");
el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,028,760 | 3,028,761 |
Can't access a control from LoginTemplate in LoginView
|
<p>Code in aspx page</p>
<pre><code><asp:LoginView ID="loginView1" runat="server" EnableViewState="false">
<LoggedInTemplate>
<asp:Button ID="btnWatchlist" runat="server" Text="+ Watchlist" />
<asp:Button ID="btnPM" runat="server" Text="PM" />
<asp:Button ID="btnEdit" runat="server" Text="Edit" />
<asp:Button ID="btnReport" runat="server" Text="Report" />
</LoggedInTemplate>
</asp:LoginView>
</code></pre>
<p>Code in aspx.cs(Codebehind) to acccess the button id's</p>
<pre><code>Button watchList = (Button)loginView1.FindControl("btnWatchlist");
Button pm = (Button)loginView1.FindControl("btnPM");
Button report = (Button)loginView1.FindControl("btnReport");
Button edit = (Button)loginView1.FindControl("btnEdit");
</code></pre>
<p>watchList,pm,report,edit is getting null values.Any mistake in my code?</p>
<p>Thanks in Advance..</p>
|
c# asp.net
|
[0, 9]
|
2,451,267 | 2,451,268 |
upload image file without post back in asp.net
|
<p>Does anybody know how can I upload an image file in a specific folder without post back
using c# .</p>
|
c# asp.net
|
[0, 9]
|
789,663 | 789,664 |
How does one properly set an onclicklistener within another class?
|
<p>I have an activity which does all the setup process, i.e. creating the initial view and the OnClickListener, which then at some point creates an object passing the activity and OnClickListener as parameters. The object then does it's own setup, changing to view and setting TableRows with the OnClickListener. I run into the issue that when ever I click on one of the Rows, it seems OnClick(View v) is not called. The code seems solid but I'm either missing something or my implementation simply wont work. Any help would be appreciated.</p>
<pre><code>public class MyActivity extends Activity {
private Object mObject;
private TextView textView;
private OnClickListener mListener = new OnClickListener() {
public void onClick(View v) {
switch(v.getId()) {
case R.someId:
mObject = new Object(MyActivity.this, mListener);
break;
case R.id.table_row:
doSomething();
break;
}
}
}
textView = (TextView)findViewById(R.id.someId);
textView.setOnClickListener(mListener);
}
public class Object {
private Activity mActivity;
private OnClickListener mListener;
private TableRow tableRow;
public Object(Activity a, OnClickListener o) {
mActivity = a;
mListener = o;
mActivity.setContentView(R.layout.layout);
tableRow = (TableRow)findViewById(R.id.table_row);
tableRow.setOnClickListener(mListener)
}
}
</code></pre>
<p>Edited code as suggested:</p>
<pre><code>public class MyActivity extends Activity implements OnClickListener{
private Object mObject;
private TextView textView;
@override
public void onClick(View v) {
switch(v.getId()) {
case R.someId:
mObject = new Object(MyActivity.this, mListener);
break;
case R.id.table_row:
doSomething();
break;
}
}
}
</code></pre>
<p>I omitted the Object class because with the above code onClick is not called without setting the OnClickListener with view.setOnClickListener(this); This also does not allow me to pass the Listener itself as a parameter, as far as I know.</p>
|
java android
|
[1, 4]
|
4,002,230 | 4,002,231 |
Can we change the font size through code behind?
|
<p>I need to change the font size of bold thing below. I have a css for use but this bold part needs font changed to 8px instead of 10(css). i want someone to help me with how to change in Code behind.</p>
<pre><code>string newpackname = dschkdowngraded.Tables[0].Rows[0]["ChangedTo"].ToString();
DateTime dt = Convert.ToDateTime(dschkdowngraded.Tables[0].Rows[0]["TakesAffect"]);
dt = dt.Date;
// need to change what is inside the ()
string packname = accountSummary.PackageName + " (Downgraded to "
+ newpackname + ". Effective from " + dt + ")";
</code></pre>
<p>Css is here:</p>
<pre><code>float: left;
padding-right: 10px;
color: #0d7194;
font-weight: bold;
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,730,547 | 1,730,548 |
link press using keys in jquery
|
<p>I have a HTML page with jquery loaded in and 2 links on the page.</p>
<pre><code><a href='www.example.com'>Buttona</a>
<a href='www.example2.com'>Buttonb</a>
</code></pre>
<p>How can I make pressing the "1" key be like pressing the first link, and pressing the "2" key be like pressing the second link using jquery?</p>
|
javascript jquery
|
[3, 5]
|
2,636,931 | 2,636,932 |
Hide page when second click on menu
|
<p>I use jQuery to display an accordion menu when clicking on a menu title.</p>
<p>The first click displays the corresponding details page, and it works fine. Now, I need to hide this details page when the user clicks on that link for the second time.</p>
<p>Thanks in advance for help.</p>
|
javascript jquery
|
[3, 5]
|
1,596,049 | 1,596,050 |
In Netbeans IDE, java web application project doesn't support php?
|
<p>In NetBeans IDE 6.9 there is no option to create a php file in java web project. But we can create a n empty file and save it as .php . However when i run the project php code is not interpreted. The code inside php tags is printed as it is. What am i doin wrong. Please can someone help me. Please.
Thanks in advance.</p>
|
java php
|
[1, 2]
|
3,523,592 | 3,523,593 |
jQuery Jump Menu Functionality For iPhone
|
<p>On my page I have a regular list of links.</p>
<p>I found a script that will convert that to a select box and options that replicate the links.</p>
<p>Using the select box, and selecting one of the 3 options jumps to that options value/url.</p>
<p>But, it does not work on my iPhone. Does anyone know how I could adjust this to work on iPhone/mobile?</p>
<p><a href="http://tinyurl.com/8a52uav" rel="nofollow">http://tinyurl.com/8a52uav</a></p>
<p>Thank you for any help. I am not good with jQuery at all really :(</p>
|
javascript jquery iphone
|
[3, 5, 8]
|
1,824,249 | 1,824,250 |
simulating mouse click
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4158847/is-there-a-way-to-simulate-key-presses-or-a-click-with-javascript">Is there a way to simulate key presses or a click with javascript?</a> </p>
</blockquote>
<p>I know it's an old and repeated question, but before replying "google it", read the question plz . </p>
<p>I'm trying to simulate some of user interactions with page in my chrome extension and one of them is mouse click. I can "click" on links with a proper href and move to that page (window.location etc ) but my problem is with anchors that load content via ajax, for example in facebook home page, if I want to trigger the "Top News" news feed button, in theory I should use : <code>$(".uiHeaderActions .fwn").click();</code> but it doesnt do anything ... and idea ?</p>
|
javascript jquery
|
[3, 5]
|
288,927 | 288,928 |
How to access the values from strings.xml dynamically?
|
<p>What I want to do is to get a specific text from <code>strings.xml</code> dynamically. I think it will involve to access an object variable dynamically.
There will be a function like:</p>
<pre><code>public void getDynamicString(int level) {
text.setText(R.string.levelText_+level);
}
</code></pre>
<p>And in <code>strings.xml</code> there will be <code><string name="levelText_5">Text level 5</string></code></p>
<p>I would rather not create a list with all the text resources. Can one do this in Java/Android.</p>
|
java android
|
[1, 4]
|
4,065,035 | 4,065,036 |
Jquery/Javascript looping div scroller
|
<p>I'm trying to make 5 divs that loop in and out forever. The divs will have classes "text1" "text2" "text3" etc. Is there anything wrong with this code? It doesn't seem to work.</p>
<pre><code>$(document).ready(function(){
var num = 1
while(num =< 5) {
$('.text' + num).fadeIn().delay(4000).fadeOut()
var num = num ++i
if(num == 5) {
var num = 1
}
else{
var num = num
}
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,013,883 | 2,013,884 |
how to get property from other function
|
<p>I want to access var w value from other function. Is it possible.</p>
<pre><code><script type="text/javascript">
var first = {
myFirst: function(){
var w= 90;
var q=12;
}}
var second= {
mySecond: function(){
first.myFirst.w
}}
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,632,384 | 3,632,385 |
How to bring focus to a window in jquery?
|
<p>I am trying to bring focus to window using jquery. The window is popup initiated through a button click on the parent page. I have some ajax calls going on in the child window, so data is being updated. My issue is that if the user clicks on the parent window and hides the child behind it, i would like to bring that child window back to the forefront if there is a data update.</p>
<p>inside $(document).ready I wire up these events:</p>
<pre><code> $(window).blur(function(){
WindowHasFocus =false;
}).focus(function(){
WindowHasFocus =true;
});
</code></pre>
<p>Then, if data is updated, I call this function:</p>
<pre><code>function FocusInput(){
if(!WindowHasFocus){
$(window).focus();
}
}
</code></pre>
<p>This works as expected in IE8, but in FireFox(and all other browsers) the Blur event nevers seem to fire if I click the parent window. Any suggestions/ideas on how achieve this?</p>
<p>update:</p>
<p>Total facepalm moment:
In FireFox:
* Tools
* Options…
* Content tab
* Advanced button next to “Enable JavaScript”
* check the box named "Raise or Lower Windows"</p>
|
javascript jquery
|
[3, 5]
|
3,189,902 | 3,189,903 |
How can I insert a variable into a variable string?
|
<p>I have this code which I need to set a unique <code>title</code>:</p>
<pre><code>var tmpImg = '<img src="/admin/icons/cross.png" title="' + title + '" />';
$(this).find("tr td input").each(function(){
title = $(this).attr("value");
$(this).hide().before(tmpImg);
});
</code></pre>
<p>What I want to happen, is that each time the <code>each</code> iterates over the <code><input></code>, it updates the <code>title</code> value in the <code>tmpImg</code> string. I know I could separate the img HTML like below, although I think this would get messy when I need to reuse the image later down the script.</p>
<pre><code>var tmpImg = '<img src="/admin/icons/cross.png" title="';
$(this).find("tr td input").each(function(){
title = $(this).attr("value");
$(this).hide().before(tmpImg + title + '" />');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,092,587 | 5,092,588 |
jquery/javascript menu issue .siblings() .toggle()
|
<p>I have coded a 3 level drop down menu in jquery and everything is working perfectly except for when I collapse the top level, it doesn't collapse the third level, i.e.:</p>
<pre><code>level 1
level 2
level 3
</code></pre>
<p>when I collapse it I get:</p>
<pre><code>level 1
level 3
</code></pre>
<p>when it should read:</p>
<pre><code>level1
</code></pre>
<p>I understand you can do this using the silbing function, but I then run into problems because I am using a toggle class as well to change an arrow either facing right or down depending on whether or not the menu is open. It closes the two sub menu levels, but doesn't toggle them so when you reopen that menu the arrows are still facing down when they should be facing right.</p>
<p>Here is my source:</p>
<pre><code>$(function() {
$("li.level2").hide();
$("li.level3").hide();
$("ul.navigation").delegate(".level1", "click", function() {
var item=$(this);
$(this).nextUntil(".level1", ".level2", ".level3").toggle();
$(this).toggleClass("highlight");
});
$("ul.navigation").delegate(".level2", "click", function() {
var item=$(this);
$(this).nextUntil(".level2",".level3").toggle();
$(this).toggleClass("highlight");
});
});
</code></pre>
<p><a href="http://jsfiddle.net/qM62Z/" rel="nofollow">Jsfiddle here</a>. Basically green is level 1 orange is level 2 and red is when the menu is open, if you click on "algebra" and then "year 11" so 2 sub menus are open then click on algebra again it doesn't close the submenus under year 11, and when you use .siblings() the toggle function isn't activated so when you click on "algebra" again to reopen it, "year 11" is read because it hasn't been toggled.</p>
|
javascript jquery
|
[3, 5]
|
4,725,390 | 4,725,391 |
i want to store user clicks in database using php and jquery
|
<p>My users table field is id,name,twitter and clicks
(clicks is hidden )</p>
<p>Logic is : whenever user clicks on another users twitter id then it should be counted and then new updated click should be stored in database.
i can do above logic.</p>
<p>But i don't know that how to detect clicks made by mouse on any link.
I mean
If the link is <a href="http://www.twitter.com/twitter" rel="nofollow">http://www.twitter.com/twitter</a> now if user clicks on that link then clicks of that link should be increased by 2.
please provide me proper info for it.
any help ?</p>
<p>Update:</p>
<pre><code> <?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("users", $con);
$result = mysql_query("SELECT *
FROM `users`
ORDER BY `users`.`clicks` DESC
LIMIT 0 , 30");
while($row = mysql_fetch_array($result))
{
echo $row['id'] . " <a href=" . $row['twitter']." target='_blank'>".$row['clicks']."</a>";
echo "<br />";
}
// some click detection code may be here..
mysql_close($con);
?>
</code></pre>
<p>Just any one tell me that how to store clicks in variable from $row['clicks']
if jquery is needed, then pls provide proper code that best match my above code.</p>
|
php jquery
|
[2, 5]
|
1,682,000 | 1,682,001 |
How to make a Dropdownlist in the header reload the main page?
|
<p>Basically, I have this webpage that is the header on any page you go to. One of the elements in this header is a drop down list that is populated with customer names. On one of these pages there are text fields that need to update with new data depending on if the user selects a different customer from the drop down list in the header. However, since I am pretty new to web-based programming, I'm not sure what code to put in the header that will make the main page below it reload when the drop down list index is changed. Also, the language this is all in is asp.net and C#</p>
|
c# asp.net
|
[0, 9]
|
4,244,490 | 4,244,491 |
Displaying and retreiving 'seconds' with TimePicker
|
<p>Currently the TimePicker view shows only hours and minutes by default and I am retrieving the values using <code>getCurrentHour()</code> and <code>getCurrentMinute()</code>.</p>
<p>Is there a solution to add seconds to the TimePicker view?</p>
|
java android
|
[1, 4]
|
2,436,681 | 2,436,682 |
JQuery's .append() executes 6 times instead of 1
|
<p>Basically, what I'm trying to do is create a marquee type thing by scrolling vertically through the banners and then moving each to the bottom after it is out of view. I can't figure out why the banner is being appended six times. I realize that it's not quite complete so don't make a remark about that please. If you have a better suggestion, let me know. <a href="http://jsfiddle.net/vCuHc/2/" rel="nofollow">http://jsfiddle.net/vCuHc/2/</a></p>
<p><strong>EDIT:</strong> How can I append the top element to the bottom and then remove the top element also?</p>
|
javascript jquery
|
[3, 5]
|
1,368,147 | 1,368,148 |
Color not changing using Jquery
|
<p>I want the default "CSS class"to be black, and when using this select function for "selected" to have white text. I don't know where I'm going wrong</p>
<pre><code>$(function() {
$('a.link').click(function() {
$('a.link').removeClass('selected');
$(this).addClass('selected');
$(this).css('color', 'white');
$(this).addClass('result-holder');
$(this).css('color', 'black');
});
});
</code></pre>
<p>Image demonstrating the problem:</p>
<p><img src="http://i.stack.imgur.com/ZOPXb.png" alt="enter image description here"></p>
<p><a href="http://imgur.com/AquDa" rel="nofollow">http://imgur.com/AquDa</a></p>
|
javascript jquery
|
[3, 5]
|
4,347,565 | 4,347,566 |
conversion type
|
<pre><code>typedef wchar_t WCHAR buf[1024] ; // code from C++ dll
</code></pre>
<p>how to define above line of code in C# ? </p>
|
c# c++
|
[0, 6]
|
1,997,606 | 1,997,607 |
call to a function that changes picture every 2 seconds
|
<p>i have a picture and i want to change it every 2 seconds when my mouse is on it.
so i write:</p>
<pre><code>$("#profilePic").mouseover(function() {
var t = setTimeout("pictureChanger()",2000);
});
</code></pre>
<p>and this is the function:</p>
<pre><code>function pictureChanger() {
currentPicture++;
currentPicture = currentPicture % NUM_PICTURES;
$("#profilePic").src = pictures[currentPicture];
}
</code></pre>
<p>it doesn't work.. however when i write <code>$("#profilePic").src = pictures[currentPicture];</code> inside the function of <code>mouseover</code> it does replace the picture. so i guess the problem is with the function <code>pictureChanger</code>..
how to i fix it so that the function will replace my pictures?</p>
<p>thank you! </p>
|
javascript jquery
|
[3, 5]
|
3,926,240 | 3,926,241 |
How to send dynamic array value in another php file using jQuery
|
<p>Please, help me to solve this problem</p>
<p>When I am trying Single input value then input value transfer data.php file successfully and I get input value in data.php file to write this code echo $name=$_POST[‘name’]; but I can transfer input array value in data.php file, actually I have not enough knowledge about jquery. So anyone can help me to solve this problem. What’s the write jquery code for transferring array value in data.php file and what’s the write php code for echo. </p>
<pre><code> <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
function get(){
$('#age').hide();
$.post('data.php',{ name: form.name.value },
// this code don't work in array
// how can i transfer name[] value in data.php file
function (output){
$('#age').html(output).fadeIn(1000);
});
}
</script>
<body>
<form name="form" action="a.php">
<input type="text" name="name[]" value="1"/>
<input type="text" name="name[]" value="2"/>
<input type="button" value="Get" onclick="get();"/>
</form>
<div id="age">
</div>
</body>
</code></pre>
|
php jquery
|
[2, 5]
|
2,803,533 | 2,803,534 |
setting display property in the code behind
|
<p>How can i set the display property to block in the code behind?</p>
<pre><code><asp:Panel ID="pnlHedgingTypeI" Style="display:none" runat="server">
pnl.Attributes.Add("display", "block");
</code></pre>
<p>is not helping me ..Could you please help me to resolve this?</p>
|
c# asp.net
|
[0, 9]
|
4,061,453 | 4,061,454 |
Can you specify the load order for page elements?
|
<p>I think I know the answer to this, but want to make sure I've not missed something...</p>
<p>I have a webpage that has a small, flash logo animation at the top of the screen. I've kept it minimal and it's just a logo, so no critical navigation or anything silly in there. Because it's the first large element to load however, it's sometimes hangs the page a bit and slows everything else down.</p>
<p>Is there a way to tell it the page to load that flash element last? It's the only flash element and I've already implemented jquery on the page (I don't know if that gives me an option?)</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
441,583 | 441,584 |
Bitmap Parameter Invalid
|
<p>I am facing an error when trying to create a bitmap directly from a string that contains file name and path.</p>
<p>My Code is described below:</p>
<pre><code>if (!string.IsNullOrEmpty(Request.QueryString["imagename"]))
{
string Image = Request.QueryString["imagename"];
Bitmap originalBMP = new Bitmap(Server.MapPath(@"UserImages/" + Image));
// Calculate the new image dimensions
int origWidth = originalBMP.Width;
int origHeight = originalBMP.Height;
int sngRatio = origWidth / origHeight;
int newWidth = 50;
int newHeight = newWidth / sngRatio;
// Create a new bitmap which will hold the previous resized bitmap
Bitmap newBMP = new Bitmap(originalBMP, newWidth, newHeight);
// Create a graphic based on the new bitmap
Graphics oGraphics = Graphics.FromImage(newBMP);
// Set the properties for the new graphic file
oGraphics.SmoothingMode = SmoothingMode.AntiAlias; oGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
// Draw the new graphic based on the resized bitmap
oGraphics.DrawImage(originalBMP, 0, 0, newWidth, newHeight);
// Save the new graphic file to the server
Response.ContentType = "image/PNG";
newBMP.Save(Response.OutputStream, ImageFormat.Png);
originalBMP.Dispose();
newBMP.Dispose();
oGraphics.Dispose();
}
</code></pre>
<p>But the following code is producing an error that Parameter is Invalid:</p>
<pre><code>Bitmap originalBMP = new Bitmap(Server.MapPath(@"UserImages/" + Image));
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,849,213 | 5,849,214 |
Given a string of html code, how can I go through every tag and remove ones that is not in my whitelist (in JQuery)?
|
<pre><code>var whitelist = ['a','div','img', 'span'];
</code></pre>
<p>Given a block of HTML code, I want to go through <strong>every single tag</strong> using JQuery</p>
<p>Then, if that tag is NOT in my whitelist, <strong>remove it and all its children.</strong></p>
<p>The final string should now be sanitized.</p>
<p>How do I do that?</p>
<p>By the way, this is my current code to remove specific tags (but I decided I want to do whitelist instead)</p>
<pre><code> var canvas = '<div>'+canvas_html+'</div>';
var blacklist = ['script','object','param','embed','applet','app','iframe',
'form','input', 'link','meta','title','input','button','textarea'
'head','body','kbd'];
blacklist.forEach(function(r){
$(canvas).find(r).remove();
});
canvas_html = $(canvas).get('div').html();
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,316,384 | 1,316,385 |
event contex for live function in jquery
|
<p>HI ,</p>
<p>I am using JQuery 1.3 , I am facing problem in using <code>live</code> event as in jQuery <code>DOM</code> element "context" is bound to default document root. So how to overcome such thing?</p>
<p>From <a href="http://api.jquery.com/live/" rel="nofollow">jQuery documentation</a>:</p>
<blockquote>
<p>As of jQuery 1.4, live events can be bound to a DOM element "context"
rather than to the default document root. To set this context, we use the
jQuery() function's second argument, passing in a single DOM element (as
opposed to a jQuery collection or a selector).</p>
</blockquote>
|
javascript jquery
|
[3, 5]
|
76,593 | 76,594 |
How can convert ArrayList<Long> to String in Java (Android)?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/599161/best-way-to-convert-an-arraylist-to-a-string">Best way to convert an ArrayList to a string</a> </p>
</blockquote>
<p>I need your help! I have array of JSon (esponse from Facebook). ArrayList. How can convert this array to String? Thanks.</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.