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 |
---|---|---|---|---|---|
3,496,588 | 3,496,589 |
jQuery create and remove <div> by click
|
<p>Hi I try to wirte a function, which enables the user to create a when he clicks on a certain area of the site, and when he clicks on that created div again, it gets deleted. Somehow I can only create divs and when I click them, a new one is created instead removing of the clicked one. I also implemented a function in which the user can determain if he wants to create a div or delete a div.</p>
<pre><code><!--changed #button to #conten-->
<div id='content'></div>
<button id='btn'></button>
var i = 0;
var remove = false;
$('#content').click(function(e) {
$('<div></div>').attr({
'id' : i
}).addClass('circle').css({
'top' : e.pageY - 20,
'left' : e.pageX - 20
}).appendTo('#button');
i++;
});
$('.circle').click(function (){
if(remove == true){
$(this).remove();
}
else{
//just to see if it was clicked
$(this).css({'background-color': 'red'});
}
});
$('#btn').toggle(function() {
$('#btn').text('add');
remove = true;
}, function() {
$('#btn').text('remove');
remove = false;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
452,224 | 452,225 |
Check the time stored in the DB, then make sure its 15 min later before running a update task
|
<p>I would like to stop people from constantly syncing/updating items in the DB as this could cause potential problems. I have a time the last sync/update occured which is stored in the DB. What I need to do is disable the user from initiating another update/sync until 15 minutes has passed since the last update/sync.</p>
<p>How would i go about doing this?</p>
<p>Update: for some reason i am getting the error "A new expression requires (), [], or {} after type" on DateTime lastUpdate. Any ideas why this could be?</p>
<pre><code> DataDataContext dc = new DataDataContext();
DateTime lastUpdate = from t in dc.Settings
where t.id == 1
select t.lastSync;
if ((DateTime.Now - lastUpdate).TotalMinutes >= 15)
{
}
else { }
</code></pre>
<p>Update: Sorted, i missed off the (); of the datacontext!! <em>facepalm</em></p>
<p>Final Update: All fixed and working! Many thanks for all your help, for the ones who think this "smells fishy" or "is bad" then here is what i did!!</p>
<pre><code>DateTime lastUpdate = (from t in dc.Settings
where t.id == 1
select t.lastSync).Single();
if ((DateTime.Now - lastUpdate).TotalMinutes >= 15)
{
syncbuttons.Visible = false;
}
else { syncbuttons.Visible = true; }
</code></pre>
<p>Now please explain what is so suspect about what i am trying to do? Stopping users from hammering a database? What if i have 30 users attempting to update/sync. Would not be that good would it!</p>
|
c# asp.net
|
[0, 9]
|
764,627 | 764,628 |
How to create simple div with transparent rest of site?
|
<p>How to create simple div with transparent rest of site (This div will be show after click in link or other div)</p>
<p>Here exemple:</p>
<p><img src="http://i.stack.imgur.com/JroNb.jpg" alt="enter image description here"></p>
|
javascript jquery
|
[3, 5]
|
2,003,285 | 2,003,286 |
"state information is invalid for this page" error
|
<p>I have an error comes up in aspx page:</p>
<p>The state information is invalid for this page and might be corrupted.</p>
<p>What would be the problem?</p>
|
c# asp.net
|
[0, 9]
|
1,814,974 | 1,814,975 |
Checking something isEmpty in Javascript?
|
<p>How can I check if a variable is empty in Javascript? Sorry for the stupid question, but I'm a newbie in Javascript!</p>
<pre><code>if(response.photo) is empty {
do something
else {
do something else
}
</code></pre>
<p><code>response.photo</code> was from JSON, and it could be empty sometimes, empty data cells! I want to check if it's empty.</p>
|
javascript jquery
|
[3, 5]
|
1,789,320 | 1,789,321 |
how to make code execute after Response.end
|
<p>My code is like this</p>
<pre><code>HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" + "name" + ".pdf");
HttpContext.Current.Response.TransmitFile("~/media/pdf/name.pdf");
HttpContext.Current.Response.End();
if (FileExists("/media/pdf/name.pdf"))
{
System.IO.File.Delete("D:/Projects/09-05-2013/httpdocs/media/pdf/name.pdf");
}
</code></pre>
<p>Here I want to download name.pdf in the browser, and after the download I want o delete that file.But the code execution stops at </p>
<pre><code>HttpContext.Current.Response.End();
</code></pre>
<p>no code after that line is executed.so my delete function is not working.Is there any work around for this issue?</p>
|
c# asp.net
|
[0, 9]
|
3,672,437 | 3,672,438 |
How do get a parent node without having a starting reference point?
|
<p>I want to provide a method for my web app that allows a user to call my function anywhere within his code (inside script tags) that will display a fade-in/fade-out message. What I don't know how to do is determine where I am at in the DOM without having a starting reference point.</p>
<p>Function:</p>
<pre><code>function displayMessage(message) {
// Display a notification if the submission is successful.
$('<div class="save-alert">' + message + '</div>')
.insertAfter($('')) // Do not know how to know where to put the message.
.fadeIn('slow')
.animate({ opacity: 1.0 }, 2000)
.fadeOut('slow', function () {
$(this).remove();
});
}
</code></pre>
<p>The HTML:</p>
<pre><code><!-- Some HTML -->
<div>
<script type="text/javascript">
displayMessage("My message.");
</script>
</div>
<!-- Some more HTML. -->
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,471,889 | 3,471,890 |
ProgressDialog working in thread on android
|
<p>I have a little problem, I hope U can help me;)</p>
<p>Trouble is, that ProgressDialog show only after loading run(), but I need to show it on start and showing it while loading some data. I put: "dialog = ProgressDialog.show(CategoriesListActivity.this,"Working...","Loading data", true);" in method run(), but the same. I print in Log.i() some info (int i++) and put title of ProgressDialog. Method work correctly, but don't show ProgressDialog. I have read some info that some thread block another thread (my created), that's why doesn't show progressDialog, but can't do anything. Thx.</p>
<pre><code> public void run() {
/** getting there long execution **/
handler.sendEmptyMessage(0);
}
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
// stop and hide dialog
dialog.dismiss();
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_
dialog = ProgressDialog.show(CategoriesListActivity.this, "Working...",
"Loading data", true);
// start new thread where get long time execution
Thread thread = new Thread(this);
thread.start();
//wait while data is loading, 'cause I need use variable from calculation
// in "EfficientAdapter" later
try {
thread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
ListView l1 = (ListView) findViewById(R.id.list);
l1.setAdapter(new EfficientAdapter(this));
}
</code></pre>
|
java android
|
[1, 4]
|
799,092 | 799,093 |
jQuery: fadeToggle() not change text of link Show / Hide
|
<p>I have a problem with fade toggle, It works when the div is visible to start with and link "Show QR" change to "Hide QR".
Link "Hide QR" should be clicked and div hidden but link of text not change to "Show QR"</p>
<p>html:</p>
<pre><code><a class="emotTab" id="qrshow" href="javascript:void(0);">Show QR</a>
<div id="div_showqr">Content.....</div>
</code></pre>
<p>javasctipt :</p>
<pre><code>$("#qrshow").click(function(){
$("#div_showqr").fadeToggle('slow');
$('#qrshow').text($('#div_showqr').is(':visible')? 'Hide QR' : 'Show QR');
$('#qrshow').text($('#div_showqr').is('display:none')? 'Show QR' : 'Hide QR');
});
</code></pre>
<p>sorry,, my english is bad :(</p>
|
javascript jquery
|
[3, 5]
|
3,472,305 | 3,472,306 |
Remove all the 'tr' if the any of the 'td' does not have given text
|
<p>I have a table with many rows . first row is the header.</p>
<p>i want to delete all the rows if any of its td does not have given text.</p>
<pre><code><tr>
<td id="1" class="links">Madia</td>
<td id="" class="edit_client" >Press</td>
</tr>
<tr>
<td id="2" class="td_link" >Nagara </td>
<td class="td_link" id="11" class="edit_client">KR Pura</td>
</tr>
</code></pre>
<p>I want to delete all the tr , if any of its td does not have given text say "me hussy".</p>
<pre><code> $('tr').each(function () {
});
</code></pre>
<p>i do not want delete first row because its header. so function should check from second row onwards. </p>
|
javascript jquery
|
[3, 5]
|
4,031,068 | 4,031,069 |
is it possible to UnZip file in android by code?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1705844/what-is-the-best-way-to-extract-a-zip-file-using-java">What is the best way to extract a zip file using java</a> </p>
</blockquote>
<p>I have a zip file that I transfered to Android. Is it possible to unzip (decompress) this file in Android with Java?</p>
|
java android
|
[1, 4]
|
1,999,620 | 1,999,621 |
Compiling android .apk by java code
|
<p>I would like to create a java app that actually programaticlly compiles a differnt android project - Meaning i'd like to create .apk files by code. How would i go about this??? Is this feasible?</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
5,682,672 | 5,682,673 |
Javascript RegExp Object
|
<p>I use this function below to quickly find an item in a table<br>
My problem is that this function only searches for text that contains the search string in the given table<br>
I have been trying my best to modify it to match only the text that begins with the search string but not working.</p>
<pre><code>function searchTable(inputVal)
{
var table = $('#supplier_table_body');
table.find('tr').each(function(index, row)
{
var allCells = $(row).find('td');
if(allCells.length > 0)
{
var found = false;
allCells.each(function(index, td)
{
var regExp = new RegExp(inputVal, '^i');
if(regExp.test($(td).text()))
{
found = true;
return false;
}
});
if(found == true)$(row).show();else $(row).hide();
}
});
}
</code></pre>
<p>Here is my jquery</p>
<pre><code> $('#itemname').keyup(function()
{
searchTable($(this).val());
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,512,330 | 1,512,331 |
Javascript , loading progress bar before site loads
|
<p>I want to make a progress bar for a GUI site that I am making and I need a bit of code in javascript to detect if the site is loading and how many elements/images have loaded and has the site fully loaded.
I have the progress bar made with css and I dont know how I can turn on/of elements in js.</p>
<p>How can I accomplish this in js or by using Jquery ?</p>
|
javascript jquery
|
[3, 5]
|
2,440,869 | 2,440,870 |
Not Applicable for the Arguments
|
<p>I'm trying to show a progress message when a preference is selected:</p>
<pre><code> Preference prefLocation = (Preference) findPreference("location");
prefLocation.setOnPreferenceClickListener(new OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
ProgressDialog pDialog = ProgressDialog.show(this, "Location" , "Finding location...", true);
return true;
}
});
</code></pre>
<p>However I'm getting an error in Eclipse: </p>
<pre><code>The method show(Context, CharSequence, CharSequence, boolean) in the type ProgressDialog is not applicable for the arguments (new Preference.OnPreferenceClickListener(){}, String, String, boolean)
</code></pre>
<p>However, when I execute the line before the setOnPreferenceClickListener, it compiles fine!</p>
<p>I'm probably revealing my severe inexperience in Java, but would appreate a clue!</p>
|
java android
|
[1, 4]
|
3,069,606 | 3,069,607 |
loop not iterating through entire arraylist
|
<p>I'm having a problem where I am trying to iterate through an arraylist which stores restaurant objects but the loop only goes through 3 of the five elements.</p>
<p>I created a test method to illustrate:</p>
<pre><code>public void testLoop() {
ArrayList<Eatery> test = new ArrayList<Eatery>();
test = eateriesListDefault;
for(Eatery e : test) {
MyLog.e(TAG, "Name: " + e.getName());
}
for (int i = 0; i < eateriesListDefault.size(); i++) {
MyLog.e(TAG, "Name " + test.get(i).getName());
test.remove(i);
}
for(Eatery e : test) {
MyLog.e(TAG, "Name " + e.getName());
}
}
</code></pre>
<p>Here test will have 5 eatery objects in it. The first loop succesfully prints 5 of 5 names.
The second loop only removes 3 of the eateries and therefore the last loop prints two names.</p>
<p>I have tried using </p>
<pre><code>for(Eatery e : eateriesListDefault) {
MyLog.e(TAG, "Name: " + e.getName());
test.remove(e);
}
</code></pre>
<p>in place of the second loop, however I get a concurrent access error.</p>
<p>Does anyone know what I am doing wrong?</p>
|
java android
|
[1, 4]
|
2,254,748 | 2,254,749 |
Java solution for C++ style compiler directive
|
<p>I have a Java array:</p>
<pre><code> String[] myArray = {"1", "2"};
</code></pre>
<p>Depending on a condition that is known at compile time I would like to assign different values:</p>
<pre><code> String[] myArray = {"A", "B", "C"};
</code></pre>
<p>In C++ I would use something like </p>
<pre><code>#ifdef ABC
// ABC stuff here
#else
// 123 stuff here
#endif
</code></pre>
<p>but what to do in Java?</p>
|
java c++
|
[1, 6]
|
945,869 | 945,870 |
Accessing value from the controls within a dynamically loaded web user control (asp.net c#)
|
<p>I have created a web user control (MemberDetails.ascx) which is loaded dynamically on a page (Member.aspx) for my website. The control has some TextBoxes. I want to store the values inputted by a user in these TextBoxes to a database on the click event of a button that is on the Member.aspx page (i.e. not a part of user control).</p>
<p>I'll use a small code for example.</p>
<p>Member.ascx page:</p>
<pre><code><%@ Control Language="C#" AutoEventWireup="true" CodeFile="MemberDetails.ascx.cs" Inherits="Users_MemberDetails" %>
<div align="center">
<table runat="server" align="center" bordercolor="Black" id="tbl1">
<tr>
<td>First Name:</td><td><asp:TextBox ID="txtFname" runat="server" /></td>
</tr>
<tr>
<td>Last Name:</td><td><asp:TextBox ID="txtLname" runat="server" /></td>
</tr>
</table>
</div>
</code></pre>
<p>Member.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 Users_Booking : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
UserControl Memberuc;
Memberuc = (UserControl)LoadControl("MemberDetails.ascx");
Memberuc.ID = "Memberuc1";
PlaceHolder1.Controls.Add(Memberuc);
}
protected void btnSave_Click(object sender, EventArgs e)
{
/*Code for saving the input to a database*/
}
}
</code></pre>
<p>I have tried several methods (using properties and FindControl etc.) to do it using suggestions on various forums, but nothing worked for me. Please post the required code.
Thanks.</p>
|
c# asp.net
|
[0, 9]
|
4,376,571 | 4,376,572 |
Android program writes to emulator but not phone
|
<p>I am trying to write an Android program to accept input and then write the data to a file on the internal storage of my phone. When I execute my program on the emulator it makes a file just as I expect it to, but when I try and execute it on my phone the file doesn't seem to be created. I've looked around on this site and I can't seem to find a solution to my problem anywhere (a few similar ones, but nothing that worked for me) I was hoping you guys might be able to offer me advice on what I'm doing wrong.</p>
<pre><code>FileOutputStream fos = null;
String x = "Sample String";
try{
fos = openFileOutput("answers.txt", MODE_PRIVATE);
fos.write(x.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
</code></pre>
<p>On the emulator, I can find the file in DDMS at "data/data/com.example.helloandroid/files/answers.txt". On the phone, if I try to open up the data folder in DDMS it shows it is an empty directory. I have already added in this line to my manifest:</p>
<pre><code><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</code></pre>
<p>I cannot seem to think of anything else that I could be doing wrong. Thanks in advance for the help, it is appreciated.</p>
|
java android
|
[1, 4]
|
1,275,487 | 1,275,488 |
js typing text to screen
|
<p>hey guys i have a problem with a function which runs just fine on my localhost by when i upload it to the server it doesn't work, could some one please point me to the solution:</p>
<pre><code>var text = "some text";
var textArray = text.split("");
var looptimer;
function letterloop(){
if (textArray.length > 0){
$("#divx").append(textArray.shift());
}
else {
clearTimeout(looptimer);
var div = $("<a href=\"#\" onmousedown=\"javascript:continueOne();\" style=\"margin-top:70px; display:block; text-align:center;\" id=\"continue\" class=\"send_msg_blue\">continue</a>").hide().fadeIn(4000);
$("#div").append(div);
return false;
}
looptimer = setTimeout("letterloop()",60);
}
letterloop();
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,211,802 | 5,211,803 |
RegularExpression validator so my textbox have to start with uppercase
|
<p>I'm using this expression: </p>
<blockquote>
<p>^[A-Z][a-zA-Z0-9]*$</p>
</blockquote>
<p>And it works fine if I type for example "Kristian". But when I want to continue that sentence like typing "Kristian is working with SharePoint", it doesn't work. Any better expression out there?</p>
|
c# asp.net
|
[0, 9]
|
4,368,613 | 4,368,614 |
SelectedIndexChanged event does not fire if Item is already selected in dropdown?
|
<p>Assume that I have a dropdown with 2 items and by default, the first item is selected. If I select the click the first item in the dropdown, is there a way I can get the selectedIndexChanged event to still fire?</p>
<p>Can I do it by setting the SelectedIndex of the Dropdown to -1, for example?</p>
<p>Well that didn't work, lol, because it does not display the currently selected value, so it is misleading.</p>
<p>An issue I have on this is that the dropdown is used for sorting. I have the sorting semi-working in that if I select the second item, it will sort in ascending order for example, but if I want to sort in descending order now using the second item, i have to select another item and then go back to the second item.</p>
<p>Even if I add a Select By... I think the best solution to sorting is to just have more items in the dropdown like:</p>
<p>Sort Numbers (Asc)</p>
<p>Sort Numbers (Desc)</p>
<p>Sort Alphabet (Asc)</p>
<p>Sort Alphabet (Desc)</p>
<p>Thanks,
XaiSoft</p>
|
c# asp.net
|
[0, 9]
|
2,716,516 | 2,716,517 |
How to open a Bootstrap modal window using jquery?
|
<p>I'm using Twitter's Bootstrap modal window functionality. When someone clicks submit on my form, I want to show the model window on clicking the "submit button" in the form </p>
<pre><code> <form id="myform" class="form-wizard">
<h2 class="form-wizard-heading">BootStap Wizzard Form</h2>
<input type="text" value="">
<input type="submit">
</form>
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
$('#myform').on('submit', function(ev) {
$('#my-modal').modal({
show: 'false'
});
var data = $(this).serializeObject();
json_data = JSON.stringify(data);
$("#results").text(json_data);
$(".modal-body").text(json_data);
// $("#results").text(data);
ev.preventDefault();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,370,307 | 2,370,308 |
JQuery missing : after property ID
|
<p>So I am working with some jquery code to do a simple hide of a p and a show of a p. I am simple adding a class called showp and showing it while making sure the others are not shown by hiding them first. But I keep getting an error missing : after property ID. Any help would be greatly appreciated.</p>
<pre><code> $(document).ready({
$("#phone").click(function(){
$(".hide2").addClass(".hide2").hide("slow");
$(".hide3").addClass(".hide3").hide("slow");
$(".hide1").addClass("showp").show("slow");
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,965,924 | 2,965,925 |
Accessing script block with jquery
|
<p>I have a script block, in the div element which is appended after html response. I want to access this block and call eval() function for this script. How can I access the script block.</p>
<p>I tried <code>$("#divId script")</code> , but it doesn't work.</p>
<pre><code><div id="divId">
<script type="text/javascript">
// some code here
</script>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
123,980 | 123,981 |
Cannot load CSS and JS dynamically with this function
|
<p>I am trying to load Plugins based on the condition as in the below function. But i am unable to do it. Please have a look at the code and let me know the errors in the code..</p>
<pre><code> function loadPlugin(choic)
{
var plugin=choic*1;
if(plugin >= 1 && plugin <= 3)
{
$("head").append("<link>");
css = $("head").children(":last");
css.attr(
{
rel: "stylesheet",
type: "text/css",
href: "/cloud-zoom/cloud-zoom.css"
});
alert('CSS Loaded');
alert($("head").html());
$.getScript('/cloud-zoom/cloud-zoom.1.0.2.min.js', function()
{
alert($("head").html());
$('.cloud-zoom').CloudZoom();
$('a.cloud-zoom').live('click',function(e)
{
e.preventDefault();
});
});
}
}
</code></pre>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,134,396 | 1,134,397 |
Accessing an element of parent page from iframe - IE7 Issue
|
<p>I'm opening an iframe(inside a pop up) from a page(say parent) and trying to hide the div element(whose id is iframeloading) of parent page from this iframe using the following code $(window.parent.document).find("#iframeloading").hide();</p>
<p>This works in ff but not working in IE7..Pls help </p>
|
javascript jquery
|
[3, 5]
|
5,404,464 | 5,404,465 |
Using PHP to Match a Javascript Timestamp
|
<p>Alright when I do the code:</p>
<pre><code><script type = "text/javascript" >
document.write((new Date).getTime());
</script>
</code></pre>
<p>You get the Unix timestamp in miliseconds. I need something that will match this in PHP. I need a variable to be set to that, NOT necessarily printed. The variable needs to be a string OR number without any formatting (decimals, commas, etc).</p>
<p>The numbers don't have to match exactly, but have to be close. I tried doing time()*1000 but it turns it into scientific notation and I couldn't format it out without messing up the string.</p>
<p>Thanks so much for any help</p>
|
php javascript
|
[2, 3]
|
3,699,453 | 3,699,454 |
How to go to Activity by clicking Table row?
|
<p>I'm making a simple app. and it is my first app too... </p>
<p>It has an activity with a menu and I made each menu option in a Table Row. Each Table Row contain an Image button and a Text Description. I want to go to another Activity when we click on each Table row. How do I do that??</p>
<p>And is it possible to use a single class file to show multiple layout files (ie. for each menu's content) ? </p>
<p>Or</p>
<p>Is there any other way than tableRow to create a menu like this and use it to go to another Activity?</p>
|
java android
|
[1, 4]
|
4,544,016 | 4,544,017 |
Render enumeration value using code blocks
|
<p>I want the value of jsonStr to be</p>
<pre><code>"{submitOfferResult: 0}"
</code></pre>
<p>instead though it is </p>
<pre><code>"{submitOfferResult: OFFER_ACCEPTED}"
//javascript
var jsonStr = "{submitOfferResult: <%=SUBMIT_OFFER_RESULT.OFFER_ACCEPTED %>}";
//c#
public enum SUBMIT_OFFER_RESULT
{
OFFER_ACCEPTED = 0,
QUALIFYING_OFFER_NOT_MET = 1,
OFFER_ACCEPTED_NOT_HIGHEST_OFFER = 2,
OSP_CLOSED = 3,
AUTO_REJECTED = 4
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,840,620 | 1,840,621 |
jQuery is not defined and could not find why?
|
<p>My jQuery code is not working and in firebug console it says: "jQuery is not defined". I have checked jQuery is loading but I still not getting why its showing error. </p>
<p>Site URL is given in comment below so I can remove it when issue resolved. Your help will be appreciated. </p>
<p>My jQuery code looks like: </p>
<pre><code>( function($) {
$(document).ready(function() {
$("form#add #divOptionsBlock .item img").css("visibility","hidden");
$('#divOptionsBlock .txtBoxStyle:first').change(function() {
var fpath = $("#divOptionsBlock .item img").attr("src") ;
var finalimage = 'http://shop.daactive.com/thumbnail.asp?file='+fpath+'&maxx=300&maxy=0';
var fpath2 = $("form#add img#large").attr("src",finalimage);
var imagepath_ahref="http://shop.daactive.com/"+fpath;
var fpath3 = $("form#add a#listing_main_image_link").attr("href",imagepath_ahref);
var fpath4 = $("form#add a#listing_main_image_link .MagicBoxShadow img").attr("src",imagepath_ahref);
var textvalue = $('#divOptionsBlock .txtBoxStyle:first option:selected').text()
$("#imagecaptiont").html(textvalue);
});
});
} ) ( jQuery );
</code></pre>
|
javascript jquery
|
[3, 5]
|
873,618 | 873,619 |
Android Webview caching works in version 4.0.x but not in 2.3.3
|
<p>I am facing a very strange issue. My jquery webview works offline in browsers and in <code>android version 4.0.x</code>. However, it does no work offline in lower versions. </p>
<p>Code for setting cache mode :</p>
<pre><code>if(isConnected) {
webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
} else {
webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ONLY);
}
</code></pre>
|
java android
|
[1, 4]
|
2,246,293 | 2,246,294 |
Reading 4-bit chunks from byte array
|
<p>I'm getting a <code>byte[]</code> from an external input, where each byte stores <strong>two</strong> 4-bit values. My task is to read the 4-bit value of index <strong>idx</strong> from this tightly packed array. I've never written such code, so I wonder if my below solution is correct, and if yes, then whether there is more optimal way to do it. (Please spare me from "why don't you test it yourself" comments; tests are not able to prove the correctness of something, only the incorrectness...).</p>
<p>So the bytes and values look like (each [] is one <code>byte</code>):</p>
<pre><code>[value0|value1] [value2|value3] [value4|value5] [value6|value7]
</code></pre>
<p>And I must retrieve the value with index <code>idx</code>. Obviously:</p>
<ul>
<li>If i is even, the expression is: <code>array[idx/2] & 0xF0</code></li>
<li>If i is odd, the expression is: <code>array[idx/2] & 0x0F</code></li>
</ul>
<p>So the code is:</p>
<pre><code>if (idx % 2 == 0) {
return array[idx/2] & 0xF0;
}
return array[idx/2] & 0x0F;
</code></pre>
<p>Is this correct, and optimal?</p>
<hr>
<p><strong>UPDATE</strong> for "quick" readers: it is not correct, please see the Answer.</p>
|
java android
|
[1, 4]
|
3,769,855 | 3,769,856 |
Different Output Color When Convert to Excel
|
<p>When I want to convert to Excel using C#, I have problem with the color.
I use references :</p>
<pre><code> using Microsoft.Office.Interop.Excel;
</code></pre>
<p>With the Code:</p>
<pre><code> private Microsoft.Office.Interop.Excel.Range workSheet_range = null;
workSheet_range.Interior.Color = GetColorValue(be.InteriorColor);
private int GetColorValue(string interiorColor)
{
switch (interiorColor)
{
case "BLUE":
return System.Drawing.Color.LightSkyBlue.ToArgb();
case "YELLOW":
return System.Drawing.Color.LightYellow.ToArgb();
default :
return System.Drawing.Color.White.ToArgb();
}
}
</code></pre>
<p>My Problem is, the source code is working fine (no error). But the color output is completely wrong. Example, when I set the interior color to <em>Yellow</em> then the output is likely <em>Light Chocolate</em>.</p>
<p>Any suggestion?</p>
|
c# asp.net
|
[0, 9]
|
3,057,899 | 3,057,900 |
ASP.NET CheckBoxList Client side validation
|
<p>Is it possible to add a custom validation function to jquery validate plugin for ASP.NET CheckBox list?I am using jquery plugin to validate all controls at client side.It works perfectly with normal inputs like textbox,dropdown list etc.For some reason it is not working with Checkboxlist.In pure html checkboxlist becomes a table with html input checkboxes in it.I wrote a custom function to check whether any of the checkboxes is checked and added it to the jquery validate but for some reason the function is not getting called.</p>
<pre><code>jQuery.validator.addMethod('cb_selectone', function (value, element) {
return false;
}, 'Please select at least one option');
</code></pre>
<p>I tried returning false all the time but still the form is validated successfully.Any help would be appreciated.</p>
|
jquery asp.net
|
[5, 9]
|
2,895,462 | 2,895,463 |
.bind is not working with dynamic html
|
<p>In below .bind event - I can not reproduce the result - when I am injecting a dynamic html.
Tried with .on/.live but those are not working</p>
<pre><code>function initToggleDetails() {
abc.Log("initToggleaction");
$('.alink').unbind('click.link');
$('.alink').bind('click.link', function(event) {
event.preventDefault();
togglelDetailsaction(this);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,858,734 | 4,858,735 |
jQuery Text Limiter not working
|
<p>I am using the textLimiter jQuery class (<a href="http://plugins.jquery.com/project/jQueryTextLimiterCounter" rel="nofollow">http://plugins.jquery.com/project/jQueryTextLimiterCounter</a>) and I can not get it to work. I am using the demo as a walk through and here is what I have so far.</p>
<p>Master Page: </p>
<pre><code><script type="text/javascript" src="~/JQuery/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="~/JQuery/textLimitCount.js"></script>
</code></pre>
<p>Page to use the limiter:
Content Place Holder for Head:</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$('#txtTest1').textLimiter();
});
</script>
</code></pre>
<p>Content Placeholder for Body:</p>
<pre><code><textarea id="txtTest1" rows="5" cols="50"></textarea><br />
</code></pre>
<p>However I can not get anything to work with limiting my text, anyone run across this or see any errors I am missing? (new to jQuery here!)</p>
|
jquery asp.net
|
[5, 9]
|
2,622,926 | 2,622,927 |
How to store class hierarchy so I can generate a tree most efficiently?
|
<pre><code>List<myObject> objects = new List<myObject>
myObject
{
string a;
string b;
}
</code></pre>
<p><code>a</code> holds the name of the <code>objects[i]</code>, and <code>b</code> holds the name of the parent of <code>objects[i]</code>.</p>
<p>How can I serialize this list to a file so I can later create a tree-like image?</p>
<p>As an example, <code>objects</code> list has four elements:</p>
<pre><code>{a=planet, b=solarsystem},
{a=moon, b=planet}
{a=solarsystem, b=universe}
{a=meteor, b=solarsystem}
</code></pre>
<p>I want to serialize this so I can later, using javascript, read the file and have enough information to generate this diagram:</p>
<p><img src="http://i.stack.imgur.com/w7x9x.png" alt="tree"></p>
|
c# javascript
|
[0, 3]
|
3,001,415 | 3,001,416 |
Why isn't this function running?
|
<pre><code> $('.posts li img').each(function() {
if( this.complete )
imageResize($(this), 64, 64);
else
$(this).load(imageResize($(this), 64, 64));
});
</code></pre>
<p>I tried adding "alert('test')" to imageResize(), but it isn't working. Is there any reason why imageResize() isn't being called?</p>
|
javascript jquery
|
[3, 5]
|
4,814,444 | 4,814,445 |
Java and C# Certification Questions with Answers
|
<p>I am new to Certification exams.. in terms of most likely questions for Java's Sun Certification and C# Certification.</p>
<p>So is there any mock test or pdf's available for such exams with answers? So I can practise it efficiently...</p>
<p>Thanks..</p>
|
c# java
|
[0, 1]
|
4,611,241 | 4,611,242 |
how to compare the date in xml row with today's date
|
<p>I have one xml file which is retrieved using jquery in sharepoint. One of the row of the xml is like below.</p>
<pre><code><z:row ows_Title='Have dinner party with Host' ows_Due_x0020_Date='2012-05-10 00:00:00' ows_MetaInfo='1;#' ows__ModerationStatus='0' ows__Level='1' ows_ID='1' ows_UniqueId='1;#{2A8F277A-C95B-420C-89A9-3B979F95C8F4}' ows_owshiddenversion='3' ows_FSObjType='1;#0' ows_Created='2012-10-25 03:19:35' ows_PermMask='0x7fffffffffffffff' ows_Modified='2012-10-29 00:56:09' ows_FileRef='1;#personal/Inclusions/Lists/Events/1_.000' />
</code></pre>
<p>Now i want to retireve the "Due Date" column and compare with the today's date. For retrieving date there is no issue. But how to compare the both dates? For comparing the date with today I used like this.</p>
<pre><code> var k = new Date();
var year = k.getYear();
var month = k.getMonth();
var day = k.getDate();
var fulldate = year+"-"+month+"-"+day
</code></pre>
<p>But it is displaying only with date. In xml we are getting time also. I dont want to compare with time. I want to compare with only dates. How to achieve it? I want to put that whole process in the following function.</p>
<pre><code>$(xData.responseXML).find("z\\:row").each(function() {
//here i want to compare that date column with present date
});
</code></pre>
<p>Finally i want, the date coming in the xml is less than the today's date or not?</p>
|
javascript jquery
|
[3, 5]
|
2,824,047 | 2,824,048 |
C# List querying and grouping
|
<p>I have this list:</p>
<pre><code>OrderId ProductId DateTime
1 1 10.01.2012
1 2 09.01.2012
2 1 11.01.2012
3 1 12.01.2012
3 2 13.01.2012
</code></pre>
<p>I want to extract another another List from this that's only <code>ProductId==1</code> and DateTime is <code>10.01.2012</code>.</p>
<p>i.e. only <code>productId==1</code> for every OrderId's.</p>
<p>Also I only want the least dateTime version of that item. </p>
<p>So for the above list, 10.01.2012 is the least dateTime where the productId==1.</p>
<p>Result Table;</p>
<pre><code>OrderId ProductId DateTime
1 1 10.01.2012
</code></pre>
<p>how can I do this?</p>
|
c# asp.net
|
[0, 9]
|
3,853,220 | 3,853,221 |
How do I protect phone number from bots
|
<p>I want a phone number which display on public page will be protected. Example converts phone number characters to HTML entities and bots can't grab the number in plain text. Let me know the trick.</p>
|
php jquery
|
[2, 5]
|
249,330 | 249,331 |
How to access a file from aspx web page ie \\folder\\mydocument.doc
|
<p>I need to access a word document by applying the following to the explorer navigation bar</p>
<p>\folder\subfolder\mydocument.doc</p>
<p>I am not looking to read the content and load the aspx page, just access the file and let the person's PC use word to open it.</p>
<p>Thanks for any help</p>
|
c# asp.net
|
[0, 9]
|
375,345 | 375,346 |
process a page on UnLoad?
|
<p>I need for a php file to process when the user click a link/go back/exits a page. Its part of a saving user info process. if i do a jquery unload how would I fire the php file to load and process.</p>
<p>jQuery(window).bind("unload", function() {
// what should i add?
});</p>
|
javascript jquery
|
[3, 5]
|
2,388,121 | 2,388,122 |
Why is jQuery tools CDN link pointing to an ad?
|
<p>Why is the link <a href="http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js" rel="nofollow">http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js</a> pointing to an ad?</p>
|
javascript jquery
|
[3, 5]
|
4,934,737 | 4,934,738 |
Edit Nodes in TreeView Control
|
<p>how to edit nodes in asp treeview control , and I want to save the changes back to the xmldocument.I didnt find TreeviewId.LabelEdit property.</p>
|
c# asp.net
|
[0, 9]
|
2,108,885 | 2,108,886 |
Get text from span with a specific class
|
<p>I have the below HTML and JQuery code and i am needing some help to do the following, i have some radio buttons with freight types, when the user choose one of them i need to get its price, it is in the span with the class <code>price</code>. I've tried to use <a href="http://api.jquery.com/closest/" rel="nofollow"><code>.closest()</code></a> but i am getting and empty result (JQuery v1.7.2). Can anybody help me to get this?</p>
<p><strong>HTML</strong></p>
<pre><code><div class="freight">
<input type="radio" name="freight-type" id="FX" value="FX" />
<label for="FX">
<span class="blue">Fedex</span>-
<strong>US$ <span class="price">12.42</span> </strong>
<span class="small-text"> (Delivery time: <strong>3 business days)</strong></span>
</label>
</div>
</code></pre>
<p><strong>JQuery</strong></p>
<pre><code>$("input[name=freight-type]").change(function() {
alert( $(this).closest(".price").text() )
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
537,730 | 537,731 |
Is it possible to transfer data directly between two android devices to other users in the same network?
|
<p>Let's say I have two android mobile devices, connected to the same wireless network, and that network hasnt external/internet access.</p>
<p>Without third party software, is it possible to transfer data through wifi without knowing the ip from each other and without creating an hotspot? Something like we do on Windows (if 2 pcs are on same network, they can share information directly without internet access)</p>
<p>Starting with the basics, I would like to develop an application, where android phones on same network appears on a list , and then a user choose on of them and writes something - and if the other user have the same app running, appears that on his phone (and then he can reply of course - basically, a chat.</p>
<p>I know this make no practical sense, but believe makes all the sense for what I need to do (it's not a chat of course). If anyone knows anything, please help me - i found nothing.</p>
<p>Thanks in advance.</p>
|
java android
|
[1, 4]
|
4,860,824 | 4,860,825 |
Using `find( )` and selecting the parent element as well
|
<p>I have been trying to create a highlight effect for a while now. This is extremely close to what I need however, the problem with this method is it leaves out the inner most parent element.</p>
<p>What I need is the exact same functionality as what the below JQuery code produces, the only difference is, I would like to include the inner-most parent object as well. Using <code>find</code> finds all children of the parent object, which is not exactly what I need. </p>
<h2><strong>Edit</strong></h2>
<p>I basically need the combination of these two statements:</p>
<pre><code>$last.parent().parent().find('*').effect("highlight", {color: '#FCF8DC'}, 2000);
$last.parent().parent().effect("highlight", {color: '#FCF8DC'}, 2000);
</code></pre>
<p>HTML</p>
<pre><code><div class="invoice-line">
<div class="prod-id-cell"><input type="text" class="prod-id-input"></div>
<div class="prod-name-cell"><input type="text"class="prod-name-input"/></div>
</div>
</code></pre>
<p>I appreciate any help in accomplishing this.</p>
<p>Many thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
5,990,673 | 5,990,674 |
how to add cancel button inside spinner
|
<p>I want to add cancel button inside of spinner how to add cancel button in spinner without </p>
<p>using alert dialog please give me an example..</p>
<p>spinner = (Spinner) findViewById(R.id.spinner);</p>
<pre><code> ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(),R.layout.test_list_item,stringArray);
adapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
spinner.setAdapter((adapter));
</code></pre>
|
java android
|
[1, 4]
|
1,981,341 | 1,981,342 |
ASP Chart with multiple X axis columns
|
<p>I have an SQL table with two columns, salesperson and status. The status can be one of three things, gold, silver and bronze.</p>
<p>How do I go about creating a chart where the salesperson name appears once along the x-axis but has three columns above their name for a count of each status?</p>
<p>Thanks,
Jonno</p>
|
c# asp.net
|
[0, 9]
|
4,515,693 | 4,515,694 |
Integrating jQuery BBQ into my current code?
|
<p>I am trying to integrate the <a href="http://benalman.com/projects/jquery-bbq-plugin/" rel="nofollow">jquery BBQ plugin</a> into my current code, at the moment I have set up a simple AJAX request that returns the selected links relative page. Can anyone tell me how I can modify the BBQ script so it will work with my code?</p>
<pre><code><ul id="nav">
<li><a href="index.html">Homepage</a></li>
<li><a href="page1.html">Link 1</a></li>
<li><a href="page2.html">Link 2</a></li>
<li><a href="page3.html">Link 3</a></li>
</ul>
<div id="inject">
<div id="main-content">
<p>This is the homepage</p>
</div>
</div>
$('#nav').find('a').click(function(e) {
$.ajax({
url : this.href,
method : 'get',
success : function(data) {
var div = $('#main-content', $(data));
$('#inject').html(div);
}
});
e.preventDefault();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,973,507 | 3,973,508 |
Export ASP.Net grid data to excel w.o. third party dll
|
<p>I want to export grid data from ASP.Net webpage to Excel without using any third party dll.</p>
<p>can anybody tell me how to do it ?</p>
|
c# asp.net
|
[0, 9]
|
1,399,746 | 1,399,747 |
How to call a javascript function directly from an activity in Android?
|
<p>I wanted to know if there is any way that I can call a JavaScript function from native Android Activity. </p>
<p>I came across: </p>
<pre><code>webView.loadUrl("javascript:hello()");
</code></pre>
<p>But it did not work for me. </p>
<p>Also, how will Android know in which html page does this JavaScript function reside? </p>
|
javascript android
|
[3, 4]
|
956,057 | 956,058 |
Android app loading white screen on device
|
<p>I've debugged my app on my PC and it works fine. When I go into my phone and tablet instead of it loading the <code>WebView</code> like it should it simply loads a white screen, I guess failing to load the web site. I'm not sure where to begin debugging since my debug mode and virtual device works fine. Any suggestions?</p>
|
java android
|
[1, 4]
|
5,256,275 | 5,256,276 |
What does this expression of jquery mean $("div[id*='box']")?
|
<p>Does below expression mean it will give me all the div objects which have id containing the word box in it? </p>
<pre><code>$("div[id*='box']")
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,714,958 | 3,714,959 |
File upload using jquery not working
|
<p>I'm trying to make a really simple file upload using jQuery, without having to download 3rd party plugin / scripts.</p>
<p>Here is my code:</p>
<p>HTML </p>
<pre><code> <form enctype="multipart/form-data" action="" method="POST" name="form">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
<?php _e('Choose a file to upload') ?>: <input name="uploadedfile" class="uploadedFile" type="file" />
<input type="submit" class="button uploadImage" value="<?php _e('Upload File') ?>" />
</form>
</code></pre>
<p>PHP</p>
<pre><code><?php
require_once($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php');
$uploaddir = WP_CONTENT_URL.'/uploads'.$_POST['current_path'];
$uploaddir = str_replace('/','\\', $uploaddir);
$uploadfile = $uploaddir .'\\'. basename($_FILES['uploadedfile']['name']);
echo $uploadfile;
?>
</code></pre>
<p>JS</p>
<pre><code> //File upload
jQuery('.uploadImage').live('click',function() {
var current_path = jQuery('#currentPath span').html();
var new_dir = jQuery(this).find('span').html();
// Load new content in browser window
jQuery.ajax({
type: "POST",
url: "../wp-content/plugins/wp-filebrowser/uploader.php",
dataType: 'html',
data: {current_path: current_path, new_dir: new_dir},
success: function(data){
alert(data);
},
error: function(){
alert('Page load failed.');
}
});
});
</code></pre>
<p>The problem is that I can't get info on <code>$_FILES['uploadedfile']['name']</code>. Is this because the form is never submitted?</p>
|
php jquery
|
[2, 5]
|
2,358,720 | 2,358,721 |
Java to C# code converter
|
<p>Are there any converters available that converts Java code to C#?</p>
<p>I need to convert the below code into C#</p>
<pre><code>String token = new String("");
URL url1 =new URL( "http", domain, Integer.valueOf(portnum), "/Workplace/setCredentials?op=getUserToken&userId="+username+"&password="+password +"&verify=true");
URLConnection conn1=url1.openConnection();
((HttpURLConnection)conn1).setRequestMethod("POST");
InputStream contentFileUrlStream = conn1.getInputStream();
BufferedReader br = new BufferedReader(new InputStreamReader(contentFileUrlStream));
token=br.readLine();
String encodedAPIToken = URLEncoder.encode(token);
String doubleEncodedAPIToken ="ut=" + encodedAPIToken;//.substring(0, encodedAPIToken.length()-1);
//String doubleEncodedAPIToken ="ut=" + URLEncoder.encode(encodedAPIToken);
//String userToken = "ut=" + URLEncoder.encode(token, "UTF-8"); //URLEncoder.encode(token);
String vsId = "vsId=" + URLEncoder.encode(docId.substring(5, docId.length()), "UTF-8");
url="http://" + domain + ":" + portnum + "/Workplace/getContent?objectStoreName=RMROS&objectType=document&" + vsId + "&" +doubleEncodedAPIToken;
String vsId = "vsId=" + URLEncoder.encode(docId.substring(5, docId.length()), "UTF-8");
url="http://" + domain + ":" + portnum + "/Workplace/getContent?objectStoreName=RMROS&objectType=document&" + vsId + "&" +doubleEncodedAPIToken;
</code></pre>
<p>Thanks in advance</p>
|
c# java
|
[0, 1]
|
4,613,083 | 4,613,084 |
Shoud these two JQuery functions produce the same behavior?
|
<p>Assuming I have the following two JQuery functions -</p>
<p>The first, which works:</p>
<pre><code>$("#myLink_931").click(function ()
{
$(".931").toggle();
});
</code></pre>
<p>and the second, which doesn't work:</p>
<pre><code>$("#myLink_931").click(function ()
{
var class_name = $(this).attr("id").split('_')[1];
$("."+class_name).toggle();
});
</code></pre>
<p>I want to replace the first with the second, which is more generalizable, but can't find any obvious syntactical problem with the second which might be preventing it from working.</p>
<p>My guess is there's a problem with the syntax:</p>
<pre><code> "."+class_name
</code></pre>
<p>Is this bad syntax?</p>
|
javascript jquery
|
[3, 5]
|
2,022,662 | 2,022,663 |
jQuery Removing last two characters in a class
|
<p>This should be pretty simple. I'm trying to use the slice method to remove the last two characters in a dynamically created string in a shopping cart.</p>
<p>So instead of having a product show as $28.00, I want the product to show up as $28. Since these values are coming from a database, I can't simply define the string in a variable, like I've seen in a lot of tutorials. </p>
<p>I've created a JSFiddle here:
<a href="http://jsfiddle.net/EbckS/" rel="nofollow">http://jsfiddle.net/EbckS/</a></p>
<p>The jQuery that's not working is below:</p>
<pre><code> $(".myclass").slice(0,-2);
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,088,626 | 1,088,627 |
Replace All innerhtml text with Javascript
|
<p>I've been trying for hours and I've looked a lot of samples on StackOverflow, but I can't fix my simple script.</p>
<p>I grabbed DOM with jQuery</p>
<pre><code>var color = $('#bscontainer').html();
</code></pre>
<p>and now the content of color is:</p>
<pre><code><img src="resources/P/Blue_BG_2Col.png" id="bg">
<img src="resources/P/Blue_Content_2Col.png" id="content">
<img src="resources/P/Blue_Title_ExchangeRate.png" id="title">
<img src="resources/P/Blue_SubTitle_2Col.png" id="subtitle">
<img src="resources/P/Blue_Disclaimer_Disclaimer.png" id="disclaimer">
</code></pre>
<p>My idea is to change all the Blue to Green, and I already try this:</p>
<pre><code>curColor="Blue";
newColor="Green";
t=color.replace(curColor,newColor);
</code></pre>
<p>It simply doesn't works. Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
308,257 | 308,258 |
how to change class of <a> tags in jquery
|
<p>I have a table structure, something similar to</p>
<pre><code><table style="width: 100%;">
<tr>
<td>
<a href="#" class="xx">one</a>
</td>
<td>
</tr>
<tr>
<td>
<a href="#" class="xx">Two</a>
</td>
<td>
</tr>
<tr>
<td>
<a href="#" class="xx">Three</a>
</td>
<td>
</tr>
</table>
</code></pre>
<p>css:</p>
<pre><code>.xx {
border: 5px solid green;
}
.yy {
border: 5px solid red;
}
</code></pre>
<p>Now what I expect is, if I click on 1st row/1st <code><a></code> its border will turn to red, and rest of <code><a></code> in green, again if I clcik on 1st row/1st <code><a></code> it should turn to green. Also if I click on any other <code><a></code> then only it should turn to red, but rest of the <code><a></code> should be green.</p>
<p>I tried:</p>
<pre><code>$(function () {
$("a.xx").click(function () {
if ($(this).hasClass("xx")) {
$(this).removeClass("xx").addClass("yy");
} else {
$(this).removeClass("yy").addClass("xx");
}
});
});
</code></pre>
<p>But it's not working.</p>
|
javascript jquery
|
[3, 5]
|
3,676,015 | 3,676,016 |
setTimeOut code not working with jQuery
|
<p>I have this code, but it execute only once...</p>
<pre><code>$('.' + container).hover(function() {
t = setTimeout( function(elem){
//this should be executed as long as I hover,
//with interval declared in viewSpped variable
$(elem).find('img').first().appendTo('.' + container).fadeOut(500);
$(elem).find('img').first().fadeIn(800);
}(this), viewSpeed);
}...
</code></pre>
<p>Any idea what I'm doing wrong? thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,202,013 | 3,202,014 |
How to flash(hide/clear/delete) the previously appended values on every new click?
|
<p>Whenever I click, the new value is appended but the previous value is also shown. How can I clear the previously appended values on every new click?</p>
<p>Here goes the onclick used in php function</p>
<pre><code>echo "<a href='#' onclick=chat_com('$name'); >$name </a><br>"; // suppose this dispalyes a,b,c
</code></pre>
<p>Here is jquery function to append this value.</p>
<pre><code>function chat_com(name) {
$('#appendto').append(name);
}
</code></pre>
<p>Here is the HTML div where value is appended.</p>
<pre><code><div id="appendto"></div>
</code></pre>
<p>On first click <code>a</code> is shown, on second click <code>a,b</code> is shown instead just <code>b</code>.</p>
|
php jquery
|
[2, 5]
|
191,833 | 191,834 |
How to click a button on website?
|
<p>The HTML code is;</p>
<pre><code><input id="submit_button" type="submit" value="Convert file" title="Upload video to convert to MP4 format">
</code></pre>
<p>How would I go about clicking this button by using the webBrowser control?</p>
<p>I tried;</p>
<pre><code>webBrowser1.Document.GetElementById("submit_button").InvokeMember("onclick"); // click convert video button
</code></pre>
<p>but it is not working.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
1,490,172 | 1,490,173 |
How to handle click event in jquery for a button?
|
<p>I have a grid view in which I have a button feild for deleting that particular row in the grid view, using the GridView_RowDeleting() event.</p>
<p>So when that particular row gets renders it's such</p>
<pre><code><input type="button" value="Delete" onclick="javascript:__doPostBack('ctl00$ContentPlaceHolderBodyMasterPage$grdvwUsers','Delete$0')" class="delete" />
</code></pre>
<p>The delete functionality works fine.</p>
<p>But I want to show a confirmation message on this button click whether to delete the user or not.
For that I have added query code for that to display the confirmation message, but thats not working , don't know why,</p>
<pre><code> $(".delete").click(function(e) {
// code for displaying the confirmation dialog
});
</code></pre>
<p>Please help me out, thanks !</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
1,199,876 | 1,199,877 |
stack overflow error
|
<p>i just got my first ever stack overflow when I ran this script:</p>
<pre><code>var hlat = 0.00;
var hlong = 0.00;
var mapdiv = document.getElementById('map');
var map_url = base_url + 'ajax/getPropMap';
var id_url = base_url + 'hotels/gethotel_id';
var id=0;
var map = null;
// apply gmaps to product map div
$(function(){
$.get(id_url, {id: segment}, getMapDetails);
});
function getMapDetails(data){
$.getJSON(map_url, {id:data}, addToProdMap);
}
function getMapDetails(data){
addProdMap(data);
}
function addProdMap(data){
hlat = data.latitude;
hlong = data.longitude;
map = new google.maps.Map(mapdiv, {
center : new google.maps.LatLng(hlat, hlong),
zoom : 13,
mapTypeId : 'hybrid'
});
var coords = new google.maps.LatLng(hlat, hlong);
var marker = new google.maps.Marker({
clickable : true,
map: map,
icon : 'http://labs.google.com/ridefinder/images/mm_20_red.png',
position : coords
})
}
</code></pre>
<p>How do I deal with this? Firefox closes and IE displays the stack overflow error</p>
|
php javascript
|
[2, 3]
|
2,030,101 | 2,030,102 |
Create Handler that manipulates head tag
|
<p>Is there any way to create a handler that changes the head tag content
real time?</p>
|
c# asp.net
|
[0, 9]
|
156,108 | 156,109 |
how to get value of row in gridview and display in textbox
|
<p>How to get value of row in <code>Gridview</code> and display in <code>Textbox</code>?</p>
<p>Don't work this code. And I don't want to use this code:</p>
<pre><code>protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) {
LinkButton lnkButton = sender as LinkButton;
GridViewRow row = (GridViewRow)lnkButton.NamingContainer;
lblSender.Text = row.Cells[2].Text;
lblSubject.Text = row.Cells[5].Text;
txtReadMsg.Text = row.Cells[6].Text;
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,716,387 | 1,716,388 |
re-fetch request in php and javascript
|
<p>here it goes;</p>
<pre><code>echo "<a href='#' class='thumb'><img class='thumb-img' value = ".$row->aid." onclick='getVote(".$row->aid.", \"".$row->atitle."\")' src='images/roadies/th".$row->aid.".jpg' /> </a>";
</code></pre>
<p>the above function sends the "$row->aid" value to a javascript function through ajax.</p>
<p>in the javascript however, i want to make a function that needs the ++value of the $row->aid variable. i want the php to get the new value and then pass it again to javascript.</p>
<p>how do i do it without a page reload?</p>
<p>to make things more clear, i just need to get the next incremented value of the php variable. i want php to get the next ++ value from the DB and pass it back to JS.</p>
<p>please help me do this. ;))</p>
|
php javascript
|
[2, 3]
|
4,036,954 | 4,036,955 |
fadein / fadeout div on checkbox select / unselect
|
<p>I am trying to bring up a menu when any of the checkbox is selected, as you can see in screenshot below, it shows the number of selections and the menu also disappears when none is select.</p>
<p><img src="http://i38.tinypic.com/200tow0.jpg" alt="alt text" /></p>
<p>I am able to bring up the menu with this code</p>
<pre><code>$("input[name='id[]']").focus(function(){
$("#menu").fadeIn();
});
</code></pre>
<p>However, i dont know how to hide it when the checkboxes are unselected and how to count number of selections.</p>
<p>Thank You.</p>
|
javascript jquery
|
[3, 5]
|
5,542,408 | 5,542,409 |
How to call instance method in predefined class from another class in android
|
<p>I have two classes, shown below:</p>
<p>TestActivity.java</p>
<pre><code>public class TextActivity extends Activity {
public void onCreate(Bundle savedinsstate) {
super.onCreate(savedinsstate);
Intent intent=new Intent(this,MYMapActivity.class);
startActivity(intent);
MYMapActivity.ma.displayGoogleMaps();
}
}
</code></pre>
<p>MYMapActivity.java</p>
<pre><code>public class MYMapActivity extends MapActivity {
public static MYMapActivity ma;
public void onCreate(Bundle savedinsstate) {
super.onCreate(savedinsstate);
ma=this;
}
public void displayGoogleMaps(){
//some code here.
}
}
</code></pre>
<p>From the above when I'm calling MYMapActivity.ma.displayGoogleMaps() I'mm getting NullPointerException. I have debugged the code then finally I found that in place of ma I am getting null. How can I resolve this?</p>
|
java android
|
[1, 4]
|
3,130,263 | 3,130,264 |
how to pass a function as part of an object in javascript without invoking the function
|
<p>I am trying to use .ajaxSubmit(). I want to pass it the options object. I want to create this options object based on the user's behavior. So this is how I am doing it:</p>
<pre><code>$('#my-form').ajaxSubmit(GetSearchAjaxFormOptions(param1, param2));
function GetSearchAjaxFormOptions(param1, param2) {
return { target: '#results',
data: GetData(),
success: RunAfterAjaxSubmit(param1, param2)
};
}
function RunAfterAjaxSubmit(param1, param2) {
// do stuff
}
</code></pre>
<p>Everything works fine except that RunAfterAjaxSubmit is called not only after the ajax call returns, but also before the ajax call is made at the following line: </p>
<p>success: RunAfterAjaxSubmit(param1, param2)</p>
<p>How do I change my code so it is only called after the ajax call is returned.</p>
<p>Many Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,570,170 | 3,570,171 |
Unable to import com.google.android.maps.MapView (Eclipse)
|
<pre><code>import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.view.ViewGroup;
import android.widget.*;
import com.google.android.maps.MapView;
public class MapView extends MapActivity {
LinearLayout linearLayout;
MapView mapView;
/** Called when the activity is first created. */
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
MapController mapController = mapView.getController();
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,970,050 | 5,970,051 |
How to display Html page in our .aspx page?
|
<p>i wrote this code </p>
<pre><code> public partial class monograph : System.Web.UI.Page
{
public string path = "file:///D:/CD IP/Html/Monographs/";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
path = path + Label1.Text + ".htm";
Response.Redirect(path);
}
}
</code></pre>
<p>How to open html page from above code??</p>
|
c# asp.net
|
[0, 9]
|
4,074,741 | 4,074,742 |
How to handle AsyncTask failure
|
<p>Is there a specific way to handle failure in an AsyncTask? As far as I can tell the only way is with the return value of task. I'd like to be able to provide more details on the failure if possible, and null isn't very verbose.</p>
<p>Ideally it would provide an onError handler, but I don't think it has one.</p>
<pre><code>class DownloadAsyncTask extends AsyncTask<String, Void, String> {
/** this would be cool if it existed */
@Override
protected void onError(Exception ex) {
...
}
@Override
protected String doInBackground(String... params) {
try {
... download ...
} catch (IOException e) {
setError(e); // maybe like this?
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,284,282 | 5,284,283 |
Connect via Bluetooth
|
<p>I have been working on a bluetooth app for android.I can select a Bt-device from vaible-device-list. How can i connect with the selected device? Could you please help me?
Thank you very much </p>
<p>Here is my code:</p>
<pre><code>public class ScanActivity extends ListActivity {
private static final int REQUEST_BT_ENABLE = 0x1;
public static String EXTRA_DEVICE_ADDRESS = "device_address";
ListView listGeraete;
BluetoothAdapter bluetoothAdapter;
ArrayAdapter<String> arrayAdapter;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list);
// adapter
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// list of devices
ListView listGeraete = getListView();
arrayAdapter = new ArrayAdapter<String>(ScanActivity.this,android.R.layout.simple_list_item_1);
listGeraete.setAdapter(arrayAdapter);
// if bt disable, enabling
if (!bluetoothAdapter.isEnabled()) {
Intent enableBt = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBt, REQUEST_BT_ENABLE);
}
// start discovery
bluetoothAdapter.startDiscovery();
registerReceiver( ScanReceiver , new IntentFilter(
BluetoothDevice.ACTION_FOUND));
}
private final BroadcastReceiver ScanReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
// find bt devices
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
BluetoothDevice device = intent
.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
arrayAdapter.add(device.getName() + "\n" + device.getAddress());
arrayAdapter.notifyDataSetChanged();
}
}
};
// select a device
public void onListItemClick(ListView l, View view, int position, long id) {
bluetoothAdapter.cancelDiscovery();
String devicesinfo = ((TextView) view).getText().toString();
String address = devicesinfo.substring(devicesinfo.length());
Intent intent = new Intent();
intent.putExtra(EXTRA_DEVICE_ADDRESS, address);
setResult(Activity.RESULT_OK, intent);
Toast.makeText(getApplicationContext(),"Connecting to " + devicesinfo +
address,
Toast.LENGTH_SHORT).show();
}
}
</code></pre>
|
java android
|
[1, 4]
|
1,673,711 | 1,673,712 |
Get unique id after the fact?
|
<p>I want to be able to change a button image on click which isn't the issue. Each button is unique to information that is pulled from the database and on click the button should change and send the appropriate info to the database. What I am unsure about is how I can change the specific button. Say there are five things up, so five buttons. Each button has its unique id to go with its information. How can I find out what the id is so that I can manipulate the button?</p>
<p>I use php to grab the info from the database and go through a while loop to get it all displayed. Once it is all displayed it is there for the user to see and then they can click on the button.</p>
<p>edit - It just came to me. I can make my onclick function take a variable and feed the variable into it. Right?</p>
|
php javascript
|
[2, 3]
|
5,890,935 | 5,890,936 |
How to trap 403 errors in C#
|
<p>I have a TRY / Catch in my C# code and I want to trap a 403 error so that I can send the user to a registration page.</p>
<p>Is there a property in EXCEPTION for status code (403) or do I have to parse the message ({"The HTTP request was forbidden with client authentication scheme 'Negotiate'."}) ?</p>
<p>I have the following </p>
<p>try</p>
<p>access web service</p>
<p>catch (Exception err)</p>
<p>So I want to be able to find the 403 code in Exception, or should I be using something other than Exception here ?</p>
|
c# asp.net
|
[0, 9]
|
3,713,449 | 3,713,450 |
Using jquery post request to same page
|
<p>I am trying to send the value "hi" to the php variable "text" via a post request made to the current page.</p>
<p>jquery</p>
<pre><code>$.post("", "hi");
</code></pre>
<p>php</p>
<pre><code>if (isset($_POST['POST'])) {
$text = $_POST['POST'];
}
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
278,579 | 278,580 |
Purpose of BAL in 3 tier architecture
|
<p>I am a newbie for 3 tier architecture as it consists of UI,BAL and DAL layers.So i am writing all the database code in DAL and i have declaring the variables in BAL and i have calling the methods into the UI,but is this is the correct way to code??What is my BAL is doing then?what is the main purpose of business layer?Can anyone explain me,Thanks.</p>
<pre><code> //In my BAL
public class ProfileMasterBLL
{
public int UserId { get; set; }
public string FormFiledBy { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
</code></pre>
<p>//In my UI</p>
<pre><code> ProfileMasterBLL pmBLL = new ProfileMasterBLL();
pmBLL.FirstName = TextBox1.Text;
pmBLL.LastName = TextBox2.Text;
//In my DAL
</code></pre>
<p>method for insert() </p>
<p>then how can i call ProfileMasterBLL.insert() ?? as i have written in DAL.</p>
|
c# asp.net
|
[0, 9]
|
837,657 | 837,658 |
how to do show hide for multiple classes
|
<p>i have did the code for one category so i need to do same thing for another categories using with same code... can suggest any shortest format for using multiple category containers.</p>
<p>ex: my symbols is one category so i need to do the such a way for another category that is "my dollars'</p>
<p>Jquery</p>
<pre><code>$('.my-symbols .show').click(function(){
$('.my-symbols .container').show(500);
});
$('.my-symbols .hide').click(function(){
$('.my-symbols .container').hide(300);
});
</code></pre>
<p>css</p>
<pre><code>#charts .my-symbols{
width:59%;
float:left;
margin-left:0.5%;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background:#666666;
padding:0.5%;
}
#charts .my-symbols .show{
width:10px;
height:10px;
background:url(../../images/blockopen.png) no-repeat;
float:right;
/*padding:10px 10px 10px 10px;*/
border:none;
top:-10px;
padding:10px 10px 10px 10px;
position:relative;
}
#charts .my-symbols .hide{
width:10px;
height:10px;
background:url(../../images/blockclose.png) no-repeat;
position:relative;
top:0;
right:0;
float:right;
padding:10px 10px 10px 10px;
border:none;
}
#charts .my-symbols .container{
display:none;
position:absolute;
padding:1%;
background:#454545;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
z-index:1;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,237,474 | 1,237,475 |
What is unique identity of an Internet connected device IP / MAC?
|
<p>I am making a script that show popup only one time , then it will never show again on that device.. </p>
<p>How is it possible to do this?</p>
<p>I have already tried by using cookies, but these can be deleted by the user and so the effect is limited.</p>
<p>Another question is what is wholly unique per device, IP Address or MAC Address?</p>
|
php javascript
|
[2, 3]
|
2,493,796 | 2,493,797 |
jquery each() index when passed self
|
<p>I am trying to access the element index during each iteration of this loop.</p>
<pre><code>$('.slide').hide().repeat().each($).fadeIn($).wait(1000, function(){
//do stuff
}).wait(noHover).fadeOut($);
</code></pre>
<p>I tried doing something like:</p>
<pre><code>$('.slide').hide().repeat().each(i, $).fadeIn($).wait(1000, function(){
alert(i);
}).wait(noHover).fadeOut($);
</code></pre>
<p>Clearly I do not understand the right way to do this.</p>
<p><em>The plugin extension im using:</em><br>
<a href="http://creativecouple.github.com/jquery-timing/examples/pause-cycle-on-hover.html" rel="nofollow">http://creativecouple.github.com/jquery-timing/examples/pause-cycle-on-hover.html</a></p>
<p>Heres a fiddle that breaks this down better:<br>
<a href="http://jsfiddle.net/zGd8a/" rel="nofollow">http://jsfiddle.net/zGd8a/</a></p>
<p>A solution:<br>
<a href="http://jsfiddle.net/zGd8a/8/" rel="nofollow">http://jsfiddle.net/zGd8a/8/</a></p>
|
javascript jquery
|
[3, 5]
|
1,985,827 | 1,985,828 |
Why is my exception handling code not handling exceptions?
|
<p>I have some C# code that pulls down a remote website using the HttpWebRequest class. I'm handling errors with a try/catch, but some errors (like Webrequest and IOException) don't seem to be getting "caught" with the way I have it setup:</p>
<pre><code>try
{
StartScrap("http://www.domain.com");
}
catch (Exception ex)
{
LogError(ex.ToString();
}
private void StartScrap(string url)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
Stream responseStream = response.GetResponseStream();
string responseText = String.Empty;
using (StreamReader readerStream = new StreamReader(responseStream, System.Text.Encoding.UTF8))
{
responseText = readerStream.ReadToEnd(); <-- I will sometimes get a Webexception error here that won't get caught above and stops the code
}
}
}
</code></pre>
<p>Update: There is more to the code, so maybe it is something outside of the code I posted? I am basically using this code in a Windows Application on a form that has a NotifyIcon. I'm using the Timer class to run the code at a certain timer interval. This is how I have it setup:</p>
<pre><code> public TrayIcon()
{
InitializeComponent();
}
private void TrayIcon_Load(object sender, EventArgs e)
{
try
{
StartScrap("http://www.domain.com");
}
catch (Exception ex)
{
LogError(ex.ToString());
}
finally
{
StartTimer();
}
}
private void StartTimer()
{
Timer Clock = new Timer();
Clock.Interval = 600000;
Clock.Start();
Clock.Tick += new EventHandler(TrayIcon_Load);
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,722,505 | 1,722,506 |
Is there an elegant way to overload a jQuery method inside of a plugin only?
|
<p>I am having a bit of a <em>dull</em> moment today, where I can't think of an elegant solution for this problem.</p>
<p>I have inherited a plugin, and I need to modify it to allow passing a <em>enabled</em> or <em>disabled</em> state to it, to have it detach all of its events, show the <em>disabled</em> state, etc.</p>
<p>Like a jQuery UI <em>plugin</em>, I was simply going to use...</p>
<pre><code>$('div').myPlugin('disabled');
</code></pre>
<p>This I have no problem with.</p>
<p>However, the plugin attaches many events which are not <a href="http://docs.jquery.com/Namespaced_Events" rel="nofollow">namespaced</a>. I want the events to be namespaced, so I can remove the events easily.</p>
<p>There are many events that are bound, so I thought <em>hey, why don't I overload <a href="http://api.jquery.com/bind/" rel="nofollow"><code>bind()</code></a> to attach the namespace automatically?</em></p>
<p>I came up with this...</p>
<pre><code>(function(oldBind) {
$.fn.bind = function() {
if (arguments.length >= 2) {
arguments[0] += '.my-plugin';
}
return oldBind.apply(this, arguments);
}
})($.fn.bind);
</code></pre>
<p>I placed this at the top of the plugin, before the <code>return this.each(fn)</code> code.</p>
<p>It seemed to work nicely.</p>
<p>However, I tossed in a <code>console.log(arguments[1].toString())</code> and noticed (as I expected) this overwrote the main jQuery <code>bind()</code> outside of the plugin.</p>
<p>What is the best way to have this overloaded <code>bind()</code> only available to this plugin?</p>
<p>Should I simply place at end of the plugin <code>$.fn.bind = oldBind</code> or is there an easier way? </p>
|
javascript jquery
|
[3, 5]
|
5,301,262 | 5,301,263 |
Click listener firing twice due to nested element
|
<p>I have the following listeners:</p>
<pre><code>$('td').on('click', '.time_note', function (e) { // When the user clicks the note div
alert('note click');
});
$('table').on('click', 'td', function(e) {
alert('time click');
});
</code></pre>
<p>I need two different actions depending on whether the note is clicked or the entire cell is clicked. I tried doing this, however, if the note is clicked - so is the cell. Both actions are fired, subsequently. Makes perfect sense.</p>
<p>However, I don't want that to happen. If the note is clicked, the action for the entire cell should not fire and vice-versa. What way is there to accomplish this? I tried to use <code>.off</code>, but that didn't work.</p>
|
javascript jquery
|
[3, 5]
|
179,260 | 179,261 |
An application is working on one server but doesn't work on another?
|
<p>I have a new web application. I've setup the application and it's working on one server(xxx) but it's not working on another(yyy). I changed the web.config file(checked throughly and I've changed the connection string and appsettings). </p>
<p>What could be the error?</p>
<p>The login page is working but when I proceed a Javascript error occurs...</p>
<p><strong>(Line: 48 Error: Object doesn't support this property or method)</strong> </p>
<p>Here's the code</p>
<pre><code>function callCompForFileUpload(responseText)
{
document.getElementById("btnView").disabled = false;
var objFolderUpload = document.getElementById("FolderUpload");
var UploadURL = document.getElementById("HdnFolderUploadURL").value + "?rid=" + responseText;
// this is error line
objFolderUpload.ShowForm(UploadURL);
}
</code></pre>
<p>Thanks saj </p>
|
javascript asp.net
|
[3, 9]
|
3,402,629 | 3,402,630 |
How to add text to span control dynamically in c#
|
<p>net c#. I am using a place holder, and adding span dynamically to the place holder. How can i add text to span dynamically in c# asp.net?</p>
|
c# asp.net
|
[0, 9]
|
1,926,055 | 1,926,056 |
jQuery Design Pattern for Updating Selectors When the HTML Changes
|
<p>I'm looking for some advice on a making my jQuery selectors more configurable. For example, given the following HTML generated by PHP:</p>
<pre><code><ul id="my-list">
<li>first</li>
<li>second</li>
</ul>
</code></pre>
<p>And a bit of jQuery:</p>
<pre><code>$(function() {
$(document).on("click", "#my-list li", function() {
alert("You clicked " + $(this).text());
});
});
</code></pre>
<p>So far so good, but then one day the designer comes along and renames the id "my-list" to "list-of-numbers", and the javascript stops working. Currently the solution is <em>remembering</em> to grep through the code for any references to "my-list", but that's very faulty. Is there a jQuery design pattern for making the selectors configurable?</p>
|
javascript jquery
|
[3, 5]
|
3,335,672 | 3,335,673 |
jQuery DateRangePicker and Tabs
|
<p>I am using <code>daterangepicker</code> plug-in inside jQuery <code>tabs</code>. Everything works fine in the first tab, but in the second tab when I click in the input field that has daterangepicker, it appears in the upper left corner.</p>
<p>I am assuming that might be because the DOM was changed by the tabs plugin and it can't initialize the way it did. I tried to put DateRangePicker initialization code after Tabs, but still no luck.</p>
<p>Here's the code:</p>
<pre><code>$("#aqtabs").tabs();
$('.date-range-picker').daterangepicker({ //settings here});
$('.b2b-date-range-picker').daterangepicker({//settings here });
</code></pre>
<p>I had to create two different classes for daterangepicker because if I use two of the same class, it doesn't put the values in the correct fields.</p>
|
javascript jquery
|
[3, 5]
|
3,954,809 | 3,954,810 |
How to display only one key if i hold the key down in the textarea
|
<p>Is There any possible way to display only one character when a key is pressed <strong>DOWN</strong> for a longer period of time what I mean is when I press lets say 's' <strong>DOWN</strong> for a longer period of time I want only 's' displayed and I don't want this to happen 'ssssssssssssssssssssssssssssssssssssssss....' . </p>
<p>And whit out using this method because this brings on the problem that if a user types fast and presses two keys at the same time only the second one will get displayed for example if I press down 'k' and press down whit out letting 'k' go the 'p' only the 'p' will get displayed. </p>
<pre><code>var textarea='';
document.getElementById('textareaID').onkeydown=keydown;
document.getElementById('textareaID').onkeyup=keyup;
function keydown () {
this.value=textarea;
}
function keyup () {
textarea=this.value;
this.value=textarea;
}
</code></pre>
<p>And please do not say using counters because it doesn't work for some reason believe me I have tried for the last 3 days.</p>
<p><a href="http://toki-woki.net/lab/long-press/" rel="nofollow">http://toki-woki.net/lab/long-press/</a> this is what i am basically trying to do but I cant understand how the part where you hold the key down and only one is displayed out is done and of course if i press a key and while the key is down i press another one both of them get displayed rest is easy.</p>
<p>So i would love and explanation its driving me crazy.</p>
|
javascript jquery
|
[3, 5]
|
38,882 | 38,883 |
how to change master page label's text after a button click on child page
|
<p>I am using shopping cart icon showing number of products in cart. but when i add item to cart shopping is not updated.so i want to know if there is any method to change master page label's text after a button click on child page.</p>
|
c# asp.net
|
[0, 9]
|
5,995,619 | 5,995,620 |
Replace an image in code behind for Asp.net
|
<p>I have a page, which is called from 2 different functions. For each function, the page has to be display different image. I have 2 images. </p>
<p>On the aspx page, code is like this. Please help me out how to display different image for different functions!! Thanks Guys!!</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,487,689 | 4,487,690 |
PHP var in jquery call
|
<p>This is working, but there is probably a better way to pass the php var. does anyone have any options? thanks</p>
<pre><code><?php $slide = "fade"; ?>
$(document).ready(function()
{
$("#showcase_right").awShowcase({transition : "<?php echo $slide; ?>"});
});
</code></pre>
|
php jquery
|
[2, 5]
|
541,835 | 541,836 |
Problem with jQuery-check after submitting a form
|
<p>I have a form, and before it submits I want to check some of the input against a database. The idea: 1) submit form, 2) check values, 3) show error or actually submit the form. Example:</p>
<pre><code>$(form).submit(function() {
$.post('check.php', {
values
}, function(res) {
// result I need before submitting form or showing an error
});
return false;
});</code></pre>
<p>Now, it takes some time before I get the result (i.e. not instantly), so I put in the <code>return false</code> at the bottom, preventing the form to submit before I get the $.post results back and do something with it.</p>
<p>Problem: after I get the results from $.post, and everything turns out to be OK, how do I tell the script to go on with submitting the form? If I use <code>submit()</code> it'll just take it back to this check script, creating an endless loop.</p>
<p>Any ideas? Thanks in advance and Merry Christmas!</p>
|
php jquery
|
[2, 5]
|
3,650,005 | 3,650,006 |
Logical operator OR problem: jQuery
|
<p>Or operator does not work. could you help how to get it right. </p>
<pre><code>$('.iconWrapper span').click(function(e) {
$('#div1').find('img').attr('src', function(index, src) {
if( src =='../../photo/roz1.jpg' || '../../photo/roz2.jpg'){
alert ('ohra');
}else{
alert ('lil');
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,217,975 | 1,217,976 |
Code behind file not recognizing controls in *.ascx
|
<p>I have a QuestionControl.ascx and a QuestionControl.ascx.cs code behind file I copied to a new project. When I build the project any references in the code behind file to controls declared in the ascx gives me this error:</p>
<blockquote>
<p>'QuestionControl' does not contain a
definition for 'rdbtnlstQuestion1' and
no extension method
'rdbtnlstQuestion1' accepting a first
argument of type 'QuestionControl'
could be found (are you missing a
using directive or an assembly
reference?)</p>
</blockquote>
<p>This is at the top of my *.ascx:</p>
<pre><code><%@ Control Language="C#" AutoEventWireup="true" CodeFile="QuestionControl.ascx.cs" Inherits="QuestionControl" %>
</code></pre>
<p>I've also tried CodeBehind:</p>
<pre><code><%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuestionControl.ascx.cs" Inherits="QuestionControl" %>
</code></pre>
<p>This is the top of my class in the codebehind file, it is not contained in a namespace:</p>
<pre><code>public partial class QuestionControl : System.Web.UI.UserControl
{
</code></pre>
|
c# asp.net
|
[0, 9]
|
417,168 | 417,169 |
How to create layout when using spinner
|
<p>hello android developers i am using spinner control in my application.when i click the spinner i need to get new layout in the right side of the spinner.How to code that.please help me.</p>
|
java android
|
[1, 4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.