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 |
---|---|---|---|---|---|
2,304,087 | 2,304,088 |
Get text of the node
|
<p>In an ASP.NET application I have a IreeView.</p>
<p>Here is one of the nodes in the view:</p>
<pre><code><td style="white-space: nowrap;">
<input id="TreeView1n10CheckBox" type="checkbox" checked="checked" name="TreeView1n10CheckBox">
<a id="TreeView1t10" onclick="TreeView_SelectNode(TreeView1_Data, this,'TreeView1t10');" href="javascript:__doPostBack('TreeView1','sPreAnalytical\\Test Requisitions\\2 Specimens: 1 Req')" class="TreeView1_0">2 Specimens: 1 Req</a>
</code></pre>
<p>As you can see it is a checkbox and there is text after it <code>'TreeView1','sPreAnalytical\\Test Requisitions\\2 Specimens: 1 Req'</code></p>
<p>How do I get the text <code>2 Specimens: 1 Req'</code> on the client side, and how do I modify this text using JavaScript and display the modified TreeView to the client?</p>
<p>this works beautifully:</p>
<pre><code>function check_OnTreeNodeChecked(event) {
var TreeNode = event.srcElement || event.target;
if (TreeNode.tagName == "INPUT" && TreeNode.type == "checkbox") {
if (TreeNode.checked) {
var elNode = document.getElementById("TreeView1t10");
var sText = elNode.innerText || elNode.innerHTML;
alert(sText);
elNode.innerHTML = "Whatever you want";
}
}
}
</code></pre>
<p>however since i need to modify the specific text next to the checkbox i need to be able to know which element id it was instead of implicitly specifying <code>var elNode = document.getElementById("TreeView1t10");</code></p>
<p><strong>Question</strong> how do i get the element id of the box that was checked?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,953,372 | 4,953,373 |
jQuery closest with attribute filter
|
<p>Does jQuery 1.5.1 support attribute selectors in the closest method?</p>
<p>Given the structure below, <code>el</code> represents the checkbox with the value 513, and I'm trying to reach up and check the ancestor checkbox with the value of 0 with</p>
<pre><code>$(el).closest("input[value='0']")[0].checked = true;
</code></pre>
<p>but the selector is returning nothing.</p>
<p>Am I missing something silly?</p>
<p><img src="http://i.stack.imgur.com/xEGv4.png" alt="enter image description here"></p>
<hr>
<p><strong>EDIT</strong></p>
<p>Sigh, so the checkbox with value 0 isn't an ancestor to <code>el</code>, just a sibling of the <code>ul</code> ancestor. I got it to work with</p>
<pre><code>$(el).closest("ul").siblings("input[value='0']")[0].checked = true;
</code></pre>
<p>But us there a cleaner way to grab it?</p>
|
javascript jquery
|
[3, 5]
|
5,712,540 | 5,712,541 |
Problem with big amount of dom elements
|
<p>I have problem with DOM elements I need to add 2000 blocks. I try to do this by setTimeout, but then events not working with this elements. Anyone what mistake I have made?</p>
<pre><code>function init(){
$('#regions').prepend("<ul></ul>");
setTimeout(function(){
var opt=$('#regions ul');
for(var i=0; i<50; ++i){
for(var j=0; j<50; ++j)
opt.append('<li class=\"field\"></li>');
}
}, 0);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,356,861 | 5,356,862 |
Remove space between buttons
|
<p>i have bunch of buttons within linear layout. But there is spaces buttons. I set padding as 0 but there no change.
There is someone who already had the same problem at <a href="http://www.mail-archive.com/[email protected]/msg51104.html" rel="nofollow">http://www.mail-archive.com/[email protected]/msg51104.html</a> but no answer at there.
Can you plese help me.</p>
|
java android
|
[1, 4]
|
3,749,727 | 3,749,728 |
Error while implemening single sign on in my asp.net application
|
<p>I am using single sign on method to redirect from on e website to another.I am using forms authentication in both sites and gave the <strong>validationkey</strong> in machine key tag in both webconfig.While i am redirecting i get this error " <strong>Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects</strong>"</p>
|
c# asp.net
|
[0, 9]
|
2,421,210 | 2,421,211 |
How to perform jquery actions on elements not yet visible
|
<p>I have a textarea in a div that I need to call a jquery function on to activate my rich textbox. The div is initially hidden and becomes visible through a button click on the server side:</p>
<pre><code><div id="RichTextDiv" style="display:none">
<textarea id="RichText" />
</div>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$("#RichText").markItUp(mySettings);
}
</script>
</code></pre>
<p>The above code doesn't work because RichTextDiv is not visible during page load. I need to perform the markItUp() action on RichText as soon as it becomes visible. How can this be achieved in jquery?</p>
<p>Thanks...</p>
|
javascript jquery
|
[3, 5]
|
1,142,279 | 1,142,280 |
setInterval update ajax column unless mouseover
|
<p>I have a column in my web design, which is periodically refreshed by a JS function "refreshColumn()" and updated by AJAX.</p>
<pre><code>setInterval('refreshColumn()',60000);
function refreshColumn() {
..make call with AJAX and load response to element...
document.getElementById('myColumn').innerHTML = xmlhttp.responseText;
}
</code></pre>
<p>This is okay, however, it's not very practical when my user is actually using that column and it refreshes on them!</p>
<p>Is it possible to modify what I have already, to incorporate an 'onmouseover' event that will stop the function from running the AJAX and refreshing the column, and 'onmouseout' allows the script to refresh again?</p>
|
javascript jquery
|
[3, 5]
|
2,457,290 | 2,457,291 |
jQuery StopPropagation issue
|
<p>I want to close the div if someone clicked outside that div. I have the below code:</p>
<pre><code> $('body').click(function(e) {
$('div.test').slideUp('slow');
});
$('div.test').live('click',function(e) {
e.stopPropagation();
});
</code></pre>
<p>But the issue is that when someone click inside the div, the div itself is closing. I want to prevent that. After debugging I found a weird stuff the debugger is hitting the $(body).click first instead of $(div.test), May I know the reason for this? Can you help me in fixing the issue?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,293,181 | 4,293,182 |
Removing duplicate strings using javascript
|
<p>I have an array of 800 sentences. I want to remove all duplicates (sentences that have the same exact words, but in different order) from the array. So for example "this is a sentence" and "is this a sentence" are duplicates. Only one one of them should remain in the array (it doesn't matter which one). </p>
<p>My first idea was to copy them one by one to a new array, each time checking to see if the sentence already exists in the new array. I would accomplish this by looping through all the elements in the new array and using the following code for comparing the sentences: </p>
<p><a href="http://stackoverflow.com/questions/1773069/using-jquery-to-compare-two-arrays">Using jQuery to compare two arrays</a></p>
<p>However, this quickly becomes too intensive in terms of calculations and causes the javascript engine to be nonresponsive. </p>
<p>Any ideas on how to make the algorithm more efficient would be appreciated. </p>
|
javascript jquery
|
[3, 5]
|
2,716,922 | 2,716,923 |
Drag and Drop label to panel in asp.net
|
<p>I know how to drag and drop in windows application, but I cannot find the mousedown event in the <code>asp:label</code> control.</p>
<p>Any idea how to do that?</p>
|
javascript asp.net
|
[3, 9]
|
3,676,891 | 3,676,892 |
How to assign value of an array variable into another array variable
|
<pre><code>String[] msgoptions;
String[] finalmsgs3 = finalmsgs2[3].split("RR");
for(i = 1; i < finalmsgs3.length; i++)
{
msgoptions[i] = finalmsgs3[i];
Log.e(TAG, "---------------" + msgoptions[i]);
}
</code></pre>
<p>I need your help, if you can resolve issues of my code. Actually i'm trying to assign values of an array variable to another array variable. but i can't do that because got some errors. So, Could you any one help me..?</p>
|
java android
|
[1, 4]
|
1,437,804 | 1,437,805 |
Can I get Jquery Pulsate Effect without using Jquery UI?
|
<p>I have in a situation where I cannot use Jquery UI for a reason. I am trying to do get Jquery UI Pulsate Effect without using Jquery UI. Similar to this link, <a href="http://docs.jquery.com/UI/Effects/Pulsate" rel="nofollow">http://docs.jquery.com/UI/Effects/Pulsate</a>. I have search a lot but couldn't find anything.</p>
|
javascript jquery
|
[3, 5]
|
5,440,567 | 5,440,568 |
Add onMouseOver Javascript Function to Asp.Net Dynamic Menu Items
|
<p>How do you add a mouseover javascript function to an asp.net menu item when the menu items are created dynamically? Doesn't allow you to add .attributes function.</p>
<p>[Javasript]</p>
<pre><code><script type="text/javascript">
function ChangeProjectImage(obj) {
var ctrl = document.getElementById(obj.id);
...code...
}
</script>
</code></pre>
<p>[HTML - Menu Control]</p>
<pre><code><asp:Menu ID="Menu1" runat="server" Orientation="Vertical" Font-Names="Verdana" Font-Size="12px"
CssClass="Menu">
</asp:Menu>
</code></pre>
<p>[CodeBehind - Add menu items dynamically]</p>
<pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Me.IsPostBack Then
Else
Dim dt As DataTable = Session("dt")
For Each dr As DataRow In dt.Rows
Dim mi As New MenuItem(dr(0), dr(1), "images\folder_03.png")
Menu1.Items.Add(mi)
Next
End If
</code></pre>
|
javascript asp.net
|
[3, 9]
|
2,197,883 | 2,197,884 |
Android Media.insertImage and retrieve image from sd card
|
<p>I'm trying to save a bitmap to the sd card and by using the string returned in Media.insertImage, create an instance of the bitmap later on. But recreating it is not working. It is saving the bitmap correctly as i can see it in the gallery app but i just can't get the bitmap path correct or something. Any help i would really appreciate. Here is what I'm doing.</p>
<pre><code> Bitmap image = Bitmap.createBitmap(this.getWidth(), this.getHeight(), Bitmap.Config.RGB_565);
this.draw(new Canvas(image));
String s = Images.Media.insertImage(Mycontext.getContentResolver(), image, "mytitle", null);
</code></pre>
<p>and I'm trying to recreate it later on in the application where loc = s from above:</p>
<pre><code>Bitmap bmp = BitmapFactory.decodeFile(loc);
</code></pre>
|
java android
|
[1, 4]
|
4,266,717 | 4,266,718 |
How to change a default Horizontal ProgressBar to vertical?
|
<p>So far i have a working horizontal progress bar.</p>
<p>This is my xml file</p>
<pre><code><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ProgressBar
android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="168dp" />
</code></pre>
<p></p>
<p>I'm going to use it as a visual indicator of a liquid tank.(Progress as level) </p>
<p>I want to know how to set it vertcal. If it is not possible can some one suggest some other option to my problem.</p>
|
java android
|
[1, 4]
|
2,185,632 | 2,185,633 |
Slide Screens in Activity android sdk
|
<p>I have Activity where i have information. How can i do so that when i slide to the side i could see another information? Is this possible to do it in one Activity? What the java code should be? What should i change in .xml files ?</p>
<p>java:</p>
<pre><code>package com.lineage.goddess;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class LineageHelpActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.help);
openRawResource();
InputStream iFile = getResources().openRawResource(R.raw.lineagehelp);
TextView helpText =(TextView) findViewById(R.id.TextView_HelpText);
String strFile = inputStreamToString(iFile);
helpText.setText(strFile);
}
private String inputStreamToString(InputStream iFile)
{
Writer writer = new StringWriter();
if(iFile!=null)
{
char[] buffer = new char[1024];
try{
Reader reader = new BufferedReader(
new InputStreamReader(iFile, "UTF-8"));
int n;
while ((n = reader.read(buffer)) != -1) {
writer.write(buffer, 0, n);
}
} catch (UnsupportedEncodingException e) {
return e.toString();
} catch (IOException e) {
return e.toString();
}finally
{
try {
iFile.close();
} catch (IOException e) {
return e.toString();
}
}
}
String result = writer.toString();
return result;
}
private void openRawResource() {
// TODO Auto-generated method stub
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,929,418 | 5,929,419 |
How do I define multiple OnInit events on the same page in asp.net?
|
<p>I have a page in which I create dynamic controls via OnInit. On the page I also have a custom user control in which i want to create other dynamic controls via OnInit (defined with override). The event in the user control overrides the event on the page: how do i prevent this?</p>
|
c# asp.net
|
[0, 9]
|
3,879,674 | 3,879,675 |
jQuery fadeout woes
|
<p>Using the <code>keyup</code> on jQuery, is there a way to check a what textfield <strong>currently</strong> has in it's box?</p>
<p>I mean if the textbox currently <strong>does not</strong> have the word 'apples' then <strong>do</strong> a jQuery function, then if it <strong>does</strong> have the word apples... then do <strong>not</strong> do the jQuery function that happens when 'apples' is not typed.</p>
<p>I hope that made sense. I tried using <code>CASES</code> and <code>keyup</code> but I couldn't get it to work.</p>
<p>Is this possible?</p>
|
javascript jquery
|
[3, 5]
|
4,469,803 | 4,469,804 |
What is the equivalent of Java's .length for arrays in C#?
|
<p>I'm new to C#, and I'm trying to convert this code from java into C#.</p>
<pre><code> static public double euclidean_2(double[] x, double[] y)
{
if (x.length != y.length) throw new RuntimeException("Arguments must have same number of dimensions.");
double cumssq = 0.0;
for (int i = 0; i < x.length; i++)
cumssq += (x[i] - y[i]) * (x[i] - y[i]);
return cumssq;
}
</code></pre>
<p>I know java uses .length but what is the equivalent in C# since I keep getting an error</p>
<p>Thanks</p>
|
c# java
|
[0, 1]
|
722,013 | 722,014 |
use onclick to create session variable with jquery or javascript?
|
<p>Is it possible onclick to create session variable with javascript or jquery then use this variable with php ?</p>
<p>For example someone click link at the bottom</p>
<pre><code><div id="list"><a onclick = "" href="javascript:void(0);">+</a></div>
</code></pre>
<p>there will be created variable like number=1;</p>
<p>then I should call it in php like : </p>
<pre><code><?php $_SESSION["number"]; ?>
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
2,820,549 | 2,820,550 |
Problems when assigning values via JavaScript to Asp.net labels and then passing via C# session object
|
<p>I am assigning variables to asp labels via javascript with a simple innerHTML call</p>
<p>example:<br/></p>
<p><code>document.getElementById('labelName').innerHTML = parseFloat(var).toFixed(2);</code></p>
<p><br/>
It appears in the label fine, and I am able to continue to manipulate it via javascript.</p>
<p>I then set it up so that that variable is put into a session object via C# codebehind buttonClick event. </p>
<p>example:<br/></p>
<pre><code>protected void btnConfirm_Click ( object sender, EventArgs e )
{
Session["sessionName"] = labelName.Text;
}
</code></pre>
<p><br/>
The buttonConfirm_Click method fires it Response.Redirects to another page and populates asp labels with the session object via the c# codebehind page_load method.</p>
<p>example:<br/></p>
<blockquote>
<p>lblResult.Text = Session["sessionName"].ToString();</p>
</blockquote>
<p><br/>
When doing this, <strong>the label is empty, no errors or 'null'.</strong> I have tried to narrow down the issue by trying various things. When I assign the text explicitly in the c# code behind of the first page and the recieve and assign it to the label on the next page, it shows correctly.</p>
<p>example:<br/></p>
<pre><code>Page 1:
Session["sessionName"].ToString() = "Test";
Page 2:
lblResult.Test = Session["sessionResult"].ToString();
</code></pre>
<p><br/>
I have tried several other things, such as casting the variables in javascript and in the codebehind, and checking to make sure I had runat="server" within each applicable label.</p>
<p>Anyways, is there something here I am missing? Is asp.net unable to detect the changes that javascript has made to the labels? Are there some incompatibility issues when using innerHTML or anything like this that maybe be causing such a thing to occur?</p>
<p>Thanks in advance!</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,867,323 | 4,867,324 |
C# directive for code to run only when working on localhost
|
<p>Is there any directive in C# that runs a code (server side code) only when the application runs on localhost and ignores it on production (not the debug true or false)?</p>
<p>It can be something that reads a web.config appsettings variable, if it's true, run the code, if it's false, ignore it (just an idea).</p>
|
c# asp.net
|
[0, 9]
|
458,589 | 458,590 |
What does this PHP syntax mean and why is this variable NaN?
|
<p>question marks are hard to search for in google.</p>
<p>What does this mean step by step?</p>
<pre><code> $page = isset($_POST['page'])?$_POST['page']:"0";
</code></pre>
<p>I am guessing it means if <code>Post['page']</code> is set use that value and if not use <code>0</code>? but i dont get it in detail. Also when I do <code>var_dump($page)</code> i get <code>"NaN"</code> ; even though <code>POST['page']</code> is not set to anything yet. What's going on?</p>
<p>--> For full disclosure, I am using this Javascript function to pass the value of page..for a "load more"/pagination functionality.</p>
<pre><code>$(function(){
$("#more").click(loadPosts);
loadPosts();
var count = 0;
var num = 2;
function loadPosts() {
$(".loading").show("fast");
count += num;
$.post("load.php", {'page': count}, function(data){
$("#contents").append(data);
$(".loading").hide("fast");
});
}
});
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
4,530,304 | 4,530,305 |
Theme in user control
|
<p>How can I change <code>Page.Theme</code> dynamically in <code>UserControl</code>?</p>
<p>As far as I know it can be done in <code>Page_PreInit</code> but <code>UserControl</code> dont have such an event, it`s exists only in Page class.</p>
|
c# asp.net
|
[0, 9]
|
992,454 | 992,455 |
How do I run a function only when a div gets loaded?
|
<p>I want to run a function only when a div gets loaded.</p>
<p>When I load the page, a number of files are loaded. At the end of the list, PHP echoes a div. When this one is displayed, jQuery should run a function.</p>
<p>I can do this with a click-event, but I want it to work automatically, without pushing a button.</p>
<p>This is how it works with a click:</p>
<pre><code>$("#PP_end_show").live("click",function(){
$("#PP_head_bar").slideToggle("slow");
$("#PP_info_file_wrap").slideUp("slow");
});
</code></pre>
<p>This is the <code>div</code> echoed by PHP:</p>
<pre><code> <?php echo "<div id=\"PP_end_show\"></div>"; ?>
</code></pre>
<p>The output is generated after an AJAX call:</p>
<pre><code><form id="PP_search_input" method="post" name="search_ID" ONSubmit="xmlhttpPost('PP_search_stream_client.php', 'PP_search_input', 'PP_thumb_output', '<img src=\'images/wait.gif\'>');return false; ">
<input name="search_string" type="text" class="PP_input" id="search_string" value="<?php echo $_POST['search_string']; ?>"/>
<button type="submit" class="PP_submit" id="search_submit"> search </button>
</code></pre>
<p>at the end of the generated output the specific div will be printed and should trigger the new jQuery function.</p>
|
php javascript jquery
|
[2, 3, 5]
|
352,913 | 352,914 |
What's the correct way to pass in tilde path in javascript in order to get the relative path?
|
<p>I have a tilde path. I would like to convert it into client url</p>
<pre><code> var path = "~/Presentation/Resources/Images/masterPage/cleanup.png";
var a = '<%=Page.ResolveClientUrl(" '+path+' ") %>';
var b = '<%=ResolveUrl("~/Presentation/Resources/Images/masterPage/cleanup.png") %>';
alert("var a-->"+a);
alert("var b-->"+b);
</code></pre>
<p>although the code above seems the same, the results I obtain for var a and var b are very different.</p>
<p><strong>Result</strong></p>
<pre><code>var a --> ~/Presentation/Resources/Images/masterPage/cleanup.png
var b --> ../../Resources/Images/masterPage/cleanup.png
</code></pre>
<p>I have a variable that stores the path, but I failed to get the result exactly like var b.
What can I do for <strong>var a</strong> so that I can get the result like <strong>var b</strong>?</p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
5,073,332 | 5,073,333 |
Add or Subtracting into $(window).scrollTop + $(window).height == $(document).height() - Scrolled to bottom of page equation
|
<p>I'm running an if function when the user gets to the bottom of the page which works great as is like this</p>
<pre><code>if($(window).scrollTop() + $(window).height() == $(document).height()) {}
</code></pre>
<p>However I want it to run slightly before the bottom - about 300px before. </p>
<p>I've tried</p>
<pre><code>if($(window).scrollTop() + $(window).height() + 300 == $(document).height()) {}
</code></pre>
<p>AND</p>
<pre><code>if($(window).scrollTop() + $(window).height() == $(document).height() -300) {}
</code></pre>
<p>and all other variations to no avail.</p>
<p>I've also tried putting variables in.</p>
<pre><code>var plusheight = 300;
if($(window).scrollTop() + $(window).height() + plusheight == $(document).height()) {}
if($(window).scrollTop() + $(window).height() + $plusheight == $(document).height()) {}
if($(window).scrollTop() + $(window).height() + "plusheight" == $(document).height()) {}
</code></pre>
<p>What am I doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
2,073,013 | 2,073,014 |
trigger event in js when opening email?
|
<p>I am trying to track when a user opens an email for a subscription service I have. Is it possible to trigger some event in javascript or something else when an email is opened?</p>
|
javascript asp.net
|
[3, 9]
|
5,720,198 | 5,720,199 |
Custom Page class
|
<p>I'm trying to create a custom class for my pages in my project.</p>
<p>Here's the default.aspx.cs</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : FrontPage
{
public String text;
protected void Page_Load(object sender, EventArgs e)
{
text = "";
}
}
</code></pre>
<p>Here's the FrontPage class:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for FrontPage
/// </summary>
public class FrontPage
{
public DataContext db = new DataContext();
public String a;
//public void Page_Load(object sender, EventArgs e)
//{
//}
}
</code></pre>
<p>The problem is I keep getting an error:</p>
<p><code>Make sure the class is defined in this kodefil corresponds to attribute 'inherits' and that it extends the correct base class (eg. Page or UserControl).</code></p>
<p>What am I doing wrong?</p>
|
c# asp.net
|
[0, 9]
|
4,558,122 | 4,558,123 |
detecting change in a text input box using jquery/javascript
|
<p>in html and javascript, I can use keyup, focus, blur to detect most of the content changes in a text input, however if the user do a copy and paste into the text input, how do I capture this change? The issue here is that the input is already in focus when user paste into it.</p>
|
javascript jquery
|
[3, 5]
|
1,685,689 | 1,685,690 |
How do I execute an event using jQuery through an html object(button) created through Javascript?
|
<p>I'm just new here. So here's where I'm stuck:</p>
<p>I created an html table using javascript. I have a button,which when clicked, will create set of tables with exactly the same structure but the objects(eg. button, text) inside those tables have different ID's. Now when I try to execute a click function using jQuery with a button on one of the produced tables, it won't work. How do I go around here? Thanks in advance!</p>
<p>Here's a sample function which creates the html table(with unique ID's) in javascript:</p>
<pre><code>function CreateTables() {
var html = ' ';
var valPrompt = prompt("How many tables would you like to add?");
parseInt(valPrompt);
for (i = 1; i <= valPrompt; i++) {
html += "<table>" + "<tr>" + "<td>" + "Text goes here" + "</td>" + "<td>" + "<input type='text' id='txtTEXT" + i + "'/>" + "</td>" + "<td>" + < input type = 'button'
id = 'btnALERT" + i + "' / > +"</td>" + "</tr>" + "</table>"
}
document.getElementById('HtmlPlaceHolder').innerHTML = html;
}
</code></pre>
<p>So, if we review the code, Sets of table with buttons(btnALERT) with unique ID's will be created if the function <strong>CreateTables</strong> is executed. In order to select the objects, I suppose I'll be using jQuery. So for example, if I bind a handler in btnALERT1(produced by CreateTables) say a click function in order to alert a simple "Hello", how will I do this? My code for this doesn't seem to work:</p>
<pre><code>$(document).ready(function() {
$('#btnALERT1').click(function() {
alert("Hello");
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,126,808 | 4,126,809 |
How can I change the font color of the textview in the listview from xml file item? android
|
<p>Depending on the value:</p>
<p>Example</p>
<p>Pay:+200 </p>
<p>Pay:-100</p>
<p>If the value of pay is higher the color of 200 is green.
If the value of pay is lower the color of 100 is red.</p>
<p>It changes color every seconds because I have xml file link from the browser
and update the xml file every seconds.
I like the color together as the link in my xml file refresh it in seconds and change the color depends if higher or lower.</p>
|
java android
|
[1, 4]
|
4,673,861 | 4,673,862 |
Help with js function explanation - Why $this = $(this)...?
|
<p>A user called "mu" as provide me the following answer that I really like.
However, I do have some questions here, and I hope anyone could help me out.</p>
<p>Given the following:</p>
<pre><code>function() {
var $this = $(this);
$this.data('orig', $this.html()).html('<a href="blabla.org">go here</a>');
},
function() {
var $this = $(this);
$this.html($this.data('orig')).removeData('orig');
}
</code></pre>
<p><strong>1)
Why do we have the need, and what does it do:
var $this = $(this) - Why can't we use $(this) all over the place?</strong></p>
<p><strong>2) Why do we need the 'orig' thing there?</strong> </p>
<p>Please, :) provide as much detail as possible, really, I'm quite new on all this.</p>
<p>Thanks a lot in advance,
MEM</p>
|
javascript jquery
|
[3, 5]
|
436,893 | 436,894 |
How to call javascript on user control
|
<p>I have webapplication in c# asp.net 4.0 </p>
<p>I have User Control in that I have written javascript :-</p>
<pre><code><script>
function SetValue() {
alert(document.getElementById('offSetClient').value);
}
</script>
<asp:HiddenField ID="clientDateTime" runat="server" />
<asp:HiddenField ID="offSetClient" runat="server" Value="Test"/>
</code></pre>
<p>and this User Control added into a web form.
Please suggest me how can I call this javascript on User Control page load.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,114,619 | 1,114,620 |
Upload image to the server without file upload control
|
<p>Am currenty working on writing code in c# to handle some operation for our iphone app.These code files will be in our server and the url are used by iPhone team to call those specific files and ger their values.</p>
<p>Now am working on photo upload functionality.I have no idea how to proceed.In asp.net i used fileupload control and saved photos in our server using fileupload control's saveas property.How can i Upload photos to the server without using any such control,i ll be having only path of the image . Can anyone suggest any other way to upload image to server without using any controls</p>
<p>EDIT:</p>
<p>Ths is not a asp.net app for iphone. Instead of writing codes in X code we write the code in asp.net & c#.They can call these url and pass values to it through querystring and get the results.</p>
<p>For example:</p>
<p>There will be a page called get userid .the Iphone phone team can pass the username through querystring and get the userid eg.(www.xx.com/MgetUserId?uname=yyy prints the username onto the aspx page which they will use )</p>
|
c# asp.net
|
[0, 9]
|
2,630,710 | 2,630,711 |
How to get correct table format ? Jquery ques
|
<p>This code prints output as given below...
<strong>code</strong>:</p>
<pre><code>$('#calendar').append('<table><thead><tr>');
var i;
for(i=0;i<=6;i++)
{
$('#calendar').append('<td>'+week[i]+'</td>');
}
$('#calendar').append('</tr></thead>');
$('#calendar').append('</table>');
</code></pre>
<p><strong>output</strong>:</p>
<pre><code><section id="calendar"><table><thead><tr></tr></thead></table><td>Sunday</td><td>Monday</td><td>Tuesday</td><td>Wednesday</td><td>Thursday</td><td>Friday</td><td>Saturday</td></section>
</code></pre>
<p>But i expect something in this structure..</p>
<pre><code><table><thead><tr><td>...</td></tr></thead></table>
</code></pre>
|
jquery javascript
|
[5, 3]
|
2,349,048 | 2,349,049 |
How to bind a repeater to an array of a custom class?
|
<p>I have a class like this </p>
<pre><code> public class Link
{
public string LinkID { get; set; }
public string Title { get; set; }
public string URL { get; set; }
}
</code></pre>
<p>and a method that returns an array of <code>Link[]</code> </p>
<p>Could I bind that to a repeater, which will reference the Title and URL from Link?<br>
How do I reference it? <code><%# DataBinder.Eval(Container.DataItem, "Title") %></code> doesn't make anything show up </p>
<p>edit:This is embarrassing..I forgot that I emptied the database a couple days ago</p>
|
c# asp.net
|
[0, 9]
|
2,267,695 | 2,267,696 |
prevent users to continue to the action page using a JS method
|
<p>I have a form that when I click on button sumbit it redirects me to the action page, and I have a test on the fields using JavaScript, that I created a function for which returns true if all fields are filled or false if there is some field which is still empty. The problem is that the method that will prevent the user to continue to the action page if he clicked on the submit button when the JS function returns false?</p>
|
php javascript
|
[2, 3]
|
5,278,483 | 5,278,484 |
jquery sortable except this one
|
<p>Need a way to allow sorting except for last item with in a list. </p>
<p>Tried using the cancel option but it didn't work and I don't think that's what its for.</p>
<p>I think a solution may be with events but would like your take on it.</p>
<p>In practice the list is dynamically generated and relies on tag and relative referencing not id's for selecting.</p>
<p>Sample code:</p>
<pre><code>$("ul").sortable({});
...
<ul>
<li>red</li>
<li>blue</li>
<li>white</li>
<li>black</li>
<li>this li should not be sorted</li>
</ul>
</code></pre>
<p>browser ie6...</p>
<p>Thank you in advanced.</p>
|
javascript jquery
|
[3, 5]
|
1,466,996 | 1,466,997 |
syntax error missing ), don't know where to place it in order to echo input
|
<p>I want to know what is the correct way of display a text input in an echo in the code below because nothing is being outputted:</p>
<pre><code><script language="javascript" type="text/javascript">
window.top.stopVideoUpload(
<?php echo $result; ?>,
'<?php echo "<input name='vidid' type='text' value='".$id."'/>" . $_FILES['fileVideo']['name']; ?>'
);
</script>
</code></pre>
<p>The error I am recieving is: <code>syntaxError: missing ) after argument list.</code></p>
|
php javascript
|
[2, 3]
|
3,326,170 | 3,326,171 |
how to prevent $(document).ready(function() {} from calling a function
|
<p>i have a simple but bit complicated problem.
what i want to do is that in my php page i have added this</p>
<pre><code>$(document).ready(function() {
$("a[rel^='prettyPhoto']").prettyPhoto({social_tools:false,overlay_gallery:false});
});
</code></pre>
<p>now this page get call through ajax too.normal call of page does <strong>nothing</strong>.but when i click i mean <code>a[rel^='prettyPhoto']</code> so it call this function prettyPhoto() and that is what i want to do.
when this page call through ajax so it directly execute the function although i have not click any thing.</p>
<p>i have tried this</p>
<pre><code>event.preventDefault();
</code></pre>
<p>but nothing working.
also i put this line of code in a function and call it but nothing happens.also remove <code>$(document).ready(function() {}); but still not working any clue</code></p>
|
javascript jquery
|
[3, 5]
|
4,864,173 | 4,864,174 |
JQuery - DIV-Content-Change should be another URL
|
<p>after the user logged in, the project-url is root/inside/. The site has 4 different main-sections, which will be displayed in a div via Ajax. The url does not change, after clicking on the links. How can i do it, that the url changes like this after clicking on the links for the main sections:</p>
<pre><code>root/inside/my_account
root/inside/part_one
root/inside/part_two
root/inside/part_three
</code></pre>
<p>I would like to use that, because when the user is at one section and uses the back-button in the browser he is at the root. That's not user likely...</p>
<p>Thanks-</p>
|
javascript jquery
|
[3, 5]
|
5,737,277 | 5,737,278 |
Full calender application in php
|
<p>The application is for a clinic.A patient can see the calender in the website and he/she can book the date for consulting.Once a patient booked a date, that day will shown as "booked". so no more person can book that day.The admin can view the days and patient details. How can we implement this.</p>
<p>I got two solution.1) Google calender.
2)<a href="http://arshaw.com/fullcalendar/" rel="nofollow">http://arshaw.com/fullcalendar/</a> </p>
<p>The second one is more apt for this.Do you guys have any other suggestions.
Thanks in advance.</p>
|
php jquery
|
[2, 5]
|
1,906,010 | 1,906,011 |
jquery check variable values
|
<p>In jQuery I have the following 4 variables. </p>
<pre><code>var add
var city
var state
var zip
</code></pre>
<p>I need to check to see that any one of the above have a value.
If none have a value that is OK. If all of them have a value that is OK.</p>
<p>Just need to check that at least one of them do not have a value.
Not sure what is the most efficient way of doing this. </p>
|
javascript jquery
|
[3, 5]
|
1,537,670 | 1,537,671 |
How to transfer a variable to a external js file in javascript?
|
<p><strong>Case 1:</strong> I have passed a variable to a external js file like this</p>
<pre><code><script type="text/javascript">
var data1, data2, data3, data4;
function plotGraph() {
var oHead1 = document.getElementsByTagName('HEAD').item(0);
var paramScript = document.createElement("script");
paramScript.type = "text/javascript";
paramScript.setAttribute('data1', data1);
paramScript.setAttribute('data2', data2);
paramScript.setAttribute('data3', data3);
paramScript.setAttribute('data4', data4);
oHead1.appendChild(paramScript);
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript = document.createElement("script");
oScript.type = "text/javascript";
oScript.src = "js/graph.js";
oHead.appendChild(oScript);
}
</script>
</code></pre>
<p><strong>Case 2:</strong> I even tried passing it like this using jquery</p>
<pre><code><script type="text/javascript">
function plotGraph() {
var data1, data2, data3, data4;
$.getScript("js/graph.js");
}
</script>
</code></pre>
<p>In the first case which is working but i had to create global variables… I dont want this…</p>
<p>In the second case which is not working has local variables which are not recognized in the js file..</p>
<p>How shall i do it? Any suggestions?</p>
|
javascript jquery
|
[3, 5]
|
5,846,046 | 5,846,047 |
Jquery dynamically create link
|
<p>I have a piece of JQuery that creates a row in a table and in one of the cells there is an X that is surrounded by a class. When it is dynamically created and then clicked on the click listener does not fire.
Here is the code.</p>
<pre><code>$('#add').click(function() {
$( '#table' ).append('<td class="x">X</td></tr>');
});
$('.x').click(function() {
alert('Fired');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,035,481 | 3,035,482 |
How do I output the location using gps on Android
|
<p>I am trying to output the location into a textview.
I have used the locationManager.toString(), but it would only give me the output android.location.LocationManager@44ee7718.
I would like to output the location like Los Angeles, CA 90501.</p>
<p>The code for LocationManager:</p>
<pre><code>LocationManager lm = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
//conversion
Criteria criteria = new Criteria();
String bp = lm.getBestProvider(criteria, false);
Location location = lm.getLastKnownLocation(bp);
double lat = location.getLatitude();
double lon = location.getLongitude();
Geocoder gc = new Geocoder(this, Locale.getDefault());
List<Address> addresses = null;
try{
addresses = gc.getFromLocation(lat, lon, 1);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Address address = addresses.get(0);
final String ad = address.getAddressLine(0);
//ends here
</code></pre>
<p>The code for the button:</p>
<pre><code>Red.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent (Intent.ACTION_VIEW);
intent.putExtra("sms_body", ad);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
}
});
</code></pre>
|
java android
|
[1, 4]
|
3,631,820 | 3,631,821 |
how to append anchor tag into parent of div?
|
<p>My html code is:</p>
<pre><code><div title="test" class="xyz">Tesing</div>
</code></pre>
<p>I want it to look like:</p>
<pre><code> <a href='#'> <div title="test" class="xyz">Tesing</div></a>
</code></pre>
<p>How to do it using JavaScript?</p>
|
javascript jquery
|
[3, 5]
|
4,394,024 | 4,394,025 |
Show / hide elements on mouse move
|
<p>I'm building a site where I want the certain sections to be hidden until the mouse is moved. They then remain visible whilst the mouse is moving, however, if it remains still for a couple of seconds they hide again.</p>
<p>I'm using jQuery on the site, in my ready state I have:</p>
<pre><code>var hide = setTimeout(function() {
hideNav();
}, 2000);
$('body').mousemove(function() {
clearTimeout(hide);
var hide = setTimeout(function() {
hideNav();
}, 2000);
showNav();
});
</code></pre>
<p>And the functions that show/hide content</p>
<pre><code>function hideNav() {
$('#primary').fadeOut(1000);
var lightbox = $('#lightbox');
if (lightbox.length) {
lightbox.fadeOut(1000);
}
}
function showNav() {
$('#primary').fadeIn(1000);
var lightbox = $('#lightbox');
if (lightbox.length) {
lightbox.fadeIn(1000);
}
}
</code></pre>
<p>This sort of works, except the timeout for hiding the elements ends up fighting with the function to show it when the mouse moves resulting in a lot of flickering.</p>
<p>EDIT: The mouse movement needs to be for anywhere on the page, not just when hovering over the element that is to be shown/hidden.</p>
<p>Any help would be appreciated.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,979,603 | 4,979,604 |
Organizing script files
|
<p>I usually have jQuery code that is page specific along with a handful of functions that many pages share. One approach is to make seperate files for organizing, but i'm thinking that putting all the script in one file and making comments in the file for readability would also work. Then when the site goes live I can minify and obfuscate if needed.</p>
<p>I think the question comes down to limiting http requests or limiting file size. Is one of these a bad habit?</p>
|
javascript jquery
|
[3, 5]
|
3,720,802 | 3,720,803 |
Open clicked thumbnail in a new tab
|
<p>I have the below code on one page:</p>
<pre><code><div id="prodoneid" class="prodcls">
<a href="javascript:void(changeIt('big.png', 'pagewrapid')());">
<img src="images/zara/thumbnails/1.png" alt="ZARA"/>
</a>
</div>
</code></pre>
<p>By the below code I am opening the image in a new window. The new page is opening but is not showing the image in the div.</p>
<pre><code>var changeIt, img;
changeIt = function(imageName, objName) {
img = '<img src="images/zara/' + imageName + '">';
newwindow = window.open( 'fprod.html', target="_blank" );
document.getElementById(objName).innerHTML = img;
setTimeout('newwindow.document.getElementById("pagewrapid").innerHTML=img',0)
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,777,018 | 3,777,019 |
how to make trial version of win and web application in .Net technology
|
<p>how to develop a trial version of window or web application in dotnet technology. as a result user can use that windows or web apps for certain day and also will not be able to use after resetting his system clock.how could make this type of trial version both in window and web.
please give me the concept in detail.</p>
<p>thanks</p>
|
c# asp.net
|
[0, 9]
|
3,876,058 | 3,876,059 |
Check if value is null
|
<pre><code>var isempty = 0;
collegeArray = $(form).find(".cname").serializeArray();
for (var i = 0; i < collegeArray.length; i++) {
alert(collegeArray[i].value);
if (collegeArray[i].value = "") {
isempty = isempty + 1;
}
}
if (isempty == 0) {
container.innerHTML = "";
document.getElementById('survey').style.visibility = 'visible';
generateSurvey(collegeArray);
} else {
alert("Please fill out all fields!");
}
</code></pre>
<p>I'm trying to check if a set of fields, has at least one empty field. If there is empty field and alert should pop, if not it should do something else. I'm serializing the input fields as an array and then looping through it. When I run it, it seems that it's alway thinking that there are no empty fields even if there are some. How do I fix this? </p>
|
javascript jquery
|
[3, 5]
|
3,818,349 | 3,818,350 |
IndexOf with decimals
|
<p>I'm looking for a bit of help ironing out a bug in a search form I'm working on. </p>
<p>I have a form of multiple checkboxes which submits via AJAX to PHP and returns a query string for use in deep-linking. The query string is used to check checkboxes on the page that appear in the query string. </p>
<p>The query string looks like this:</p>
<pre><code>var returnedResults = #Size=35.5&Size=36&Colour=red&Material=leather
</code></pre>
<p>I have a form with a series of checkboxes like this:</p>
<pre><code><input type="checkbox" name="Size[]" id="35" value="35">
<input type="checkbox" name="Size[]" id="35.5" value="35.5">
<input type="checkbox" name="Size[]" id="36" value="36">
...
<input type="checkbox" name="Colour[]" id="red" value="red">
...
</code></pre>
<p>I am using jQuery's each function to loop through the checkboxes and check them if they appear in the query string:</p>
<pre><code>$('input').each(function(){
if (returnedResults.indexOf($(this).val()) >= 0) {
// check the box
}
});
</code></pre>
<p>This works fine for the most part but appears to return true for Size=35 when Size=35.5 is the only thing in the query string. ie. the checkbox with value=35 is checked when returnedResults=#Size=35.5</p>
<p>Is this a quirk of indexOf when dealing with decimals or is there something I'm doing wrong?</p>
<p>Many thanks for your help in advance.</p>
|
javascript jquery
|
[3, 5]
|
3,185,929 | 3,185,930 |
jquery: find out at which position (order) a particular element is among its neighbors
|
<p>I think this should be simple but I haven't been able to figure it out:</p>
<p>I have a container with a couple of children:</p>
<pre><code><div id='container'>
<div id='one'>some</div>
<div id='two'>random</div>
<div id='three'>text</div>
</div>
</code></pre>
<p>I want to be able to know the position of say element $('#two')... which should return 2 (as the element is the second of the container's children, $('#one').... should return 1 and so on.</p>
<p>Thanks a lot in advance,</p>
<p>Martin</p>
|
javascript jquery
|
[3, 5]
|
481,293 | 481,294 |
asp net javascript Cache clear
|
<p>I have a website that i did some time ago now they request some new features and i did some changes in some javascript files, but when i publish the clients that use the IE have problems with cache so in they browser they have old version of javascript. How can i clear the client cache so when they visit website they use latest javascript files that i modify.</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
4,332,098 | 4,332,099 |
JavaScript alert doesn't show
|
<p>I am trying to built a select option menu. If the user chooses the first (default) option, the alert window should be shown, but it isn't shown. Need help, thanks!</p>
<p>Here is my html code</p>
<pre><code> <select name="sets" id ="selectset">
<option value="General">Select Set</option>
<option value="The Happy Couple">Ceremony</option>
<option value="Ceremony">Ceremony</option>
<option value="Lunch">Lunch</option>
<option value="Garden">Garden</option>
<option value="Longname">This is max length</option>
</select>
<input type="button" class="form_button" id="movetoset" value=" Move Marked to Set">
</code></pre>
<p>Here is my javascript code</p>
<pre><code> $('#movetoset').click(function() {
if(document.getElementById("selectset").value == "General"){
alert("Please choose a set");
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,000,678 | 5,000,679 |
Get date in the 17-05-2012 format
|
<p>im stuck at a problem here im getting the date in the following format</p>
<pre><code>Wed May 16 2012 10:22:39 GMT+0500
</code></pre>
<p>i have tried </p>
<pre><code>.toString('dd-MM-yyy');
</code></pre>
<p>but to no avail how can i parse the given format into the required one.</p>
|
javascript jquery
|
[3, 5]
|
1,120,640 | 1,120,641 |
Javascript to make a component to dynamically follow another one
|
<p>I have a dynamically rendered div/span that needs to follow a particular component e.g. a textbox. Currently it is set to a particular coordinate on the page and it is shown as appearing right beneath the textbox. But it no longer appears that way when a div above the textbox gets collapsed/expanded (i.e. it goes above/under the textbox).</p>
<p>Think of it as a search result area appearing under a search result box after clicking the search button, but the search result area moved when a random div above the search text box collapsed/expanded.</p>
<p>I'm pretty sure that a bit of javascript would fix this. I tried googling for it, but struggling to come up with decent keywords (and my search phrase didn't really return me much).</p>
<p>The div/span in question is rendered in jQuery dynamically. I was wondering what does the quick solution look like?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
3,667,259 | 3,667,260 |
Jquery DIV count add class
|
<p>Add class of test after div count</p>
<p>Any help would be appreciated :-)</p>
<pre><code>$(function() {
var coloumnCount = $("#plans-wrapper").children("div.column").length();
if(coloumnCount > 3 {
$("column").addClass("test");
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,411,901 | 4,411,902 |
How to disable checkbox one after another?
|
<p>I have two checkboxes with different names:</p>
<pre><code><input type="checkbox" name="checkbox1" value="checkbox1">
<input type="checkbox" name="checkbox2" value="checkbox2">
</code></pre>
<p>I'd like to implement code where when checkbox1 is checked, checkbox2 is disabled and when checkbox2 is checked, checkbox1 is disabled. When it's unchecked, it should enable the other back as well.</p>
<p>How can I achieve with jQuery or JavaScript?</p>
|
javascript jquery
|
[3, 5]
|
4,349,935 | 4,349,936 |
PHP Code to generate event to repeat in a random shuffle of intervals between 1-20 seconds
|
<p>This program sends an email every 20 sec. </p>
<p>How can I amend the code to have it send an email, then pause for a random number of seconds between 1 and 20, then repeat till the end ?
Any help on this is much appreciate. Thanks in advance! </p>
<p>Here is the code that is associated with the Delay section of the User Interface as it is </p>
<pre><code>if (!$delaySecs) {
$delaySecs = 20;
}
<input name="delaySecs" type="text" value="<? print $delaySecs; ?>" size="10">
</code></pre>
|
php javascript
|
[2, 3]
|
739,477 | 739,478 |
Javascript script timer issue
|
<p>I am trying to make a count down timer. I manage to make one but the problem with this is it stops when I close browser. So when user revisit my site it restart again. What I want is to keep that timer. <em>For example, if user leaves my site at timer 22:14:09. So timer will continue. Lets say the user revisits my site after an hour so the time should be 21:14:09.</em> How can I do that?</p>
<p>Here is my JS</p>
<pre><code>$(function () {
var hrs, mins, secs, TimerRunning, TimerID,
Timer = {
init: function () {
hrs = 23;
mins = 59;
secs = 59;
TimerRunning = false;
Timer.StopTimer();
Timer.StartTimer();
},
StopTimer: function () {
if(TimerRunning)
clearTimeout(TimerID);
TimerRunning=false;
},
StartTimer: function () {
TimerRunning = true;
$('.timer').html(Timer.Pad(hrs) + ":" + Timer.Pad(mins) + ":" + Timer.Pad(secs));
TimerID = self.setInterval("StartTimer()", 1000);
if(hrs == 0 && mins == 0 && secs == 0)
StopTimer();
if (secs == 0) {
mins--;
secs = 59;
}
if (mins == 0) {
hrs--;
mins = 59;
}
secs--;
setTimeout(function () { Timer.StartTimer(); }, 1000);
},
Pad: function (number) {
if(number < 10)
number = 0+""+number;
return number;
}
};
Timer.init();
});
</code></pre>
<p><strong>Update</strong></p>
<p><a href="http://jsfiddle.net/TH2fp/" rel="nofollow">DEMO</a></p>
|
javascript jquery
|
[3, 5]
|
3,939,224 | 3,939,225 |
JS scroll starts bottom. I want it start at top
|
<p>The site I am working on:
<a href="http://bit.ly/OZSjT9" rel="nofollow">http://bit.ly/OZSjT9</a></p>
<p>Please view source code. I have so many different JS codes I think it's conflicting.</p>
<p>I am sooo new at Javascript that I have to get code online to get things to work. Well my trouble is this. Every time you load the page it starts at the bottom of the one page website. It obviously should start at the top so that visitors will see the header first. Can anyone explain to me why this is happening? And how do I fix it? Thanks so much!</p>
<pre><code>$('a[href*=#]').each(function() {
if ( filterPath(location.pathname) == filterPath(this.pathname)
&& location.hostname == this.hostname
&& this.hash.replace(/#/,'') ) {
var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) +']');
var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
if ($target) {
var targetOffset = $target.offset().top;
$(this).click(function() {
$('html, body').animate({scrollTop: targetOffset}, 2000);
return false;
});
}
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,679,916 | 1,679,917 |
When JavaScriptSerializer is mandatory?
|
<p>here i attach a sample code. they used JavaScriptSerializer to generate data in json format and send back the data to client</p>
<p>GetPersons() has been called by jquery ajax function. code here</p>
<pre><code>$.ajax({
type: "POST",
url: "Default.aspx/GetPersons",
contentType: "application/json; charset=utf-8",
data: "{}",
dataType: "json",
success: AjaxSucceeded,
error: AjaxFailed
});
[WebMethod()]
public static string GetPersons()
{
List<person> persons = new List<person>()
{
new Person { UId = 1, Name = "Brij", Address = "Noida"},
new Person { UId = 2, Name = "Rahul", Address = "New Delhi" },
new Person { UId = 3, Name = "John0", Address = "Chris"}
};
JavaScriptSerializer ser = new JavaScriptSerializer();
return ser.Serialize(persons);
}
</code></pre>
<p>when a method is decorated by WebMethod then data is generated in json format automatically when they are return. if you guys look it closely
then u can see GetPersons() string instead of List. why some one return string instead of List . if they would return List
then data need not to be generated manually in json format. am i right?</p>
<p>so i just need to know why people use JavaScriptSerializer to generate data in json format. so please tell me what kind of situation one has to use </p>
<p>JavaScriptSerializer to generate data manually in json format?</p>
<p>please discuss in detail.......thanks</p>
|
jquery asp.net
|
[5, 9]
|
2,749,111 | 2,749,112 |
Javascript Variable value in PHP
|
<p>I have my code look like this </p>
<pre><code>var bal=$(this).val();
var findbalance="<?=balancefromid(bal);?>";
alert(findbalance);
</code></pre>
<p>is that possible?</p>
|
php javascript
|
[2, 3]
|
2,893,018 | 2,893,019 |
How to get list of all Session Variables created in a Solution / Project
|
<p>I am working on an existing ASP.NET / C# project. How can I find all session variables created in the project in different code behind / in line code / class file, without running the project in debug mode. I am using vs 2008.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
3,015,183 | 3,015,184 |
Toast can't be used in new runnable?
|
<p>as the title,i was used toast in runnable but there is an error
my code:</p>
<pre><code>public Runnable backgroud=new Runnable(){
public void run() {
// TODO Auto-generated method stub
try
{
while(!Thread.interrupted())
{
String msg="this is a test";
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
Thread.sleep(1000);
}
}
catch(InterruptedException c)
{
c.printStackTrace();
}
}
};
</code></pre>
|
java android
|
[1, 4]
|
751,804 | 751,805 |
Global EditText Variables
|
<p>I'm writing my first android app, and I have an EditText object that I want to be read across my entire program (multiple activities). I'd like to take in a user's name on one screen/activity/layout and read it in several others to manipulate or display it, so I've found that the string needs to be public and static, and that there should be a class with my global variables. What is the correct way to do this? I've tried using bundles and several other methods, but none seem to work.</p>
|
java android
|
[1, 4]
|
262,770 | 262,771 |
generating DOM inside a div tag from javascript
|
<p>I have this javascript function:</p>
<pre><code>jQuery(document).ready(function() {
FB.api('/me/friends', function(response) {
if(response.data) {
$.each(response.data,function(index,friend) {
$("#fb_friends").append("<div style=\"width:150px;float:left;font-size:11px;color:White;\">");
$("#fb_friends").append("<input type=\"checkbox\" name=\"friends\" value=\"1244524\" />");
$("#fb_friends").append("<img src=\"http://graph.facebook.com/' + friend.id + '/picture\" alt=\"Picture\" style=\"width:24px\">");
$("#fb_friends").append(friend.name);
//alert(friend.name + ' has id:' + friend.id);
$("#fb_friends").append("</div>");
});
} else {
alert("Error!");
}
});
});
</code></pre>
<p>I also have this in my html:</p>
<pre><code><div id="fb_friends" style="height:280px;overflow:scroll;" >
</div>
</code></pre>
<p>I want to call this getFriends function so that it populates the HTML inside this fb_friends div I have. How do I do this?</p>
<p><strong>UPDATED</strong> the code above doesn't work</p>
|
javascript jquery
|
[3, 5]
|
5,225,023 | 5,225,024 |
Download using WebClient - IIS Basic Authentication
|
<p>I am using this to download html content from a site published on IIS:</p>
<pre><code>using (var client = new WebClient())
{
client.Credentials = CredentialCache.DefaultCredentials;
string html = client.DownloadString("http://site.com");
}
</code></pre>
<p>But when the IIS is set to Basic Authentication this doesn't works. The user already type user and password on the IIS dialog box. </p>
<p>There is a way to make this work without pass a user and password again?</p>
|
c# asp.net
|
[0, 9]
|
3,826,163 | 3,826,164 |
Android: Saving ArrayList of User Defined Objects between onPause and onResume
|
<p>I am working on an application where i am saving the state of an application in an ArrayList. Now, to save this state, i tried to use Serialization. But, somewhere in the user defined object, i am using Button, which is not letting me serialize the entire object. </p>
<p>I wanted to know, is there any other way of saving this array list between onPause and onResume?. I even tried onSaveInstanceState, but it doesnt have support for ArrayList. </p>
<p>Thanks,
Chander</p>
|
java android
|
[1, 4]
|
1,662,367 | 1,662,368 |
ViewTreeObserver Listener not called after some time
|
<p>I have great difficulties when using ViewTreeObserver. All works fine for some unpredictable period of time, and then the listener is not operational anymore. It is certainly because of what is written in the doc:<strong>The returned ViewTreeObserver observer is not guaranteed to remain valid for the lifetime of this View</strong>
Therefore i redo the setup every time I change my view:</p>
<pre><code> protected void shrinkToFit(final TextView t) {
if(vto==null||!vto.isAlive()){
vto = t.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
public void onGlobalLayout() {
doAdjust(t);
}
});
}
}
</code></pre>
<p>and here's how I invoke it:</p>
<pre><code>TextView t = (TextView) findViewById(R.id.maindesc);
t.setTextSize(Constants.MAINDESC_SIZE);
String todisp_1 = tarifreadtemp.area_desc + ":"
+ tarifreadtemp.area_tarifuserdesc;
shrinkToFit(t);
t.setText(todisp_1);
t.invalidate();
</code></pre>
|
java android
|
[1, 4]
|
2,307,759 | 2,307,760 |
How do I prevent button presses until form request is completed when form request causes a file download
|
<p>In my Asp.net webforms site I have a form where users select various options and those options are sent back in a postback that generates a PDF report and sends that file back to the user for download via the following code:</p>
<pre><code> protected void btnTopGenReport_Click(object sender, EventArgs e)
{
var stream = new PodMainReportGenerator().GenerateReport(GetReportParameters());
var bytes = stream.ToArray();
stream.Close();
// Set the content headers
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment;filename=testReport.pdf");
Response.AddHeader("Content-Length", bytes.Length.ToString());
Response.BinaryWrite(bytes);
Response.End();
}
</code></pre>
<p>The problem is this report can take a good 10 or so seconds to generate due to the amount of data and processing required, but I don't want people getting impatient and clicking the button over and over again.</p>
<p>In a normal page I would add javascript to disable the buttons on click. This works because when postback is complete the server comes back with the form buttons re-enabled. However, since the form's response is not an HTML page but a downloaded file, which I don't know how to detect.</p>
<p>Essentially, how do I disable the form's buttons but re-enable them once we get the response from the server (and the http file transfer is initiated)?</p>
|
c# asp.net
|
[0, 9]
|
3,429,164 | 3,429,165 |
Select a Multi-select DropDown by values with jquery
|
<p>I have asked a similar <a href="http://stackoverflow.com/questions/12584387/select-a-dropdown-by-values-with-jquery">question</a> this morning, how to select a dropdown by its value rather than sequence.</p>
<p>The problem is now how to use a multi-select dropdown and select the options by their value rather than sequence. (e.g. I would like to select a1 and a3, by their respective primary key, 1 and 4) </p>
<pre><code><select id="id_deals-sales_item" multiple="multiple">
<option value="1">a1</option>
<option value="2">a2</option>
<option value="4">a3</option>
</select>
</code></pre>
<p>The old way by sequence:</p>
<pre><code>for (i=0; i<data[0].fields['sales_item'].length;i++)
$('#id_deals-sales_item>option:eq(' + (data[0].fields['sales_item'][i]) + ')').prop('selected', true);
</code></pre>
<p>I was hoping to apply the same solution here with val(), But it doesn't work.</p>
<pre><code>for (i=0; i<=data[0].fields['sales_item'].length;i++)
$('#id_deals-sales_item').val(data[0].fields['sales_item'][i]);
</code></pre>
<p>Do I have to apply a different trick here? Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,666,786 | 3,666,787 |
Recording button ID's in Javascript
|
<p>I am trying to create an item selection menu, where the user is presented with multiple buttons to pick their choices. I am creating several divs with PHP.</p>
<pre><code> <div id="h1-1"><input type="button" value="h1-1" onclick="recordValue()"></div>
<div id="h1-2"><input type="button" value="h1-2" onclick="recordValue()"></div>
</code></pre>
<p>I would like to record all the values of buttons pressed and show these values via Ajax.
Then when user is done selecting and presses submit I will insert these into MSSQL database.</p>
<ul>
<li>How do I record button values to an array with Javascript?</li>
<li>How do I then show what was pressed?</li>
<li>Where could I execute some filtering of the selections (e.g. if h1-1 was pressed i do not want them to be able to select h2-1) ?</li>
</ul>
|
php javascript
|
[2, 3]
|
3,632,650 | 3,632,651 |
jQuery Functions Syntax Difference
|
<p>How does:</p>
<pre><code>(function($) {
/// code
})(jQuery)
</code></pre>
<p>differ from <code>$(document).ready(function()</code> in jquery?</p>
<p>I know what the <code>ready</code> function does. It awaits until the HTML is loaded before it starts. However, does <code>(function($)</code> do the same?</p>
|
javascript jquery
|
[3, 5]
|
319,174 | 319,175 |
jQuery .slideUp() effect running issue
|
<p>Can anybody tell me why the Effect is running so often is hovered. I mean you hover 3 times without to wait that the Effect is finished and than you can wait until the Effect has run 3 times. </p>
<pre><code> $(function() {
$('#dropdown_nav li').find('.sub_nav').hide();
$('#dropdown_nav li').hover(function() {
$(this).find('.sub_nav').slideDown(300);
}, function() {
$(this).find('.sub_nav').delay(2000).slideUp(300);
});
});
</code></pre>
<p>Here can it be tested: <a href="http://jsfiddle.net/QTGvJ/" rel="nofollow">http://jsfiddle.net/QTGvJ/</a></p>
|
javascript jquery
|
[3, 5]
|
207,200 | 207,201 |
how to store AdminId in session using 3tire
|
<p>how to store adminId in session using 3tire.</p>
|
c# asp.net
|
[0, 9]
|
280,791 | 280,792 |
How can I find wifi speed in Android and how can I display wifi speed in TextView?
|
<p>To find wifi speed I used this code:</p>
<pre><code>WifiManager wifiManager = (WifiManager)this.getSystemService(Context.WIFI_SERVICE);
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
if (wifiInfo != null) {
int linkSpeed = wifiInfo.getLinkSpeed(); //measured using WifiInfo.LINK_SPEED_UNITS
//txtSpeed.setText(linkSpeed);
}
</code></pre>
<p>I want to display the speed in my TextView. How can I do this?</p>
|
java android
|
[1, 4]
|
4,545,246 | 4,545,247 |
JQuery Getting Dynamically Created Select Value
|
<p>I have been reviewing a lot of pages about this and can't seem to figure out why this isn't working. </p>
<p>In an HTML page I am using PHP to dynamically create a dropdown box on the page like this:</p>
<pre><code>$sel = '<select "id"="userPhones">';
foreach ($user_phones as $single_phone)
{
$phoneId = $single_phone['id'];
$phoneNum = $single_phone['phone_num'];
if($single_phone['isdefault']=='1')
{
$sel.="<option id=".$phoneId." selected='selected'>".$phoneNum."</option>";
}
else
{
$sel.="<option id=".$phoneId.">".$phoneNum."</option>";
}
}
$sel .='</select>';
echo $sel;
</code></pre>
<p>I see the dropdown appear on the page without a problem and it all looks like it is working. But then later I try to use JQuery to get at the value of the dropdown to act on it by doing this:</p>
<pre><code>phone_num = $('#userPhones :selected').val();
alert(phone_num);
</code></pre>
<p>For some reason whenever I try to get at the value I am getting an alert of "undefined" and not the value of the dropdown. I am sure this is being set because I have looked at he source of the page and I have checked with Firebug that the elements exist on the page. I have tried just using the ID of the dropdown and val(), I have tried using text() but cannot seem to grab anything. Can someone please tell me what on earth is going on here? I have been racking my brains about this for a while now. </p>
|
php jquery
|
[2, 5]
|
5,585,506 | 5,585,507 |
Correct usage of Asp.Net Response.TransmitFile and Response.End()
|
<p>What is the correct usage of this code?</p>
<pre><code>httpContext.Response.AddHeader("Content-Disposition", "inline; filename=" + HttpUtility.UrlPathEncode(fileName));
httpContext.Response.ContentType = "image/png";
httpContext.Response.AddHeader("Content-Length", new FileInfo(physicalFileName).Length.ToString());
httpContext.Response.TransmitFile(physicalFileName);
httpContext.Response.Flush();
httpContext.Response.End(); //Use it or not?
</code></pre>
<p>Is it really good to use <code>.Flush()</code> and <code>.End()</code>?</p>
<p>According to <a href="http://blogs.msdn.com/b/aspnetue/archive/2010/05/25/response-end-response-close-and-how-customer-feedback-helps-us-improve-msdn-documentation.aspx" rel="nofollow">this</a> you should never ever use <code>Response.End()</code> (only in error or hacking scenarios)</p>
<p>But in some of the answers the <code>.End()</code> is reconmended...?</p>
<p>Like in <a href="http://stackoverflow.com/questions/8570269/using-response-transmitfile-to-download-file-but-also-contains-the-page-source">this</a> article.</p>
<p>So it is appropriate to use <code>Response.End</code> or not?</p>
|
c# asp.net
|
[0, 9]
|
1,073,689 | 1,073,690 |
Mono for Android WebClient Special characters
|
<p>I'm using Mono for Android (C#) and WebClient DownloadString to get source code of a HTML website, that uses special characters (č,š,ž). But when displaying the code, it shows � instead of the characters. Is there a way to show the correct characters?</p>
|
c# android
|
[0, 4]
|
3,810,069 | 3,810,070 |
close a menu with a "anywhere click"
|
<p>as u guys can see, i have a drop down menu.</p>
<p>have alot of columns, each one have a option to open the menu.</p>
<pre><code>$(".optionCont").live("click", function(){
$(".dropMenuCont").slideUp();
if($(this).next().css("display") == "none"){
$(this).next().slideDown();
}else{
$(this).next().slideUp();
}
});
</code></pre>
<p>so, my question is, how can i do the menu slideUp when i click in any place of the page ?</p>
<p>like a , document click ? </p>
<p>i visited others topics, but dont know why, this is not working, maybe i'm doing in a diferent way.</p>
<p>accept any tips in the menu coding.</p>
<p>demo: <a href="http://jsfiddle.net/CjWBQ/4/" rel="nofollow"><strong>Jsfiddle</strong></a></p>
|
javascript jquery
|
[3, 5]
|
1,897,210 | 1,897,211 |
Cant add jquery to the head dynamically and run jquery code
|
<p>I have got this code:</p>
<pre><code>function init(){
if (typeof window.jQuery !== 'function') {
var link = document.createElement('script');
link.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';
document.getElementsByTagName('head')[0].appendChild(link);
}
}
window.onload = init;
if (typeof window.jQuery === 'function') {
$(document).ready(function(){
alert(1);
});
}
</code></pre>
<p>What I am trying to do is to add jquery script link to the head if jQuery doesnt exist and then run the code. What could be best is to check whether jquery exists in the head as soon as possible and then add a link to the source. But I dont know how to achieve so?</p>
<p><strong>UPDATE:</strong>
An alternative approach would be using a function:</p>
<pre><code> function init(){
if (typeof window.jQuery !== 'function') {
var link = document.createElement('script');
link.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';
document.getElementsByTagName('head')[0].appendChild(link);
start_code();
}
else{
start_code();
}
}
window.onload = init;
function start_code(){
$(document).ready(function(){
alert(1);
});
}
</code></pre>
<p>I could basically call a function after everything is loaded.. But this doesnt work well. cause the $ is not defined error is being thrown too</p>
|
javascript jquery
|
[3, 5]
|
5,801,682 | 5,801,683 |
JQuery fadeIn fadeOut with setInterval working sporadically
|
<p>I have a bunch of images that need to rotate in and out one at a time every 2 seconds with fancy JQuery fadeIn and fadeOut. I have all the images in the HTML to pre-load them and a setInterval timer that fades the current image out, then fades the next image in. Problem is that sometimes when you are clicking or scrolling during the fade in/out process, the JS gets interrupted and the current image never disappears and the next one fades in giving you two images.</p>
<p>I get the feeling it has something to do with setInterval not running properly every 2 seconds, but are there any better ways to accomplish what I need?</p>
<p>Here's a snippet of code:</p>
<p>HTML</p>
<pre><code><a href="javascript:;">
<img id="img1" src="image1.gif" />
<img id="img2" src="image2.gif" style="display:none;" />
<img id="img3" src="image3.gif" style="display:none;" />
</a>
</code></pre>
<p>JS</p>
<pre><code>var numImages = 3;
var currentImage = 1;
imageInterval = window.setInterval("changeImage();", 2000);
function changeImage()
{
$("#img" + currentImage).fadeOut("slow", function() {
if (currentImage >= numImages)
{
currentImage = 0;
}
$("#img" + (currentImage + 1) ).fadeIn("slow", function() {
currentImage++;
});
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
166,366 | 166,367 |
facebook or twitter style load more option
|
<p>I've been trying to create a facebook or twitter like load more option as an alternative for ordinary pagination. I've been trying to create a feature without any external plugins, just using jQuery alone. The load more option works fine minus one feature, that is scrolling the newly appended div element coming to users view.. I will add the codes and a jsfiddle link to show what I am trying to get here.</p>
<p><a href="http://jsfiddle.net/xFu3M/11/" rel="nofollow">JSfiddle</a></p>
<pre><code>$("#loadMore").on("click", function(e) {
e.preventDefault();
var divCollection = number;
for (var k = 0; k < 5; k++) {
$("#loadMore").before("<div class='subDivs' id='indID1" + number + "'>" + number + "</div>");
number++;
}
alert("indID" + parseInt(divCollection));
goToByScroll("indID" + parseInt(divCollection)); // try change to indID4
});
function goToByScroll(id) {
var el = $('#' + id);
console.log(el);
var elOffs = el.offset().top;
var parOffs = el.closest('.contentBody').offset().top;
$('.contentBody').stop().animate({
scrollTop: elOffs - parOffs
}, 100);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,139,808 | 1,139,809 |
Is it possible to base 36 encode with JavaScript / jQuery?
|
<p>I'm thinking about using the encode/decode technique here (Encoding to base 36/decoding from base 36 is simple in Ruby)</p>
<p><a href="http://stackoverflow.com/questions/6338870/how-to-implement-a-short-url-like-urls-in-twitter">how to implement a short url like urls in twitter?</a></p>
<p>Idea being to track user referrals, invite URLs. I can use Rails to decode, but it there a way to encode with Javascript or jQuery?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,396,486 | 1,396,487 |
How to hide the full url of a website and only display the domain name?
|
<p>How would I hide the pages that the user is surfing and just show
him/her the domain name. E.G. www.google.com as opposed to
www.google.com/index.aspx etc...</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
3,961,440 | 3,961,441 |
Using C# we can develop application for Android and Iphone?
|
<p>Nowadays, every body speaking about Android and iPhone, I think popularity of those operation systems.</p>
|
c# iphone android
|
[0, 8, 4]
|
1,618,766 | 1,618,767 |
Android setOnClickListener(this) Error
|
<p>I have created a button in my Android application & I tried to set onclick listner to run onClick method like follows </p>
<pre><code>...
Button btn_ok;
btn_ok = (Button)findViewById(R.id.button1);
btn_ok.setOnClickListener(this);
}
public void onClick() {
EditText uN = (EditText) findViewById(R.id.EditText04);
uN.setText("Clicked!");
}
</code></pre>
<p>But Eclipse shows an error & says that "setOnClickListener" need to Cast Argument. After casting it is like this</p>
<pre><code>btn_ok.setOnClickListener((OnClickListener) this);
</code></pre>
<p>Then when I'm running the program Emulator says that "Program has stopped unexpectedly"...
How can I solve this problem ? </p>
|
java android
|
[1, 4]
|
4,194,193 | 4,194,194 |
conditionally call JavaScript function
|
<p>I have a "Pay" button where we are starting to accept credit card. I need to call a Javascript function from the server side click event. I tried with Response.Write as below but that does not trigger my function that is defined in the separate .js file. What else can I do?</p>
<pre><code> protected void btmMakePayment_Click(object sender, EventArgs e)
{
if (user selected credit card)
{
Response.Write("<script language='javascript' type='text/javascript'>OpenPayPalDialog();</script>");
}
else
{
continue with the current server side logic
}
}
</code></pre>
<p>Thank You in advance.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,793,872 | 3,793,873 |
Strange behaviour jquery
|
<p>Ok, I've seen this in some topics but haven't fixed my script.</p>
<p>I have a piece of jquery that doesn't work because of I use it to manage (validate ) a piece of html (form ) that is loaded using a jquery fucntion load() after loading the page.</p>
<p>But if I put for example an <code>alert("Something")</code> in the script outside the functions, it works.</p>
<p>I've tried putting the validation script inside these beginnings but it doesn't work...</p>
<pre><code>$(window).bind("load", function() {
$(document).ready(function () {
</code></pre>
<p>it is very strange... do have you a solution?</p>
<p>Update: working now, check the first answer's solution!</p>
|
javascript jquery
|
[3, 5]
|
4,664,228 | 4,664,229 |
Dynamically adding control to master page
|
<p>I have a problem with dynamically loading control's into master page's ContentPlaceHolder.</p>
<p>Name of the ContentPlaceHolder and path of the UserControl is loaded from db and send to this little code: </p>
<blockquote>
<p>Control c = this.Page.LoadControl(uc-path-from-db);<br>
this.Page.Master.FindControl(cph-name-from-db).Controls.Add(c);</p>
</blockquote>
<p>When I run it, I get this error:</p>
<blockquote>
<p>The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).</p>
</blockquote>
<p>What am I doing wrong?</p>
|
c# asp.net
|
[0, 9]
|
2,892,253 | 2,892,254 |
set watermark on an image with high quality
|
<p>I have a handler wich set watermark on images. The problem is the quality is not so good.
Here is the code:</p>
<pre><code> byte[] imageBytes = null;
using (Graphics G = Graphics.FromImage(ImageToWatermark))
{
using (ImageAttributes IA = new ImageAttributes())
{
ColorMatrix CM = new ColorMatrix();
CM.Matrix33 = Opacity;
IA.SetColorMatrix(CM);
G.DrawImage(Watermark, new Rectangle(WatermarkPosition, Watermark.Size), 0, 0, Watermark.Width, Watermark.Height, GraphicsUnit.Pixel, IA);
}
}
using (MemoryStream memoryStream = new MemoryStream())
{
ImageToWatermark.Save(memoryStream, GetImageFormat(context.Request.PhysicalPath));
imageBytes = memoryStream.ToArray();
}
</code></pre>
<p>How can I set the quality for the result?</p>
<p>Thank you,
Alina</p>
|
c# asp.net
|
[0, 9]
|
4,385,002 | 4,385,003 |
How to reset a list
|
<p>It might be a silly question but still i am facing problem with this.</p>
<pre><code> var eformDetailIds = [];
eformDetailIds=$("[name=eform_id]").map(function(){ return $(this).val() }).get();
</code></pre>
<p>this is the code that i have written in js function and calling this function on button click.</p>
<p>But the problem is the list eformDetailIds containing the previous values also. could you please how to set this empty list for every function call? Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
968,305 | 968,306 |
What are the limits of Python?
|
<p>I spent a few days reading about C++ and Python and I found that Python is so much simpler and easy to learn. </p>
<p>So I wonder does it really worth spending time learning it? Or should I invest that time learning C++ instead?</p>
<p>What can C++ do and Python can't ?</p>
|
c++ python
|
[6, 7]
|
2,564,095 | 2,564,096 |
load more using jquery?
|
<p>I have a div having 100 results like.</p>
<pre><code><div id="main">
<div class="sub">This is a test 1</div></br>
<div class="sub">This is a test 2</div></br>
<div class="sub">This is a test 3</div></br>
.
.
.
<div class="sub">This is a test 1oo</div></br>
</div>
</code></pre>
<p>At a time I am showing 10 results how can I add another 10 results on clicking add more button and so on.</p>
|
javascript jquery
|
[3, 5]
|
1,013,173 | 1,013,174 |
asp.net master property string, how to check in content page if string is empty
|
<p>if i have a master property string for example:</p>
<pre><code>public String SharedInfo
{
get { return (String)Session["SharedInfo"]; }
set { Session["SharedInfo"] = value; }
}
</code></pre>
<p>and a label in an content page, i check if the string is empty by doing:
if(Master.SharedInfo == null)</p>
<p>now my question is: why does if(Master.SharedInfo == "") not work, because the SharedInfo is a string right?</p>
|
c# asp.net
|
[0, 9]
|
1,577,989 | 1,577,990 |
Html returned as a response to a jQuery ajax call
|
<p>My jQuery function is making a ajax call (GET request) and it has to return HTML that I will then inject in the page in the success event.</p>
<p>What do I have to escape in the HTML to ensure there aren't any issues?</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.