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,753,004 | 2,753,005 |
Correct usage for Page.ClientScript.RegisterForEventValidation
|
<p>i have the following method in a usercontrol</p>
<pre><code> protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
Page.ClientScript.RegisterForEventValidation(DataList1.UniqueID);
if (DataList1.Items.Count > 0)
{
foreach (DataListItem item in DataList1.Items)
{
Page.ClientScript.RegisterForEventValidation(item.UniqueID);
foreach (Control ctrl in item.Controls)
{
if (ctrl is Button)
{
Button btn = ctrl as Button;
Page.ClientScript.RegisterForEventValidation(btn.UniqueID, btn.CommandArgument);
}
}
}
}
}
</code></pre>
<p>I'm trying to get the page to stop giving me the "Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page" error when a selection is made (button is clicked with databound command argument) in the Datalist. i've tried to register the event validation for the submit control, but i can't get it working.</p>
<p>Anyone had any sucess using this method? I really don't want to disable the event validation for the page.</p>
|
c# asp.net
|
[0, 9]
|
3,025,740 | 3,025,741 |
Convert JSON into uri-encoded string
|
<p>I got a JSON/javascript object which I would like to get <code>x-www-form-urlencoded</code>.</p>
<p>Something like <code>$('#myform').serialize()</code> but for objects.</p>
<p>The following object:</p>
<pre><code>{
firstName: "Jonas",
lastName: "Gauffin"
}
</code></pre>
<p>would get encoded to:</p>
<p><code>firstName=Jonas&lastName=Gauffin</code> (do note that special characters should get encoded properly)</p>
|
javascript jquery
|
[3, 5]
|
6,017,370 | 6,017,371 |
call future javascript function compatibility on all browsers?
|
<p>let say i have function like below</p>
<pre><code>function doSomethingNow(){
callSomethingInFutureNotExistNow();
}
</code></pre>
<p>at the moment doSometingNow() is created callSomethingInFutureNotExistNow() not exist yet. It will be created in the future, on firefox, this doesn't show any error on firebug. Will these kind of function compatible on all browsers without throwing errors ?</p>
|
javascript jquery
|
[3, 5]
|
442,620 | 442,621 |
I need to have 2 symbols after dot
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript">How can I format numbers as money in JavaScript?</a><br>
<a href="http://stackoverflow.com/questions/6134039/format-number-to-always-show-2-decimal-places">Format number to always show 2 decimal places</a><br>
<a href="http://stackoverflow.com/questions/8225558/how-do-i-round-to-2-decimal-places">How do I round to 2 decimal places?</a> </p>
</blockquote>
<p>In PHP I can do the following to round to 2 decimal places;</p>
<pre><code>$number = 3.45667;
$result = number_format($number, 2, '.', ''); // 3.46
</code></pre>
<p>How can I do the same in JavaScript?</p>
|
php javascript
|
[2, 3]
|
820,658 | 820,659 |
Deleting appended element with jQuery
|
<p>I'm trying to develop a simple todo-application but the elements who been created with jQuery, can't be deleted with the shortkey I've setup. The shortkey I've made works on the first element (and other elements that are on the page from the beginning) but elements that came into the DOM via jQuery, can't be deleted.</p>
<pre><code><script>
$(document).ready(function() {
$('textarea.todo').focus(function () {
$(this).elastic();
});
$('textarea.todo').focusout(function () {
$(this).animate({ height: "2em" }, 500);
$(this).scrollTop(0);
});
$('#addTodo').click(function(){
$('<textarea class="todo" rows="1"></textarea>').appendTo('#todos');
});
$('.todo').bind('keydown', 'alt+ctrl+d', function(){
$(this).fadeOut('Slow');
});
});
</script>
</head>
<body>
<div id="header">
Simple<span id="alt">TODO</span>
</div>
<div id="todos">
<textarea class="todo" rows="1"></textarea>
</div>
<div id="footer">
<div class="left"><img src="PlusSign.png" id="addTodo"/></div>
<div class="right">HELP</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,662,292 | 4,662,293 |
how to set an object into C++ from C#
|
<p>I want to configure a C++ project from C#.</p>
<p>E.g: If I have this class in C#:</p>
<pre><code>public class Person
{
public Person(){}
public string FirstName
{get; set;}
public string LastName
{get; set;}
public int Age
{get; set;}
}
</code></pre>
<p>Then I have a list of persons:</p>
<pre><code>Person per1 = new Person();
per1.FirstName = "Per1";
per1.LastName = "Last";
per1.Age = 20;
Person per2 = new Person();
per2.FirstName = "Per2";
per2.LastName = "Last2";
per2.Age = 21;
</code></pre>
<p>then I have:</p>
<pre><code>List<Person> persons = new List();
persons.Add(per1);
persons.Add(per2);
</code></pre>
<p>My question is how can I pass that '</p>
<blockquote>
<p>persons</p>
</blockquote>
<p>' list in a C++ source.</p>
<p>A sample is much appreciated!</p>
<p>Thanks in advance.</p>
|
c# c++
|
[0, 6]
|
5,728,253 | 5,728,254 |
How do I select a row's cells and get their value through JavaScript?
|
<p>I am working on the hotel reservation system and I want to select a cell from a table.</p>
<p>Given this table:</p>
<pre class="lang-none prettyprint-override"><code> Today 2/Jan/2012
Date 2/jan 3/jan 4/jan 5/jan 6/jan
room 200 ||||||||||||||||
room 201
</code></pre>
<p>Room no 200 is booked for 3 days, so no one can select this cell. But the other cell can be selected, i.e. anyone can reserve room 200 on 5 jan and 6 jan.</p>
<p>I want to create a solution with JavaScript or any other ASP control. How can I do this?</p>
|
javascript asp.net
|
[3, 9]
|
3,548,319 | 3,548,320 |
Send value on onsubmit
|
<p>I want to send <code>document.getElementById('source').value</code> onsubmit. How can i send? thanks
this value <code>document.getElementById('source').value</code> working fine. But I want to call this on submit. Because some time user could change the value.</p>
<pre><code>new AjaxUpload(btnUpload, {
action: 'upload-file.php?source='+document.getElementById('source').value+'&destination='+document.getElementById('destination').value+'&subjectarea='+document.getElementById('subjectarea').value+'&order_id='+document.getElementById('order_id').value,
name: 'uploadfile',
onSubmit: function(file, ext,source){
if (! (ext && /^(txt|pdf|doc|docx|pptx|ppt|xlsx|xls)$/.test(ext))){
// extension is not allowed
status.text('Only TXT, PDF, PPTX, PPT, XLS, XLSX, DOC or DOCX files are allowed');
return false;
}
;
status.text('Uploading...');
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,930,192 | 2,930,193 |
.height() only making DIV scrollable after window resize
|
<p>The intent of this script is to make a DIV that is 100% of the page height minus the top section.</p>
<p>Here's the page:</p>
<p><a href="http://nerdi.net/playground/kev/indexNEW.html" rel="nofollow">http://nerdi.net/playground/kev/indexNEW.html</a></p>
<p>Here it is stripped down on jsFiddle, where it appears to be working. </p>
<p><a href="http://jsfiddle.net/JVKbR/94/" rel="nofollow">http://jsfiddle.net/JVKbR/94/</a></p>
<p>For me, (on Chrome and FF) the scrollable div (.mid-col-main) only becomes scrollable upon resizing the window (Maximize, drag from corner, etc)</p>
<p>Any idea what I'm doing wrong?</p>
<p><strong>EDIT: Jasper and Davin's solution both work. Thank you.</strong></p>
|
javascript jquery
|
[3, 5]
|
4,969,275 | 4,969,276 |
Passing an HTML string to jQuery function
|
<p>I'm working on an application which retrieves some HTML code from a record in a database. That strings then gets taken and inserted inside of a specific div. Right now I'm accomplishing this by passing the variable from Java and printing it within the div in the JSP. Now I'm trying to use an external jQuery function to accomplish this task and I'm struggling with how to pass this String to the jQuery function.</p>
<p>I tried something like this:</p>
<pre><code><script>
var message = <%=message %>;
</script>
<script src="files/js.js" type="text/javascript"></script>
</code></pre>
<p>But it can't seem to interpret the var once it hits the external function (I tried using StringEscapeUtils but that didn't fix the issue). </p>
|
java javascript jquery
|
[1, 3, 5]
|
5,727,338 | 5,727,339 |
Disabling Back button of Browser on Logout click like Yahoo,Gmail etc for Security
|
<p>First, I am setting the session variable as Session["SessionId"] in the globle.asax file as below:-</p>
<pre><code>void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
string sessionId = Session.SessionID;
Session["SessionId"] = "true";
}
</code></pre>
<p>I am using this code in the page_load() event of master page:-</p>
<pre><code>Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";
if(Session["SessionId"] == null)
{
Response.Redirect("PatientLoginPage.aspx");
}
</code></pre>
<p>and using Firefox as my default brower, but it is not working in it as well as Chrome broweser correct me if i am wrong please help me...</p>
<p>Thanks in advance,</p>
<p>vaibhav D.</p>
|
c# asp.net
|
[0, 9]
|
4,546,921 | 4,546,922 |
what is the problem with itemdatabound event in listview?
|
<p>i am getting the following error during itemdataboundevent of a listview.</p>
<p><strong>Description:</strong> An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.</p>
<p><strong>Compiler Error Message:</strong> CS0030: Cannot convert type 'System.Web.UI.WebControls.ListViewItemType' to 'System.Data.DataRowView'</p>
<p><strong>Source Error:</strong></p>
<pre><code> Line 91: CheckBox chk = (CheckBox)e.Item.FindControl("chkFocusArea");
Line 92:
Line 93: System.Data.DataRowView rowView = (System.Data.DataRowView)e.Item.ItemType;
Line 94:
Line 95: }
</code></pre>
<p>my code behind for itembound event is</p>
<pre><code>protected void lvFocusArea_ItemDataBound(object sender, ListViewItemEventArgs e)
{
if (e.Item.ItemType == ListViewItemType.DataItem)
{
CheckBox chk = (CheckBox)e.Item.FindControl("chkFocusArea");
System.Data.DataRowView rowView = (System.Data.DataRowView)e.Item.ItemType;
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,912,208 | 1,912,209 |
How to create div tag rotation like polyvore.com
|
<p>Example Link: <a href="http://www.polyvore.com/cgi/app" rel="nofollow">http://www.polyvore.com/cgi/app</a></p>
|
javascript jquery
|
[3, 5]
|
510,668 | 510,669 |
Signed script to do cross-domain queries
|
<p>I read <a href="http://developer.yahoo.com/javascript/howto-proxy.html" rel="nofollow">this article</a> which said:</p>
<blockquote>
<p>Digitally sign your scripts. In Firefox you can apply a digital signature to your script and those scripts will then be considered "trusted" by the browser. Firefox will then let you make XMLHttpRequests to any domain</p>
</blockquote>
<p>I read <a href="http://www.mozilla.org/projects/security/components/signed-scripts.html" rel="nofollow">this page</a> to see how to accomplish this signed script, but it really didn't explain it all that well. Can someone show me how to go about signing my script?</p>
|
javascript jquery
|
[3, 5]
|
2,157,550 | 2,157,551 |
this code is producing an error.."System.InvalidCastException: Specified cast is not valid."
|
<pre><code>cmd1.CommandText = "SELECT distinct MbrBtch from Member where MbrStrm='"+DrpDwnStrm .SelectedItem .Text +"'";
cmd1.Connection = con;
DataTable Table1;
Table1 = new DataTable("mbr");
DataRow Row1;
DataColumn MbrBatch = new DataColumn("MbrBatch");
MbrBatch.DataType = System.Type.GetType("System.Int32");
Table1.Columns.Add(MbrBatch);
try
{
con.Open();
SqlDataReader RdrMbr = cmd1.ExecuteReader();
while (RdrMbr.Read())
{
Row1 = Table1.NewRow();
Row1["MbrBatch"] = Convert.ToInt32(RdrMbr.GetInt32(0));
Table1.Rows.Add(Row1);
}
RdrMbr.Close();
}
finally
{
con.Close();
}
DrpDwnBtch.DataSource = Table1;
this.DrpDwnBtch.DataTextField = "MbrBatch";
DrpDwnBtch.DataBind();
//here MbrBtch is numeric type attribute of sql server.
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,173,175 | 1,173,176 |
Hiding divs when clicking outside an image
|
<p>I have a webpage with several hidden divs. I have them set up so that when an image is clicked, they will display and if the image is clicked again, they hide. The problem is, I need to hide them if they're visible and any part of the page is clicked. I've searched high and low and have found some suggestions but have yet to find one that works. Can anyone help?</p>
|
javascript jquery
|
[3, 5]
|
5,146,685 | 5,146,686 |
ASP.NET dynamically insert code into head
|
<p>I'm working inside of a Web User Control (.ascx) that is going to be included in a regular web form (.aspx), but I need to be able to dynamically insert code into the head of the document from the User Control. In my Coldfusion days <cfhtmlhead> would do the trick. Is there an equivalent of this in ASP.NET or a similar hack?</p>
|
c# asp.net
|
[0, 9]
|
4,296,009 | 4,296,010 |
Which programming language to scrape data from web and do api calls at the same time?
|
<p>My project deals with scraping a lot of data from sites that don't have API or calling APIs if there is one. Using multiple threads to improve speed and work real time. Which would be the better programming language for this? I'm comfortable with Python. But, threading is an issue. Thus, thinking of using JS in node.js. Thus, which should I choose?</p>
|
javascript python
|
[3, 7]
|
2,311,252 | 2,311,253 |
Is it safe to call jQuery's resize() function to execute my own resize handler?
|
<p>I am defining a resize handler that positions some elements on the screen, like this:</p>
<pre><code>$(window).resize(function() {
// Position elements
}
</code></pre>
<p>I also want to execute this functionality when the page first loads, so I just add the following right after the above code:</p>
<pre><code>$(window).resize();
</code></pre>
<p>This works just fine. However, I'm wondering if I may trigger any side effects, harmful or not, by calling this function - I really just want to execute my own resize handler. Of course, I could do the following to make sure that I execute only my handler:</p>
<pre><code>var positionElements = function() {
// Position elements
}
$(window).resize(positionElements);
positionElements();
</code></pre>
<p>However, I'm new to JavaScript and I want to keep my code as concise as possible - this adds some boiler plate code to the mix.</p>
<p><strong>Edit:</strong> In fact, my code can be shortened even more by using chaining. Like this:</p>
<pre><code>$(window).resize(function() {
// Position elements
}).resize();
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,389,175 | 3,389,176 |
How to show the Birthdate in mm/dd/yyyy format if year is separated from it?
|
<p>I have a modalpopup inside it I have checkboxes,when I check the checkboxes and save the changes there is a dynamically created table with dynamically generated labels.I have a checkbox Birthdate inside the modal popup which shows the mm/dd only.And another checkbox below it that will show the year only, and will be visible if Birthdate checkbox is checked.
I want to show that if Birthdate checkbox is checked and the save button is clicked then insisde the dynamic table it will show the mm/dd only.And if year checkbox is checked ,and the save button is clicked, then it will show the Birthdate inside the dynamically created table as mm/dd/year.</p>
|
c# asp.net
|
[0, 9]
|
5,560,155 | 5,560,156 |
waiting until two values have changed in jquery
|
<p>I have two form fields and would like to post those values using jquery only when both have a value. I have tried this but there must be a better way. I think this way could lead to errors</p>
<pre><code>$('#RFID').change(function(e){
if($(this).val() != '' && $('#STATION_ID').val() != ''){
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,528,685 | 4,528,686 |
How to create effecient stack implementation in javascript?
|
<p>I need a good stack implementation in JS. Pref jquery</p>
<p>Please help</p>
|
javascript jquery
|
[3, 5]
|
519,337 | 519,338 |
How to restrict the TextBox to accept only one dot in decimal number in keypress event in C#
|
<p>I am developing a windows mobile application, in this i want to restrict the asp.net textbox to accept only one dot in decimal number (C#) so please suggest me how to do this.</p>
<p>Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
3,394,108 | 3,394,109 |
Casting ArrayList<SomeClass> to ArrayList<SomeInterface>
|
<p>I have 3 classes representing 3 differents things:
<code>Article</code>,
<code>Photos</code>, and
<code>Videos</code></p>
<p>All 3 things have 2 properties in common:
A <code>title</code> and and <code>image</code>.</p>
<p>I have an <code>interface</code> called <code>ImageTitleListItem</code> that the 3 classes implement.
That <code>interface</code> is just a getter/setter for <code>title</code> and <code>image</code></p>
<p>I have 3 classes that are <code>ArrayList</code>:</p>
<pre><code>Articles extends ArrayList<Article>
Photos extends ArrayList<Photo>
Videos extends ArrayList<Video>
</code></pre>
<p>I have an <code>ArrayListAdapter</code> that display a list of those <code>images</code> with there <code>title</code>.</p>
<p>The constructor of the <code>ArrayListAdapter</code> receive <code>ArrayList<ImageTitleListItem></code> as a parameter</p>
<p>When I call it :</p>
<pre><code>adapter = new ArrayListAdapter(Articles)
</code></pre>
<p>I have an error: </p>
<pre><code>The constructor ArrayListAdapter(Articles) is undefined
</code></pre>
<p>That's normal, so i tried to cast it:</p>
<pre><code>adapter = new ArrayListAdapter((ArrayList<ImageTitleListItem>)Articles)
</code></pre>
<p>Now the error is: </p>
<pre><code>Cannot cast from Articles to ArrayList<ImageTitleListItem>
</code></pre>
<p>I'm relativly new to java so there's a trick I'm missing, can somebody help me on this.</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
5,275,824 | 5,275,825 |
How to load jQuery in JS Bin
|
<p>Is it possible to run jQuery code in jsbin.com? </p>
|
javascript jquery
|
[3, 5]
|
1,614,155 | 1,614,156 |
Javascript, Jquery - break if statment
|
<p>I have this part of code:</p>
<pre><code>if(mess <= 0 || mess < -width) {
img_container.find('ul').animate({'margin-left' : mess + 'px' }, 1000);
}
</code></pre>
<p>I need this to stop working when <strong>mess</strong> is lesser the <strong>-width</strong>. How can I do this?</p>
|
javascript jquery
|
[3, 5]
|
1,758,407 | 1,758,408 |
How to make the text bold using jquery
|
<p>I have this out put.</p>
<pre><code><option value="18277">Dollar Max Hospice~Mx</option>
<option value="12979">Routine Adult Physical Exam Visit Limit</option>
<option value="12841">Is Reverse Sterilization Covered Out of Network?</option>
<option value="12918">MD CDH PPO Variables 2</option>
<option value="12917">DC CDH PPO Variables 2</option>
<option value="12833">Is Sterilization Covered No Network?</option>
<option value="12834">Is Sterilization Covered In Network</option>
</code></pre>
<p>I have a search box and button when i hit Dollar I need to bold the text in my list box. I need to itterate the list box data and make that text as bold.</p>
<p>Can any body help me out.</p>
|
javascript jquery
|
[3, 5]
|
2,204,567 | 2,204,568 |
Asp.Net, accessing variables from previous page a good approach?
|
<p>While redirecting from page to page generally i used to pass values as querystring but as you know query string is not a good approach as there are many security concerns and more over its having a maximum size is of 256 Bytes or ie length 2048 characters. So is it a good approach to access variables by setting previous page ie <code>"<%@ PreviousPageType VirtualPath="" %>"</code> and accessing previous page items</p>
<p>Please let me know, is there any other way for passing variables other than <code>Sessions</code> and is using Previous page concept a Good Approach? </p>
|
c# asp.net
|
[0, 9]
|
3,119,353 | 3,119,354 |
Handling errors in jQuery(document).ready
|
<p>I'm developing JS that is used in a web framework, and is frequently mixed in with other developers' (often error-prone) jQuery code. Unfortunately errors in their jQuery(document).ready blocks prevent mine from executing. Take the following simple sample:</p>
<pre><code><script type="text/javascript">
jQuery(document).ready(function() {
nosuchobject.fakemethod(); //intentionally cause major error
});
</script>
<script type="text/javascript">
jQuery(document).ready(function() {
alert("Hello!"); //never executed
});
</script>
</code></pre>
<p>Shouldn't the second ready block execute regardless of what happened in the previous? Is there a "safe" way to run jQuery(document).ready that will run even in the case of previous errors?</p>
<p>EDIT: I have no control/visibility over the error-prone blocks as they're written by other authors and mixed in arbitrarily.</p>
|
javascript jquery
|
[3, 5]
|
3,341,982 | 3,341,983 |
I want to bind a arraylist to grid in asp.net c#?
|
<pre><code>nsecashservice serviceofgainers = new nsecashservice();
int idd = serviceofgainers.maxID();
System.Collections.ArrayList copygrid = new System.Collections.ArrayList();
System.Collections.ArrayList grid = new System.Collections.ArrayList();
grid = serviceofgainers.getdata(idd);
copygrid = grid;
System.Collections.ArrayList losers = new System.Collections.ArrayList();
this.dataGridView1.DefaultCellStyle.BackColor = Color.Bisque;
dataGridView1.EnableHeadersVisualStyles = false;
dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Salmon;
dataGridView1.Columns.Add("Sl.No", "Sl.No");
// Console.WriteLine("column width: " + dataGridView1.Columns[0].Width);
dataGridView1.Columns.Add("scripName", "Company");
dataGridView1.Columns.Add("prevClose", "previousClose");
dataGridView1.Columns.Add("closeValue", "closeValue");
dataGridView1.Columns.Add("percentDiff", "percentDiff");
//int row = grid.Count - 1;
for (int r = 0; r <= 14; r++)
{
scripinfo inf = grid[r] as scripinfo;
//Console.WriteLine("Row count" + dataGridView1.Rows.Count);
dataGridView1.Rows.Add();
dataGridView1.Rows[r].Cells[0].Value = r + 1;
dataGridView1.Rows[r].Cells[1].Value = inf.scripName;
dataGridView1.Rows[r].Cells[1].Style.ForeColor = System.Drawing.Color.Blue;
dataGridView1.Rows[r].Cells[2].Value = Math.Round(inf.prevClose, 2);
dataGridView1.Rows[r].Cells[3].Value = Math.Round(inf.closeValue, 2);
dataGridView1.Rows[r].Cells[4].Value = Math.Round(inf.percentDiff, 2);
dataGridView1.Rows[r].Cells[4].Style.ForeColor = System.Drawing.Color.Green;
}
</code></pre>
<p>this code i have done in window application i want to change it to asp.net c#. in this i am getting a array list of 1500 rows of data containing 4 columns of data. plz help me to to change this code. </p>
|
c# asp.net
|
[0, 9]
|
1,374,242 | 1,374,243 |
Translating .htaccess to web.config
|
<p>I am hosting a php application on my virtual Windows server running IIS. </p>
<p>The person who wrote the php website for me asked me to put this piece of codes in a .htaccess:</p>
<pre><code><IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
</code></pre>
<p>But as this application is running on IIS, I need to translate this piece of codes to web.config. So could any one have experience about this, please help me to translate them into web.config?</p>
<p>Thanks in advance!</p>
|
php asp.net
|
[2, 9]
|
4,904,313 | 4,904,314 |
Why does jQuery.ready run when the page isnt ready?
|
<p>so often i put jquery document ready functions at the bottom of my html, just to have it run before all the elements of the page are loaded. i'm tired of my functions not working because resources arent finished loading on the page, jquery.ready keeps saying the elements are done loading when they arent! who wants to set a 300ms timeout just so that their functions wait a little after jquery.ready?</p>
|
javascript jquery
|
[3, 5]
|
1,725,389 | 1,725,390 |
Store additional info with button
|
<p>How can I attach additional information to a button programmatically? I can mButton.setText("new text") to change the text but I want to be able to add a few more fields so that when you click the button you can grab those extra fields and use the data. How might I do that?</p>
|
java android
|
[1, 4]
|
3,014,333 | 3,014,334 |
Working Around Closure in JQuery "ajax" Method
|
<p>I'm relatively new to javascript and although I know what's causing the bug, I'm not sure how to refactor this to make it work.</p>
<pre><code>for ( ... ) {
var variableQueryValue = i
addLink.bind('click', function() {
$.ajax({
type: 'POST',
url: '/example',
data: 'queryvalue=' + variableQueryValue,
success: function(data) {
console.log('Got into success method!');
}
});
});
}
</code></pre>
<p>So basically we are binding a click event to some element whose data attribute is dependent on some variableQueryValue that changes every iteration. Because of the closure of the bind function handler, in the ajax request it will bind an event handler that uses the same value of variableQueryValue for each iteration.</p>
<p>How can I refactor this such that the updated variableQueryValue is taken into account?</p>
<p>Thanks for any help!</p>
|
javascript jquery
|
[3, 5]
|
1,118,474 | 1,118,475 |
How to find the control of textbox inside the grid
|
<p>I am using ASP.NET and I have one <code>GridView</code> that has a <code>TextBox</code> within an editTemplate, but I am not able to find the control; whenever I try to assign the value to <code>TextBox</code> of <code>GridView</code> I'm getting a <code>NullReferenceException</code>. </p>
<p>My code is as follows:</p>
<pre><code>for (int i = 0; i < grdTransfer.Rows.Count; i++)
{
GridViewRow row = grdTransfer.Rows[i];
if (((CheckBox)row.FindControl("chkSelect")).Checked)
{
count = 1;
(row.FindControl("txtDestLocation") as TextBox).Text = txtLocation.Text;
}
}
</code></pre>
<p>Issue: <code>NullReferenceException: object reference not set to the instance of an object</code>.</p>
<p>This means I'm getting <code>null</code> whenever I try to assign the value of <code>GridView</code> <code>TextBox</code> from outside the <code>TextBox</code> at runtime. </p>
<p><em><strong>What am I doing wrong?</em></strong></p>
|
c# asp.net
|
[0, 9]
|
4,976,393 | 4,976,394 |
How to find header Control In Repeater?
|
<p>I am finding Header control in Repeater in C#</p>
<pre><code>HtmlGenericControl nameposition = null;
nameposition = (HtmlGenericControl)Repeater1.Controls[0].Controls[0].FindControl("tweet-container");
</code></pre>
<p>I am getting Error How to use it?.Aspx Code</p>
<pre><code><div id="tweet-container" runat="server"> </div>
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,875,291 | 2,875,292 |
Get part of URL using jquery
|
<p>I have been googling, a lot, and found quiet many similar issues around the www but not anything that nails my issue to the ground.</p>
<p>I have a jquery function that get the href attribute from an anchor tag, which is supposed to return this value - #SomeIDHere</p>
<p>On my development environment it works perfectly, but on production it returns the current URI + the #ID. I only need the #ID part to make the rest of the script work as intended.</p>
<p>This is how I get the href, now I only need to split the href value and get the #ID part.</p>
<pre><code>function myFunction(sender) {
var id = sender.getAttribute('href');
alert(id);
// functionallity here...
}
</code></pre>
<p>I have tried this <a href="http://stackoverflow.com/questions/4059193/jquery-href-anchor-value">solution</a> which was a brilliant start but when I tried implementing it I only got undefined values or javascript errors.</p>
<p>Some of the things I tried:</p>
<pre><code>function myFunction(sender) {
var id = sender.getAttribute('href');
var newID = $(id).search.split('#')[1]; // got an error
alert(id);
// functionallity here...
}
function myFunction(sender) {
var id = sender.getAttribute('href');
var newId = $(id).split('#')[1]; // got an error
// functionallity here...
}
function myFunction(sender) {
var id = sender.getAttribute('href');
var newId = $(sender)[0].search.split('#')[1]; // returned undefined
// functionallity here...
}
</code></pre>
<p>Any thought or ideas of how to do this? I'm kind of lost at the moment.</p>
|
javascript jquery
|
[3, 5]
|
3,415,198 | 3,415,199 |
static initialisation vs dynamic initialisation
|
<p>Why, in C++, do we prefer static initialization to dynamic initialization?
Whats the big deal?if static initialization is so performant then why do new languages like Java, C# use dynamic initialization?</p>
|
java c++
|
[1, 6]
|
1,259,474 | 1,259,475 |
Fade effect left to right on a image
|
<p>I have fade effect structure. With the following:</p>
<pre><code> <img src='firstStar.jpg' alt='star image' id='firstStar' />
var loopImages = function(){
$('#firstStar').fadeIn(1500, function(){
$('#firstStar').fadeOut(1500, loopImages);
});
}
loopImages();
</code></pre>
<p>It's working. But i want, this effect get left to right. Is it possible?</p>
|
javascript jquery
|
[3, 5]
|
4,358,765 | 4,358,766 |
Accessing email inbox through content provider
|
<p>I'm trying to access the core application email using a content provider. Is this possible?</p>
|
java android
|
[1, 4]
|
5,278,736 | 5,278,737 |
javascript jQuery - Given a comma delimited list, how to determine if a value exsits
|
<p>given a list like:</p>
<pre><code>1,3,412,51213,[email protected], blahblah, 123123123123
</code></pre>
<p>which lives inside of a input type"text" as a value:</p>
<pre><code><input type="text" value="1,3,412,51213,[email protected], blahblah, 123123123123, [email protected]" />
</code></pre>
<p>How can I determine if a value exists, like 3, or blahblah or [email protected]?</p>
<p>I tried spliting with inputval.split(',') but that only gives me arrays. Is search possible?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,891,248 | 3,891,249 |
Android Emulator: Write file to local file system?
|
<p>I am wondering if its possible to get my android application to save a file to a windows file system or is there a simple work around I can adopt?</p>
<p>I am using the android emulator to do tests and I need it to write to the local hard drive so I can do further processing on the file.</p>
<p>I hope this is possible and I appreciate any help.</p>
|
java android
|
[1, 4]
|
60,116 | 60,117 |
Maven plugin for Java code obfuscation
|
<p>Is there a maven plugin for obfuscating Java code (Java SE, Java EE or Android)?</p>
|
java android
|
[1, 4]
|
1,736,462 | 1,736,463 |
How to unpack Javascript in Python
|
<p>I would like to retrieve the contents of a javascript script instead of executing it upon requesting it. </p>
<p>EDIT: I understand that Python is not executing the javascript code. The issue is that when I request this online JS script it gets executed. I'm unable to retrieve the contents of the script. Maybe what I want is to decode the script like so <a href="http://jsunpack.jeek.org/dec/go" rel="nofollow">http://jsunpack.jeek.org/dec/go</a></p>
<p>That's what my code looks like to request the js file:</p>
<pre><code>def request(self, uri):
data = None
req = urllib2.Request(uri, data, self.header)
response = urllib2.urlopen(req)
html_text = response.read()
return html_text.decode()
</code></pre>
<p>I know approximately what the insides of the script look like but all I get after the request is issued is a 'loaded' message. My guess is that the JS code gets executed. Is there any way to just request the code? </p>
|
javascript python
|
[3, 7]
|
730,023 | 730,024 |
JS variable contains PDF or DOC File. How I can pass this file for user?
|
<p>jQuery. Inside:</p>
<pre><code>xxx.bind('submit',function() {
...
oSignedData.Content - contains decrypted PDF, DOC, JPG or other file
}
</code></pre>
<p>How I can pass this file for user?</p>
<p>When I use <code>document.getElementById('invoice_encoded_data').value = oSignedData.Content</code>
resultant file is corrupted.
Please, reply ASAP.</p>
|
javascript jquery
|
[3, 5]
|
5,997,931 | 5,997,932 |
ASP.NET C# Dynamically create table with postback button on each row
|
<p>I am trying to display a table dynamically loaded from database with dynamically created button in the first cell of each row. Each button has assigned ROW_ID value that uniquely identifies the button in one "generic" method handler.</p>
<p>As far as I can understand the only way I can do this is by loading data and displaying it & wiring-up buttons to handler during Init life-cycle phase. The problem I am facing is when this button would (for example purposes) were to call delete (or other modification) procedure in the database for that particular row I would have to do Response.End and reload the page to reflect this modification, because during PostBack handlers its already too late to re-fetch new dataset from DB and create new set of buttons and wire it to the handler. Full page reload however losses state for all controls, which is not desirable.</p>
<p>One thing to note: I am using custom-render user control to display the resultset from database (it looks like a table though). I am not using DataGridView with DataBinding.</p>
<p>Possible solution would be to use radio-button for each row and one static button in the bottom, but this is far from ideal.</p>
<p>The questions is: Whats better way to do this? Am I missing something? I find it hard to believe that ASP.NET would be this cumbersome to handle this generic use case.</p>
<p>Thanks for any possible suggestions.</p>
|
c# asp.net
|
[0, 9]
|
4,035,114 | 4,035,115 |
loading js function from another file
|
<p>i have a javascript like that</p>
<pre><code>$.fn.hasBorder = function() {
if ((this.outerWidth() - this.innerWidth() > 0) || (this.outerHeight() - this.innerHeight() > 0)){
return true;
}
else{
return false;
}
};
function removeImage(){
$(document).ready(function() {
var selectedImgsArr = [];
$("img").click(function() {
if($(this).hasBorder()) {
$(this).css("border", "");
//you can remove the id from array if you need to
}
else {
$(this).css("border", "1 px solid red");
selectedImgsArr.push($(this).attr("id")); //something like this
alert(selectedImgsArr);
}
});
</code></pre>
<p>I load this script to my page. In order to use this script</p>
<p>i wrote this</p>
<pre><code>div load="removeImage">
</code></pre>
<p>What it does not work ? </p>
|
javascript jquery
|
[3, 5]
|
2,084,553 | 2,084,554 |
Jquery dropdown active and show hide issue
|
<p>Demo Link: <a href="http://bit.ly/NRWoHw" rel="nofollow">http://bit.ly/NRWoHw</a>. Unable to add class (inpage) for anchor (Menu Item 1). When you roll out of the div containing border that div is hiding. But for (Menu Item 1) submenu should always show. It's visible only for first time you visit.</p>
|
javascript jquery
|
[3, 5]
|
4,983,832 | 4,983,833 |
How to dynamically load jQuery in a javascript function, call another function, and return that function's return value?
|
<p>I have a function which uses jQuery. I need to dynamically inject jQuery with JavaScript and have that function return that function’s return value. I would like to do something like</p>
<pre><code>(function(){
var jQueryLoaded = false;
var returnValue;
if (!window.jQuery) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://code.jquery.com/jquery-1.7.1.min.js';
script.onreadystatechange= function () {
if (this.readyState == 'loaded' || this.readyState == 'complete')
onJQueryLoaded();
};
script.onload = onJQueryLoaded;
document.getElementsByTagName('head')[0].appendChild(script);
}
else {
returnValue = myJQueryFunction();
if (typeof(returnValue) == 'undefined')
returnValue = true;
return returnValue;
}
function myJQueryFunction() {
// do something
}
function onJQueryLoaded() {
if (jQueryLoaded)
return;
jQueryLoaded = true;
var $ = jQuery;
returnValue = myJQueryFunction();
if (typeof(returnValue) == 'undefined')
returnValue = true;
}
while (typeof(returnValue) == 'undefined'); // wait until onJQueryLoaded returns
return returnValue;
})();
</code></pre>
<p>but <code>onJQueryLoaded</code> does not get called during the <code>while</code> loop.</p>
<p>Is there any way to have my base function wait until <code>onJQueryLoaded</code> gets called before returning?</p>
|
javascript jquery
|
[3, 5]
|
5,577,908 | 5,577,909 |
How do you access an asp.net code behind session object member variable in javascript?
|
<p>I have a class that handles all of my session variables in my asp.net application. Moreover, I sometimes store objects in the session variables so as to allow me to code very similar to a normal .net application.</p>
<p>For example, here is an object in a session variable:</p>
<pre><code>public cUser User
{
get { return (cUser)HttpContext.Current.Session["CurrentUser"]; }
set { HttpContext.Current.Session["CurrentUser"] = value; }
}
</code></pre>
<p>And here is the instance of MySessionClass:</p>
<pre><code> public static MySessinClass Current
{
get
{
MySessionClass session = (MySessionClass)HttpContext.Current.Session["MySessionClass"];
if (session == null) {
session = new MySessionClass();
HttpContext.Current.Session["MySessionClass"] = session;
}
return session;
}
}
</code></pre>
<p>So, in my code behind aspx page, I would just do something such as </p>
<pre><code>int userID = MySessionClass.Current.User.UserID;
</code></pre>
<p>This works great and I love it. However, I want to apply the same principle in javascript from my aspx page:</p>
<pre><code>var userID = <%=MySessionClass.Current.User.UserID%>;
</code></pre>
<p>However, when I access that webpage, I get an error saying that it does not recognize the MySessionClass object.</p>
<p>So, given the context that I am in, what would be the best way to reference that UserID variable, from the object, from the session, in javascript? Maybe my syntax to reference it is off or I am going at it the wrong way. Any help would be appreciated, thank you.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,237,096 | 1,237,097 |
Re-using a variable inside jquery.ajax
|
<p>I have the following function. This function is called with a setTimeout upon a form submit. </p>
<pre><code>function get_progress( fileID, filename) {
$.ajax({
url: filename,
type: 'HEAD',
success: function() {
$.ajax({
type: 'POST',
url: 'read_file.php',
data: 'filename=' +filename,
success: function(html) {
document.getElementById(fileID).innerHTML = html + ' <img src="images/loading.gif" />'
setInterval("get_progress(fileID,filename)",400);
}
});
}
});}
</code></pre>
<p>I am running into errors as soon as the setInterval is triggered upon success. It appears that fileID and filename are <strong><em>empty variables</em></strong>, despite having values in them before the code reaches the success state. </p>
<p>Why is this happening ? Do I have to assign them as global variables instead ? </p>
|
javascript jquery
|
[3, 5]
|
4,781,630 | 4,781,631 |
Placing a icon to display text onmouseover
|
<p>I have developed an e-commerce site. For user form input box, i want to put a question mark icon as help tool. When user takes mouse on that icon it should display the help text. I am not getting how to do it. Please someone help me in doing this .</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,363,064 | 1,363,065 |
Calling a JS fucntion on a button click refreshes the page
|
<p>I have a ASP page which has a JS function that is being called on a HTML input button click, but every time on the button click the page is reloaded and goes back to the initial state.</p>
<p>I have disabled caching both on server and client side, using these tags</p>
<pre><code><%
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
%>
</code></pre>
<p>and </p>
<pre><code><meta http-equiv="Expires" CONTENT="0"/>
<meta http-equiv="Cache-Control" CONTENT="no-cache"/>
<meta http-equiv="Pragma" CONTENT="no-cache"/>
</code></pre>
<p>I tried to figure out what is the problem which is causing the page to refresh on a button click, rather than calling a JS function, but no dice. </p>
<hr>
<p>As asked for here is the button code</p>
<pre><code> <button class="textinput" id ="reloadData" onclick="reloadData()" title="Reload Data">Refresh</button>
</code></pre>
<p>and the function called</p>
<pre><code> function reloadData() {
var DPS = document.getElementById("datepickerStart").value;
var DPE = document.getElementById("datepickerEnd").value;
var startDP = new Date(DPS);
var endDP = new Date(DPE);
var startDate = (startDP.format("isoDateTime")).replace(/:/g, '\\:');
var endDate = (endDP.format("isoDateTime")).replace(/:/g, '\\:');
layer.redraw();
}
</code></pre>
<p>I don't think this has to do something with the function called because it is just readjusting the values in the filter.</p>
|
javascript asp.net
|
[3, 9]
|
2,928,077 | 2,928,078 |
Jquery background for a dropdown list
|
<p>I have a dropdown list and I would like to make a specific item in the list have a background color of yellow and I'm not sure of the jquery code for this.</p>
<p>Here's the script:</p>
<pre><code><script language="text/Javascript">
$(function(){
$('select[id="ddlParticipants"]'.rows[2].bgColor = "#FFFF00")
})
</script>
</code></pre>
<p>and here's the dropdown list:</p>
<pre><code><asp:DropDownList ID="ddlParticipants" runat="server" Width="300px"
AutoPostBack="True"
onselectedindexchanged="ddlParticipants_SelectedIndexChanged"
meta:resourcekey="ddlParticipantsResource1">
<asp:ListItem Text="<%$ Resources:Resources, Select %>"
meta:resourcekey="ListItemResource1"></asp:ListItem>
<asp:ListItem Text="---I am a NEW participant---" Value="0"
meta:resourcekey="ListItemResource2"></asp:ListItem>
</asp:DropDownList>
</code></pre>
<p>I want to make the listitem that reads "I am New Participant" yellow.
Anyone have any ideas?</p>
<p>Thanks</p>
|
jquery asp.net
|
[5, 9]
|
1,092,699 | 1,092,700 |
creating simple cookies in asp.net c#
|
<p>My application needs to store cookies. When a user logs on I want to make sure that if the cookie does not exist create it and store value, but if it does modify it.</p>
<pre><code>if(cookieExist)
{
cookiename = "value";
}
else
{
create a new cookie
then store the value;
}
</code></pre>
<p>Thanks for any help</p>
|
c# asp.net
|
[0, 9]
|
1,039,328 | 1,039,329 |
Google map is not open properly
|
<p>I am working on a task wherein user need to search hotel in my project. In the search result list there is an option to see the map of that particular hotel. Now what happens is when i click to see the map the map doesn't load properly.
Now i have marked something else. If i close the dialogbox and click again to see the map it doesn't load but if i try to see the map without closing dialogbox then it shows map perfectly and quickly.</p>
<p>I am using jquery-ui-1.8.5.min.js for dialog box.In that google map is loaded.</p>
<p>Can anyone please guide me how to sort this issue...</p>
|
php jquery
|
[2, 5]
|
3,005,831 | 3,005,832 |
JQuery - Dynamic Text Trimming - Iphone issue
|
<p>We are implementing a mobile version of a clients website. A store page has a long list of store information with links to further info an example of one store HTML block is as follows - </p>
<pre><code> <div class="overlayContent">
<h2>Bagot Opticians</h2>
<div>
10 Library Road
<br>
Kendal, LA9 4QB
<br>
Tel: 01539 721619
</div>
<a href="store-directory/bagot-opticians.aspx">more about S., C. &amp; T. Bagot</a>
</div>
</code></pre>
<p>I have used the following code to loop through the stores and remove the 'more about part of the text: </p>
<pre><code> $(document).ready(function() {
$('.jsGrid ul li').each(function(index) {
var anchortext =($('.overlayContent a', this).text());
alert(anchortext)
$('.overlayContent a', this).html(anchortext.substring(10, anchortext.length));
});
});
</code></pre>
<p>it works fine on every device apart from an iphone - which for some reason picks up the tel number as part of the a target!? Can anyone offer a different approach or any reason for this issue?</p>
<p>Cheers
Paul</p>
|
jquery iphone
|
[5, 8]
|
456,498 | 456,499 |
Trigger an Asp.net menu click in code
|
<p>How can I trigger a Asp.net menu click in code behind? (it's a Webcontrol.Menu)</p>
<p>Ideally I don't want to do this but it is embedded in a horrible Sharepoint webpart that I am trying to add a feature to and don't have time to rewrite it.</p>
<p>The click on the menu item sets the index of a MultiView control to show one of the views. I need to trigger the whole page lifecycle again.</p>
|
c# asp.net
|
[0, 9]
|
919,187 | 919,188 |
Object doesn't support property or method 'Toggle' in IE9 and IE8
|
<p>I am getting JavaScript error like:</p>
<blockquote>
<p>Object doesn't support property or method 'Toggle'</p>
</blockquote>
<p>The <code>slideToggle</code> is working fine in IE. But i am getting this JavaScript error in IE. How can I resolve this. need to add any plugin or change anything. </p>
<pre><code> $('#divid').slideToggle("slow");
$('#divid').Toggle("slow");
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,457,286 | 5,457,287 |
XMLVM EXEC error Could not find or load main class org.xmlvm.Main
|
<p>Please excuse the ignorance if I missed anything.</p>
<p>I am trying to build the CSharp Fireworks (Visual Studio 2008) example that was included in the packaged downloaded via SVN. However, after building the project successfully, there is a post-build that takes place, but throws an error. I've listed the error below....
Also, what is the org.xmlvm.Main class and how do I use it.</p>
<p>java -classpath ./lib/bcel.jar;./lib/jakarta-regexp.jar;./lib/jdom.jar;./lib/mbel.jar;./lib/saxon9.jar;./lib/xercesImpl.jar;./ org.xmlvm.Main --java --out=./ FireWorks.exe</p>
<p><em><strong>EXEC : error : Could not find or load main class org.xmlvm.Main</em></strong>
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: </p>
<p>The command "java -classpath ./lib/bcel.jar;./lib/jakarta-regexp.jar;./lib/jdom.jar;./lib/mbel.jar;./lib/saxon9.jar;./lib/xercesImpl.jar;./ org.xmlvm.Main --java --out=./ FireWorks.exe" exited with code 1.
Done building project "FireWorks.csproj" -- FAILED. </p>
|
c# java iphone
|
[0, 1, 8]
|
366,702 | 366,703 |
How does an Interface implement functionality?
|
<p>In ASP.net Generic handler files (.ashx)
Sessions are by default not enabled, the sessions collection is empty no matter what.</p>
<p>But by simply implementing the "ISessionHandler", sessions are suddenly accessable though the sessions collection..</p>
<p>I really dont understand that, becuase in my head interfaces doesnt do anything other than telling other stuff what methods, properties etc. it needs to have.</p>
<p>Does anyone know how that works?</p>
<p>Thanks in advance :)</p>
|
c# asp.net
|
[0, 9]
|
3,442,415 | 3,442,416 |
how to access xml data in TextView in Android
|
<p>I would like to access xml data which contains Questions ans there 4 objective type answers
and I want to access them in 5 textViews which access each question and there related answer on every next button click.
its like an online examination.</p>
|
java android
|
[1, 4]
|
4,267,732 | 4,267,733 |
Jquery - Get element by id constructing the id in string
|
<p>I have a trouble using an element with jquery. I am constructing the name in a var such as:</p>
<pre><code>var myId = "#" + myGotId;
$(myId).attr("title", "changed");
</code></pre>
<p>$(myId) is returning empty. I would want to get my element by id but constructing my Id dynamically joining strings.</p>
<p><em>edit by @Pointy</em> — additional code supplied in a comment by the OP:</p>
<pre><code>var form = $('form#formDefaultValue');
$(':submit', form).click(function(event) {
event.preventDefault();
$.post(form.attr('action'), form.serialize(), function(data, status, XMLHttpRequest) {
if (status == 'success') {
$("#msgInformation").html("Your changes have been successfully saved.");
jQuery("#spanDefaultValue").attr("class", "db");
var g = indexNodeSelected;
g = g.replace("\\", "\\\\\\\\");
$('#'+ g).find("span").attr("class", "");
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,107,577 | 4,107,578 |
Android support for Torch Mode
|
<p>I've tried looking around for a particular answer to this question but can't find it. Hopefully someone here can help!</p>
<p>I'm trying to get Torch mode to work on all phones (The main problems seem to be Droid X, LG Ally etc.) but can't get it to work for everyone.</p>
<p>I set the Torch mode like this:</p>
<pre><code>mParameters = mCamera.getParameters();
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
mCamera.setParameters(mParameters);
</code></pre>
<p>This seems to work for most phones but not some. I've since implemented a check like this:</p>
<pre><code>if(mCamera.getParameters().getFlashMode() != null){ ... Set Torch ... }
else { Toast: "Unsupported Phone"; }
</code></pre>
<p>(That's the short hand version)...</p>
<p>Any ideas? Thanks a lot!</p>
|
java android
|
[1, 4]
|
4,183,094 | 4,183,095 |
How to set replace command if dynamic target in anchor tag
|
<p>This is my Html</p>
<pre><code>desc=<a target="_blank" href="http://www.taxmann.com/corporatelaws/fileopencontainer.aspx?Page=CIRNO&amp;id=27000000000000002519&amp;search=">A. P. (DIR Series) Circular No. 46 dated June 14, 2005</a>
String k = replace ( desc, "<a target=\"_blank\" href=\"http://www.taxmann.com/corporatelaws/fileopencontainer.aspx?Page=RULES&amp;id=35000000000000001648&amp;search=\">", "");
</code></pre>
<p>In desc I'm getting HTML I have replace command
I have to remove link so I'm pick data from anchor tag target is dynamic where id varies I'm able to replace linking to text whose target is </p>
<p><a href="http://www.taxmann.com/corporatelaws/fileopencontainer.aspx?Page=RULES&id=35000000000000001648&search=" rel="nofollow">http://www.taxmann.com/corporatelaws/fileopencontainer.aspx?Page=RULES&id=35000000000000001648&search=</a>\ </p>
<p>but when ever target changes, I mean to say if id changes, it doesn't replace link as text. </p>
<p>Please tell me how to get and set the id values so that if target will be dynamic we can replace link as text. I'm new to android programming.</p>
|
java android
|
[1, 4]
|
5,899,163 | 5,899,164 |
Maximum Length of a filename on Win7
|
<p>I have a web application which allows users to download a file. In doing so it asks users to provide the name to it in textbox. The upper limit of this text box is 200 characters. When i try to download a file on my Win7 system while accessing this application i do not get the whole 200 characters, instead i get only 158. I went through some articles that suggest that the max character length of a filename for Win7 is 256 characters and also the location (whole path) of the download gets accounted for in this. Also this 158 characters includes the location where this file is chosen to save, in the browser. </p>
<p>Please suggest..</p>
|
c# asp.net
|
[0, 9]
|
3,865,654 | 3,865,655 |
selecting proper value of spinner accroding to my Class
|
<p>i am making an edit Screen of my Account.</p>
<p>My account class has some properties. Now i want to show these properties and then edit them.
I Have made a spinner that shows the account type.</p>
<p>Right now i am using this code</p>
<pre><code> ArrayAdapter<CharSequence> typeOfAccountAdapter = ArrayAdapter.createFromResource(
this, R.array.typeOfAccountArray, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
typeOfAccount.setAdapter(typeOfAccountAdapter);
typeOfAccount.setOnItemSelectedListener(new OnItemSelectedListener()
{
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,int arg2, long arg3)
{
if (typeOfAccount.getSelectedItem().toString().equals("Income"))
myAccount.accountType = AccountType.kAccountTypeIncome;
else if(typeOfAccount.getSelectedItem().toString().equals("Asset"))
myAccount.accountType = AccountType.kAccountTypeAsset;
else if(typeOfAccount.getSelectedItem().toString().equals("Cash"))
myAccount.accountType = AccountType.kAccountTypeAssetCash;
else if(typeOfAccount.getSelectedItem().toString().equals("Bank"))
myAccount.accountType = AccountType.kAccountTypeAssetBank;
else if(typeOfAccount.getSelectedItem().toString().equals("Liability"))
myAccount.accountType = AccountType.kAccountTypeLiability;
else
myAccount.accountType = AccountType.kAccountTypeLiabilityOther;
setStrDeatilOfAccount();
}
</code></pre>
<p>This code actually instead of displaying <code>myAccount.accountType</code>, sets the first element of <code>spinner</code> as <code>accountType</code> of my account.</p>
<p>How can i display not the first item of array of <code>typeOfAccountArray</code> but <code>accountType</code> of <code>myAccount</code></p>
<p>And then i can edit and change it accordingly.</p>
<p>Best Regards</p>
|
java android
|
[1, 4]
|
1,329,797 | 1,329,798 |
why using eval and parsonJson together?
|
<p>I think jquery $.parseJSON can convert jsons string to JavaScript object, why someone still use eval($.parseJSON) together?</p>
|
javascript jquery
|
[3, 5]
|
4,088,860 | 4,088,861 |
Selective div hiding with IDs
|
<p>I have four columns detailing the changelogs of a game and I'd like to add an option allowing users to simply click a button and only have them view the most recent updates. Each update has it's own div. Would I be able to do so through JQuery by adding an id to these most recent update divs such as "current" and on the click of a button, remove all divs with the class "update" that do not have the "current" id?</p>
<p>Four Columns --> Each column having a most recent update looking like so :-</p>
<pre><code><div class="ch-update">
<div class="ch-update-header active">
Minecraft 1.5.1
</div>
<ul>
<li>Fixed a bunch of bugs</li>
<li>Improved performance</li>
<li>Notable: Crash on Mac OS X on "OpenGL Function Not Supported"</li>
<li>Notable: Unable to place paintings</li>
</ul>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,163,715 | 2,163,716 |
ASP.Net/Jquery find client event after Response.End()
|
<p>I have a button that is generating a PDF file on the server and then setting the response header information to the client for the file to be downloaded.</p>
<p>I would like to display a "Please Wait..." message during the postback because it could be time intensive. I'm able to display a div with no problem when the button is clicked but I'm not able to hide this div when the server returns the information.</p>
<p>Below is my server side code:</p>
<pre><code>Response.Buffer = true;
Response.Charset = "";
Response.AddHeader("content-disposition", "attachment; filename=" + Casefile.SerialCode + ".ppt");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(binaryData);
Response.Flush();
Response.End();
</code></pre>
<p>I've tried the following Jquery to hide my Div but it never gets called...</p>
<pre><code>$(document).onLoad(function ()
{
$('#divLoading').css("display", "none");
});
</code></pre>
|
jquery asp.net
|
[5, 9]
|
2,461,281 | 2,461,282 |
get a value with javascript from a element with a link/button
|
<p>When i click on the link which has the id bob i want it to close the chat but also give the value of the hidden input shown below.</p>
<pre><code><div id="chat" class="chat">
<div id="ch" class="ch">
<label id="name1">bob</label>
<a id="bob" onclick="closechat(this.id)">x</a> <--- LINK I CLICK ON
</div>
<input type="hidden" name="to" id="to" value="bob"> <-- HIDDEN VALUE I WANT
<input type="hidden" id="chatboxid" value="chatbox">
<div class="chatbox" id="chatbox" style="display: none; ">
<div class="messages"></div>
<textarea name="message" id="message" class="chatinp" rows="3" cols="27">
</textarea>
<button class="send" onclick="submitmessage()">Send</button>
</div>
</div>
</code></pre>
<p>the link i click gives me a id which is the id of a user and then it will close that chatbox
but i need the hidden value as it stores the value of a needed id so i can use <strong>JQUERY</strong>
to close it.</p>
<p>oh and this gets clones so the elements ids keep on changing everytime i clone it.</p>
|
javascript jquery
|
[3, 5]
|
3,644,196 | 3,644,197 |
Auto click input from other page
|
<p>Hy for example if on page Y (not my website) page contents next button :</p>
<pre><code><input class="xxx" type="submit" id="xxx_play" value="Play">
</code></pre>
<p>And i want with the help of php or jquery to autopress this input after x Seconds is this possible ?</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,987,261 | 2,987,262 |
Remove all other list items except the one that is clicked using jQuery
|
<p>I have list of this kind</p>
<pre><code><ul>
<li><div class="pname">Name1</div><div class="pid">ID1</div>...</li>
<li><div class="pname">Name2</div><div class="pid">ID2</div>...</li>
<li><div class="pname">Name3</div><div class="pid">ID3</div>...</li>
...
</ul>
</code></pre>
<p>If I click on any of the list item, rest all other list items should be removed. Can anyone suggest how I could do this?</p>
|
javascript jquery
|
[3, 5]
|
2,320,569 | 2,320,570 |
event for when dialog is fully loaded
|
<p>I am trying to add a jscrollpane to a dialog once the dialog is loaded. I tried using the <code>dialogopen</code> and <code>dialogfocus</code> events but it seems these trigger too early. Is there an event I can subscribe to that tells me the dialog is fully loaded and displayed and its safe to call jscrollpane? Right now i'm just adding a half second timeout but that seems hacky and shows the user a broken dialog for a half second. </p>
<p>Any other solutions would also be welcome. </p>
<pre><code>$("#diagBox").load($(this).attr('href'), function() {
$dialog.imagesLoaded(function() {
$dialog.dialog('open');
$dialog.dialog("option", "position", "center");
setTimeout(function(){
$('input, textarea').placeholder();
$('.scroller').jScrollPane();
positionElements();
},500);
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,913,256 | 5,913,257 |
Globalization/CultureInfo in Android
|
<p>It is possible to set the culture (for let's say en-Us) for the entire application? I know that in C# this is possible.</p>
<p>thanks advanced.</p>
|
java android
|
[1, 4]
|
1,648,153 | 1,648,154 |
Jquery adding and removing items from listbox
|
<p>I've created this <a href="http://jsfiddle.net/j2ctG/" rel="nofollow">fiddle</a>, it allows the user to click on either art or video, dynamically populating the the second listbox with the list associated with those selections. There are two buttons, one to add the selection to the box, the other which removes the selection.</p>
<p>What I would like to do is prevent the user from adding some that has already been added. The value of the options will all be Guids. Bonus points if you can modify the fiddle to use Guid instead of ints.</p>
<p>I've tried this:</p>
<pre><code>$.each($("#SelectBox2 option:selected"), function (i, ob) {
if (i == $(this).val()) {
} else {
inHTML += '<option value="' + $(this).val() + '">' + $(this).text() + '</option>';
}
});
</code></pre>
<p>I would like to enable the user to remove the selected items from the list.</p>
<p>Thanks,</p>
<p><strong>UPDATE</strong> Just letting you guys know what the solution is that I came up with, I got the bonus points because i added GUID to it in a really smart way :) <a href="http://jsfiddle.net/Lz5YM/" rel="nofollow">fiddle</a>, I also tidied up the html to make it look nice and neat.</p>
<p><strong>MAJOR UPDATE</strong> A massive thanks to everyone who has contributed to this question, I have taken on board everyones comments and fiddles and have generated this <strong>>></strong> <a href="http://jsfiddle.net/no1_melman/dpjQY/" rel="nofollow">fiddle</a> <strong><<</strong></p>
|
javascript jquery
|
[3, 5]
|
3,615,074 | 3,615,075 |
help with convert in java for android
|
<p>I have this code in C#, I have tried to convert him to Java for android, but I get an error in doing so. </p>
<p>This is the C# code:</p>
<pre><code>sum = "";
string Num = "123ABC";
int i, j;
string TmpOT;
for (i = 0; i < Num.Length; i++)
{
TmpOT = Num.Substring(i, 1);
j = Convert.ToChar(TmpOT);
j = (j / 10) + (j % 10);
if (j >= 10)
{
j = (j / 10) + (j % 10);
}
sum += j.ToString();
}
</code></pre>
<p>And this my attempt at converting it to Java:</p>
<pre><code>for (i = 0; i < Num.length(); i++)
{
TmpOT = Num.substring(i, 1);
j = Convert.ToChar(TmpOT);
j = (j / 10) + (j % 10);
if (j >= 10)
{
j = (j / 10) + (j % 10);-
}
Sum += String.valueOf(j);
}
</code></pre>
<p>the error is in line 5 - convert to char</p>
|
c# java android
|
[0, 1, 4]
|
4,705,549 | 4,705,550 |
how to add text on 5 span that uses same id
|
<p>How do i add a text to all 5 spans that share the same id.</p>
<p>the html goes:</p>
<pre><code><div class="body">
<form>
<span id = "test" ></span>
<span id = "test" ></span>
<span id = "test" ></span>
<span id = "test" ></span>
<span id = "test" ></span>
</form>
</div>
</code></pre>
<p>The js:</p>
<pre><code>function check_aff_payment(elem){
$(elem).find('#test').each(function(){
$("#test").text("*");
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,058,429 | 3,058,430 |
replacing php form with new content on submit using jquery
|
<p>I have a poll with the following action</p>
<pre><code>echo("\t<form class=\"vote\" method=\"post\" action=\"" . $url . "vote.php\">\r\n");
</code></pre>
<p>vote.php calls several validating functions and finally displays the poll results</p>
<p>What I want is when the submit button is pressed, using jQuery, call vote.php and display the vote result replacing the poll.</p>
<p>Thanks in advance.</p>
|
php jquery
|
[2, 5]
|
3,259,809 | 3,259,810 |
need a beginners android project to work on
|
<p>I have an itch to do development on android. I know some JAVA (just learned it) and I want to develop a simple android app for my phone or for an android tablet that I have (simple Chinese 7" tablet that I purchased off eBay).</p>
<p>Is there a simple tutorial that I can follow that will get me up to speed?</p>
|
java android
|
[1, 4]
|
2,182,475 | 2,182,476 |
Passing a textbox value to javascript on key up function
|
<p>Here i have passed the text control to the java script function but i just want to pass the value of the text box to the java script function instead on onkeyup. </p>
<pre><code>function Changed(textControl) {
var _txtEmpName = document.getElementById('<%=txtEmpName.ClientID%>');
var _EnteredString = _txtEmpName.value;
<asp:TextBox
ID="txtEmpName" runat="server" onkeyup="javascript: Changed( this );"></asp:TextBox>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
2,533,560 | 2,533,561 |
capture tabpage close event
|
<p>i'm using this control <a href="http://www.codeproject.com/KB/tabs/NewCustomTabControl.aspx" rel="nofollow">http://www.codeproject.com/KB/tabs/NewCustomTabControl.aspx</a>, the one with the close red X ( like chrome ) on every tabs.
I need in my project to capture if a tab is close by the red X.. How can I do it?
Thx</p>
|
c# asp.net
|
[0, 9]
|
5,830,039 | 5,830,040 |
Adding To Calendar Date ... Not accurate?
|
<p>Can anyone please help.
I am geting current date from Calendar.
I then would like to set a string to a new date by adding number of months..
When i use the following code it works when i add 12 months to date,
But when i try to add 1 month, then next date is January (+2 Months)
When i try to add 3 months, next date is April.
6 months, next date is October 2013 etc....
When trying to add 24, 36 or 48 Months it almost works but is 1 month early.
There doesn't seem to be a pattern to how the date is changing</p>
<pre><code>//Get Current date and set as text
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, Retest); // Months to Date
int day = c.get(Calendar.DATE);
int month = c.get(Calendar.MONTH);
int year = c.get(Calendar.YEAR);
if (month<=9) { MONTH$ = "0"+month ;}
else {MONTH$ = ""+month; } //Set month to MM
NextTest$ = ""+day+"/"+MONTH$+"/"+year; //Put date ints into string DD/MM/YYYY
Toast.makeText(this, "Re-Test Due.. "+NextTest$, Toast.LENGTH_SHORT).show();
</code></pre>
|
java android
|
[1, 4]
|
2,185,171 | 2,185,172 |
Javascript function call to ASP.NET
|
<p>My Javascript function calling a sever side callback function.
This is working fine when I give alert(). If I comment alert() then the browser throw a warning ..</p>
<p>My function is </p>
<pre><code> function callMe(){
var input = 'input parameter list';
var val= <%=gridCtrlUsers.ClientID%>.callbackControl.Callback(input);
// If I comment this alert ,it would throw a browser warning.
alert(val) // This prints true or false
}
</code></pre>
<p>Could anyone please help me ?</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
1,556,288 | 1,556,289 |
Is it OK to create multiple threadpools (ExecutorService)?
|
<p>I created multiple ExecutorService instances in my code, usually each UI page has one ExecutorService instance. Each ExecutorService instance will execute some http get request threads.</p>
<pre><code>private ExecutorService m_threadPool = Executors.newCachedThreadPool();
</code></pre>
<p>Is it OK to do that?</p>
<p>The problem I met is that sometimes the http get requests got response code -1 from HttpURLConnection getResponseCode() call. I don't know whether it is caused by multiple threadpool instances.</p>
<p>Thanks. </p>
|
java android
|
[1, 4]
|
4,217,383 | 4,217,384 |
asp.net page "page is loading"
|
<p>How can I display the circular swirl image, that is usually seen in asp.net pages, while a page is loading (retrieving data etc)?</p>
|
c# asp.net
|
[0, 9]
|
208,916 | 208,917 |
How can I tell if a variable is wrapped in jQuery or not?
|
<p>I have a function that has the signature of:</p>
<pre><code>function(id,target){
//do stuff
}
</code></pre>
<p>The target parameter is assumed to be a jQuery wrapped object however it is possible that it could be a dom element in which case I'd like to wrap it in jQuery before I do operations on it. How can I test the target variable for jQuery? </p>
|
javascript jquery
|
[3, 5]
|
3,833,996 | 3,833,997 |
Launch app from dialer
|
<p>This is what I have so far but nothing happens when I input this combination in dialer</p>
<pre><code>public class DialReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, final Intent intent) {
if (intent.getAction().equals(android.content.Intent.ACTION_NEW_OUTGOING_CALL)) {
String phoneNumber = intent.getExtras().getString( android.content.Intent.EXTRA_PHONE_NUMBER );
if(phoneNumber.equals("*#588637#")) {
Intent intent1 = new Intent(context , Activity.class);
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
context.startActivity(intent1);
}
}
}
}
</code></pre>
<p>and in androidmanifest</p>
<pre><code> <receiver
android:name=".receiver.DialReceiver"
android:exported="true"
android:process=":background"
tools:ignore="ExportedReceiver" >
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
</code></pre>
|
java android
|
[1, 4]
|
3,314,903 | 3,314,904 |
How to add a background theme and/or background wallpaper to my app?
|
<p>How to add a background theme and/or background wallpaper to my app? Right now my app background is plane.</p>
|
java android
|
[1, 4]
|
1,069,111 | 1,069,112 |
C# ASP.NET Korzh Query Builder Custom Value Editor
|
<p>I would like to find out from someone if they have worked with <a href="http://devtools.korzh.com/" rel="nofollow">Korzh Query Builder</a> before.</p>
<p>If so, have you tried implementing a Custom Value Editor, and if so, how did you do this, and if possible do you have any links/documentation.</p>
<p>The provided exaples/documentation is a bit shoddy.</p>
<p>I have spent some time trying to figure this out, as the List examples are very slow once the number of items breach the 1000+ mark.</p>
<p>Any help/articles/links in this regrds will be greatly appreciated.</p>
|
c# asp.net
|
[0, 9]
|
4,526,475 | 4,526,476 |
Why do I get syntax errors when constructing selectors
|
<p>This is follow up question.</p>
<p>The first selector which is fully typed out finds the value all the others give a syntax error even though they "look" identical.</p>
<pre><code> $(".smoothie").on("mouseover", function(event) {
// .. other code
// first
value = $(".row_2.tuesday .e_1.current_Status .smoothie_Text").attr("value");
alert(value);
// second
selector = "\'.row_2.tuesday .e_1.current_Status .smoothie_Text\'";
alert(selector);
value = $(selector).attr("value");
//third
value = $("\"." + row_Classes[0] + "." + row_Classes[1] + " ." + container_Classes[0] + "." + container_Classes[1] + " .smoothie_Text\"").attr("value");
alert(value);
//.. other code
}).svg({loadURL: '../_public/_icons/smoothie.svg'});
</code></pre>
<p>Could some one please advise what I am doing wrong.</p>
<p><strong>Edit</strong></p>
<p>Error from console is:</p>
<blockquote>
<p>Error: Syntax error, unrecognized expression: ' [Break On This Error]</p>
<p>throw new Error( "Syntax error, unrecognized expression: " + msg );</p>
</blockquote>
<p>Which we know from yesterdays enquiries is from sizzle.</p>
|
javascript jquery
|
[3, 5]
|
5,282,128 | 5,282,129 |
Determine if Link is valid upon user clicking on it
|
<p>I offer a widget where a user can store their links that they have created.</p>
<p>So in other words They:</p>
<ol>
<li>Click Add Link</li>
<li>Modal Pops up and they enter information: Link Title, Link URL, Order</li>
<li>Saves that to the DB via AJAX and then refreshes the widget to display all of the users links they have created.</li>
</ol>
<p>What I would like do is when the user clicks on their link, determine if the link exists(Could be not on this domain so I can see a foreseeable issue w/ AJAX) if it does then proceed with normal Open new Window and send them on their merry way. </p>
<p>However if not I would like to generate a Growl Like message that says something like.</p>
<blockquote>
<p>I'm sorry that Link Does not exist,
please verify your link.</p>
</blockquote>
<p>I basically need the method for validating the links existence on a client side basis. Is this even possible ?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,877,809 | 1,877,810 |
I need PDF file print in server side
|
<p>I need PDF file print in to server side using asp.net C# code,
If is possible?</p>
<p>If is it possible mean how to print the PDF file in server side</p>
|
c# asp.net
|
[0, 9]
|
2,003,562 | 2,003,563 |
Passing data between PHP webpages from a dynamically generated list
|
<p>I have a PHP code which generates a dynamic list inside a form like the following, note that the list is built dynamically from database:</p>
<pre><code>echo '<form name="List" action="checkList.php" method="post">';
while($rows=mysqli_fetch_array($sql))
{
echo "<input type='password' name='code' id='code'>";
echo "<input type='hidden' name='SessionID' id='SessionID' value='$rows[0]' />";
echo "<input type='submit' value='Take Survey'>";
}
</code></pre>
<p>What I need is to POST the data corresponding to the user choice when he clicks on the button for that row to another page.
If we use hyperlinks with query strings there will be no problem as I'll receive the data from the other page using a GET request and the hyperlinks would be static when showed to the user.
Also I need to obtain the user input from a textbox which is only possible with POST request.</p>
<p>Simply from the other page (checkList.php) I need these data for further processing:</p>
<pre><code>$SessionID=$_POST['SessionID'];
$Code=$_POST['code'];
</code></pre>
<p>As I have a while loop that generates the fields, I always receive the last entry form the database and not the one corresponding to the line (row) that the user chosed from the LIST.</p>
|
php javascript jquery
|
[2, 3, 5]
|
376,316 | 376,317 |
Animate OnComplete firing too early
|
<p>I'm implementing a progress bar (for timing a background task, I already know the exact time it will take) - but I'm having trouble with the oncomplete event firing early.</p>
<pre><code>$("#go").on("click", function(event){
event.preventDefault();
$('#report-loader .bar').animate({
width: 500
},
{
easing: 'linear',
duration: 500,
complete: function() {
alert('complete');
}
});
});
</code></pre>
<p>
</p>
<p>Here's a JSFiddle that shows an example of what I mean:
<a href="http://jsfiddle.net/ezE8b/1/" rel="nofollow">http://jsfiddle.net/ezE8b/1/</a></p>
|
javascript jquery
|
[3, 5]
|
415,442 | 415,443 |
Sum of numeric field checkboxes in gridview
|
<p>I am having difficulties in assigning double value (for example 124.00) of label text in asp.net. This label is in content page of .net master page.</p>
<p>But I am having the following two problems:</p>
<pre><code><script type="text/javascript">
var totalAmount = 0; //Defined global variable;
function addval(vals) //I am passing vals(Double from sever side)
{
totalAmount = totalAmount + vals;
(document.getElementsByTagName("<%= lblCurrentProductTotal.ClientID %>")).value= totalAmount.toString();
}
</script>
</code></pre>
<ul>
<li><p>Each time "clickCh" is called; this sets the <code>totalAmount</code> (a global variable) with the parameter passed. It's like if I pass <code>145</code> first time it assigns as <code>"0145"</code> and second time if I pass <code>156</code> the totalAmount becomes <code>"0145156"</code> as I am expecting it to add as <code>145+156=301</code>.</p></li>
<li><p>It's not assigning the value to the label "lblCurrentProductTotal"
Please let me know if i am missing something.</p></li>
</ul>
<p>Thanks in advance!</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
769,935 | 769,936 |
PHP session variable is retrieved in Javascript but becomes undefined
|
<p>I have two session variables that I retrieve in a Javascript code. This is how the code is set up:</p>
<pre><code><html>
<head>
</head>
<body>
<p><?php echo $_SESSION['userid'] ?></p> --> This works and value is shown
<p><?php echo $_SESSION['accesstoken'] ?></p> --> Value is also shown
<script type="text/javascript">
var userid = <?php echo $_SESSION['userid'] ?>;
var token = <?php echo $_SESSION['accesstoken'] ?>;
alert(userid); --> this works and shows pop up with value
alert(token); --> this doesnt work and is undefined
</script>
</body>
</html>
</code></pre>
<p>This is the value of userid: 551234131</p>
<p>This is the value of my token:
AAADAq39fEZA0BAAVJyvfZAiu1kIcaHG4SFVzuBWl3hXfC9W0g26JaqXwZAHuNdIhh2eFDkwyopunCsZCCW3jZADT8DQBjZCAdRTC5PkgtN4wZDZD</p>
<p>Before the token value is stored in the session variable it is actually held inside another javascript variable without any problem (i.e I can call that variable with alert() and the token is shown).</p>
<p>So transfering this value FROM javascript TO session variable = no problem.
But transfering the same value FROM session variable TO Javascript = doesnt work.</p>
<p>At first I thought there was a problem with datatypes so I tried casting it to a string value but it doesnt work. Any idea on what could cause this situation?</p>
|
php javascript
|
[2, 3]
|
5,475,577 | 5,475,578 |
jQuery find not working
|
<p>This is my HTML:</p>
<pre><code> <p class="first">blah blah <a href="" class="more">read more</a></p>
<div class="read_more">
<p>more text</p>
</div>
</code></pre>
<p>And javascript:</p>
<pre><code>$(document).ready(function(){
$('a.more').click(function(){
$(this).find('.read_more').slideDown();
return false;
});
});
</code></pre>
<p>Doesn't seem to do anything (read_more is set to display: none) any ideas?</p>
|
javascript jquery
|
[3, 5]
|
5,227,109 | 5,227,110 |
What is the fastest way to work with ajax request?
|
<p>I am a little bit confused about what is the fastest and the friendly way with the server to request POST or GET from server by AJAX, is it jQuery (<code>$.load()</code>, <code>$.get()</code>, <code>$.post()</code>, <code>$.ajax()</code>) or Javascript like XMLHttpRequest? </p>
<p>I need to make a function or class to use in my project to call request from server via AJAX, but I don't know what is the faster and more friendly with the server jQuery or Javascript.</p>
|
javascript jquery
|
[3, 5]
|
3,297,896 | 3,297,897 |
Invoke a function after right click paste in jQuery
|
<p>I know we can use bind paste event as below:</p>
<pre><code>$('#id').bind('paste', function(e) {
alert('pasting!')
});
</code></pre>
<p>But the problem is, that it will call before the pasted text paste. I want a function to be triggered <em>after the</em> right click -> paste text pasted on the input field, so that I can access the pasted value inside the event handler function.</p>
<p><code>.change()</code> event also doesn't help. Currently I use <code>.keyup()</code> event, because I need to show the remaining characters count while typing in that input field.</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.