Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
|---|---|---|---|---|---|
5,278,225
| 5,278,226
|
jquery select remove undefined?
|
<p>I using jquery how do i remove the one of the elements of the select dropdown where the value</p>
<pre><code><option value=" ">undefined</option>
</code></pre>
<p>i tried </p>
<pre><code>$("#subType option[value=' ']").remove();
$("#subType option[value='']").remove();
</code></pre>
<p>None of them worked.</p>
<p>Please advise.</p>
|
javascript jquery
|
[3, 5]
|
1,356,655
| 1,356,656
|
How to get input value to modal box jquery UI
|
<pre><code><div id="befor-box">
<form id="newsletter-form" name="newsletter-form" action="/sub/" method="post">{% csrf_token %}
<input name="email" type="text" value="Enter your Email here" class="text"/>
<input class="submit" onclick="showDialog();" value="Subscribe!" />
</form>
</div>
</code></pre>
<p>How to get EMAIL value from:</p>
<p><code><input name="email" type="text" value="Enter your Email here" class="text"/></code> </p>
<p>to:</p>
<p><code><input name="email" type="text" value="" class="text"/></code></p>
<p>from here:</p>
<pre><code><div id="dialog-modal" style="display:none;">
<form name="newsletter-form" action="/sub/" method="post">
<input name="email" type="text" value="" class="text"/>
<input name="fname" type="text" value="First name" class="text"/>
<input name="lname" type="text" value="Last name" class="text"/>
<input type="submit" class="submit" value="Subscribe!" />
</form>
</div>
<script type="text/javascript">
function showDialog()
{
$( "#dialog-modal" ).dialog({
});
}
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,931,042
| 4,931,043
|
to pass values (data) from our application to native app in android?
|
<p>i am developing program for union and intersection of two strings in android, i also calculate number of character in union as well intersect results individually?the results values (union&intersect) should pass to native calculator and the result will shown in calculator?</p>
<p>i have to pass the that result data to native calculator?</p>
<p>examle:i have two strings</p>
<blockquote>
<p>sunday,
monday</p>
</blockquote>
<p>the union is:<strong>sundaymo</strong>,the length of result <strong>union</strong> string is:<strong>8</strong>
the intersection is :<strong>nday</strong>,the length of result intersection string is:<strong>4</strong></p>
<p>the sum of <strong>union and intersection</strong> is :<strong>8+4=12</strong>;
the values 8 and 4 should pass to <strong>native calculator</strong>,the result should be shown in <strong>native</strong> <strong>calculator</strong>.</p>
<p>how should i do please provide code for me
please answer to me</p>
|
java android
|
[1, 4]
|
5,376,492
| 5,376,493
|
Rendering javascript code in php document
|
<p>I'm a beginner to PHP and I have a quick question. Is it possible to have javscript code injected into a document through php?</p>
<p>For example, suppose I wanted to inject a button that called a function after a form is filled out:</p>
<pre><code><html>
<head>
<script type = text/javascript>
function func() {
...
}
</script>
</head>
<body>
<form action = 'welcome.php' method = 'post>
Name: <input type = 'text' name = 'fname' />
<input type = 'submit' value = 'submit' />
</form>
<?php
if (isset($_POST['fname'])) {
echo '<input type = button onclick = func />'
}
?>
</body>
</html>
</code></pre>
<p>Would this work? If not, why not?</p>
<p>Any help would be great</p>
|
php javascript
|
[2, 3]
|
2,086,132
| 2,086,133
|
How to have custom object listen for child custom object's events?
|
<p>I am trying to create a couple of custom objects in JavaScript and I am unsure if I am going about things the proper way.</p>
<p>I have two objects: 'UserInterface' and 'VolumeSlider'. Up until a moment ago these two objects were independent, but coupled through methods. I decided that UserInterface should instead 'have' a VolumeSlider.</p>
<p>So:</p>
<pre><code>UserInterface = {
_volumeSlider: null,
initialize: function () {
this._volumeSlider = VolumeSlider; //TODO: Should this be a new volumeSlider();
this._volumeSlider.initialize();
//I want to setup a listener for VolumeSlider's change-volume events here.
}
}
VolumeSlider = {
_volumeSlider: null,
initialize: function () {
this._volumeSlider = $('#VolumeSlider');
var self = this;
this._volumeSlider.slider({
orientation: 'horizontal',
max: 100,
min: 0,
value: 0,
slide: function (e, ui) {
self.passVolumeToPlayer(ui.value);
},
change: function (e, ui) {
self.passVolumeToPlayer(ui.value);
}
});
},
passVolumeToPlayer: function (volume) {
if (volume != 0)
UserInterface.updateMuteButton(volume);
else
UserInterface.updateMuteButton('Muted');
}
}
</code></pre>
<p>Question is two-fold:</p>
<ul>
<li>Is this an alright way to be creating my objects and setting up children?</li>
<li>I would like UserInterface to be able to respond to VolumeSlider._volumeSlider's change and slide events instead of having to be explicitly told. How can I go about accomplishing this?</li>
</ul>
|
javascript jquery
|
[3, 5]
|
5,760,581
| 5,760,582
|
Using JavaScript to switch through tabs without changing layout?
|
<p>My webpage is at <a href="http://sarahjanetrading.com/js/j/index.html" rel="nofollow">http://sarahjanetrading.com/js/j/index.html</a></p>
<p>I have done all the layout and coding. I want the tabs to toggle when clicked over them. I tried google but was in vain. I am willing to achieve the effect using either JavaScript or jQuery. My tabs are empty right now, And I want the layout to remain the same.</p>
<p>NEW :</p>
<p>This is my code so far: </p>
<pre><code><script type="text/javascript">
var lis = $('#main-tabs li');
lis.click( function() {
//Reset all the tabs
lis.removeClass('active-tab').addClass('inactive-tab');
$(this).addClass('active-tab');
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$(".tab-content").hide();
$("ul#main-tabs li a:first").addClass("active").show();
$("#wrap > div").hide().filter(":first").show();
$("ul.tabs li a").click(function() {
$("ul.tabs li > a").removeClass("active");
$(this).addClass("active");
$("#wrap > div").hide();
var activeTab = $(this).attr("href");
$(activeTab).show();
return false;
});
});
</script>
</code></pre>
<p>For the full HTML and JavaSript code (new) please go to <a href="http://sarahjanetrading.com/js/j/index.html" rel="nofollow">http://sarahjanetrading.com/js/j/index.html</a></p>
<p>What it does is that when I click on a list item, it changes the tab, but not the content. And when I click on the anchor of a list item, it changes the content, but not the tab. I want both the content and the tab to change consistently. </p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,409,684
| 3,409,685
|
how to use different sender than credentials use in smtp configuration in asp.net
|
<p>Hi in my web application we are sending mail to the person who<code>s birthday is in current week, so while sending mail i don</code>t want sender as email id which is used in smtp configuration i want to use different email id as sender,</p>
<p>Can any one tell me how i can achieve this,</p>
|
c# asp.net
|
[0, 9]
|
335,966
| 335,967
|
Selecting readOnly textboxes with JQuery
|
<p>In my ASP.NET MVC project i need to select all text boxes that have attributed "readOnly" in current page and show modal Jquery dialog in keypress on the disabled text box.Any help appreciated.</p>
|
javascript jquery
|
[3, 5]
|
210,883
| 210,884
|
How to send selected information from Android phone to Hotel Management Software
|
<p>I am developing my first android application for restaurant in which i want to the customer to select the recipes from menu. Now as per my need i have to send the order from particular customer to the Hotel Management Software running on the Reception. I am stuck with the following concerns:</p>
<ol>
<li><p>How to differentiate identity of order from individual customer ?</p></li>
<li><p>How to send Acknowledge to the Hotel Management Software and Send response to the customer that order has been placed ?</p></li>
</ol>
|
java android
|
[1, 4]
|
5,511,861
| 5,511,862
|
How can I submit a web form by clicking keyboard button?
|
<pre><code><form action="page.php" method="post">
<input type="text" name="some_text" />
<input type="submit" name="some_submit" /
</form>
</code></pre>
<p>I want to submit this form by pressing defined keyboard button. I wonder how to do it. If it was just an <code><a></code> element it would be simple - I would just change <code>window.location</code> value after handling keypress event. But there is some data to send and I have no idea how to solve this.</p>
|
php javascript
|
[2, 3]
|
3,445,802
| 3,445,803
|
Page postback even though validate function returns true
|
<p>I am using ASP.NET 4.0, JS, and Jquery for some validation. My js is throwing this error after my validation runs and returns false. It also is allowing for a post back to occur. </p>
<p>JS excerpt throwing the error:</p>
<pre><code> var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
Sys.Observer.raiseEvent(this, "endRequest", eventArgs);
if (error && !eventArgs.get_errorHandled()) {
throw error;
}
</code></pre>
<p>My full error message:</p>
<pre><code>SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: Index was outside the bounds of the array.
ScriptResource.axd, line 938 character 13
</code></pre>
<p>my JS:</p>
<pre><code> if (regex) {
result = patt.test($(this).val());
} if (!result) {
//return false;
$(this).focus();
alert("Please enter the " + failed_type + " in the following format: " + format);
return false;
}
</code></pre>
<p>Button:</p>
<pre><code><asp:Button ID="Update" runat="server"
Text="Update" CssClass="button"
TabIndex="4" OnClientClick="return update_Click(event);" OnClick="Update_Click" />
</code></pre>
<p>Call Stack:</p>
<pre><code>PageRequestManager$_endPostback,ScriptResource.axd line 938
PageRequestManager$_parseDelta,ScriptResource.axd line 1653
PageRequestManager$_onFormSubmitCompleted,ScriptResource.axd line 1414
Anonymous Function, ScriptResource.axd, line627
Anonymous function, ScriptResource.axd, line 4337
raise, ScriptResource.axd, line 7247
WebRequest$completed, ScriptResource.axd, line 7251
WebRequest$completed, ScriptResource.axd, line 7251
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,316,206
| 1,316,207
|
Efficiently Composing a Dialog using BlockUI and jQuery
|
<p>I am creating a small wrapper for the fantastic <a href="http://jquery.malsup.com/block/" rel="nofollow">BlockUI</a> plugin used in my application to easily create dialogs that meet my needs.</p>
<p>Sometimes I am a bit jQuery retarded and would like to know from any of the aficionados out there how they would do this particular task.</p>
<p>This function creates a header, middle and footer custom to my application. Uses some passed in options to fill out the HTML further. Composes the dialog and then inserts it into the <a href="http://jquery.malsup.com/block/" rel="nofollow">BlockUI</a> plugin.</p>
<pre><code>function blockApp(element, options){
var header = jQuery('<div class="modal-header clearfix"><h2></h2><span><a href="#"></a></span></div>'),
center = jQuery('<div class="modal-content"></div>'),
footer = jQuery('<div class="modal-footer"></div>');
//Compose dialog
var opts = jQuery.extend({}, dialogDefaults, options);
header.find('h2').html(opts.title);
center.html(jQuery(element).html());
var comp = jQuery('<div></div>').append(header).append(center).append(footer);
jQuery('#notificationUI').block(jQuery.extend({}, standardBlock, {
message: comp,
}));
jQuery('.blockOverlay').click(function(){
jQuery('#notificationUI').unblock();
});
}
</code></pre>
<p>I tried using wrap() and wrapInner() at first with no success also.</p>
<p>My question is <strong>How would John Resig do this</strong>?</p>
|
javascript jquery
|
[3, 5]
|
802,864
| 802,865
|
Passing an object's hierarchy as an argument to it's parent function
|
<p>I have an Object called <code>html</code> inside a Function called <code>tpl()</code>.</p>
<pre><code>html = {
intro: ['intro', 'html'],
common: { header: ['common', 'header', 'html'] },
more:{ header: { link: ['hello', 'world'] } }
};
</code></pre>
<p>I am trying to access <code>html</code>'s values by passing it's hierarchy as an argument to <code>tpl()</code>;</p>
<p>I pass a String <code>common.header</code> as an argument, in order to get back the inner-object's content.</p>
<p>[example]:</p>
<pre><code>var a = tpl('common.header'); // correct, returns 'common header html'
</code></pre>
<p>The issue, is when I need to target deeper nested objects:</p>
<pre><code>var b = tpl('more.header.link'); // how can i make this work ?
</code></pre>
<hr>
<p>This is the function I wrote, I am trying however to make it more <em>dynamic</em> (make it possible to work with deeper objects).</p>
<pre><code>var tpl = function( path ){
if(!path){ return false; }
var that = this;
that.html = {
intro: ['intro', 'html'],
common: { header: ['common', 'header', 'html'] },
more: { header: { link: ['hello', 'world'] } }
};
path = path.split('.');
return (!!path[1] ? that.html[path[0]][path[1]] : that.html[path[0]]).join('');
/*
// Here is where I am stuck
for(var i = 0; i < path.length; i++){
if( path[i][ path[i+1] ] ){}
}
*/
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,020
| 4,021
|
How to retrive "Last Modified Date" of uploaded file in ASP.Net
|
<p>I am developing a website, in which client uploads some document files like doc, docx, htm, html, txt, pdf etc. I want to retrieve last modified date of an uploaded file. I have created one handler(.ashx) which does the job of saving the files.</p>
<pre><code>Following is the code:
HttpPostedFile file = context.Request.Files[i];
string fileName = file.FileName;
file.SaveAs(Path.Combine(uploadPath, filename));
</code></pre>
<p>As you can see, its very simple to save the file using file.SaveAs() method. But this HttpPostedFile class is not exposing any property to retrieve last modified date of file.</p>
<p><strong>So can anyone tell me how to retrieve last modified date of file before saving it to hard disk?</strong> </p>
|
c# asp.net
|
[0, 9]
|
5,899,346
| 5,899,347
|
How to run onclick event in asp.net from another button's javascript?
|
<p>Void button has a confirm box after receiving true, expecting running another button's click event
however, Void2_Button_Click not run, where is wrong?</p>
<pre><code>protected void Void2_Button_Click(object sender, EventArgs e)
{
// do something
}
Void_Button.Attributes.Add("onclick", "var agree=confirm('Confirm to void?'); if (agree){document.getElementById('Void2_Button').click();}");
</code></pre>
<p>This question has not been solved yet, Who can answer?</p>
|
c# asp.net
|
[0, 9]
|
2,814,298
| 2,814,299
|
How to design with Paging of Gridview with additional options
|
<p>I have a problem that I want to design a gridview with additional options with paging in a different way which is shown in below images. I can implement simple paging concept in GridView but that will not shown like this which I desired as in images. This will show Records Per Page options also. Please suggest me any solution regarding this.</p>
<p>Thanks in advance.</p>
<p><img src="http://i.stack.imgur.com/ESHCj.png" alt="enter image description here"></p>
|
c# asp.net
|
[0, 9]
|
1,021,259
| 1,021,260
|
How to programmatically get session cookie name?
|
<p>The default cookie name for the Session Id in ASP.NET is <code>ASP.NET_SessionId</code>. It's also possible to change this name to something else like <code><sessionState cookieName="FooBar" /></code>. </p>
<p>Is there a member to easily access this name like with <code>FormsAuthentication.FormsCookieName</code>?</p>
|
c# asp.net
|
[0, 9]
|
3,321,567
| 3,321,568
|
How to convert asp:label to asp:texbox in asp.net?
|
<p>On the <code>page_load</code> event I am checking if the authorization is <code>Admin</code> or not. If they are not in the <code>Admin</code> role then I have to change the available <code>**asp:label**</code> control to an <code>**asp:textbox**</code> control in the UI.</p>
<p>1) Will it be possible to dynamically convert/replace an <code>asp:label</code> control to an <code>asp:textbox</code> control?</p>
<p>2) If conversion/replacement is possible, then can I do it in the code behind instead of using <code>Jquery</code>?</p>
<p>FYI : I am using <code>c#</code>, <code>ASP.NET</code>.</p>
<pre><code><asp:Label ID="label1" runat="server" Text="Data">&nbsp;</asp:Label>
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,133,853
| 3,133,854
|
How to merge mutiple tables into one, with same schema and column names
|
<p>I have 3 collection datatable that shows in this below</p>
<pre><code>Month: January
ID NAME Absent
001 John 3
002 Travis 0
Month: February
ID NAME Absent
001 John 18
002 Travis 14
Month: March
ID NAME Absent
001 John 10
002 Travis 5
</code></pre>
<p><strong>Before</strong>, I have used to <code>merge</code> DataTable</p>
<pre><code>dataTable.merge(dataTable2);
</code></pre>
<p>The result is like this:</p>
<pre><code>ID NAME Absent
001 John 3
002 Travis 0
001 John 18
002 Travis 14
001 John 10
002 Travis 5
dataTable.Merge(dataTableTemp);
GridView.DataSource = dataTable;
GridView.DataBind();
</code></pre>
<p><strong>But, I want to create like this</strong> (we say: custom GridView):</p>
<pre><code> Jan Feb Mar Apr
ID NAME Absent Absent Absent Absent
001 John 3 18 10
002 Travis 0 14 5
</code></pre>
<p>How to add/merge every month in the right side of table before, so if I add next month it will appear in the right side of table before..</p>
<p>How to create this:??? Is there any method of function or tools that I can use??</p>
<p>Thanks for any help..</p>
|
c# asp.net
|
[0, 9]
|
2,998,105
| 2,998,106
|
Issue with writeCapture in safari 5.1 , while loading banner ad
|
<p>I am, using <a href="https://github.com/iamnoah/writeCapture" rel="nofollow">writeCapture</a> to display ads , its working in every browser except safari 5.1.
<br>Its just loading ad's noscroipt code & empty saying ,</p>
<pre><code><div style="margin:0px;padding:0px;border:none;" id="atm_div_0.5912452735938132"></div>
<noscript>&lt;iframe src="http://ads.atomex.net/cgi-bin/adserver.fcgi/ad?section=3893&amp;width=300&amp;height=250&amp;enc=1&amp;type=iframe&amp;js=0&amp;clickTag=http://adnet.affinity.com/adlink/5359/2359613/0/170/AdId=2586164;BnId=5;itime=693384896;nodecode=yes;link=http%3A//adnet.affinity.com/adlink%2F5359%2F2359613%2F0%2F170%2FAdId%3D2586164%3BBnId%3D5%3Bitime%3D693384896%3Blink%3D" height="250" width="300" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" &gt;&lt;/iframe&gt;</noscript>
</code></pre>
<p>Can anyone help me with this issue.</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,401,265
| 5,401,266
|
Using SimpleDateFormat in a for loop on a list of objects
|
<p>My app crashes whenever I try to do this:</p>
<pre><code>for (CalendarEvent event : this.ListofEvents){
String myDate = new String(event.getDate());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
try {
theDate = format.parse(myDate);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(theDate.getDate());
}
</code></pre>
<p>If I just print event.getDate() as a test, it displays all the dates. But when I try to format each date I'm assuming it locks up the phone resources. It's a fairly large List with many entries. </p>
<p>Perhaps there's a better method of getting the day, month, and year without taking up all the resources.</p>
|
java android
|
[1, 4]
|
1,307,275
| 1,307,276
|
My Return false is not working in this code..using jquery
|
<pre><code>$(function () {
$('#form4').submit(function () {
var val = $("#txtNewServiceTypeCategory").val();
$("#ServiceTypeCategoryName").children("option").each(function () {
var $this = $(this);
if (val == $this.val()) {
alert("ServiceTypeCategory Name is already added! Please Choose Differnt Category Name");
return false;
}
});
$('#someHiddenDiv2').show();
$('#STSave').attr('disabled', 'disabled');
$.ajax({
url: this.action,
type: this.method,
data: $(this).serialize(),
success: function (result) {
$('#someHiddenDiv2').hide();
alert('Saved NewServiceTypeCategory Successfully. Thank you!');
},
error: function () {
alert('Error occured! Plese try again later!.');
$('#someHiddenDiv2').hide();
$('#STSave').removeAttr('disabled');
}
});
return false;
});
});
</code></pre>
<p>This return false is not working in the above code even if its showing the popup message other things are executing here,</p>
<pre><code>$("#ServiceTypeCategoryName").children("option").each(function () {
var $this = $(this);
if (val == $this.val()) {
alert("ServiceTypeCategory Name is already added! Please Choose Differnt Category Name");
return false;
}
});
</code></pre>
<p>What I am doign wrong in this?</p>
<p>Thanks</p>
|
javascript asp.net jquery
|
[3, 9, 5]
|
5,543,077
| 5,543,078
|
jquery - button in ajax respone - no response to click
|
<p>jquery;</p>
<p>Situation - just upgrading from pure javascript to jquery - prompted by browser inconsistencies.</p>
<p>On load, a page displays, in a div, the result of an ajax request, which includes an OK button, <code><input name="srd_button_ok" type="button" value="OK"></code> at the bottom.</p>
<p>Clicking OK button IS NOT detected by:</p>
<pre><code>$('[name*="srd_button_ok"]').click (function(){
alert("srd_button_ok clicked");});
</code></pre>
<p>However, another 'test button' placed in a separate div on same page, permanently displayed <code><input name="test_div" type="button" value="Test Div"></code> IS detected by:</p>
<pre><code>$('[name*="test_div"]').click (function(){
alert("test_dv clicked");});
</code></pre>
<p>Both of the above within</p>
<pre><code>jQuery(document).ready(function(){ ....});
</code></pre>
<p>What am I missing or doing incorrectly?</p>
<p>Your advice will be appreciated.</p>
<p>Many thanks,</p>
<p>Ivan Rutter</p>
|
javascript jquery
|
[3, 5]
|
5,299,539
| 5,299,540
|
How to create own jQuery-like function in JavaScript?
|
<p>How can i create a function which looks like the jquery callback $</p>
<p>Say i want to call a element with id= "mydiv".</p>
<p>i want to be able to call it like </p>
<pre><code>var div = $("mydiv").value;
</code></pre>
<p>i think the function should look like </p>
<pre><code>function $(element)
{
return document.getElementById(element);
}
</code></pre>
<p>Is that the right way to do it, or do you prefer another way to solve it?</p>
|
javascript jquery
|
[3, 5]
|
4,840,642
| 4,840,643
|
How can I target an element's 'parent'
|
<p>I have some <code><TD>s</code> without unique names. Inside them there are spans with unique classnames so I have no problem targetting the spans. How can I target the parent <code><td></code> so I can change its class?</p>
<p>I want to do something like <code>$(".classname").parent("TD").className="newClassclassname"</code>.</p>
|
javascript jquery
|
[3, 5]
|
1,940,938
| 1,940,939
|
jQuery simple modification to disable click on image when it was clicked once
|
<p>jQuery simple modification to disable clicking</p>
<p>The following jQuery make use of an image submit button of a the JqPostForm form to post. </p>
<p>How to change the image from image1.png to image3.png when clicked and disable further clicking ? and how to remove the Thank you message after 2 sec ?</p>
<p>There is no need of keeping the form.</p>
<pre><code><script>
$(function(){
$("#JqPostForm").submit(function(e){
e.preventDefault();
$.post("add.php",
function(data){
$("#message_post").html("Thank you");
});
});
$('#submit').hover(
function(){ // Change the input image's source when we "roll on"
$(this).attr({ src : 'image2.png'});
},
function(){ // Change the input image's source back to the default on "roll off"
$(this).attr({ src : 'image1.png'}); }
);
});
</script>
<form id="JqPostForm">
<input type="image" name="submit" id="submit" src="image1.png">
</form>
<div id="message_post"></div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,624,521
| 1,624,522
|
How to create object attribute with name from input id?
|
<pre><code><input id="some_id" value="some_value">
</code></pre>
<p>I need to create <code>{some_id: some_value}</code> (in other words i need to use as name of the attribute value of id) from upper input. </p>
<p>I tried:</p>
<pre><code>jQuery('[name="page-numbers[]"]').map(function () {
return { jQuery(this).attr('id'): jQuery(this).val()};
}).get();
jQuery('[name="page-numbers[]"]').map(function () {
return {this.id: this.value};
}).get();
</code></pre>
<p>But every time i get an error near <code>{this.id:</code>. If only call <code>this.id</code> or <code>this.value</code> or same jQuery - result returns.</p>
|
javascript jquery
|
[3, 5]
|
5,903,739
| 5,903,740
|
How to manage multiple versions of same class file for different SDK targets?
|
<p>This is for an Android application but I'm broadening the question to Java as I don't know how this is usually implemented.</p>
<p>Assuming you have a project that targets a specific SDK version. A new release of the SDK is backward incompatible and requires changing three lines in one class.</p>
<p>How is this managed in Java without duplicating any code(or by duplicating the least amount)?
I don't want to create two projects for only 3 lines that are different.</p>
<p>What I'm trying to achieve in the end is a single executable that'll work for both versions. In C/C++, you'd have a <code>#define</code> based on the version. How do I achieve the same thing in Java?</p>
<p><strong>Edit</strong>: after reading the comments about the #define, I realized there were two issues I was merging into one:</p>
<ul>
<li>So first issue is, how do I not
duplicate code ? What construct is there that is the equivalent of a
<code>#define</code> in C.</li>
<li>The second one is: is it possible
to bundle everything in the same
executable? (this is less of a
concern as the first one).</li>
</ul>
|
java android
|
[1, 4]
|
3,100,247
| 3,100,248
|
Action bar has dissappeared
|
<p>I am new to android development and seem to be stuck at the moment. Whenever I compile and test my app on a device I getting a fatal error message:</p>
<pre><code>=1: thread exiting with uncaught exception (group=0x4137d930)
12-10 22:07:28.423: E/AndroidRuntime(20961): FATAL EXCEPTION: main
12-10 22:07:28.423: E/AndroidRuntime(20961): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hyperlocal.tradeit/com.hyperlocal.tradeit.MainActivity}: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.support.v4.view.ViewPager
</code></pre>
<p>then app stops running after the splash screen.</p>
<p>The action bar doesn't even appear in the graphical layout any more and the IDE cannot find any errors :/</p>
<p><a href="http://pastebin.com/2Fh9UVwf" rel="nofollow">Here is my code</a></p>
<p>Any help would be appreciated, thanks!</p>
|
java android
|
[1, 4]
|
3,845,884
| 3,845,885
|
asp.net - displaying a dictionary with a list as the value?
|
<p>I'm seeking advice as to what would be the best way to do this in ASP.Net (C#).</p>
<p>I'm trying to create a page that lists a all the staff in our office, and had a summary of 4 weeks worth of their timesheets.</p>
<p>I have a timesheet object for each week which can do all of that, and I figure I can return a Dictionary> to get the data there. But what is the best way of databinding that? </p>
<p>What i want it to display is like this:</p>
<pre><code>StaffMember - WEEK 1 (DATE) - WEEK 2 (DATE) - WEEK 3 (DATE) - WEEK 4 (DATE)
---------------------------------------------------------------------------
BOB BUILDER - Val1, Val2,[] - Val1, Val2,[] - Val1, Val2,[] - Val1, Val2,[]
OLD MATE - Val1, Val2,[] - Val1, Val2,[] - Val1, Val2,[] - Val1, Val2,[]
</code></pre>
<p>etc etc for all staff. the [] denotes a checkbox which the person who uses this page will check off when they have processed something on their end relating to that weeks timesheet.</p>
<p>My thought is this:
- Have a listview with the item template setup to have table rows and cells, and literals for the values
- onitemdatabound get the keyvaluepair and then set the staff member literal to the name of staff member (which is the key), then set each value from each of the week to be the values from the corresponding timesheet in the list</p>
<p>Problem is that I'm not sure how to dynamically set the date of each week, I guess I could do a findcontrol on the template of the listview or something? Or set the table up outside of the listview? Just all feels a little messy though so I thought I'd get some advice from the clever people at stackoverflow. Is there an easier way to do this?? Is using complicated dictionaries like that frowned upon in .net and is there another way of doing it?</p>
|
c# asp.net
|
[0, 9]
|
119,666
| 119,667
|
regular expression validator
|
<pre><code><asp:RegularExpressionValidator
id="RegularExpressionValidator1"
ControlToValidate="toAmountTextBox"
ValidationExpression="^\d*[1-9]\d*(\.\d+)?$"
Display="Dynamic"
EnableClientScript="true"
Text="* Please Enter valid amount"
runat="server" />
</code></pre>
<p>This code validates but shows the error message in validation summary... I want to display the message beside the text box it is validating!</p>
|
c# asp.net
|
[0, 9]
|
907,248
| 907,249
|
Opening the webpage as if a link has been clicked from webpage
|
<p>There is a webpage at this URL:</p>
<p><a href="http://www.vankampen.com/Products/529Portfolios" rel="nofollow">http://www.vankampen.com/Products/529Portfolios</a></p>
<p>This webpage opens with default option "With Sales Charge". There is a link "Without Sales Charge" on this webpage. When we click on this link then webpage displays options related with "Without Sales Charge".</p>
<p>I want to open the "http://www.vankampen.com/Products/529Portfolios" URL with "Without Sales Charge" option instead of default "With Sales Charge" option. </p>
<p>On mouse over of "Without Sales Charge" it shows following function being invoked:
javascript:__doPostBack('ctl00$ctl00$ctl00$m_mainContent$m_secondaryContent$m_mainContent$list529Funds$ctrl1$withoutSalesCharge','')</p>
<p>Can someone suggest me if it is possible to open the webpage with "Without Sales Charge" option instead of "With Sales Charge" option?</p>
<p>Thanks,</p>
|
asp.net javascript
|
[9, 3]
|
2,192,764
| 2,192,765
|
jQuery: running youtube videos in for loop, plays last video
|
<p>I have <code>jQuery</code> function as</p>
<pre><code>function play_queue_video() {
var queue_videos = $('.queue_list .view-item');
for (var i = 0; i < queue_videos.length; i++) {
console.log('id - ' + queue_videos[i].id);
play_video(queue_videos[i].id, true);
}
}
</code></pre>
<p>If I have <code>n</code> videos, it plays the last video, because it just loops and goes to last</p>
<p><strong>Needed</strong>
- What can I do to make sure each video plays for the duration it is needed to?</p>
|
javascript jquery
|
[3, 5]
|
2,399,006
| 2,399,007
|
Textbox value onclick onblur issue
|
<pre><code><asp:TextBox ID="TxtBOX"
runat="server"
CssClass="text"
Height="32px"
Width="360px"
TextMode=MultiLine
TextWrapping="Wrap"
AcceptsReturn="True"
VerticalScrollBarVisibility="Visible"
onclick="if(this.value='<%=_data.Obsprevia.ToString()%>'){this.value=''}"
onblur="if(this.value=''){this.value='<%=TxtObservaciones.Text.ToString()%>'}">
</asp:TextBox>
</code></pre>
<p>That's my code.</p>
<p>Default TxtBOX.Text comes from code behind (_data_obsprevia). What I want to achieve is, a clean up of that default text once the user clicks on the textbox. And if the txbox lose focus while the user didn't write anything, get back that default text.</p>
<p>I can't achieve that, and if the user DID write something, and lose-gain focus again, the textbox gets empty again.</p>
<p>Thanks.</p>
<p><strong>EDIT</strong></p>
<p>Fixed the == inside the IFs, Now it looks like this</p>
<pre><code><asp:TextBox ID="TxtBOX"
runat="server"
CssClass="text"
Height="32px"
Width="360px"
TextMode=MultiLine
TextWrapping="Wrap"
AcceptsReturn="True"
VerticalScrollBarVisibility="Visible"
onclick="if(this.value=='<%=_data.Obsprevia.ToString()%>'){this.value=''}"
onblur="if(this.value==''){this.value='<%=TxtObservaciones.Text.ToString()%>'}">
</asp:TextBox>
</code></pre>
<p>But when I first click on it, it's not cleaning the deafult data. And if I erase it, and go losing focus it shows <code><%=TxtObservaciones.Text.ToString()%></code>
Not the value held inside of it.</p>
|
javascript asp.net
|
[3, 9]
|
5,500,695
| 5,500,696
|
Python and Android
|
<p><a href="http://code.google.com/p/android-scripting/" rel="nofollow">This</a> link says that it is indeed possible to write code in <strong>Python</strong> and use it for app development in <strong>android</strong> platform. I would like to know what the catch is when using Python and not Java. Is there any compromise being made in speed of execution or size?</p>
|
android python
|
[4, 7]
|
664,718
| 664,719
|
Parse HTML Code
|
<p>On input we have HTML like:</p>
<pre><code><table>
<tr>
<td>
<img ...>
</td>
<td>
<img ...>
</td>
...
</tr>
</table>
</code></pre>
<p>But in last td:</p>
<pre><code><td>
<img ...>
<img ...>
<td>
</code></pre>
<p><strong>Question:</strong> How to remove 2nd <code>img</code>? We can use PHP, JS and CSS.</p>
|
php javascript
|
[2, 3]
|
1,032,717
| 1,032,718
|
jQuery and Unicode characters
|
<p>I am calling a .txt file from a jquery ajax call. It has some special characters like <code>±</code>. This <code>±</code> is a delimiter for a set of array; data I want to split out and push into a JavaScript array.</p>
<p>It is not treated as <code>±</code> symbol when interpreted like this.</p>
<p>How do I get that data as just like browser content?</p>
|
javascript jquery
|
[3, 5]
|
2,489,823
| 2,489,824
|
Mixing php and javascript -- under what conditions?
|
<p>Under what conditions can I put PHP into Javascript code? Is it always ok? Is it just a bad idea? I am surprised I have not seen it more. </p>
<p>For example, I came across this..</p>
<pre><code>$('#thumbnail').imgAreaSelect({aspectRatio: '<?php echo $thumb_height/$thumb_width;?>', onSelectChange:preview});
</code></pre>
<p>..which was in an onpage script element. I'm not so experienced, but I was just surprised that I had never seen mixed js/php before. But can you put PHP in .js files as well? If I set the file extension to .php, will the file be parsed?</p>
|
php javascript
|
[2, 3]
|
5,444,223
| 5,444,224
|
RSA decrypt in ANdroid
|
<p>I am using RSA modulus and encrypting a data with modulus and trying to decrypt it with private key of RSA ..i m using RSA/ECB/PKCS1Padding at the decrypt end </p>
<p>Thnx in advance </p>
|
java android
|
[1, 4]
|
4,132,157
| 4,132,158
|
What is the best first-step to start building android applications?
|
<p>Sorry for asking this beginner's question and I know I may get down-votes but please guide me here.</p>
<p>What is the best first-step to start building android applications? I feel the need to start doing so, however I have no clue whatsoever how to start. All I know (and heard from people) is that android applications are based on a Java-code that is different from the Java I know. so ..</p>
<ul>
<li><p>knowing that I am v.good in c++ (and feel v.confident around its codes), is there is away of building android application using just c++, and, if there is a way, what is it? </p></li>
<li><p>if there is not, and knowing that I already know some basics of Java programming (as a very beginner), do I have to learn a new different type of Java (like different Java syntax and concepts) or it is just a higher complicated level of the same Java I know ?</p></li>
</ul>
<p>Thanks </p>
|
java android c++
|
[1, 4, 6]
|
896,733
| 896,734
|
button click focus text on textarea
|
<p><img src="http://i.stack.imgur.com/nY3nl.png" alt="enter image description here">i am working on this project where i press a button that will look for specific words in the textarea(may be move the cursor to that specific word). i tried many things but so far no luck.
here what i am trying to do.</p>
<pre><code>$line ="<html>
<head>
<title>Drum studio home</title>
<body>
<img src="/images/fo.png" alt=""/>
</body>
</html> ";
</code></pre>
<p>the textArea is in php page, test.php </p>
<pre><code><textarea name="tvalue" id="tvalue">
<?php
echo $line . "\r\n";
?>
</textarea>
<input type="submit" value="find next" name="submit"/>
</code></pre>
<p>when i run test.php i will see the following inside the textarea.</p>
<pre><code><html>
<head>
<title>Drum studio home</title>
<body>
<img src="/images/fo.png" alt=""/>
<img src="/images/fo.png" alt="fo image"/>
</body>
</html>
**find next** --- this is the button
</code></pre>
<p>The find next button will find any image that has no alternative text.
I know i need js or jquery. I am new to this. so Don't know really where to start. please help.
thanks</p>
|
php javascript
|
[2, 3]
|
856,931
| 856,932
|
passing multivariables to new page via gridview select
|
<p>I have a gridview where i want to pass two different ID when i select a row to a new page.
I need them to be two different variables so i dont want to bind them together.</p>
<p>Currently, the way i am doing it with link select the values of SUBMITTEDJOBAPPLICATION & the
JOBAPPLICATIONID variables are the same(which is incorrect). What i mean is the SUBMITTEDJOBAPPLICATION is correct but the
JOBAPPLICATIONID is the same as SUBMITTEDJOBAPPLICATION and that is incorrect.</p>
<pre><code><asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/UnscreenedApplicantPage.aspx?SubmittedID={0}&jobID={0}", Eval("SUBMITTEDJOBAPPLICATION"), Eval("JOBAPPLICATIONID")) %>'>Select</asp:HyperLink>
</code></pre>
<p>How can i remedy this?</p>
|
c# asp.net
|
[0, 9]
|
3,901,865
| 3,901,866
|
How to improve RandomAccessFile usage?
|
<p>I'm using a <code>RandomAccessFile</code> to <strong>rw</strong> data to it constantly. The size of the file can range from 5MB up to 200MB. This file is used as a <strong>circular buffer</strong>. </p>
<p>My main concern is the constant seek before a read and write.</p>
<p>What happens after seek? Does part of the file data get buffered right away into memory? Does it even do anything after a seek?</p>
<p>I want to understand how it works and how I could improve the performance of using the <code>RandomAccessFile</code> to read write at different positions. I just feel the constant seek is possibly using too many resources? </p>
<p><strong>Possible solution to avoid constant seek?</strong> </p>
<ol>
<li>Instantiate two <code>RandomAccessFile</code> instances one to read and the other to write. Of course these would be tightly synchronized.</li>
<li>Use two <code>FileChannels</code>. Not even sure how I could prevent the pointer from moving when I need to read the tail of my buffer or the head of the buffer.</li>
</ol>
|
java android
|
[1, 4]
|
2,453,181
| 2,453,182
|
Accepting a serialized form from jquery in asp.net
|
<p>In asp.net mvc it's pretty easy to receive a form collection in a ajax page webmethod like:</p>
<pre><code>public bool AddSomething(FormCollection form)
{
return true;
}
</code></pre>
<p>How do I receive serialized data in an asp.net page method:</p>
<pre><code> [WebMethod]
public static string AddSomething(??)
{
//...
return true;
}
</code></pre>
|
jquery asp.net
|
[5, 9]
|
2,433,246
| 2,433,247
|
how convert date(02/07/2012) to Tuesday, Febraury 7, 2012
|
<p>Can any one please help me how to convert date(02/07/2012) to Tuesday, Febraury 7, 2012.
And how can i relate it to datepicker.</p>
<p>OR</p>
<p>is there any date picker which provides date like Tuesday, Febraury 7, 2012 ,when user selects date from datepicker.And how can i add next and previous buttons to the date picker.</p>
<pre><code><html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js">
</script>
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<div>
<p>Date: <input type="text" id="datepicker"></p>
</div>
</body>
<script>
$("#datepicker").click(function(){
var date = $("#datepicker").val();
var date_obj = new Date(date);
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
var date_str = days[date_obj.getMonth()] + ", " + months[date_obj.getMonth()] + " " + date_obj.getDate() + ", " + (1900+date_obj.getYear());
alert(date_str);
});
</script>
</html>
</code></pre>
<p>I tried like this but its just alert before date picker.
Which event I have to use here?
Can anyone help me please? Thanks in advance.</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,190,931
| 1,190,932
|
How to redirect after File upload?
|
<p>I have a File.aspx form where I display all the files.</p>
<p>When I upload a file I am using a upload.aspx file to run c# code to upload the file.</p>
<p>The thing is that at the end , I want to refresh the page automatically to display the new file upload but apparently it's not redirecting even if all the parameters are good.</p>
<p>This is the code I use </p>
<pre><code> HttpContext postedContext = HttpContext.Current;
string param = Request.UrlReferrer.Query;
string param2 = Request.UrlReferrer.Query;
var url = HttpUtility.ParseQueryString(param).Get("projectName");
var url2 = HttpUtility.ParseQueryString(param2).Get("projectId");
HttpPostedFile file = postedContext.Request.Files[0];
string name = file.FileName;
byte[] binaryWriteArray = new
byte[file.InputStream.Length];
file.InputStream.Read(binaryWriteArray, 0,
(int)file.InputStream.Length);
//FileStream objfilestream = new FileStream(Server.MapPath("~\\" + "\\Files\\" + url + "\\" + name), FileMode.Create, FileAccess.ReadWrite);
FileStream objfilestream = new FileStream(("C:\\inetpub\\wwwroot\\Clientportal\\Files\\" + url + "\\" + name), FileMode.Create, FileAccess.ReadWrite);
objfilestream.Write(binaryWriteArray, 0, binaryWriteArray.Length);
objfilestream.Close();
string[][] JaggedArray = new string[1][];
JaggedArray[0] = new string[] { "File was uploaded successfully" };
JavaScriptSerializer js = new JavaScriptSerializer();
string strJSON = js.Serialize(JaggedArray);
Response.Write(strJSON);
Response.Redirect(string.Format("Files.aspx?projectId={0}&projectName={1}", url2, url));
</code></pre>
<p>Any ideas ? I'm a bit stuck because I use this response.redirect everywhere and it works only when the code is in the same code file...</p>
<p>Maybe it's because of the fact that I try to redirect from another code file ?</p>
|
c# asp.net
|
[0, 9]
|
207,045
| 207,046
|
createuserwizard adding roles to users
|
<p>Hi I have a createuserwizard controls and I would like assign ROLES when creating a user.</p>
<p>Any idea how to do it? Thanks</p>
<p>Here my code C#</p>
<pre><code> <asp:CreateUserWizard ID="uxCreateUserWizardInput" runat="server"
LoginCreatedUser="False">
<WizardSteps>
<asp:CreateUserWizardStep runat="server" />
<asp:CompleteWizardStep runat="server" />
</WizardSteps>
</asp:CreateUserWizard>
</code></pre>
<p>I found out answer to my questions here
<a href="http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx" rel="nofollow">http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx</a></p>
|
c# asp.net
|
[0, 9]
|
3,836,000
| 3,836,001
|
How to apply a function to two elements?
|
<p>I have two elements <code>#DateTimeStart</code>, <code>#DateTimeEnd</code>, I would like apply my <code>datetimepicker</code> to both.</p>
<p>With this code I cannot have the result.. any idea what I am doing wrong here?</p>
<pre><code>$(document).ready(function () {
// This does not work
$('#DateTimeStart', '#DateTimeEnd').datetimepicker({
addSliderAccess: true,
sliderAccessArgs: { touchonly: false }
});
});
</code></pre>
<p>What I am trying to achieve is like but with less code </p>
<pre><code>// This code works
$(document).ready(function () {
$('#DateTimeStart').datetimepicker({
addSliderAccess: true,
sliderAccessArgs: { touchonly: false }
});
$('#DateTimeEnd').datetimepicker({
addSliderAccess: true,
sliderAccessArgs: { touchonly: false }
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,791,013
| 2,791,014
|
Associating unique properties to anonymous functions in JavaScript
|
<p>What's a standard way of associating unique properties to anonymous JavaScript functions while creating them so that these properties can be accessed within the functions themselves when they are executed (i.e. run time)?</p>
<p>A scenario is this:</p>
<p><em>Say I have events which I want to bind to dynamically generated anonymous functions.</em></p>
<pre><code>var events = ['connect','disconnect','error','connect_failed'];
for(a in events){
var handler = function(){
// console.log(arguments.callee.custom); // Not reliable 'cos callee is supposedly deprecated
console.log('<event-name>');
};
handler.custom = events[a];
$(window).on(events[a],handler);
}
</code></pre>
<p>Since using <strong>arguments.callee</strong> is deprecated and not guaranteed to be optimal on all platforms. What's the recommended way of achieving something similar to this?</p>
|
javascript jquery
|
[3, 5]
|
4,689,523
| 4,689,524
|
Android - TouchDrag moves image within view, but need entire view to move
|
<p>My image simply moves within my image view based upon the touch location. I need the entire view to move (not just the image in it).</p>
<p>Here is my code in onTouch:</p>
<pre><code>ImageView image = (ImageView)v;
switch (event.getAction() & MotionEvent.ACTION_MASK)
{
case MotionEvent.ACTION_DOWN:
savedMatrix.set(matrix);
start.set(event.getX(),event.getY());
mode = DRAG;
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP:
mode = NONE;
break;
case MotionEvent.ACTION_MOVE:
if (mode == DRAG)
{
matrix.set(savedMatrix);
matrix.postTranslate(event.getX() - start.x, event.getY() - start.y);
}
break;
}
image.setImageMatrix(matrix);
return true;
</code></pre>
|
java android
|
[1, 4]
|
2,879,077
| 2,879,078
|
After upgrading to Visual Studio 2010 - The type or namespace name 'xxxxxxxxx_ascx' does not exist in the namespace 'ASP'
|
<p>We recently upgraded our website project to Visual Studio 2010.</p>
<p>I am now getting this error whenever I try to Publish the Website with the "Allow this precompiled site to be updatable" checked.</p>
<p>This worked previously using Visual Studio 2008 so I am not sure why it is not working now.</p>
<pre><code>The type or namespace name 'xxxxxxxxx_ascx' does not exist in the namespace 'ASP'
(are you missing an assembly reference?)
</code></pre>
<p>The lines causing the error are all doing this sort of thing.</p>
<pre><code>ASP.content_Controls_Info_ascx infoControl = new ASP.content_Controls_Info_ascx();
infoControl.Stages = query.ToList();
PlaceHolder1.Controls.Add(infoControl);
</code></pre>
<p>I have not upgraded anything else so the dot net framework is still 3.5</p>
<p>The site builds fine and a publish works without "Allow this precompiled site to be updatable" checked. The content_Controls_Info_ascx part of the code also highlights the class name so it is finding it.</p>
|
c# asp.net
|
[0, 9]
|
1,311,416
| 1,311,417
|
Confirmation before deleting (jquery)
|
<p>I would like to show a simple confirmation dialog box show before running a delete function.</p>
<p>Here is what I have so far</p>
<p>HTML:</p>
<pre><code><!-- Delete Confirmation Dialog Box -->
<div id="confirm" style="display:none;">
<div class="message">Are you sure you want to delete?</div>
<div class="buttons">
<div class="cancel">No</div><div class="accept">Yes</div>
</div>
</div>
<!-- Delete Button/s -->
<a href="javascript:void(0);" onclick="delete("1")"><img src="images/48x_delete.png" alt="48x_delete" width="24" height="24"/></a>
<a href="javascript:void(0);" onclick="delete("2")"><img src="images/48x_delete.png" alt="48x_delete" width="24" height="24"/></a>
...etc...
</code></pre>
<p>jQuery:</p>
<pre><code>function delete(id) {
fileName= 'update_db.php';
$('#response').html("<img src='images/ajax-loader.gif' border=0> Please Wait");
$.post(fileName,{postvar:1, id:id, action:'delete'}, function(res) { showStatus(res);});
}
</code></pre>
<p>Could someone help me to modify my code to show the dialog box and confirm the delete?? Thanks!!!</p>
|
javascript jquery
|
[3, 5]
|
5,893,068
| 5,893,069
|
how to catch key event on textbox?
|
<p>if i have focus on textbox and i press enter or Esc</p>
<p>how to catch this event ?</p>
|
c# asp.net
|
[0, 9]
|
1,035,249
| 1,035,250
|
Jquery window.location not redirecting but refreshing page
|
<p>I have the following Jquery snippet </p>
<pre><code>// General search
$j(".search").each(function () {
var baseURL = "/search.aspx?c=Entire%20Site&q=";
var searchBox = $j(this);
searchBox.find("input").keypress(function (e) {
if (e.keyCode == 13) {
submitSearchValueFromTextBox(searchBox, baseURL);
}
});
});
submitSearchValueFromTextBox = function(searchBox, baseURL) {
window.location.href = baseURL + escape(searchBox.find("input").val());
};
</code></pre>
<p>HTML for input</p>
<pre><code><span class="searchBox">
<span>
<input type="text" name="searchBoxHeader" id="searchBoxHeader" value="<%= SearchLabel %>" />
</span>
</span>
<span class="searchBtn">
<a href="#" class="btnSearchTop">
<img src="/images/search_btn.gif" name="submitHeader" id="submitHeader"/>
</a>
</span>
</code></pre>
<p>What I am testing is when the user hits enter key to take the user to my search page, I find the code works correctly in that it finds the correct keyCode and when getting to the redirect function but it just refreshes the page rather than go to it.</p>
<p>Any ideas ?</p>
<p>Edit it works fine with onclick its the enter key stroke that doesnt work</p>
<pre><code> searchBox.find("a").click(function () {
submitSearchValueFromTextBox(searchBox, baseURL);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,812,919
| 5,812,920
|
handling more than one divisions in javascript
|
<p>In my program I have 3 divisions with class 'information', 'interest' and 'wall'.
I want this divisions to change their color when a a user clicks on it.
Initially all 3 division classes have same color <code>#dcdcdc</code>.
When user clicks on 1 of them I want to change its color to <code>#999</code>, but color of other divisions must remain <code>#dcdcdc</code>.</p>
<p>This much part is working correctly but when i click on 2nd division, the previous doesn't change its color back to <code>#dcdcdc</code>. </p>
<p>JavaScript part.</p>
<pre><code>$(document).ready(function(){
$('#pro_head > div').click
(
function()
{
$(this).css("background-color", "#999");
$(this).css("font-weight", "bold");
},
);
});
</code></pre>
<p>HTML part:</p>
<pre><code><div pro_head>
<div class="information"></div>
<div class="interest"></div>
<div class="wall"></div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,342,725
| 4,342,726
|
focusout jquery not work
|
<p>i want #result will hide on send click outside #search_form. i try use focusout but it not work.</p>
<pre><code><div id="search_form">
<form method="post" onsubmit="return checkForm(this.form)">
<div class="search padding">
<input type="text" id="searchbox" name="manga_name" class="input" value="Tìm truyện muốn đọc ..." onfocus="if (value =='Tìm truyện muốn đọc ...'){value =''}" onblur="if (value ==''){value='Tìm truyện muốn đọc ...'}" onkeyup="keyup();"/>
<input type="submit" value=" " id="searchsubmit" class="go"/>
</div>
</form>
<div id="result"></div>
</div>
<script>
$("#search_form").focusout(function() {
$('#result').html('');
$('#result').css('display', 'none');
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,817,942
| 4,817,943
|
<option> tag, display:none and jquery
|
<p>I have a <code>div</code> that is being used as a dialog with jQuery's <code>.dialog()</code>. This div has a select box with options. The options the user has already selected are displayed on the main page. They can remove options from the main page and can open the dialog multiple times to add more options.</p>
<p>I populate the select box with all possible options on page load, but then when I open the dialog box I use jQuery's <code>hide()</code> to hide the options that the user has already selected and are displayed on the main page. This adds the CSS <code>display:none;</code> to the element in question, which IE ignores on <code><option></code> tags and displays anyway.</p>
<p>I can easily enough call <code>remove()</code> instead and remove it from the DOM. However, if the user selects some options, them removes them on the main page, then opens the dialog again to select more options, the options are no longer in alphabetical order, the options that were removed from the DOM and put back in it are now at the bottom since I used <code>.append()</code>.</p>
<p>Is there any way to get IE to hide <code><option></code> tags? Or is there a better way to do this? Or is there a way to insert in alphabetical order simply?</p>
|
javascript jquery
|
[3, 5]
|
3,431,826
| 3,431,827
|
Inside OnClickListener I cannot access a lot of things - how to approach?
|
<p>Inside an OnClickListener I cannot access most variables "outside" of the scope, like this:</p>
<pre><code>findViewById(R.id.Button01).setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
Intent mainApps = new Intent(Intent.ACTION_MAIN);
mainApps.addCategory(Intent.CATEGORY_LAUNCHER);
List<ActivityInfo> activities = this.getPackageManager().queryIntentActivities(mainApps, 0);
/*
Intent intent = new Intent("com.sygic.drive/com.sygic/drive/.SygicDriveActivity");
startActivity(intent);*/
}
});
</code></pre>
<p>in this example I need to get the PacketManager, and I cannot get it since I do not have the Context available inside the OnClickListener. </p>
<p>I could make a static reference outside, and use it inside, but is that correct? Seems odd to have to do that all the time?</p>
|
java android
|
[1, 4]
|
2,893,848
| 2,893,849
|
What is the most idomatic way to index a list of objects by coordinates
|
<p>I have a strong python background and a total newbie with Java, so I try to do things in <em>Pythonic</em> way in java and end up struggling. Currently I have a problem to figure out how to do store objects, indexed by coordinates, so that they are iterable. I <em>could</em> create an 2-dimensional array of the objects, but I'm afraid that would take a lot of memory <strong>AND</strong> I would have to iterate over all the indexes every time (when I only want to do it occassionally) to get all the objects.</p>
<p>In python, I would use a dictionary with tuples as keys, but looks like such thing is not possible in Java.</p>
<p>E.g.</p>
<pre><code>class bar()
pass
bar1 = bar()
bar2 = bar()
# etc
foo = { (0,1): bar1, (100,30): bar2 }
for x in foo.values():
do_something()
</code></pre>
|
java python
|
[1, 7]
|
2,233,890
| 2,233,891
|
Is there any reason to use Server.MapPath() to reference a file store?
|
<p>I have seen several developers perform:</p>
<pre><code>string fileStore = Server.MapPath(@"~\someDirectory");
File.Create(fileStore + "someFileName.xxx");
</code></pre>
<p>I find that this makes unit testing difficult. Since I test with MSTest, there's no HTTP context, so this code just flat out fails.</p>
<p>Instead, I store my file paths in web.config.</p>
<p><code>string fileStore = ConfigurationManager.AppSettings["fileStore"];</code></p>
<p>This works with unit tests. Why do developers use <code>Server.MapPath()</code> in this way? Are there some benefits I'm unaware of?</p>
|
c# asp.net
|
[0, 9]
|
2,563,537
| 2,563,538
|
javascript countdown timer new date
|
<p>I am using javascript for a count down timer</p>
<pre><code><script type="text/javascript">
$(function() {
var newYear = $(".HF").val();
alert('hehe' + newYear);
$('#countdown').countdown({ until:newYear, format: 'DHMS', layout:
'<div id="timer">' + '<hr />' +
'<div id="timer_days" class="timer_numbers">{dnn}</div>' +
'<div id="timer_hours" class="timer_numbers">{hnn}</div>' +
'<div id="timer_mins" class="timer_numbers">{mnn}</div>' +
'<div id="timer_seconds" class="timer_numbers">{snn}</div>' +
'<div id="timer_labels">' +
'<div id="timer_days_label" class="timer_labels">days</div>' +
'<div id="timer_hours_label" class="timer_labels">hours</div>' +
'<div id="timer_mins_label" class="timer_labels">mins</div>' +
'<div id="timer_seconds_label" class="timer_labels">secs</div>' +
'</div>' +
'</div>'
});
});
</script>
</code></pre>
<p>it gets its until value from a hidden field <code>HF</code>.The value of the hidden field is a string 10/22/2011...but the timer shows only 34 mins left while it must show 2 days and some hours and some mins left..why??</p>
|
javascript asp.net
|
[3, 9]
|
1,578,760
| 1,578,761
|
How to remount /sdcard directory to read/write on emulator?
|
<p>Can you please tell me how to remount /sdcard directory to read/write on emulator?</p>
<p>I read <a href="http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html" rel="nofollow">this</a></p>
<p>But I don't know how to apply that to remount /sdcard directory in read-write mode?</p>
|
java android
|
[1, 4]
|
5,993,531
| 5,993,532
|
android object/ class structure for graphing
|
<p>Am currently developing an android application that requires real time data viewing with achartengine: still in the application design:</p>
<p>My data will be presented in two types:</p>
<ol>
<li>plain data</li>
<li>charts - using achartengine
in this category i will have several graph types like line chart, bar, pie e.t.c</li>
</ol>
<p>The problem that am having when designing class diagrams for the application is that am stuck on whether to handle Graphs as a package then have the graph types as a class inside the package or create a class for each graph type which resides on my application package..</p>
<p>Kindly help me out on this.</p>
|
java android
|
[1, 4]
|
2,110,208
| 2,110,209
|
jquery change event without postback
|
<p>I have a listbox and on a particular selected value i want to display a dropdown and on selection of a value from the dropdown i want to display another dropdown.</p>
<p>I have achieved this using jquery but the dropdowns are displayed only after postback. How to avoid the postbacks ?</p>
<p>This is my jquery code</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
if ($('#<%=under_list1.ClientID %> option:selected').val() == 0) {
$("#ddl_nature1").show();
$("#ddl_gross1").hide();
if ($('#<%=ddl_nature.ClientID %> option:selected').val() == 'I', $('#<%=ddl_nature.ClientID %> option:selected').val() == 'E') {
$("#ddl_gross1").show();
}
else {
$("#ddl_gross1").hide();
}
}
else {
$("#ddl_nature1").hide();
$("#ddl_gross1").hide();
}
});
</code></pre>
<p></p>
<p>under_list1 is my listbox id, ddl_nature1 is my first dropdown and ddl_gross1 is my second dropdown.</p>
|
jquery asp.net
|
[5, 9]
|
5,918,967
| 5,918,968
|
Get client certificate in asp.net c# browser application using server side coding
|
<p>Problem to get client certificate in ASP.NET browser application. Main problem is that we need to get the client certificate from the client machine in browser application.</p>
<p>I use this code to do that</p>
<pre><code>X509Certificate2 certificate = new
X509Certificate2(Page.Request.ClientCertificate.Certificate);
</code></pre>
<p>But it didn’t get the client certificate.</p>
<p>I have the server code that get the certificate from server but I need the client certificate.</p>
<p>Server code: </p>
<pre><code>X509Store store = new X509Store("My");
var cer = Request.ClientCertificate;
store.Open(OpenFlags.ReadOnly);
var certificates = store.Certificates;
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,503,220
| 2,503,221
|
Removal of multiple fields and labels
|
<p>I'm very new to jQuery and have been stumped by particular issue. I am dynamically adding 2 checkbox fields to a screen form using the code below:</p>
<pre><code>var summon_search = "<br><br><br><label for='summon_search'>Search this resource from compatible products*</label><input type='checkbox' id='summon_search' >";
var summon_link = "<br><br><label for='summon_link'>Link direct from content items in compatible products*</label><input type='checkbox' name='summon_link'>";
$(summon_search+summon_link).insertAfter("#jstor_selection");
</code></pre>
<p>However I have had limited success when I want to remove these fields AND labels (which is dependant on another value) and replace them with new fields. The code below shows my best attempt so far. It does appear to remove the labels and first field, but for some reason the last field remains. Could someone please advise if they can spot anything I've done wrong, or perhaps supply a better example of handling this ?</p>
<pre><code>if ($("#summon_search").length > 0 ) {
//Removal of Label and Field (Attempted)
$("label[for=summon_search]").remove();
$("label[for=summon_link]").remove();
$("#summon_search").remove();
$("#summon_link").remove();
</code></pre>
<p>Any feedback much appreciated.</p>
|
javascript jquery
|
[3, 5]
|
4,310,194
| 4,310,195
|
An equivalent of javascript unload for PHP
|
<p>For javascript there is an unload function, when a page closes, do something. Is there the same for php?</p>
<p>Thanks
Jean</p>
|
php javascript
|
[2, 3]
|
2,110,366
| 2,110,367
|
jQuery "load()" Can't Load PHP "curl_exec()" Result
|
<p>I want an HTML file to load the result of "curl_exec()" method of a PHP file.</p>
<p>The PHP file is located in localhost, and the HTML file can be anywhere.</p>
<p>Eg the PHP file name is "curl.php".</p>
<p>I used jQuery "load()" to load the result, but it doesn't work, even after I upload the files to a web server.</p>
<p>The HTML file code:</p>
<p><a href="http://jsfiddle.net/aTkEZ/" rel="nofollow">http://jsfiddle.net/aTkEZ/</a></p>
<p>The "curl.php" code:</p>
<p><a href="http://jsfiddle.net/Quk8N/" rel="nofollow">http://jsfiddle.net/Quk8N/</a></p>
<p>What is wrong with my code?</p>
|
php javascript jquery
|
[2, 3, 5]
|
160,826
| 160,827
|
Detect external link Click?
|
<p><strong>How can i detect external link click?</strong></p>
<p>I have a simple question, which may or may not have an simple answer. I need to detect if some of my page's user's have clicked an external link, an ad for example. </p>
<p>My first tought was that i would place an random number of transparent div's over a specific link so an user should click on it until he'll get redirected to a new page but that would be inconvievnant for users and would still be exploitable.</p>
<p>I hope that you guys can help me out and i'll do my best to help you out one day.</p>
<p>Sorry for my english as my native language isn't english.</p>
|
javascript jquery
|
[3, 5]
|
209,043
| 209,044
|
how can i make my webpage load faster with or without jquery and php
|
<p>i was wondering about fast page load for google and facebook. how it is possible... If we say they have high quilified servers then visit <a href="http://www.iconarchive.com/" rel="nofollow">http://www.iconarchive.com/</a> and type some thing in its search box and hit enter and see the same load time as google and facebook. </p>
<p>let me know about that rocket science.</p>
|
php jquery
|
[2, 5]
|
340,467
| 340,468
|
setting a class to a menu depending of the url link
|
<p>Here is my scenario, my sub pages are not recognizing the parent, probably cause I set the structure bad, however going to back to fix that is not an option for now, problem the menu parent is getting the parent class in the wrong places....</p>
<p>So what I need to achieve...</p>
<p>if I have this url structure: domain.com/products/.... assign "current" class to menu X...</p>
<p>If I have this other: domain.com/sales/..... assign "current" class to Y....</p>
<p>I know I can do it via javascript, however I lack of knowledge of it, I'm just looking for a solid starting point.</p>
<p>I would appreciate any help.</p>
<p>Thanks in advanced.</p>
|
javascript jquery
|
[3, 5]
|
936,283
| 936,284
|
history.go(-1) function not working for dropdown
|
<p>i am using the function history.go(-1) function on my button to go back. but i am getting a prob in value selected in dropdown. </p>
<p>the sourceview is showing the original value selected but on UI its showing the previous value</p>
<p>means when i click on back button,</p>
<p>UI shows the same value but when i view the source code then the selected value is the same that need to be appear</p>
<p>for example</p>
<p>suppose my dropdown has data in format MM/YYYY
first i select 02/2010 and then after that i select 04/2010
now when i click on back button having onclick ="history.go(-1)"</p>
<p>then the value in dropdown remains the same i.e 04/2010 but when i see the source code, then for dropdown the selected value shows as 02/2010.</p>
<p>I cant understand this UI behavior. can any one help me to rectify this</p>
|
javascript asp.net
|
[3, 9]
|
5,264,066
| 5,264,067
|
Debug jquery in asp. Net app
|
<p>I have a Web app that calls <em>jQuery</em> somewhere to show a <code><div></code>. Anyone know of a way to intercept that call, see exactly what is calling that <code><div></code> to appear? </p>
<p>I need to make that div appear on another button and the original button that makes that <code><div></code> appear has a bunch of stuff that happens and I'd like to isolate only showing of that <code><div></code>?. </p>
<p>The app is asp. Net Web forms with <em>jQuery</em>.</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
1,984,367
| 1,984,368
|
Easy way to pass node reference via post data?
|
<p>I have a list of input objects in my DOM, each with a button. When the user clicks one of the buttons, a dialog box is AJAXed. I would like to pass a reference to one of the input objects, depending on which button is clicked, to the dialog box. This way when the dialog box "Okay" button is clicked, it knows which input to manipulate on the original page.</p>
<p>Have I lost you yet? So how can I pass this input node reference to the AJAXed dialog box?</p>
<p>I am trying to steer away from using a global variable to store the node reference. I also do not want to have to give each input a unique id or name as this would force other areas of my code to become more complicated.</p>
<p>I suspect I will end up having to use one of the above solutions, but before I do, is there some way to pass a node reference via an URL without using the node's id or name? Would I have to use a selector index or something?</p>
<p>Note: Using JQuery.</p>
|
javascript jquery
|
[3, 5]
|
3,487,263
| 3,487,264
|
How to correctly position popup of selectmenu in IE and Chrome
|
<p>I don't have this problem in firefox. But in IE and Chrome. as figure below shows, top of the popup of the dropdownlist appears in the middle of folded box. It should be positioned right after the folded box. This will mess user interaction. For example, if user clicks the dropdownbox, the popup will close as soon as it appears because that click selects the first item. Anybody resolved this problem. I guess it might be related to font size. But just a guess. Any clue will be appreciated.</p>
<p><img src="http://i.stack.imgur.com/sNVVh.jpg" alt="enter image description here"></p>
|
javascript jquery
|
[3, 5]
|
2,713,879
| 2,713,880
|
how to use the window object (or better way) to make dynamic property names
|
<p>I read <a href="http://stackoverflow.com/a/5117153/1252748">here</a> that the window object can be used to dynamically make a property name within an object. What is the way this is done</p>
<p>I have a function like</p>
<pre><code>function storeValues(){
var info = {};
$('.class1').each(function(index1, value1){
$('.class2', $(this)).each(function(index2, value2){
//so here I'd like to add a string to the property name
//like 'param-' and 'detail-' so I could end up with a
//structure like
//info.param_0.detail_0
//then
//info.param_0.detail_1
//info.param_1.detail_0
//info.param_1.detail_1
//info.param_1.detail_2
info.'param_'index1.'detail_'index2 = $(this).find('.desired_input').val();
});
}
</code></pre>
<p>Is this possible. Or is there a smarter way of doing it?</p>
|
javascript jquery
|
[3, 5]
|
625,205
| 625,206
|
Append Order - jQuery
|
<p>I am trying to get the string to order by how it is displayed (red,blue,orange,black). For some reason, it will append the order randomly. For Example: it would output (blue,orange,red,black). Any help would be great. Thanks.</p>
<pre><code>var tCookie = "red,blue,orange,black";
var Cookies = tCookie.split(',');
if (Cookies) {
for (var i = 1; i <= Cookies.length; i++) {
var dataString = "TabId="+Cookies[i]+"";
$.ajax({
type: "POST",
url: "includes/tab.php",
data: dataString,
cache: false,
success: function(html){
$("#Dynamic_Tab").append(html).children(':last').hide().fadeIn("fast");
}
});
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,028,655
| 1,028,656
|
Simple javascript issue
|
<p>It turns out this does exactly what I want it to do. But HTML does not replace the function call with a value, which is why I got confused. The correct value IS passed into the array though. I am leaving this question here in case others have the same issue.</p>
<p>I have some javascript:</p>
<pre><code><script type="text/javascript">
var $SAT = $SAT || [];
$SAT.push(['setContent','subtype','sub']);
$SAT.push(['setUser', '1234']);
</script>
</code></pre>
<p>but I want to replace 'sub' with a function call to retrieve the value by other means, like so:</p>
<pre><code><script type="text/javascript">
function getValue() {
return 'Some Value';
}
var $SAT = $SAT || [];
$SAT.push(['setContent','subtype',getValue()]);
$SAT.push(['setUser', '1234']);
</script>
</code></pre>
<p>however the resulting code does not replace the getValue() function call with 'Some Value' as I would have expected. Does anybody know why, and what I need to do to fix this?</p>
<p>Much appreciated!</p>
|
javascript jquery
|
[3, 5]
|
866,825
| 866,826
|
Difference between element.each and .each(element) in jquery
|
<p>What is the difference between </p>
<pre><code>$(element).each(function(){
});
</code></pre>
<p>And </p>
<pre><code>$.each("element",function(){
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,737,623
| 3,737,624
|
use javascript variable into python Block
|
<p>I want to use JavaScript variable into python Block.</p>
<pre><code><script>
$(document).ready(function() {
$("#WO_cpp_id").change(function() {
id = this.selectedIndex;
ajax('{{=URL(r=request,f='get_CIs',vars={'CPP_Id':'#here I want to use id variable')}}', ['WO_cpp_id'], 'WO_ci_id');
})
.change(); }); </script>
</code></pre>
<p>Thanks in Advance</p>
|
javascript jquery python
|
[3, 5, 7]
|
3,992,058
| 3,992,059
|
extract addresses from google map
|
<p>how can i extract all addresses,corresponding latitude & longitude of a city(eg:Bangalore) from google map using php/js and store in mysql table .can anyone help me.Its urgent.Thank Yo</p>
|
php javascript
|
[2, 3]
|
3,708,926
| 3,708,927
|
How to open image href on a aspx page
|
<p>When the thumbnail is clicked I would like the full size image to open on http//example.com/image.aspx instead of http//example.com/images/image.jpeg without creating an individual page for each image and editing each href. I know that this is possible with php but I was wondering if there was some way of doing it with javascript, jquery, asp.net, or...? If it is possible, (I maybe stretching it here), would it also be possible to run this on the master page for all thumbs? The thumbs have no class or id. Right now they are in straight html markup. I have searched for days and have found nothing that would even get me started on the correct path with the exception of php. I don't need the target blank if I could implement this because this would allow me to open the image on a aspx content page with full site navigation. Here is the code as of right now.</p>
<pre><code><a target="_blank" href="image.jpg/jpeg"><img alt="something" src="pictures/image_small.jpg/jpeg"></a>
</code></pre>
<p>A page from our site is <a href="http://backalleypics.com/PeoplesPages/Sa~Se/SarahShahiPages/SarahShahi1.aspx" rel="nofollow">http://backalleypics.com/PeoplesPages/Sa~Se/SarahShahiPages/SarahShahi1.aspx</a>. An example of the php type is <a href="http://www.theplace2.ru/photos/gallery.php?id=47" rel="nofollow">http://www.theplace2.ru/photos/gallery.php?id=47</a> I really don't want a gallery, pop up window, or light box. The purpose is to get ad views for each image click and have navigation on the page.</p>
|
php javascript jquery asp.net
|
[2, 3, 5, 9]
|
1,846,201
| 1,846,202
|
JQuery, how to access click object after ajax call?
|
<p>this seems like it should be straightforward, but I'm having trouble getting it to work.</p>
<p>I have a .click bind to many buttons of a certain class. When that button is clicked, it passes its id to a $.post call for processing.</p>
<p>When the $.post call returns successfully, I'd like to remove the button and add a message to the container, but I can't seem to even access the button at that point.</p>
<p>Here is the .click bind:</p>
<pre><code>$('.button').click(function() {
$.post('process.php', {
action: 'checkit'
},
function(result) {
if (result == 'win') {
// Access the button that was pressed with jQuery
}
else {
alert("fail");
}
});
});
</code></pre>
<p>I've tried, $(this), this, and also setting a variable like var trigger=this as I enter the initial click function, but none of these are working. I get undefined, or it points to the actual JQuery object, not the button.</p>
<p>Does anyone have any insight into how I can access the button that was clicked at that point, using a jQuery wrapper, essentially something like $( <em>triggered button</em> ).html() so that I can manipulate the correct button?</p>
<p>Thanks for your time.</p>
|
javascript jquery
|
[3, 5]
|
4,925,091
| 4,925,092
|
How to move to privious visited page with the current URL
|
<p>How to move to privious visited page with the current UR. Previous URL was has some diffrent parameters and current page have some different,</p>
|
javascript jquery
|
[3, 5]
|
2,643,904
| 2,643,905
|
How to hide an dom element after creating it on the fly with Jquery?
|
<p>I am trying to build a form where users can add a text field by clicking on a "add option" button. They can also remove added fields by a "remove option" link created on the fly by Jquery, along with the text field. My code looks like this :</p>
<pre><code>$(document).ready(function(){
$("#add_option").click(function(){
var form = $("form");
var input_field = '<input type="text" />';
var delete_link = '<a href="#">remove</a>';
form.append(input_field + delete_link);
return false;
});
$("a").click(function(){
alert('clicked');
return false;
});
});
</code></pre>
<p>This code is not working : when I click on the "add_option" button, a new text field and the "delete_link" appear. But when clicking on the "delete_link" created by JQuery, the browser follows the link instead of launching a pop-up displaying "clicked". Any idea ?
Thanks !</p>
|
javascript jquery
|
[3, 5]
|
5,276,876
| 5,276,877
|
Accessing html controls within an #include html file, from server side c#
|
<p>Following code is an example, I just want to know if this can be done.</p>
<p>I have an test.aspx file with this server side include tag;</p>
<pre><code><!--#include file="listOfCountries.htm" -->
</code></pre>
<p>Within listOfCountries.htm, I have:</p>
<pre><code><html>
<div>
<select id="countryList" runat="server">
<option></option>
...
</select>
</div>
</html>
</code></pre>
<p>Now, Is there a way to access "countryList" in test.aspx.cs file ?</p>
<p>On another note, say I didn't have the #include "Countries.htm" in test.aspx, is it possible to access the controls within Countries.htm from test.aspx.cs ? (i.e. accessing an external html file controls in cs)</p>
|
c# asp.net
|
[0, 9]
|
5,977,721
| 5,977,722
|
How can I load data on a page based on this being added into the URL #a=1380369&i=23007472
|
<p>On a php page with javascript (jquery) in the urel I would like to have something like this<br>
idex.php?var=something*<em>#a=1380369&i=23007472</em>* </p>
<p>The page will load photos and have a next and previous link, when this is clicked on it will use ajax to load the new image into the page but I need to also change the URL to add someting like this to the end of it <strong>#a=1380369&i=23007472</strong> and then everytime a new photo is loaded it will change the URL value. If a user were to copy and paste the URL of an image page the page needs to use the <strong>#a=1380369&i=23007472</strong> values to load the correct image on that page. </p>
<p>The result I am trying to get is it will act like a regualr galler, you can use ajax to load new photo page but it will not be an actual redirect to a new page load, ajax will just pull what it needs. The part I need to know is how to access the <strong>#a=1380369&i=23007472</strong> url data and load the appropriate stuff based on it.</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,968,541
| 5,968,542
|
csv file upload on asp.net
|
<p>User need to upload 30,000 csv values, these values may contain 16 digit numbers or zipcodes.</p>
<p>Now our asp.net project doesn't use AJAX tool kit controls or jquery or any other 3rd party controls or open source code. This is restriction as per companies privacy policy.</p>
<p>So I have to come with a best way to accommodate file upload feature. This has to be versatile in regards to re-usability some thing like a custom control</p>
<p>This file upload feature should not be saved on the server, instead I need to read data into stream buffer and send them to UI then once user verify these values he/she'll have to hit submit thus values will be saved to DB.</p>
<p>what are the best ways to implement this, </p>
<ul>
<li>Can I make use of <strong>System.Net.Webclient</strong>? or </li>
<li>Is there any other alternative ways by using <strong>Async HttpHandlers</strong>? </li>
<li>Can I show <strong>file upload progress to UI</strong> ?</li>
</ul>
<p>Appreciate if you could help me with proper guidence on this.</p>
<p>Thanks in advance
krish</p>
|
c# asp.net
|
[0, 9]
|
941,033
| 941,034
|
How to get windows logged in user id from ASP.NET with anonymous access
|
<p>I have a web application which is set on forms and anonymous access. I have a default page on which I want to get the current windows logged in user, it's an ASP.Net application.</p>
<p>How can I do this?</p>
|
c# asp.net
|
[0, 9]
|
1,784,731
| 1,784,732
|
What does it mean "No Launcher activity found! and The launch will only sync the application package on the device!"
|
<p>I got this warning from console when running my application on emulator
No Launcher activity found!
The launch will only sync the application package on the device!</p>
<p>In fact i have declared two activities as the GMapsActivity and MainActivity launcher in AndroidManifest.xml file</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.emsgpstracking.fh"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.emsgpstracking.fh.GMapsActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.main" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:exported="false"
android:name="com.emsgpstracking.fh.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.main.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
</application>
</manifest>
</code></pre>
<p>What's the reason? Please give me a solution</p>
|
java android
|
[1, 4]
|
3,326,268
| 3,326,269
|
returning incorrect floating point value
|
<p>I have a method getFar() which should return 5.1f:</p>
<pre><code> float far = 5.1f;
public float getFar()
{return far;}
</code></pre>
<p>But when I call it from another class </p>
<pre><code> System.out.println("Far: "+ mRenderer.getFar());
</code></pre>
<p>it returns different values every time. In one run it can be 5.25..., in another 5.78..., etc</p>
<p>How can I return 5.1f?</p>
|
java android
|
[1, 4]
|
694,862
| 694,863
|
Close currently opened tab
|
<p>I've tried <code>window.close();</code> to close the currently opened tab but it does not seem to work. What am I doing wrong? My scope is to run a JavaScript script that automatically closes a manually opened tab. </p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,265,638
| 1,265,639
|
execute javascript before dom is loading
|
<p>i want to develop a handle javascript class that handle used frameworks, among other things.</p>
<p>For example:</p>
<pre><code>myClass.addFramework('jQuery'); // just an example
</code></pre>
<p>It works fine and my class add the framework - but if there any jQuery code in it, it wouldnt work, because the framework is loaded after the dom ist ready, so a default jQuery snippet like <code>jQuery(document).ready(function(){});</code> cant work, because 'jQuery' isnt already defined.</p>
<p>Is there any solution to that i can script a 'fix' that before the rest of the dom is beginning to loading all my "addFramework" methodes must be executed ?</p>
|
javascript jquery
|
[3, 5]
|
5,200,981
| 5,200,982
|
How to generate sequence of numbers/chars in javascript?
|
<p>Is there a way to generate sequence of characters or numbers in javascript?</p>
<p>For example, I want to create array that contains eight 1s. I can do it with for loop, but wondering whether there is a jQuery library or javascript function that can do it for me?</p>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
1,266,598
| 1,266,599
|
clearInterval() Undefined Error After Using setInterval()
|
<p>I know this isn't supposed to be inline, but YUI library's dialogs force me to. My issue is that whenever I hover over this div, the margin-left scroll activated but it does not stop when I move the mouse out of the div. The JS console reports that:</p>
<blockquote>
<p>Uncaught ReferenceError: timerID is not defined</p>
</blockquote>
<p>And here's the code:</p>
<pre><code><div class="span1" onmouseover="
var timerID;
$(document).ready(function(){
timerID = setInterval(scrollLeft, 10);
function scrollLeft(){
$('.inner_wrapper').animate({
marginLeft: '-=30px'
});
}
});
" onmouseout="clearInterval(timerID)">
</div>
</code></pre>
<p>EDIT: The thing is that I can NOT run SCRIPT tags inside dialogs (they are already created via scripts, which filter any javascript besides inline one like onmouseover and onmouseout). So your suggestions of encapsulating the onmouseover and onmouseout handles in a single function will not work in this case.</p>
|
javascript jquery
|
[3, 5]
|
4,030,220
| 4,030,221
|
embed php in c++ application or any way can it be done?
|
<p>i was looking for way to embed php script into c++ windows application .
i found old facebook project that i dont know how much good it is or how to use it in windows app if any .
is there any way to embed php in a Windows application?</p>
|
php c++
|
[2, 6]
|
579,192
| 579,193
|
Checkbox uncheck if other checkbox is selected
|
<p>I have many city input checkboxes. I have given the first checkbox the name <strong>All</strong>; if the user selects that then only <strong>All</strong> checkbox gets selected, and not the other city checkboxes.</p>
<p>If the user checks any other city, then the <strong>All</strong> checkbox should automatically be unchecked. I want to do this with JavaScript or jQuery.</p>
<pre><code><input type="checkbox" name="city_pref[]" id="city_all" value="0" checked /><label for="city_all">All</label>
<input type="checkbox" name="city_pref[]" id="city_pref_1" value="Chicago" /><label for="city_pref_1">Chicago</label>
<input type="checkbox" name="city_pref[]" id="city_pref_2" value="Texas" /><label for="city_pref_2">Texas</label>
</code></pre>
<p>and so on....</p>
|
javascript jquery
|
[3, 5]
|
4,299,081
| 4,299,082
|
webview never call ShuldOverrideUrlloading in webviewclient in android
|
<p>I have a webview and a link on the URL that I have loaded on that webview, I want such like that if user clicks in this link the app will go to the background and open that link with the default web browser of that device. To do this I have done the following:</p>
<pre><code>web = (WebView) findViewById(R.id.webview01);
progressBar = (ProgressBar) findViewById(R.id.progressBar1);
web.getSettings().setUseWideViewPort(true);
web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
web.getSettings().setPluginState(PluginState.ON);
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setDomStorageEnabled(true);
web.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url != null
&& url.startsWith("http://the6figuremarketer.com/apps/androidfb21/thks.html")) {
view.getContext().startActivity(
new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
return true;
} else {
return false;
}
}
});
web.loadUrl("http://the6figuremarketer.com/apps/androidfb21/index.html");
</code></pre>
<p>but I figured out that the <code>shouldoverrideurl</code> method is nevet get called. what should I do now? can anyone help?</p>
|
java android
|
[1, 4]
|
5,002,151
| 5,002,152
|
How do I add controls dynamically to a dynamically created panel?
|
<p>I have a repeater that creates n-number of panels. I am trying to dynamically add different controls to each of the panels. I may very well be going about this the wrong way.</p>
<p>My code is more or less:</p>
<p>.aspx:</p>
<pre><code> <asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<% Response.Write("<asp:panel runat=\"server\" id=\"uxPanel_"); %>
<%# DataBinder.Eval(Container.DataItem, "TableId")%><% Response.Write("\"></asp:panel>"); %>
</ItemTemplate>
</asp:Repeater>
</code></pre>
<p>.cs:</p>
<pre><code>public partial class class1: System.Web.UI.Page
{
DataSet ds= null;
protected void Page_Load(object sender, EventArgs e)
{
GetRecords(1,1);
}
protected void GetRecords()
{
ds= dal.LoadRecords();
this.Repeater1.DataSource = ds.Tables[0];
this.Repeater1.DataBind();
Literal lit = new Literal();
lit.Text = "Some text";
this.FindControl("uxPanel_1").Controls.Add(lit);
}
</code></pre>
<p>}</p>
<p>Just to be clear in this example "dal.LoadRecords" is simply call to a method that retrieves some records from a DB. </p>
<p>I think my problem is how I am adding my panels in the first place, but this seemed like an easy way to have them uniquely named.</p>
<p>Any Pointers? </p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
955,017
| 955,018
|
android is my application still running?
|
<p>i have this thread which run as a service:</p>
<pre><code> public void run() {
try {
while(true) {
Thread.sleep(timeInterval);
results = sendGetMessage();
b.putString("results", results);
receiver.send(2, b);
}
} catch (InterruptedException e) {
results = e.toString();
}
this.stop();
}
</code></pre>
<p>i want to write a simple function which will check if my application is still running (in order to replace the everlasting while(ture) i've written).
something like: while(isMyAppRunning).
my problem now that even when i'm closing the app, the service keep on running..
can someone please be kind and give me a code example?</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.