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 |
---|---|---|---|---|---|
1,708,041 | 1,708,042 |
converting this function from Javascript to jQuery
|
<p>I've tried over and over to change this function to jQuery but I can't seem to get it to run properly. Could anyone give me any help with it at all?</p>
<pre><code>window.onresize = resizeImage;
function resizeImage(){
var newHeight = document.documentElement.clientHeight;
var newWidth = document.documentElement.clientWidth;
document.getElementById('crofthouse').width = (newHeight / 2) * 1.33;
document.getElementById('crofthouse').height = (newHeight / 2);
document.getElementById('main').style.width = (newHeight / 2) * 1.33;
document.getElementById('main').style.height = (newHeight / 2);
var margin = (newHeight - document.getElementById('crofthouse').height) / 2;
document.getElementById('main').style.margin = margin + ',auto,' + margin + ',auto';
}
</code></pre>
<p>here's my attempt at converting it
window.onresize = resizeImage;</p>
<pre><code>function resizeImage(){
var newHeight = document.documentElement.clientHeight;
var newWidth = document.documentElement.clientWidth;
$("#crofthouse").css("width, (newHeight /2) * 1.33")
$("#crofthouse").css("hegiht, (newHeight /2)")
$("#main").css("width, (newHeight /2) * 1.33")
$("#main").css("height, (newHeight /2)")
var margin = (newHeight - $('#crofthouse').css("height) / 2");
$('main').css("margin = margin + ',auto,' + margin + ',auto'");
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,057,280 | 4,057,281 |
javascript restore style
|
<p>I want to see a specific div on full-screen and change style and for this, I used this function: </p>
<pre><code>$(function () {
$('#trigger').click(function () {
var screenres = screen.width + 'x' + screen.height;
document.getElementById("map").style.backgroundColor = "white";
if (screenres == "1920x1080") {
document.getElementById("map_canvas").style.height = "1000px";
}
if (screenres == "1366x768") {
document.getElementById("map_canvas").style.height = "600px";
}
});
}
</code></pre>
<p>The style is changed but it doesn't return to its former state. For example before full-screen; the map div's height:300px after the full-screen its value 1000px.</p>
<p>How can I return first value?</p>
|
javascript jquery
|
[3, 5]
|
2,863,650 | 2,863,651 |
Counting checkboxes in JS/JQuery
|
<p>I have this simple line, that I was hoping would count all checked checkboxes with the class (.photos):</p>
<pre><code>var count = $('.photos').length;
</code></pre>
<p>It counts all the checkboxes that have that class (.photos) but it doesn't count the checked ones.</p>
<p>Does anybody know how to alter this line to count the checked checkboxes within this class?</p>
<p>Regards</p>
|
javascript jquery
|
[3, 5]
|
3,601,061 | 3,601,062 |
Preloader does not preload and loads the page a second time
|
<p>I found this nice jQuery <a href="http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/" rel="nofollow">preloader/progress bar</a>, but I cannot get it to work as it is supposed to. The problem is that it first loads my page and after my whole page is loaded the 0%-100% bar displays quickly, after that it reloads my page again. So it does not show the progress bar BEFORE the page loads and it loads the page a second time as well. </p>
<p>Here is my implementation code:</p>
<pre><code><head>
<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/jquery.queryloader2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("body").queryLoader2();
});
</script>
</head>
<body>
My content...No other reference in here for the Jquery preloader
</body>
</code></pre>
<p>Thanks for any help in advance.</p>
|
javascript jquery
|
[3, 5]
|
3,043,119 | 3,043,120 |
Android packaging error
|
<p>When I compile my Android Project I always get this Error:</p>
<blockquote>
<p>Error generating final archive: duplicate entry: about.html</p>
</blockquote>
<p>But I can't find any about.html in my Project.
Does anyone know how to solve the error?</p>
|
java android
|
[1, 4]
|
2,605,491 | 2,605,492 |
Want to use default configuration for SMTP from <system.net> configuration section
|
<p>I'd like to put an encrypted password in the configuration section. I have the decryption function, but where do I put it so that when SMTPClient is instantiated using this configuration information that I can run the decryption function for the password?</p>
<p>Thanks for any tips!</p>
|
c# asp.net
|
[0, 9]
|
5,628,393 | 5,628,394 |
Programmatically get Carrier time in android
|
<p>I am relying on time in one of my application where We support only when mobile is connected to network, where we are trying to initialize in offline , i.e. It has to work without network where I can't rely on user time.</p>
<pre><code> I felt it's a challenging to learn but I have a little time to implement, any suggestion's would be great unless removing the offile policy :)
</code></pre>
<p>Thanks and regards,
karthik kondlada</p>
|
java android
|
[1, 4]
|
4,105,143 | 4,105,144 |
Android - Location Listener throughout my application
|
<p>In my application there are more than 10 activities.With the help of Location manager ,it updates all my changes in the location in a db.But it seems too difficult to code the same in all activities.Since the location updation is meant for whole application,is there is any solution in java so that code size can be effectively reduced? </p>
|
java android
|
[1, 4]
|
4,579,597 | 4,579,598 |
How a Dialog window can modify JS in the parent window
|
<p>I have a site that opens a dialog. In that dialog I want to be able to modify a JS value in the parent window. The sites are at the same domain.</p>
<p>in the parent I can do:</p>
<pre><code>currentUserModel.guest(false)
</code></pre>
<p>In the dialog, how can I do currentUserModel.guest(false)?</p>
<p>Right now if I try I get:</p>
<pre><code>Uncaught ReferenceError: currentUserModel is not defined
</code></pre>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,936,271 | 4,936,272 |
Jquery closing in click
|
<p>im having a problem in a script that i download it in the web, basically what i need is a FAQ question whit the collapse panel interaction, but in this case different in the other out there i want when i click in one question it opens, and when i click in another question the question before closes and open the one i clicked.</p>
<p>I found this <a href="http://feloliveira.com.br/blog/faq-de-perguntas-e-respostas-com-jquery/" rel="nofollow">Collapse panel script</a></p>
<p>It works well, but is missing one detail, if i click in the same link (question), the question doesn´t collapse back to normal normal mode, its only possible to close him chosing another link. I want to be able to close the question when i chose another question and when i click the same question again.</p>
<p>the javascript code in the main page:</p>
<pre><code><script type="text/javascript">
<!–
$(function() {
var $h2;
var $answer;
$(‘.answer’).hide();
$(‘#faq h2′).bind(
‘click’,
function()
{
if ($h2 && $h2[0] != this) {
$answer.slideUp();
$h2.removeClass(‘open’);
}
$h2 = $(this);
$answer = $h2.next();
$answer.slideDown();
$h2.addClass(‘open’);
}
)
});
–>
</script>
</code></pre>
<p>Hope for some help</p>
|
javascript jquery
|
[3, 5]
|
3,418,674 | 3,418,675 |
define an array of input control in aspx.cs
|
<p>i have an input control of type file.</p>
<pre><code><input id="FileUpload1" type="file" runat="server" size="35" />
</code></pre>
<p>there are four input controls like this and in aspx.cs file i m trying to make an array of these ids..</p>
<p>i have made an array </p>
<pre><code>HtmlInputFile[] fl = new HtmlInputFile[4] { FileUpload1, FileUpload2, FileUpload3, FileUpload4 };
</code></pre>
<p>but it gives me an error..how can i get the value of these inputs.</p>
|
c# asp.net
|
[0, 9]
|
4,589,868 | 4,589,869 |
Javascript - id's are timestamps, if more than 10 then delete the oldest one
|
<p>A bit of a tricky one, at least for me. Here is the scenario:</p>
<pre><code><div id="gifs">
<img src="gif/1.jpg" alt="" >
<img src="gif/10.jpg" alt="" >
<img src="gif/15.jpg" alt="" >
<img src="gif/20.jpg" alt="" >
<img src="gif/5.jpg" alt="" >
</div>
</code></pre>
<p>Everytime a user clicks on an image, the image changes to a gif and the id is set with a timestamp.<br>
The issues is, I don't want more than 4 gifs at a time. Which means that, if there are 4 gifs, next time a user clicks, the older one goes back to being a jpg. HOW CAN I DO THAT?</p>
<p>Here is my jquery so far:</p>
<pre><code>$("#gifs img").click(function () {
var original = $(this).attr("src");
var newsrc = original.replace('jpg','gif');
if(!$(this).hasClass('on')){
$(this).attr("src" , '');
$(this).attr("src", newsrc );
$(this).addClass('on');
var t = new Date();
var time = t.getTime();
$(this).attr('id' , time);
// HELP MOSTLY HERE, IN THE EACH FUNCTION. NEED TO STORE TIMESTAMP INSIDE AN ARRAY...
$('.on').each(function(e){
//dif[] = $(e).attr('id');
});
/*var oldest = dif.min();
var oldestsrc = $('#'+oldest).attr("src");
var oldestnewsrc = oldestsrc.replace('gif','jpg');
$('#'+oldest).attr("src",oldestnewsrc); */
}
});
</code></pre>
<p>Help much appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,181,245 | 5,181,246 |
how to populate textarea when a checkbox is clicked using jquery
|
<p>i want to detect if the checkbox is set to true and then put some data into a textarea. any examples of this?</p>
|
asp.net jquery
|
[9, 5]
|
4,736,461 | 4,736,462 |
Android javax.naming.* replacement?
|
<p>I am trying to find an API for my android application that will replace the javax.naming package for DNS look up information. The java.net.InetAddress gives me some of the information that I need for my DNS tool, but fails to look up the MX and NS records.</p>
<p>Does anyone have a suggestion on the API's I should be using to accomplish this?</p>
|
java android
|
[1, 4]
|
1,395,399 | 1,395,400 |
Why is first sound slow to play with soundmanager2?
|
<p>I've just finished this jquery plugin to display musical scales:</p>
<p><a href="http://www.daveconservatoire.org/tools/scales" rel="nofollow">www.daveconservatoire.org/tools/scales</a></p>
<p>The piano keys are clickable and play the relevant notes. I'm using the Soundmanager2 package. </p>
<p>I'm loading all the sounds when the page loads, but even when loaded I notice that the first note I click takes a while to playback the note - but then when I click on either that note or any other note the playback is quick and crisp. </p>
<p>Why does it take a second or so to "wake up" soundmanager?</p>
|
javascript jquery
|
[3, 5]
|
5,190,413 | 5,190,414 |
jQuery - How to make the input values ("email", "password") reappear when out of focus?
|
<p>When I click inside the input fields the values "Email" and "password" disappear which is what I want. But if the user doesn't enter his email/pass and clicks somewhere else, I want "Email" and "Password" to reappear. </p>
<p>jQuery:</p>
<pre><code>$('.login-user, .login-pass').focus(function() {
$(this).val("");
});
</code></pre>
<p>Html:</p>
<pre><code><input type="text" name="user" value="Email" tabindex="1" class="login-user" />
<input type="password" name="password" value="Password" tabindex="2" class="login-pass" />
</code></pre>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
3,491,777 | 3,491,778 |
Show elements depending on html value of a tag
|
<p>I would like to accomplish the following with jquery : </p>
<p>When I click on this link </p>
<pre><code><a href="#">Cars</a>
</code></pre>
<p>I would like all divs like those </p>
<pre><code><div class="product">
<div class="category">Cars</div>
</div>
</code></pre>
<p>to do something.</p>
<p>You get the idea, I have a menu with a list of categories, and a list of products, each containing a div with the category name, and I would like to make them hide/show.</p>
|
javascript jquery
|
[3, 5]
|
5,627,196 | 5,627,197 |
Question about javascript event handler syntax
|
<p>My question appears to have been deleted yesterday before it could be answered, so I'm starting a new thread on the subject.</p>
<p>I've been trying to find cross-browser resize javascript, and ran across this syntax in one answer posted here:</p>
<pre><code>$(window).resize(function()
</code></pre>
<p>I'm afraid I don't understand the syntax <code>$(window).</code>. Is that something specific to jquery?</p>
|
javascript jquery
|
[3, 5]
|
2,789,846 | 2,789,847 |
Databind a List<System.Web.UI.WebControls.Image> to a repeater
|
<p>Im trying to bind a List of Images (<code>System.Web.UI.WebControls.Image</code>) to a repeater, but the image is shown as broken. It seems allright when I put a breakpoint inside the ItemDataBound-event, the DataItem is correct and have the correct ImageUrl. Yet, the result is wrong.</p>
<p>This code is very simple, but will be way more complex at the end. Binding a <code>List<String></code> with ImageUrls wont help me in the end, since all images will have more unique properties aswell.</p>
<p>Repeater:</p>
<pre><code><asp:Repeater ID="repButtons" runat="server" OnItemDataBound="repButtons_OnItemDataBound">
<ItemTemplate>
<asp:Image ID="imgButton" runat="server" />
</ItemTemplate>
</asp:Repeater>
</code></pre>
<p>Making the list with images:</p>
<pre><code>List<System.Web.UI.WebControls.Image> myButtons = new List<System.Web.UI.WebControls.Image>();
Image myEditButton = new Image();
myEditButton.ImageUrl = "~/images/themes/pencil.png";
myButtons.Add(myEditButton);
repButtons.DataSource = myButtons;
repButtons.DataBind();
</code></pre>
<p>Databinding:</p>
<pre><code>protected void repButtons_OnItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Image myImage = (Image)e.Item.DataItem;
Image imgButton = (Image)e.Item.FindControl("imgButton");
imgButton = myImage;
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,324,826 | 4,324,827 |
validate and submit form when enter is pressed in input(textbox) field but does not select history when enter pressed
|
<p>similar to how we have onfocus and onclick on input tags I am using the below method( if the method is wrong please let me know what would be the proper method ) for submitting a form when someone presses enter on a textbox in a field in a form </p>
<p>Example when someone writes the password in the password field and presses enter (when the cursor is on the password field) the form should submit.</p>
<p>I even have a submit button but I want the same thing to happen when text has enter pressed when submit is clicked</p>
<p>I am using this right now </p>
<pre><code>onkeypress='if (event.keyCode == 13) { validate(); }'
</code></pre>
<p>for my textbox fields</p>
<p>the issue over here is that when the history of my text box shows below my text box and I select it by pressing enter it does not take the value first in my text box. It straight away validates the value in the text box </p>
<p>Example:
I have typed abcin my email textbox, I get [email protected] below my text box showing that I had typed that earlier, not when I do down by pressing the down arrow and pressing enter it does not take [email protected] in my text box but straight away runs validate() anhd gives me an error as wrong email format.</p>
<p>I believe it should first take my old value in the text box and then run the validate function</p>
<p>I am using codeigniter</p>
|
php javascript
|
[2, 3]
|
777,701 | 777,702 |
Java Declaration
|
<p>I am new to android. i know only core java.</p>
<p>I saw the declaration </p>
<pre><code>ArrayList<ApplicationInfo> mAppInfo;
</code></pre>
<p>in Android sample project.
Can anyone explain what is the meaning of above declaration.</p>
|
java android
|
[1, 4]
|
1,968,324 | 1,968,325 |
Like browser,Multiple Tabs loading simultaneously....How to do like this in Javasript or jquery
|
<p>My question is, how to to use Same function in Two different tabs at same time. Simply Like browser, multiple Tabs loading simultaneously. How to do like this in JavaSript or jQuery. </p>
|
javascript jquery
|
[3, 5]
|
1,380,838 | 1,380,839 |
Clearing a session
|
<p>I have a session class where i am saving text box values(application) in a session. However, when the user times out due to inactivity or just goes back to the home page i want to clear all session data.
I tried to set it in the homepage but the !IsPostBack keeps firing.</p>
<pre><code>if (!IsPostBack)
{
JobPositionSystemDAL jps = new JobPositionSystemDAL();
DataSet ds = jps.GetJobs();
GridView2.DataSource = ds;
GridView2.DataBind();
}
if (IsPostBack)
{
Session.RemoveAll();
}
</code></pre>
<p>Thank you.</p>
|
c# asp.net
|
[0, 9]
|
1,176,878 | 1,176,879 |
jQuery detect if an element is visible
|
<p>Using <code>.fadeIn()</code> and <code>.fadeOut()</code>, I have been hiding/showing an element on my page, but with two buttons, one for hide and one for show. I now want to have one button to toggle both. Therefore, my question is how do I detect if the element is visible or not?</p>
<p>My HTML as it is:</p>
<pre><code><a onclick="showTestElement()">Show</a>
<a onclick="hideTestElement()">Hide</a>
</code></pre>
<p>My JS as it is:</p>
<pre><code><script>
function showTestElement(){
$('#testElement').fadeIn('fast');
}
function hideTestElement(){
$('#testElement').fadeOut('fast');
}
</script>
</code></pre>
<p>My HTML as I would like to have it:</p>
<pre><code><a onclick="toggleTestElement()">Show/Hide</a>
</code></pre>
<p>My JS as I would like to have it, although pure jQuery would be nice:</p>
<pre><code><script>
function toggleTestElement(){
if (document.getElementById('testElement').***IS_VISIBLE***) {
$('#testElement').fadeOut('fast');
}
else{
$('#testElement').fadeIn('fast');
}
}
</script>
</code></pre>
<p>Any help gratefully received..</p>
|
javascript jquery
|
[3, 5]
|
92,778 | 92,779 |
How can we get the current exchange rate?
|
<p>We have payment gateway and Fedex shipping in our project. Problem is if the person is from some other country then we have to charge different rates for shipping. How can we get the current exchange rate. Is there any service available?</p>
|
c# asp.net
|
[0, 9]
|
868,213 | 868,214 |
Select form option on page load
|
<p>I would like to select the option contained within a php variable on page load.</p>
<pre><code><?php
$pre = 78;
?>
<select id="form8" name="form8">
<option value="15">15</option>
<option value="25">25</option>
<option value="64">64</option>
<option value="78">78</option>
<option value="82">82</option>
</select>
<script>
$(document).ready(function(){
$("form8").val("<?php echo $pre; ?>");
}
</script>
</code></pre>
<p>Expected output should be, </p>
<pre><code><select id="form8" name="form8">
<option value="15">15</option>
<option value="25">25</option>
<option value="64">64</option>
<option value="78" selected="selected">78</option>
<option value="82">82</option>
</select>
</code></pre>
<p><a href="http://jsfiddle.net/qQZVN/1/" rel="nofollow">http://jsfiddle.net/qQZVN/1/</a></p>
|
php javascript jquery
|
[2, 3, 5]
|
2,180,067 | 2,180,068 |
Ventrilo Status on your website
|
<p>I'm looking for some examples of how you would show the status of a ventrilo server on your website. What I would like is the ability to show who is logged on and what channel they are logged into. I have found sites that you can purchase, but would like to either find a open source or free solution.</p>
<p>If there is not a solution already in place, some information on how this would be accomplished in either php or c#/asp.net, as I do have both options available. </p>
<p>Edit:
Now, I would really like to know how this is done.</p>
|
c# php asp.net
|
[0, 2, 9]
|
4,785,069 | 4,785,070 |
Change CSS with jQuery Sortable
|
<p>How can I change CSS property once sorted. Something likes this:</p>
<pre><code> $( "#sort" ).sortable({
$(#div1).css("background-color","yellow");
});
</code></pre>
<p>Thanks alot</p>
|
javascript jquery
|
[3, 5]
|
4,866,617 | 4,866,618 |
Count characters with jQuery in case of multiply entries
|
<p>Here I have html structure. It repeats several times on the page.</p>
<pre><code><article class="boo">
<h4>Here goes the title</h4>
</arcticle>
</code></pre>
<p>I want to count the number of characters in each header h4 inside of article.</p>
<pre><code>$('article.boo h4').text().length > 70
</code></pre>
<p>Counts the total number of characters in all headers. What I want is to check if each and every of the headers is longer than 70 characters.</p>
<p>What is the best way to loop through all the elements and make a validation in this case?</p>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
5,083,585 | 5,083,586 |
Avoid round number when casting a float to string
|
<p>I need avoid round number when casting a float to string, I need the number is exactly the same.</p>
<p>In this moment if I make this:</p>
<pre><code>String value = String.valueOf(1234567.99);
</code></pre>
<p>The the value = 1234568.0 ,so I need the value = 1234567.99 after casting.</p>
|
java android
|
[1, 4]
|
1,670,669 | 1,670,670 |
Font picker Implementation
|
<p>I want to implement a font and color picker in my project. I implemented the color picker, I got it the code, but still I don't get the code to implement the font picker. Does any one know?</p>
<p>Thanks in advance.</p>
|
php javascript
|
[2, 3]
|
598,296 | 598,297 |
jQuery: cancel sortable on top-most LI element?
|
<p>I have two sortables that are straight UL elements, each with at least on LI element and as many as ten, sorted like so:</p>
<pre><code>$(".sortable").sortable({
connectWith: ".sortable",
cancel: '.no-drag',
}).disableSelection();
</code></pre>
<p>I want each UL to have a top-most LI element reading 'Title'. I don't want this LI element to be draggable, and I don't want it to be sortable; it's effectively a header block for the UL. The 'cancel' option in the sortable() call DOES prohibit the user from dragging it around, but the user can still drag other LI elements in the list up and down, dislodging the top-most LI. I want to prevent this.</p>
<p>Essentially: I want LI items 2-N to be sortable, and 1 fixed.</p>
<p>Thoughts?</p>
|
javascript jquery
|
[3, 5]
|
3,120,567 | 3,120,568 |
handler = function?
|
<p>every time i encounter this word i wonder what it really means. eg an event handler, is that a function?</p>
<p>$('a').click(function(){
...
});</p>
<p>is the click an event. and the handler the anonymous function?</p>
|
php jquery
|
[2, 5]
|
1,215,043 | 1,215,044 |
HOW NOT update a variable in post back
|
<p>Consider the code</p>
<pre><code>public partial class Classname: somethng
{
bClass objClass = new bClass();
Boolean isfindclicked=false;
protected void Page_Load(object sender, EventArgs e)
{
//rowid = 0;
if (!IsPostBack)
{......
...
}
}
protected void btnFind_Click(object sender, EventArgs e)
{
isfindclicked=true;
}
</code></pre>
<p>On a button click,certain operations are performed if the isfindclicked value is true.But once the button is clicked the page is reloaded and the value of isfindclicked sets to false.So the fn inside the buttn clicked is not executed...</p>
<p>So any way to make the varible isfindcliked <strong>not updated during page postbacks.</strong>.I ave tried with Session,it worked..but is there any other way out in not updating the isfindclicked value during page reloads...?</p>
|
c# asp.net
|
[0, 9]
|
5,370,190 | 5,370,191 |
How to do client callback for each item in a foreach statement using c#?
|
<p>I want to show each item Id that is doing now dynamically in a foreach statement.
How to do some kind of client callback to show the item Id in a foreach statement?</p>
<pre><code><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
</code></pre>
<p>.</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
List<int> list = new List<int>()
{
1,2,3,4,5
};
foreach (var item in list)
{
Label1.Text = string.Format("I'm doing item {0} now.", item.ToString());
Page.RegisterStartupScript("", string.Format("<script>alert('doing item {0} now')</script>", item.ToString()));
Thread.Sleep(1 * 1000);
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,301,269 | 5,301,270 |
div hide and show javascript having blinking problem in mozilla
|
<p>My javascript is </p>
<pre><code> function Show1()
{
//document.getElementById("Popup_tooltip").style.overflow="auto";
document.getElementById("Popup_tooltip").style.display="block";
}
function Hide1()
{
/* hide the pop-up */
document.getElementById("Popup_tooltip").style.display="none";
}
</code></pre>
<p>my css for div is</p>
<pre><code>.tooltip
{
display:block;
position:absolute;
top:145px;
left:700;
width:100%;
height:100%;
}
</code></pre>
<p>and my div is </p>
<pre><code><div id="Popup_tooltip" class="tooltip" >
<table width="180" height="70" border="1" bordercolor="#3a93ed" style="border-collapse:collapse;" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#ebf5ff">
Help contents related to this topic will display here.
As a tooltip, if u need for help?
</td>
</tr>
</table>
</div>
</code></pre>
<p>and onmouseover and mousehide i call function show and hide..
Its coming properly in IE but having problem in Mozilla
Please reply asap
thanx</p>
|
asp.net javascript
|
[9, 3]
|
5,501,931 | 5,501,932 |
getting installed applications programmattically
|
<p>I am trying to get the installed application in android after clicking a icon. Under the icon click code I wrote following code:</p>
<pre><code>Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.ACTION_ALL_APPS);
startActivity(intent);
</code></pre>
<p>But it kills the application. I want to show the installed applications on the screen programmatically like when we see when press app key on android.</p>
<p>Is it possible?
where am I doing wrong?
Thank you in advance.</p>
|
java android
|
[1, 4]
|
2,275,088 | 2,275,089 |
How to get text around an element?
|
<p>If I have</p>
<pre><code><div id='wrapper'>
<fieldset id='fldset'>
<legend>Title</legend>
Body text.
</fieldset>
</div>
</code></pre>
<p>How could I retrieve the "Body text" without retrieving the text inside of legend tag?</p>
<p>For instance, if I wanted to see if the text inside the fieldset contains the word "body" and change that word, while ignoring whatever might be in the legend? innerHTML retrieves all text from all children nodes.</p>
<p>Use of jQuery wouldn't be a problem.</p>
|
javascript jquery
|
[3, 5]
|
5,150,520 | 5,150,521 |
I'm using jQuery boxy plugin for Ajax modal pop up window
|
<p>I'm using jQuery boxy plug in for Ajax modal pop up window and and populating it through Ajax. In that window populate combo box using Ajax first time it will populate. But when I close modal window and again open it and hit the button, the combo box does not populate.</p>
<p>I'm using php as server side language.</p>
<p>How to fix it and where am I making a mistake?</p>
<p>Here is the code</p>
|
php jquery
|
[2, 5]
|
112,233 | 112,234 |
Rounded corners AND shadow applied to one div?
|
<p>How? Any suggestions besides CSS? </p>
<p>I have tried JQuery (dropCurves, shadow, shadedborder, corner osv).</p>
|
javascript jquery
|
[3, 5]
|
670,139 | 670,140 |
QueryString to Textbox
|
<p>I have a table tblProfile, which contains fields with Id, Name, Address. I have 2 aspx page, which are Home.aspx and Here.aspx. On my Home.aspx I have used this code to pass the Id in my Here.aspx:</p>
<pre><code><asp:HyperLink ID="link" runat="server" NavigateUrl="Here.aspx?id={0}"
Font-Names="Times New Roman" Font-Size="Medium" >Click here</asp:HyperLink>
</code></pre>
<p>In code behind Home.aspx.cs:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
string bID = Request.QueryString["Id"];
if (string.IsNullOrEmpty(Id))
{
Response.Redirect("Here.aspx?", true);
}
ViewState["Id"] = Id;
link.NavigateUrl = String.Format(link.NavigateUrl, Id);
}
</code></pre>
<p>I don't have any problem with passing the Id to url in 2nd page. But what I want right now is, on my Here.aspx, I have 3 textboxes which supposed to be filled by the Id, Name and Address of the certain Id that passed from the Home.aspx. Tried many but had no luck at all. Any help would be appreciated. By the way, I'm using asp.net with c#.</p>
|
c# asp.net
|
[0, 9]
|
5,008,642 | 5,008,643 |
Href Links Dymamically
|
<p>I have some links in an json file</p>
<pre><code><code>
"links": [
{"link": "http://www.google.com/",
"id": "1"
},
{"link": "http://www.poogle.com/",
"id": "2"
},
{"link": "http://www.foogle.com/ ",
"id": "3"
},
]
</code>
</code></pre>
<p>on a webpage, I will like a js function or script that will write in the url href dynamically </p>
<p>So if im on a page and the href is </p>
<pre><code> <a href id=”1”> </a>
</code></pre>
<p>it should be able to write in google.com into that ahref.</p>
<p>Also is this the best approach to take, should I use Id? Or something else?</p>
<p>Your insight will be helpful</p>
<p>UPDATED</p>
<pre><code>JSON FILE:
{"links":
[
{"link": "google.com",
"id": "1"
},
{"link": "yahoo.com",
"id": "2"
},
{"link": "msn.com",
"id": "3"
},
{"link": "mash.com",
"id": "4"
},
{"link": "facebook.com",
"id": "5"
}
]
}
</code></pre>
<p>JS</p>
<pre><code>for (var i = 0; i < linksObj.links.length; i++) {
var linkObj = linksObj.links[i];
var elem = document.getElementById(linkObj.id);
if (elem) {
elem.href = linkObj.link;
elem.innerHTML = linkObj.link;
}
}
</code></pre>
<p>HTML</p>
<pre><code><a id='1'></a><br>
<a id='2'></a>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,187,283 | 5,187,284 |
How to return a value from a nested and anonymous function?
|
<p>I have this JS code:</p>
<pre><code>function paging() {
$('.paging li').click(function(e) {
$('.paging li a').removeClass("active");
$(this).find('a').addClass("active");
$('#img-grp-wrap img').hide();
var indexer = $(this).index();
$('#img-grp-wrap img:eq('+indexer+')').fadeIn();
e.preventDefault();
return indexer;
});
}
var $cur_page = paging();
console.log($cur_page);
</code></pre>
<p>I would like to use the indexer value outside the function paging() but when I try doing console.log(), it just says <em>undefined</em>.</p>
<p>How do I structure this so that I can pass the index value of the link I clicked outside the function (which is the indexer variable)?</p>
<p>I'm a programming newbie so please bear with me.</p>
|
javascript jquery
|
[3, 5]
|
2,083,520 | 2,083,521 |
on mouse up change button
|
<p>I have a set of buttons. I want that when I do mouse up on one of the buttons, that particular button will change its back colour while all the other will remain the same. </p>
<p>Any help on how to do it without having any post back.?</p>
|
javascript asp.net
|
[3, 9]
|
1,396,716 | 1,396,717 |
Trying to delay a for loop until a div is loaded
|
<p>I'm playing around with loading and moving around div elements on a page. I'm trying to fade in a string and then reverse it. The reverse loop needs to wait until after the initial fade in loop completes. Here is what I have so far but it doesn't execute the reverse loop. I assume because it can't see the initial divs yet.</p>
<pre><code>var string_to_reverse = "Reverse",
i;
for (i = 0; i < string_to_reverse.length; i++) {
$("<div>" + string_to_reverse[i] + "</div>").hide()
.appendTo("body").delay(500 * i).fadeIn(1000);
}
$("body div:last").load(function () {
for (i = 1; i <= $("body div").length; i++) {
$("body div:eq(" + i + ")").detach().prependTo($("body"));
}
});
</code></pre>
<p><a href="http://jsfiddle.net/vk45U/" rel="nofollow">http://jsfiddle.net/vk45U/</a></p>
|
javascript jquery
|
[3, 5]
|
669,537 | 669,538 |
Assigning Values to DropDownList in Grid
|
<p>I have a DropDownList in a Grid and I have a foreach loop that loops through a Query and matches data and fills the drop down list for each row on that. But It is putting the data all in the same dropdownlist. So row 1, row 2, row 3, etc. all get combined into the dropdownlist. I am trying to make it so in row 1 dropdlownlist has the info for row 1 and row 2 the dropdownlist has the info for row 2 and so on.</p>
<p>I have this so far:</p>
<pre><code>protected void grdExceptions_ItemDataBound(object sender, GridItemEventArgs e)
{
var linqContext = new DataClassesDataContext();
var sessionleads = from q in linqContext.Leads where q.SessionID == SessionId orderby q.RowIndex select q;
if (e.Item is GridDataItem)
{
foreach(var p in sessionleads)
{
var lQuery = (from a in gServiceContext.CreateQuery("account") where (a["name"].Equals(p.AccountName) &&
a["address1_postalcode"].Equals(p.ZipCode) &&
a["address1_stateorprovince"].Equals(p.State)) ||
(a["address1_line1"].Equals(p.Address1) &&
a["address1_postalcode"].Equals(p.ZipCode) &&
a["address1_city"].Equals(p.City))
select new
{
Name = !a.Contains("name") ? string.Empty : a["name"]
});
foreach (var a in lQuery)
{
((e.Item as GridDataItem)["Account"].FindControl("AccountList") as DropDownList).Items.Add(new ListItem(a.Name.ToString()));
}
}
}
}
</code></pre>
<p>I have a DropDownlist in the ItemTemplate of the Grid. So for the first row I would want whatever matches are found assigned to the drop downlist in the first row, for the second row I would want whatever matches the dropdownlist in the second row, etc.</p>
<p>What am I doing wrong?</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
5,542,195 | 5,542,196 |
jquery: eventObject.pageY and scrollbar
|
<p>I am using eventObject.pageY to get the current mouse position when the event is fired. But I noticed the number is relative to the document but not the viewport. </p>
<p>I want to get the pageY relative to the viewport(when vertical scrollbar appears it has difference to the pageY relative to the document), how to get that?</p>
|
javascript jquery
|
[3, 5]
|
5,168,220 | 5,168,221 |
In asp.net how to validate textbox depending on other text box?
|
<p>In asp.net Depending on Experience I should validate the salary of an employee. </p>
<p>If the employee is fresher his salary should be 1 lac to 1.5 lac. Or salary = 1.5 lac * years of exp to 3.5 * years of exp.</p>
<p><em><strong></em>**</strong> i have tried his*<strong><em>*</em>**</strong>
protected void Button1_Click(object sender, EventArgs e)
{</p>
<pre><code> if (IntExp == 0)
{
RangeValidator1.MaximumValue = "150000";
RangeValidator1.MinimumValue = "100000";
RangeValidator1.Type = ValidationDataType.Integer;
RangeValidator1.Validate();
if (!RangeValidator1.IsValid)
{
RangeValidator1.ErrorMessage = "Enter CTC between 100000 and 150000";
}
Response.Redirect("ABCAddEmp.aspx");
}
else
{
int max = IntExp * 150000;
int min = IntExp * 350000;
RangeValidator1.MaximumValue = "max";
RangeValidator1.MinimumValue = "min";
RangeValidator1.Type = ValidationDataType.Integer;
RangeValidator1.Validate();
if (!RangeValidator1.IsValid)
{
RangeValidator1.ErrorMessage = "Enter CTC between " + max + " and " + min;
}
Response.Redirect("ABCAddEmp.aspx");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,202,465 | 1,202,466 |
gridview is refreshing result rows when clicked on the select command column
|
<p>I am trying to view one of the result as a report in the report viewer by clicking on the select command in the 1st column. But the other rows are refreshing and showing different rows when the report is displayed below the grid in a report viewer. i don't want the results to change when i select a particular row..</p>
|
c# asp.net
|
[0, 9]
|
5,700,313 | 5,700,314 |
run function if EITHER statement is true
|
<p>This below is a snippet from the code that I am working on. The short version of this is when a radio button with a label of <strong>NO</strong> is NOT checked, then the details textbox will show. I simply want to add another condition which allows the box to be shown IF another label is checked. </p>
<p>Example: IF 'NO' OR 'HOW MANY PEOPLE' are checked, then show the textbox.</p>
<p>I have been trying using the pipes but to no success.</p>
<pre><code>if ($this.siblings('label').text() != 'No') {
if ($this.is(':checked')) {
$details.show();
$prompt.hide();
}
}
</code></pre>
<p>Thanks to anyone in advance, I know this is a simple question Im just a bit stuck!</p>
|
javascript jquery
|
[3, 5]
|
3,524,245 | 3,524,246 |
Is rewriting a PHP app into Python a productive step?
|
<p>I have some old apps written in PHP that I'm thinking of converting to Python - both are websites that started as simple static html, then progressed to PHP and now include blogs with admin areas, rss etc. I'm thinking of rewriting them in Python to improve maintainability as well as to take advantage of my increase in experience to write things more robustly.</p>
<p>Is this worth the effort?</p>
|
php python
|
[2, 7]
|
3,962,170 | 3,962,171 |
Java Thread checkAccess
|
<p>I was pondering, playing around with some code. I came across the following method in the Thread class: <code>checkAccess()</code>. </p>
<p>The documentation (literally) says <em>"Does nothing."</em> Why would this possibly be in the Thread class if it does nothing? - Are we possibly dealing with developer trolls?</p>
<p>Screenshot:</p>
<p><img src="http://i.stack.imgur.com/Afw40.png" alt="enter image description here"></p>
|
java android
|
[1, 4]
|
2,252,118 | 2,252,119 |
when to choose ASP.NET and When PHP?
|
<p>I am not here to add another subjective question.</p>
<p>I know that many developers are using only ASP.NET and others Only PHP......</p>
<p>in my case where my team uses both, of course more advanced in one, </p>
<p>I like to know the keys to choose one ? can you guys list all the Pros, and cons for those language? I know both are good, Dont be BIASED.</p>
<p>answers for other langauges are welcomed.</p>
<p>I will add one pro for DOTNET: C# is used for all kind of developments( Web, windows..)</p>
|
php asp.net
|
[2, 9]
|
2,745,653 | 2,745,654 |
Unable to update the header summaries for PreferenceActivity on smartphones running 4.x
|
<p>From what I've noticed, on smartphones running 4.x when you have a PreferenceActivity with headers, the OS will first create an activity containing the headers. When the user clicks on one item from the headers list, another activity will be created representing the PreferenceFragment for that entry. On tablets, the headers list and this fragment belongs to the same activity and appear simultaneously on the screen.</p>
<p>So, the problem is this. When the user is in the PreferenceFragment, and he changes some setting there, I want to update the corresponding header summary. I have a reference to the headers object from onBuildHeaders() call:</p>
<pre><code>@Override
public void onBuildHeaders(List<Header> aTarget) {
...
headers = aTarget;
}
</code></pre>
<p>Now in order to update the header I loop through this list and check the id:</p>
<pre><code>private void setHeaderSummary(int id, String summary) {
for (Header header : headers) {
if (header.id == id) {
header.summary = summary;
invalidateHeaders();
return;
}
}
}
</code></pre>
<p>This works perfect on tablets, however on smartphones it has no effect. When the user returns from the PreferenceFragment to the first PreferenceActivity (by hitting the Back button), the headers remain unchanged.</p>
|
java android
|
[1, 4]
|
659,121 | 659,122 |
Call javascript function from asp.net code behind after server side code executes
|
<p>I have an asp.net button, that when clicked calls a code behind function. The function does some evaluation, and then I want to call javascript from within this asp.net function.</p>
|
asp.net javascript
|
[9, 3]
|
557,518 | 557,519 |
Using jQuery, how do I add elements to a jQuery object that's yet to be created?
|
<p>Perhaps I am doing this wrong and suggestions on how to improve my code are appreciated. My situation is this: I have a toolbar with different elements that are populated by a callback. I do not want to use the show() or hide() commands, I prefer to use detach, but I think there should be a nice way to deal with it. Here's my code:</p>
<pre><code>entryView = function _entryView() {
var menuButton = $('<div/>').addClass('menuButton');
toolBar();
$.getJSON('ajax', function(o) {
var $enum2 = ss.IEnumerator.getEnumerator(dto.TransmittalDates);
while ($enum2.moveNext()) {
var dateTime = $enum2.get_current();
$('.menu').append($('<div/>').addClass('menuitem').text(dateTime.toString()));
}
});
}
toolBar = function _toolBar() {
var flyoutMenu = $('<div/>').addClass('menu');
$('.menuButton').click(function(o) {
$('.menubutton').append(flyoutMenu);
});
</code></pre>
<p>I did a quick cut and paste and renamed the variables to make them make sense. As you can see on the entry I build the toolbar and the very last thing I do is the ajax call. The menu, however, is not created until the "click" event, so appending is not possible.</p>
<p>I realize that having global variables is bad, so I'm trying to avoid that, but I think the best situation would have the ajax call populate a Menu variable and when the DOM is created, to pull from that same Menu item. How do I pull this off? Is there a better way to do it?</p>
<p>Edit: Fubbed a bit on the toolbar function, I think I have it should be correct now.</p>
|
javascript jquery
|
[3, 5]
|
5,627,077 | 5,627,078 |
JavaScript/jQuery HTML Encoding
|
<p>I'm using Javascript to pull a value out from a hidden field and display it on a textbox</p>
<p>The value in the hidden field is encoded.</p>
<p>e.g.</p>
<pre><code><input id='hiddenId' type='hidden' value='chalk &amp; cheese' />
</code></pre>
<p>gets pulled into</p>
<pre><code><input type='text' value='chalk &amp; cheese' />
</code></pre>
<p>via some JQuery to get the value from the hidden field (Its at this point that I lose the encoding)</p>
<pre><code>$('#hiddenId').attr('value')
</code></pre>
<p>The problem is when I read chalk & cheese from the hidden field, javascript seems to lose the encoding, but to escape " and ' I want the encoding to remain.</p>
<p>Is there a Javascript library or a Jquery method that will Html Encode a string?</p>
|
javascript jquery
|
[3, 5]
|
1,618,634 | 1,618,635 |
How to input \t from asp.net
|
<p>I'm trying to input a control character from an asp.net form. For example I want a user to be able to enter \t into a text box and it be \t not \ \t (The space is there as one of them gets escaped if I put them together). What's the best way to go with this? I've been staring at it continuously now for quite a while and the answer isn't jumping out at me. Thanks.</p>
<p>Update:</p>
<p>Thanks guys, but I've just answered myself.</p>
<p>I've just found in Regex the static Unescape method, so in my web app I am now doing:</p>
<p>(Where tb is an asp.net TextBox)</p>
<pre><code> var inputText = tb.Text;
if (inputText.Length == 2)
{
var escaped = System.Text.RegularExpressions.Regex.Unescape(inputText);
if (escaped.Length == 1)
{
var character = escaped.ToCharArray()[0];
if (char.IsControl(character))
{
inputText = character.ToString();
}
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,520,862 | 3,520,863 |
jquery - disable click
|
<p>I just want to disable the ability for a user to click on an element for some condition. Here is some of the code I am working with:</p>
<pre><code> $('#navigation a').bind('click',function(e){
var $this = $(this);
var prev = current;
current = $this.parent().index() + 1; // store the position in current
if (current == 1){
$("#navigation a:eq(1)").unbind("click"); // i want to disable the ability to click this element if current is 1
}
if (current >= 2){
$("#navigation a:eq(1)").bind("click"); // this is wrong, but I want to rebind the click if current is greater than 1.
}
</code></pre>
<p>}</p>
|
javascript jquery
|
[3, 5]
|
5,520,558 | 5,520,559 |
IE:how to get popup's opening window when using window.open(url)
|
<p>we are running a click-to-call service, my idea is basically like this: website have a link on their page, when the link is clicked, a web page(say it is popup.aspx) hosted on our server is popup, user can input their phone number, and click "call me" button to let the website call him. In the button click event, I want to get Request.UrlReferrer, then query the db to get website's phone. But in IE, Request.UrlReferrer is null(firefox is ok, not test chrome yet),my question is how to get opening window' url in IE?</p>
<p>we put popup.aspx on our server because </p>
<ol>
<li><p>our client website is not force to use asp.net. </p></li>
<li><p>we have the control what we put on the popup window, and can modify the page just from our side, if we put the pop window on our partner's side, if we have 100 partner, and we change the page's design, we will notify everyone of them to change this, change that...</p></li>
<li><p>we can implement a statics system to know how popup a day, which site is most popular,etc</p></li>
</ol>
|
javascript asp.net
|
[3, 9]
|
2,137,492 | 2,137,493 |
Image Preview in safari and IE 9 browsers not working
|
<p><strong>i'm using following code, whick works perfect in IE8 and lower version, chrome, firefox. But it fails to work in Safari and IE 9.</strong></p>
<pre><code><script type="text/javascript">
function readURL0(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#Img0').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
</script>
<asp:FileUpload ID="fuFile0" runat="server" onChange="readURL0(this)" />
<img id="Img0" src="../images/myproject-thumb.jpg" alt="preview" width="70" height="70" />
</code></pre>
<p><strong>Is there any alternate solution, or any other suggestion.
thanks</strong></p>
|
javascript asp.net
|
[3, 9]
|
5,656,415 | 5,656,416 |
Run a PHP function via Jquery onclick event
|
<p>I am trying to run a php function based on a button click using jquery but not through a POST. It is a function that is using array data that was printed on the form. Is this possible?</p>
|
php jquery
|
[2, 5]
|
4,998,752 | 4,998,753 |
Compile C++ .lib files make them DLL for C# enviroment
|
<p>I've got plenty of these object file library :
addrstor.exp
authhlp.lib</p>
<p>I would like to have them as a DLL and add into the C# project and try to use the method which involved.</p>
<p>How could I achieve that ?</p>
<p>Thanks</p>
|
c# c++
|
[0, 6]
|
5,067,807 | 5,067,808 |
How to get cookie value with javascript or jquery
|
<p>I am getting following cookie values on my home page.</p>
<blockquote>
<p>vsettings=HiddenNotifications=%2C19%2C;
(referral)|utmcmd=referral|utmcct=/;
ASPSESSIONIDQCSBCCAD=LFLGDKACEGPCPFGBANHFFBMK;
ASPSESSIONIDSASDCCDA=OFEHPJACGHNKICDLFBOCJNNH;
ASPSESSIONIDQCSDDCBC=LGFPBDLCKHLIOLPMCAGJNFIM;
ASPSESSIONIDQCTACBAC=DCIPJDLCNDBEGEIIELCGFMDP;CustomerID;
ASPSESSIONIDSCTCAABD=LHPFFLFDEMIBIENBMGMLFIFP;
ASPSESSIONIDSAQDDDAD=HMCDMLFDFCLJCIBHMEHPNHME; s_cc=true;
__utmc=97358351; CustomerID=755B031ED8C016EC4F90D6F3127E776AE202DEF5BC6EB9F7A9BB19E49323BC3B;
ASPSESSIONIDQCSDBDAC=CFBDJEAAPJJGHMDGOCCHALHC;
ASPSESSIONIDSASCBDAD=FLGJHFAAJAJBICGIMOOJEFFF;Session%5FToken=C8F2A63C3BBA4E39BBF73B83C108D1C6</p>
</blockquote>
<p>I want get the value of CustomerID cookie.
Using jquery I wrote this:</p>
<pre><code>$.cookie('CustomerID',{ path:'/'});
</code></pre>
<p>But I am not getting the value for cookie - it is showing me blank.</p>
<p>How can I get the CustomerId cookie?</p>
|
javascript jquery
|
[3, 5]
|
5,911,470 | 5,911,471 |
Display title attribute of an image inside a DIV
|
<p>This is the page I'm trying to do: <a href="http://www.lifetime-watches.com/gal-ws.html" rel="nofollow">Gallery</a></p>
<p>And what I'm trying to do is when you hover over the thumbnails, the div in front of the main image would fade in and show the title attribute for the image. Hover over the left and topmost image and the title should display on the watch.</p>
<p>I tried following the instructions <a href="http://stackoverflow.com/questions/3675096/show-the-title-of-a-link-in-a-div-not-in-a-tool-tip/">here</a> but for the second image the title didn't swap and it only showed the first one. </p>
<p>Also I'm a little bit confused where to add the fadein fadeout for the div... </p>
<p>Sorry for the noobish question, I'm still learning this.</p>
<p>Thank you.</p>
|
javascript jquery
|
[3, 5]
|
1,892,040 | 1,892,041 |
Easiest way to create a confirmation message with jQuery/JavaScript?
|
<p>How can I achieve this?</p>
<ol>
<li>A user clicks the delete link (with a class of "confirm").</li>
<li>Confirmation message appears asking "Are you sure?" with "Yes" and "Cancel" options.</li>
</ol>
<p>If yes is selected, the link continues as clicked, but if cancel is selected, the action is canceled.</p>
<p><strong>Update:</strong> Final working code with <code>confirm()</code> thanks to <a href="http://stackoverflow.com/questions/1844351/how-to-disable-click-with-jquery-javascript/1844412#1844412">this guy</a>:</p>
<pre><code>$('.confirm').click(function() {
return confirm("Are you sure you want to delete this?");
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,958,289 | 3,958,290 |
sending request and parameter when submit from using ajax
|
<p>I want to submit a form using jquery <code>.post()</code>. I want to send all the input names in addition to another parameter, in there any way to send data and the request?</p>
<pre><code> $.post("RegistrarManagementServlet",{"option":"cancelRequest"},function(){
alert("hi");
});
</code></pre>
<p>here is how we submit the request</p>
<pre><code> $.post("RegistrarManagementServlet",request,function(){
alert("hi");
});
</code></pre>
<p>I want to send all the data in the form (in the normal post request) in addition to option parameter, how can I make it?</p>
<p><strong>EDIT</strong></p>
<p>where should I define the request as function parameter, since the code occurs after confirmation dialog appear</p>
<pre><code>$('#cancelRequest').click(function(event){
event.preventDefault();
jConfirm('Are you sure to delete registrar request?', 'Confirmation Dialog', function(result) {
if(result == true){
request.cancelRequest="cancelRequest"; //request is not defiend
$.post("RegistrarManagementServlet",request,function(){
alert("hi");
});
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,496,272 | 2,496,273 |
Javascript/JQuery bouncing text off left and right sides of a div
|
<p>I want text to bounce of the left and right sides of a div tag (<code>#header</code>). It works fine when it bounces of the right, then goes back and hits the left. The problem is that after it hits the left and starts to go right again it never hits the right side. It just keeps going and the window scrollbar appears. It appears as soon as it hits the left side. It seems that the div tag.</p>
<pre><code>var finishedGoingRight = false;
setInterval(function() {
slideText();
}, 10);
function slideText(){
if(!finishedGoingRight){
$('#header h1').css("right","-=1");
}else{
$('#header h1').css("left","-=1");
}
if($('#header h1').css("right") == "20px"){
finishedGoingRight = true;
}
if($('#header h1').css("left") == "485px"){
finishedGoingRight = false;
}
}
</code></pre>
<p>Hope I explained it clearly :)</p>
|
javascript jquery
|
[3, 5]
|
5,253,313 | 5,253,314 |
Foreach inside array.map()
|
<p>I'm trying to map values to a new array. The problem is that the property that I'm mapping can either be a number or an array.</p>
<p>I have a problem when it comes to arrays, because my result is an associative array. My goal is to turn <code>[[1,2,3], [1,2,3]]</code> (see below) in to <code>[1,2,3,1,2,3]</code>. In other words; just make it a one dimensional array.</p>
<p>I've tried with a foreach loop inside the map(), without success. Any ideas?</p>
<pre><code>var list = [{ foo: 1, bar: [1,2,3] }, { foo: 2, bar: [1,2,3] }];
var retArr = list.map(function (v) {
return v.bar;
});
console.log(retArr); // [[1,2,3], [1,2,3]]
</code></pre>
<hr>
<pre><code>var list = [{ foo: 1, bar: [1,2,3] }, { foo: 2, bar: [1,2,3] }];
var retArr = list.map(function (v) {
if($.isArray(v.bar)){
$.each(v.bar, function(i, v){
return v;
});
} else {
return v.bar;
}
});
console.log(retArr); // [undefined, undefined]
</code></pre>
<p><a href="http://jsfiddle.net/Mck7N/" rel="nofollow">http://jsfiddle.net/Mck7N/</a></p>
|
javascript jquery
|
[3, 5]
|
1,186,543 | 1,186,544 |
Finding Changed Form Element With jQuery
|
<p>i have a form(id="search_options") and i tracking changes in form by:</p>
<pre><code> $("#search_options").change(function() {
// Bla Bla Bla
});
</code></pre>
<p>In this form i have many inputs and one of is select(id="project_category") and i want to catch if user changed project_category select or another input. How can i done this ? Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,393,721 | 3,393,722 |
How to allow users to select the Android app's installation location (SD card or internal storage)
|
<p>I need to allow a user to select whether the app should be installed to an SD card or the internal memory. I cannot find any information about that at <a href="http://developer.android.com/index.html" rel="nofollow">developer.android.com</a>.</p>
<p>The only thing I can do is to specify <code>android:installLocation</code> as "internalOnly", "auto", or "preferExternal". However, I'd like to let users choose that when the app is being installed.</p>
<p>Is it possible to do that on Android?</p>
|
java android
|
[1, 4]
|
1,162,306 | 1,162,307 |
Web browser - redirecting F1 (doesn't work always)
|
<p>I'm using <code>jQuery</code> for redirect <code>F1-F10</code> keys in web browser (MFF or chrome):</p>
<pre><code>$('*').live("keydown", function(e) {
if (e.keyCode == 112)
{
document.getElementById('form:f1').click();
return false;
}
});
</code></pre>
<p>So, when I press <code>F1</code>, instead of browsers own <code>HELP</code> the button with ID <code>form:f1</code> is fired.
And <strong>it works properly, but sometimes not</strong>. </p>
<p>E.g. 10 times I start the web app (browser) and redirecting is working properly, and at the 11th start of the browser, it doesn't work suddenly and I have to restart browser.</p>
<p>All other <code>javascript</code> or <code>jQuery</code> functions are working always, but redirecting doesn't. </p>
<p>Don't you know where could be the problem?</p>
|
javascript jquery
|
[3, 5]
|
3,475,303 | 3,475,304 |
Zipentry is not streaming files in order in Android?
|
<p>I am trying to stream files from a zip file using ZipEntry class in android, however I am not getting the files in alphabetical order.</p>
<p>Here is my code:</p>
<pre><code>InputStream is = context.getResources().openRawResource(R.raw.file);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(is));
try {
ZipEntry ze;
while ((ze = zis.getNextEntry()) != null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int count;
while ((count = zis.read(buffer)) != -1) {
baos.write(buffer, 0, count);
}
String filename = ze.getName();
byte[] bytes = baos.toByteArray();
int value = progress++;
task.doProgress(value);
Log.e(" -- zip process ---", "Filename: " + filename.toString());
// do something with 'filename' and 'bytes'...
}
} catch (IOException e) {
// TODO Auto-generated catch block
Log.e("Database Install", "Error: " + e.toString());
e.printStackTrace();
} finally {
try {
zis.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
</code></pre>
<p>I am not sure what is wrong with the code.</p>
|
java android
|
[1, 4]
|
4,705,838 | 4,705,839 |
What are Python implementation of nextInt(), hasNext() from Java?
|
<p>I have this input file</p>
<pre><code>1 2
10 2
81 3
23 6
2537857295 19
34271891003654321 1267253
</code></pre>
<p>I am reading the file like this</p>
<pre><code>with open("powersearch.txt") as fileIn:
for line in fileIn:
print line
</code></pre>
<p>I am wondering if I want to, for every single line, have the 1st integer stored as <code>firstNum</code>, the 2nd stored as <code>secondNum</code>. With Java I can use a <code>scanner</code> and do <code>nextInt()</code> and <code>hasNext()</code> to get the integers, what are the equivalent in Python?</p>
|
java python
|
[1, 7]
|
4,387,774 | 4,387,775 |
how to create a tabhost without xml layout?
|
<p>currently I am developing an Android game which does not include an XML layout; instead we dealing directly with the Android engine.</p>
<p>In an activity, I need to create a tab host which contains 3 tabs.</p>
<p>I am using this code:</p>
<pre><code>public class InventoryActivity extends BaseGameActivity{
public Engine onLoadEngine() {
this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
return new Engine(new EngineOptions(true, ScreenOrientation.PORTRAIT, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));
}
public void onLoadResources() {
}
public Scene onLoadScene() {
}
}
</code></pre>
<p>I am not using findViewById.</p>
<p>How should I call to create a tabhost?</p>
|
java android
|
[1, 4]
|
794,810 | 794,811 |
restricting image size and type in jquery
|
<p>I have an input with type=file. This is used to upload images. Now I want to restrict images size to 500 kb and type to .png only. Please help</p>
|
javascript jquery
|
[3, 5]
|
3,717,978 | 3,717,979 |
Highlighting search words like Chrome with jQuery
|
<p>I have recently done a very simple highlighting with jQuery and a highlight plugin. It looks like this:</p>
<blockquote>
<p>$('myButton').click(function() {</p>
<p>$('body').highlight($('#myInputText').val());</p>
<p>});</p>
</blockquote>
<p>But I wonder how can I do the Chrome like highlighting, I mean highlight the letters whenever I type in some letter in textbox without submitting. I think maybe use a keyup event... Any ideas?</p>
<p><strong>Thanks Andy, i changed 'this[0]' to 'search[i]' in your code and it works if there is only one 'p' tag</strong></p>
<pre><code>$(document).ready(function(){
var search = ['p', 'div', 'span'];
$("#highlighter").bind('keyup', function(e){
var pattern = $(this).val();
$.each(search, function(i){
var str = search[i];
var orgText = $(str).text();
orgText = orgText.replace(pattern, function($1){
return "<span style='background-color: red;'>" + $1 + "</span>"
});
$(str).html(orgText);
});
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,600,606 | 5,600,607 |
How can I use a JavaScript variable as a PHP variable?
|
<p>I'm trying to include JavaScript variables into PHP code as PHP variables, but I'm having problems doing so. When a button is clicked, the following function is called:</p>
<pre><code><script type="text/javascript">
function addTraining(leve, name, date)
{
var level_var = document.getElementById(leve);
var training_name_var = document.getElementById(name);
var training_date_var = document.getElementById(date);
<?php
$result = "INSERT INTO training(level, school_name, training_date) VALUES('level_var', 'training_name_var', 'training_date_var')" or die("Query not possible.");
?>
</script>
</code></pre>
<p>How can this problem be fixed?</p>
|
php javascript
|
[2, 3]
|
96,608 | 96,609 |
jQuery Inserting Text into a Textarea at the Cursor Position
|
<p>I've seen this example floating around on how to insert text at the cursor in a text area:</p>
<p><a href="http://jsfiddle.net/adamadam123/bTUWa/5/" rel="nofollow">http://jsfiddle.net/adamadam123/bTUWa/5/</a></p>
<p>The above works fine but when I've tried to add it to my own code (which is primarily jQuery) I find I can't get it to work anymore - below is an example of my code trying to use the function:</p>
<p><a href="http://jsfiddle.net/adamadam123/bbE48/6/" rel="nofollow">http://jsfiddle.net/adamadam123/bbE48/6/</a></p>
<p>Can someone help me get the second jsfiddle working. Note: really want to pass the ID across as there are many div's with different ID's but all have the same textarea.classname within.</p>
<p>thankyou</p>
<pre><code><div id="100000000">
<input id="insertPattern" type="button" value="insert pattern" />
<textarea class="chatMessengerFooterTextArea">insert some text into this string</textarea>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,484,203 | 4,484,204 |
How do I check on whether my synchronized methods are blocking (Android + Java)
|
<p>I have a feeling that my synchorization may be a little coarse (juddering UI) and was wondering how do I find out when/if my synchronized java methods are blocking on each other. My current project is on Android but I am interested in the more general Java case as well.</p>
<p>Thanks, </p>
|
java android
|
[1, 4]
|
2,003,124 | 2,003,125 |
HTML to jQuery to PHP, then from PHP to jQuery to HTML
|
<p>Ok, I have this code:</p>
<pre><code><html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
function get() {
$.post('tt.php', { name : $(this).attr('id') }, function(output) {
$('#age').html(output).show();
});
}
</script>
</head>
<body>
<input type="text" id="name"/>
<a id="grabe" href="javascript: get()">haller</a>
<div id="age">See your name</div>
</body>
</html>
</code></pre>
<p>Here's what I want: get the id of an anchor tag from the anchor tag that has been clicked by the user via jQuery and then past that to a PHP file. The PHP file will then echo the id name of the anchor tag that was clicked by the user back to the jQuery which will then display the output into the specified element.</p>
<p>Here's the PHP file:</p>
<pre><code><?
$name=$_POST['name'];
if ($name==NULL)
{
echo "No text";
}
else
{
echo $name;
}
?>
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
563,503 | 563,504 |
how to make array of labels get their text from DataTable data
|
<p>could you please help me, I need to get data from my database and then make these data the text of labels here the code</p>
<pre><code> protected void Button3_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt = DA.SelectAllProper("18");
TableCell[] c = new TableCell[dt.Rows.Count];
TableRow[] row = new TableRow[dt.Rows.Count];
Label [] l=new Label[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
l[i].Text = dt.Rows[i][0].ToString();
l[i].Attributes.Add("style", "float:left;");
c[i].Controls.Add(l[i]);
row[i].Cells.Add(c[i]);
MyCell = new TableCell();
MyRow = new TableRow();
Mylbl = new Label();
Mylbl.Attributes.Add("style", "clear:both; height:5px;");
MyCell.Controls.Add(Mylbl);
MyRow.Controls.Add(MyCell);
t1.Controls.Add(row[i]);
t1.Controls.Add(MyRow);
}
public DataTable SelectAllProper(string m)
{
SqlDataAdapter sda = new SqlDataAdapter("select Name,Type from Properties where CatID =N'" + m+ "'", con);
sda.SelectCommand.CommandType = CommandType.Text;
DataTable dt = new DataTable();
sda.Fill(dt);
return dt;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
879,371 | 879,372 |
jQuery animate expand proportionally
|
<p>I'm now in problem about how to <strong>animate</strong> function in jQuery to expand proportionally. Normally, it expand one-sided only just like expand to bottom or expand to right.</p>
<p>What I want is to expand proportionally left-right-top-bottom by using animate.</p>
<p><img src="http://i.stack.imgur.com/UQZ5W.jpg" alt="alt text"></p>
<p>Following is my coding. What I said above, it expand to bottom only.</p>
<pre><code>$(document).ready(function() {
var theFrame = $("#FrmPatient", parent.document.body);
theFrame.animate({width: 650, height: 485}, 1000);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,781,767 | 5,781,768 |
Jquery how can i stop the select element from droping down?
|
<p>i want to stop the user to see the list while clicking select option element :</p>
<pre><code><select name="_users_id_requester">
<option value="0">-----</option>
<option selected="" value="774">Asmaa El Habib,Yassine</option>//except this one
<option value="779" title="Ahlam Edouiri - U8K8O">Ahlam Edouiri</option>
<option value="746" title="Ainane Mohamed - MohamedAinane">Ainane Mohamed</option>
</select>
</code></pre>
<p>i have tried the readonly method , but the problem is i'm using the element within a form , so the form can't read the selected value </p>
|
javascript jquery
|
[3, 5]
|
1,878,780 | 1,878,781 |
JavaScript - Checkbox like radiobutton functionality
|
<p>How i can code the functionality of checkbox like radiobutton,below is mine quick code but it's seems not so perfect.</p>
<pre><code><asp:checkbox id="chkA" runat="server" onClick="SetCheck(this)"/>
<asp:checkbox id="chkB" runat="server" onClick="SetCheck(this)"/>
<Javascript>
function SetCheck(chk)
{
Switch(chk.id)
{
case "chkA" :
chkB.checked=false;
break;
Case "chkB" :
chkA.checked=false;
break;
}
}
</Javascript>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
1,261,663 | 1,261,664 |
return value from listener
|
<p>I have static method which plays music. How to return value from this method when play completed?</p>
<pre><code>public static int playSample(Context context, int resid) {
AssetFileDescriptor afd = context.getResources().openRawResourceFd(resid);
try {
mediaPlayer.reset();
mediaPlayer.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getDeclaredLength());
mediaPlayer.prepare();
mediaPlayer.start();
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
public void onCompletion(MediaPlayer mediaPlayer) {
// from here i want return some value that play is completed
}
});
afd.close();
} catch (IllegalArgumentException e) {
Log.e("a", "Unable to play audio queue do to exception: " + e.getMessage(), e);
} catch (IllegalStateException e) {
Log.e("a", "Unable to play audio queue do to exception: " + e.getMessage(), e);
} catch (IOException e) {
Log.e("a", "Unable to play audio queue do to exception: " + e.getMessage(), e);
}
}
</code></pre>
|
java android
|
[1, 4]
|
263,121 | 263,122 |
Slide show/hide content on link click
|
<p>I have tried to find a solution to what I want to do but nothing matches exactly. Closest thing I have found is a tab accordion. To be precise, I have a horizontal menu comprised of links that when clicked will show extra content below the row of links with a nice slide down animation, and slide up when the same link is clicked (the rest of the page content moves when the hidden content is revealed, which is what I want). </p>
<p>The problem is that when other links are clicked they also show extra content but the content from an earlier click is still visible. I want that earlier content to slide up before the new content slides down. Is this possible, and if it is, how do I go about accomplishing it?</p>
<p>Here's the code I have:</p>
<pre><code>$(document).ready(function() {
// hides the menu as soon as the DOM is ready
$('#about').hide();
$('#search').hide();
$('#pages').hide();
$('#links').hide();
// toggles the menu on clicking the noted link
$('#toggleabout').click(function() {
$('#about').slideToggle(400);
return false;
});
$('#togglesearch').click(function() {
$('#search').slideToggle(400);
return false;
});
$('#togglepages').click(function() {
$('#pages').slideToggle(400);
return false;
});
$('#togglelinks').click(function() {
$('#links').slideToggle(400);
return false;
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,313,040 | 4,313,041 |
Development under Android
|
<p>I have the Android-based tablet, and I want to do some development actions on it.</p>
<p>Is there a way to code and compile Java and Android applications on my tablet?</p>
|
java android
|
[1, 4]
|
797,521 | 797,522 |
Submitting ASP form from Java application
|
<p>I am writing a Java application that has a log in screen. Ideally, I would like to take the user supplied data (name, password), and submit it to an ASP form that can verify their credentials. I do not own the ASP form, I can only access the URL. I also do not want the user to be entering their credentials straight into the web form. They would enter their credentials into my program, and my program would put the data into the form and submit, and allow/deny the user based on the response.</p>
<p>Of course, the submit button on the ASP form is a POST request. However, constructing the URL (...login?username=name&password=pass) does not work, as the form must be submitted via the button with the text boxes filled in.</p>
<p>I have tried two approaches:</p>
<ol>
<li><p>Using Java's URLConnection class. This does not seem to work because the form submitting is limited to the method I mentioned above, which is constructing the URL.</p></li>
<li><p>Using Javascript to access and edit the elements on the page. This has not worked either, because the Javascript is being run from my program, which is not a web browser, and therefore has no access to the 'document' or 'window' commonly used.</p></li>
</ol>
<p>Other potential solutions I can think of:</p>
<ol>
<li><p>Opening a browser to the login page but not giving it focus, running a script to fill out and submit the form, parsing the response, and then closing the browser. This would not involve the user at all, except for the input into the login page in my Java program.</p></li>
<li><p>Using a 3rd party Java library (suggestions? references to tutorials?).</p></li>
<li><p>Embedding the URL into my login screen (any help in this regard would be appreciated).</p></li>
</ol>
<p>The things that cannot be changed are that my program is in Java, and that the login URL is an ASP form that hides the POST data from the URL.</p>
<p>Let me know if anything needs clarification. Any help is welcome.</p>
|
java javascript asp.net
|
[1, 3, 9]
|
1,421,629 | 1,421,630 |
Can I run a call just _after_ an element is focused?
|
<p>From what I gather, jQuery's <a href="http://api.jquery.com/focus/" rel="nofollow">focus()</a> gets called before the element is focused. I believe this is so because the element's border is different when focused, and <a href="http://stackoverflow.com/questions/7650892/how-to-scroll-down-the-page-when-a-covered-input-box-is-focused/7659021#7659021">when I measure it I get the unfocused border size</a>.</p>
<p>Is there a way to run code right after the element gets focus?</p>
|
javascript jquery
|
[3, 5]
|
5,286,189 | 5,286,190 |
Validation for number with jquery
|
<p>How can write jquery code that input just accept number. if was something except number typed does not allow(mean if user type word typed stop, field just accept number no word). How is it without use plugin?</p>
<pre><code><input type="text" name="passport_number" class="number">
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,858,522 | 2,858,523 |
Push return value of jQuery callback function from another function
|
<p>I have the following problem. Let's say there's a function that opens some kind of dialogue:</p>
<pre><code>function dialogue(param1, param2, callback)
{
var has_callback = (arguments.length == 3) ? true : false;
$.get('some_url.php', function(response) {
if (has_callback) {
callback(response);
}
}, 'json');
}
</code></pre>
<p>Now I can call the dialogue like this:</p>
<pre><code>dialogue('Headline', 'Text', function(response)
{
console.log(response);
});
</code></pre>
<p>and the response of some_url.php via the $.get method will be logged via the callback.</p>
<p>My problem is now, that the dialog can call a function like this:</p>
<pre><code>function update_dialogue(data)
{
if (data.callback)
{
// is there a way to "push" the callback data
// to the original dialogue callback function?
}
}
</code></pre>
<p>and I would like to be able to "push" that callback back to the original dialogue() function. I hope it's clear what I am trying to do and that someone can help me if something like this is possible at all or if I need some kind of listener...?</p>
<p>Thanks!!</p>
|
javascript jquery
|
[3, 5]
|
231,893 | 231,894 |
Get binding column name of templatefield's texbox
|
<p>In ASP.net, I'm using textbox in templatefield's itemtemplate. I got it data-bound with no problem.
But my problem is, I'm trying to write a function to find column index by its data-bounding table's column name.</p>
<p>Something like this :</p>
<pre><code>foreach (DataControlFieldCell cell in row.Cells)
{
if (cell.ContainingField is BoundField)
{
if (((BoundField)cell.ContainingField).DataField.Equals(SearchColumnName))
{
return columnIndex;
}
}
else if (cell.ContainingField is TemplateField)
{
//Finding column name of data-bound textbox or dropdownlist ??
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,983,854 | 5,983,855 |
View for Team List
|
<p>I have a bit of a 'what is it' question.</p>
<p>Currently, I am trying to create a page that will create teams, and allow the user to select the member for those teams.</p>
<p>So far, dynamically render ListBoxes (amount based on teams selected) to the page, then the user selects a member, and adds them to the team.</p>
<p>I want to allow for an <strong>x</strong> amount of teams added, but this will get messy with the amount of list boxers that could <em>possibly</em> be added.</p>
<p>I would like to know if there is a view that could represent that in once clean environment. I would like do display the team name, in the header, and its member beneath - with editing options on them. I've looked up the GridView and ListView, but I cant see how they could do <em>exactly as i wanted.</em> I have provided a highly refined picture to help elaborate.</p>
<p><img src="http://i.stack.imgur.com/M6K4E.png" alt="Very well crafted picture"></p>
<p><strong>Edit:</strong> This is not a 'how do I do this - gimmie code question. I would just like to know IF it could be done, and if so, what control I could use. Mayb even a reference to a page with something similar to give me a quick tutorial ^^</p>
|
c# asp.net
|
[0, 9]
|
582,914 | 582,915 |
Dealing with static resources in dev/live environment ASP.NET MVC
|
<p>I am going to be serving my site files from a site like cdn.mysite.com and will consume them from site like www.mysite.com. In development I have web projects setup, 1 for CDN and 1 for the actual site (controllers, views, models).</p>
<p>What I would like to do is come up with the most elegant way to go from dev (development fabric) to live (azure) without having to do some elaborate msbuild task. Is there some common tools or methodologies out there that are for this purpose?</p>
|
javascript asp.net
|
[3, 9]
|
2,754,225 | 2,754,226 |
How to update main activity to know that prefs are changed?
|
<p>I have</p>
<pre><code>SharedPreferences myPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
</code></pre>
<p>and </p>
<pre><code>myPreferences.getBoolean("checkbox", true)
</code></pre>
<p>So, how can my main activity know when user change preferences state?
For example if user don't wont to get notifications any more.
Thanks.</p>
|
java android
|
[1, 4]
|
683,871 | 683,872 |
setting values [jquery or javascript]
|
<p>So I have an input box, and when a user types something in it I want a second textarea change its value to match that of the input's, on click. How can I do this using javascript, jquery, or something simpler, or php...</p>
<p>Here's my code:</p>
<p>This is the first input:</p>
<pre><code><form class="form1" action=../search.php method="post">
<input class="askInput" type="text" name="q" value="Search for tags and users or ask a question" onclick="if(this.value == 'Search for tags and users or ask a question') this.value='';" onblur="if(this.value.length == 0) this.value='Search for tags and users or ask a question';"></input>
<input class="searchEnter" type="image" name="submit" src="../Images/askQuestion.png"></input></form>
</code></pre>
<p>This is the textarea:</p>
<pre><code><div id="askCenter">
<img class="close" src="../Images/closeAsk.png"></img>
<h1><img src="../Images/askQuestionTitle.png" alt="Ask this question"></img></h1>
<textarea></textarea>
<span class="holder"><input type="text" value="add tags" onclick="if(this.value == 'add tags') this.value='';" onblur="if(this.value.length == 0) this.value='add tags';"></input>
<span class="note">&#8727; Tags are separated by commas</span>
</span>
<input class="askAway" type="image" src="../Images/askAway.png" alt="Ask away"/>
</code></pre>
<p></p>
|
javascript jquery
|
[3, 5]
|
5,008,671 | 5,008,672 |
Change date format in jquery
|
<p>I keep looking for steps in the Internet on how I can change a format of a certain date</p>
<pre><code>$j("#activitycalendar").datepicker("setDate", $j.datepicker.parseDate("yy-mm-dd",$_GET.critval));
</code></pre>
<p>All I want to do is to set the date of a datepicker depending on what the <code>$_GET.critval</code> contains. And the <code>$_GET.critval</code> contains a date in this format </p>
<blockquote>
<p>2011-12-05</p>
</blockquote>
<p>as the jqueryui documents says </p>
<blockquote>
<p>"The new date may be a Date object or a string in the current date
format (e.g. '01/26/2009')" <a href="http://jqueryui.com/demos/datepicker/#method-setDate" rel="nofollow">jQuery UI - Datepicker Demos and Documentation</a></p>
</blockquote>
<p>so I wanted to change the format of my <code>$_GET.critval</code> so it can change the date of the datepicker. I tried the <code>$j.datepicker.parseDate</code> but it really doesn't work. the return value of that parsing will be like this</p>
<blockquote>
<p>Mon Dec 05 2011 00:00:00 GMT+0800 (Taipei Standard Time)</p>
</blockquote>
<p>Is there any solution so I can format the date and set the date of the datepicker? thanks</p>
|
javascript jquery
|
[3, 5]
|
1,948,358 | 1,948,359 |
Detecting changes in window.location
|
<p>I am trying to detect changes in window.location (for example to be notified if the user tries to reload the page) but I can't seem to find a way to do that.
Are there some events associated with it?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
427,012 | 427,013 |
jQuery objects as elements
|
<p>I see this syntax in some advanced jQuery:</p>
<pre><code>$container
</code></pre>
<p>as in:</p>
<pre><code>$input = $container.find('.fn_this_timeline')
</code></pre>
<p>EDIT: based on some of the comments below, just to clarify the first instance of '$container' that I can see is created right at the beginning:</p>
<pre><code>init: function($container){
var myThing = this,
$input = $container.find('.fn_do_some_calc'),
$submit = $container.find('.fn_do_some_other_calc'),
defaultValue = parseInt($input.val(), 10);
myThing.$container = $container;
</code></pre>
<p>The line above confuses me even more :/</p>
<p>I'm used to using jQuery selectors like this: $('#mySelector').method('etc');</p>
<p>Can someone let me know what the difference is and when it's appropriate or applicable to use the 'shorthand' style?</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.