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,997,673
| 2,997,674
|
Jquery ignore elements with "disabled" class
|
<p>I'm using jquery and creating event handlers like this:</p>
<pre><code>$('#some_selector a.add').live('click', function(){...});
</code></pre>
<p>However, I need to <strong>not execute</strong> handlers when an element has <code>disabled</code> class. Then I wrote the following to achieve this:</p>
<pre><code>$('#some_selector a.add:not(.disabled)').live('click', function(){...});
</code></pre>
<p>But I'm tired of watching over all the places that I need to add <code>:not(.disabled)</code>, sometimes I forget to add it and so on. Moreover, if I have an anchor element and my handler prevents default action on it, than adding <code>:not(.disabled)</code> will cause browser to open next page instead of doing nothing. </p>
<p>So is there a way to set up automatic disabling on handler execution when an element meets some condition (like having "disabled" class)?</p>
|
javascript jquery
|
[3, 5]
|
5,118,789
| 5,118,790
|
How to get div height value in JavaScript or jQuery?
|
<p>I need to get a <code>div</code>'s height in JavaScript or jQuery and change it's value in CSS.</p>
<p>How could I do this in jQuery or JavaScript?</p>
|
javascript jquery
|
[3, 5]
|
2,501,827
| 2,501,828
|
How can I load an aspx page in another aspx page in a specific <div> tag
|
<p>I would like to update a certain part of the page with content from another *.aspx page, thus avoiding having to have just one (very) long page of code.</p>
<p>So: How can I load an aspx page in another aspx page in a specific tag, without having to reload the entire page.</p>
|
c# asp.net
|
[0, 9]
|
4,704,567
| 4,704,568
|
Using javascript to insert links in text WITHOUT replacing entire content of div
|
<p>I'm writing a widget that searches for specific keywords in a specified "#content" div. </p>
<p>Here is how I set it up originally using jQuery (simplified version):</p>
<ul>
<li>set a variable equal to the html of the content: <code>var content = $('content').html();</code></li>
<li>use some regexes to replace certain keywords with <code><a href='link.html'>keyword</a></code></li>
<li>replace the html of the content div with the new content: <code>$('content').html(content);</code></li>
</ul>
<p>This works for the most part, but the problem occurs when the "#content" div contains javascript. When I set <code>$('content').html(content)</code>, it re-runs any javascript code contained in the <code>$('content')</code> div, which can cause errors. Since this is a widget that I'm writing to work on any site, I don't have control over the content div, and whether there will be any javascript in it.</p>
<p>My questions is, is there a way to replace JUST the keywords with <code><a href='link.html'>keyword</a></code>, WITHOUT replacing the entire content of the div?</p>
|
javascript jquery
|
[3, 5]
|
3,023,310
| 3,023,311
|
Translate Java code to PHP code (13 lines)
|
<p><a href="http://stackoverflow.com/questions/1351828/combinatorics-building-10-groups-of-100-elements-while-elements-remain-sorted">simonn helped me to code an ordered integer partition function here.</a> He posted two functions: one function simply gives back the count of partitions, the second function gives the partitions as a list.</p>
<p>I've already managed to translate the first function from Java to PHP:</p>
<ul>
<li><a href="http://paste.bradleygill.com/index.php?paste%5Fid=15870" rel="nofollow">Java version</a></li>
<li><a href="http://paste.bradleygill.com/index.php?paste%5Fid=15770" rel="nofollow">PHP version</a></li>
</ul>
<p>Unfortunately, I can't manage to translate the second function. Can anyone help me and translate this small function for me?</p>
<pre><code>public class Partitions2
{
private static void showPartitions(int sizeSet, int numPartitions)
{
showPartitions("", 0, sizeSet, numPartitions);
}
private static void showPartitions(String prefix, int start, int finish,
int numLeft)
{
if (numLeft == 0 && start == finish) {
System.out.println(prefix);
} else {
prefix += "|";
for (int i = start + 1; i <= finish; i++) {
prefix += i + ",";
showPartitions(prefix, i, finish, numLeft - 1);
}
}
}
public static void main(String[] args)
{
showPartitions(5, 3);
}
}
</code></pre>
<p>It would be great if the solution would be one single function instead of a class with several functions.</p>
<p>Thank you very much in advance! And thanks again to simonn for this great answer!</p>
|
java php
|
[1, 2]
|
3,809,688
| 3,809,689
|
Android VideoView cannot play video
|
<p>I am trying to play video in Android. My widget is Kindle Fire so Android version is 2.3.4.
Here is my code:</p>
<pre><code>super.onCreate(savedInstanceState);
setContentView(R.layout.video);
Uri uri = Uri.parse(getIntent().getExtras().getString(VIDEO_URI));
MediaController mediaController = new MediaController(this);
VideoView videoView = (VideoView) findViewById(R.id.videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(uri);
videoView.requestFocus();
videoView.start();
</code></pre>
<p>It shows dialog box with title </p>
<p>"Cannot play video" </p>
<p>and message </p>
<p>"An error occured while trying to play your video. The video may have been interrupted or is an unsupported format. Please try again."</p>
|
java android
|
[1, 4]
|
4,601,256
| 4,601,257
|
Deployed ASP.NET site has DEBUG true
|
<p>I have a deployed ASP.NET site. The <code>compilation</code> setting for <code>debug</code> is set to <code>false</code>. I have some code that checks the <code>DEBUG</code> define and it is reporting <code>true</code>.</p>
<p>Why? What do I need to do for this to be <code>false</code>?</p>
<p>This used to work but ever since I upgraded my website from .NET 2.0 to .NET 3.5, I see this problem. Note that the server was always .NET 3.5.</p>
<p><strong>Update</strong><br>
As already stated above, in my web.config file <code>debug</code> is <code>false</code> (I understand the the DEBUG preprocessor symbol and the web.config setting are not related). In addition, the Configuration Manager of VS2010 only provides Debug as a configuration for the website and any attempt to add Release is overwritten by VS2010.</p>
<p>I just realised one other detail; I am using SP1 beta of VS2010. Perhaps this is causing the problem?</p>
|
c# asp.net
|
[0, 9]
|
1,475,860
| 1,475,861
|
jQuery Extension accepting a String not just an Object
|
<p>This might be a silly question, but I can't seem to find a solution...</p>
<p>I just wanted to make a <strong>isNullOrWhiteSpace</strong> extension (same name as the .NET one), to determine if a string is <code>'', '0', 0, undefined, null</code>. Nothing crazy.</p>
<p>Now doing it with a typical jQuery extension, it seems it is always looking for a jQuery <strong>Object</strong> to be passed in. But for in my extension, I need it to work with a simple <strong>string</strong>, but it doesn't work at all when I do.</p>
<pre><code>$.fn.isNullOrWhiteSpace = function () {
if (['', '0', 0, undefined, null].indexOf($.trim(this)) > -1) {
return false;
}
return true;
};
'testing'.isNullOrWhiteSpace(); // doesn't work
// Uncaught TypeError: Object has no method 'isNullOrWhiteSpace'
</code></pre>
<p><strong>What am I missing here??</strong></p>
<p>-- from answers below, turns out it should be simply:</p>
<p><strong><code>$.isNullOrWhiteSpace</code></strong>, the <code>$.fn.</code> part makes it a jQuery-Object extension as opposed to just a regular extension (like <code>$.isArray()</code>, <code>$.trim()</code> (which I use in my own question... sigh))</p>
|
javascript jquery
|
[3, 5]
|
259,250
| 259,251
|
How to create flyout effect using jQuery
|
<p>See: <a href="http://www.obout.com/flyout/flyout.aspx" rel="nofollow">http://www.obout.com/flyout/flyout.aspx</a></p>
<p>How to create a flyout effect similar to the one shown in the page linked to above using jQuery? </p>
|
javascript jquery
|
[3, 5]
|
5,428,017
| 5,428,018
|
Setting a default value in sharedpreferences
|
<p>Is there a method to set default values in shared preferences?</p>
<p>Here is my load preferences code</p>
<pre><code> public void LoadPreferences() {
SharedPreferences sharedPreferences = getSharedPreferences(values, MODE_PRIVATE);
String strSavedMem1 = sharedPreferences.getString("MEM1", "");
String strSavedMem3 = sharedPreferences.getString("MEM3", "");
</code></pre>
<p>and here is my save preferences code</p>
<pre><code> public void SavePreferences(String key, String value) {
SharedPreferences sharedPreferences = getSharedPreferences(values, MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(key, value);
editor.commit();
}
</code></pre>
|
java android
|
[1, 4]
|
1,970,379
| 1,970,380
|
Loop through a set of ids and copy them
|
<p>I have an unordered list with ids like so:</p>
<pre><code><li id="e1">01</li>
<li id="e2">02</li>
<li id="e3">03</li>
<li id="e4" class="event_day">04</li>
<li id="e5" class="event_day">05</li>
</code></pre>
<p>And a div with content like so:</p>
<pre><code><div id="descriptions">
<div></div>
<div></div>
</div>
</code></pre>
<p>I want to copy the ids of the list items with the class event_day and assign them to the divs with a letter at the end so that they would become:</p>
<pre><code><div id="e4d"></div>
<div id="e5d"></div>
</code></pre>
<p>I have come up with:</p>
<pre><code>$("#descriptions>div").each(function() {
$(this).attr("id", $(".event_day").attr("id") + "d");
});
</code></pre>
<p>But as you can probably tell, it does not loop and rather takes the first id and assigns it to all the divs resulting in:</p>
<pre><code><div id="e4d"></div>
<div id="e4d"></div>
</code></pre>
<p>I'd highly appreciate it if you could explain the flaw in the logic and maybe even a link to something that I could read to improve my skills. I was looking at <a href="http://docs.jquery.com/Attributes/attr#keyfn" rel="nofollow">http://docs.jquery.com/Attributes/attr#keyfn</a> but it did not make sense. Thanks for reading!</p>
|
javascript jquery
|
[3, 5]
|
4,472,081
| 4,472,082
|
I.E - keypress happen all the time - jquery
|
<p>i have a problem with ie, like always.</p>
<p>check this demo with IE9 or 8: <a href="http://jsfiddle.net/C5Jzw/4/" rel="nofollow">DEMO</a></p>
<p>go inside the input and hit the <strong>enter</strong>, i dont know why the alert will apear.</p>
<p>bug ?</p>
<pre><code> // the button
$("#client").live("click", function(){
alert('test');
});
// the input text
$("#pesq_model").live("keypress", function(e){
// testing with nothing
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,176,828
| 1,176,829
|
Read cookie values through javascript or jquery
|
<p>I have called one asp page inside the iframe</p>
<p>You can check here: <a href="https://www.fiestacups.com/ProductDetails.asp?ProductCode=DUMMY" rel="nofollow">https://www.fiestacups.com/ProductDetails.asp?ProductCode=DUMMY</a></p>
<p>If customer select font and select clip art image or upload image for clip art then I have store all that values in cookies.</p>
<p>Now I want to get that cookies values in java-script variable on the another page.</p>
<p>How can I do this?
Please help me....</p>
|
javascript jquery
|
[3, 5]
|
1,853,016
| 1,853,017
|
how to import multiple sql file in android db using jquery
|
<p>I have multiple sql file in my assets folder and building app on android. I want this sql to import in android app database on by one using jquery. How to do that please help. I have done code for single file but i want it for multiple sql file. </p>
<pre><code>var filePath = 'database/crmaaaa_1.sql';
//alert(filePath);
$.get(filePath, function (response) {
var statements = response.split('\n');
var shortName = "crm1";
var version = '1.0';
var displayName = 'crm1';
var maxSize = 40000000; // bytes
// db = openDatabase(shortName, version, displayName, maxSize);
var db = window.openDatabase(shortName, version, displayName, maxSize);
// db.transaction(populateDB, errorCB);
db.transaction(function (transaction) {
jQuery.each(statements, function (index, value) {
// alert("query"+value);
if (value != '') {
transaction.executeSql(value, [], successHandler, function (e) {
alert("Error executing sql " + value);
});
}
});
});
});
</code></pre>
|
android jquery
|
[4, 5]
|
1,268,756
| 1,268,757
|
calling javascript function from code behind
|
<p>I am trying to call a javascript function from code behind on the button click event. below is my javascript code.</p>
<pre><code> ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "strScript", "javascript:clearBox();", true);
</code></pre>
<p>and the function is</p>
<pre><code><script type="text/javascript">
function clearBox() {
alert("Test");
}
</script>
</code></pre>
<p>I get an error "Object expected"</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,010,971
| 3,010,972
|
Nested conditional statements (if, switch then if again)
|
<p>Quick question: is this kind of nesting possible?
An if statement first passing a switch and then another if statement so it won't affect other values that were not caught on switch?</p>
<pre><code>var cookie = ""; //some value previously setted by filtering a cookie, like a product id
var prod = "";
var img = "";
if ((cookie != null) && (prod != '')) {
switch (cookie) {
case '001': case '002': case '003':
prod = "Product01";
img = "product01.jpg"
break;
case '004': case '005': case '006':
prod = "Product02";
img = "product02.jpg"
break;
case '007': case '008':
prod = "Product03";
img = "product03.jpg"
break;
case 'null':
break;
}
if (window.location.pathname == 'somepage') {
//jQuery code
} else if (window.location.pathname == 'anotherpage') {
//jQuery code
} else {
//jQuery code
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
390,982
| 390,983
|
Ordering javascript code on a page executed with argument calculated in codebehind in ASP.NET
|
<p>A situation requires me to order javascript code on a page be executed with an argument calculated in codebehind in ASP.NET</p>
<p>Here is the situation:</p>
<p>I have a page called search.aspx . This page contains a button and a textbox. Users put their arguments for search in the textbox and then click the button. The button posts back and runs a button click method. This code behind logic (running on the server) serializes and inserts the contents of the textbox to a DB. </p>
<p>Assuming a rowID or something to identify the serialized query by will be returned inside the button click method, how can I then tell the page (search.aspx) to open a new tab with results.aspx?query=.</p>
<p>I know I have to use javascript as the code behind can't open a new tab, but I am just wondering how to do so.</p>
<p>I've never used JS so a maximum amount of details in the answer is better.</p>
|
asp.net javascript
|
[9, 3]
|
3,883,328
| 3,883,329
|
How to read HTTP POST Request Message Parameters in c#
|
<p>I am able to read the url and entire page but not able to read the HTTP POST Request Message Parameters in c#.
In my situation i am posting a post url to a site after they verify they send me a HTTP Post message with parameters like id.</p>
<p>here is my code in c#</p>
<pre><code>HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create(uri);
postsourcedata = "processing=true&Sal=5000000";
request1.Method = "POST";
request1.ContentType = "application/x-www-form-urlencoded";
request1.ContentLength = postsourcedata.Length;
request1.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)";
Stream writeStream1 = request1.GetRequestStream();
UTF8Encoding encoding1 = new UTF8Encoding();
byte[] bytes1 = encoding1.GetBytes(postsourcedata);
writeStream1.Write(bytes1, 0, bytes1.Length);
writeStream1.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
StreamReader readStream = new StreamReader(responseStream, Encoding.UTF8);
string page = readStream.ReadToEnd();
//page.Close();
return page.ToString();
</code></pre>
<p>They are sending me request parameters like id and text , how to read these parameters on my side.I am posting to the website through a web service.</p>
<p>Can anyone help me with this?</p>
|
c# asp.net
|
[0, 9]
|
3,190,815
| 3,190,816
|
Getting system's hardware information of a connected user to a PHP website ? Is it possible?
|
<p>I am posting this in order to confirm if it is possible for PHP to get a user's machine hardware information when connected to a website? </p>
<p>In my case I am developing an Intranet which requires one user - one machine login. Which means a user assigned to his/ her machine can only login, others cannot login from that particular machine. In this regard, my database and PHP Code is already up and running without machine dependency. </p>
<p>I presume it is not possible because PHP is a Server Side code which requires none of the User's system resources to get in touch with. To get system's hardware information - some application must be installed in user's machine to get it done. But is this possible in any regard for example a PHP Desktop application (though not in development) or any Java application to check machine's information and get appended it to Normal user's login. </p>
<p>Awaiting experts solutions...</p>
|
java php
|
[1, 2]
|
3,616,868
| 3,616,869
|
direct user to another page
|
<p>how do i code it as javascript when user leave the field empty, they will direct the user to another page?</p>
<p>i'm using asp.net..</p>
|
asp.net javascript
|
[9, 3]
|
1,074,446
| 1,074,447
|
Position element through css
|
<p>what part of my code is wrong I keep getting invalid argument</p>
<p>I want to position the div element outside the document window on the left.</p>
<pre><code>jQuery(this).css({"left": (jQuery(document).css("left") - jQuery(form).width())});
</code></pre>
|
javascript jquery
|
[3, 5]
|
301,258
| 301,259
|
disabling an input button
|
<p>I want to disable this button on document ready but I'm new to it so please help:</p>
<p>Here is my code: </p>
<pre><code> $(document).ready function {
setTimeout("check_user()", 250);
}
</code></pre>
<p>please help</p>
|
javascript jquery
|
[3, 5]
|
1,528,447
| 1,528,448
|
How to easily time a block of C# code?
|
<p>I need a simple way (and compact if possible) to execute a block of C# while counting time. Something similar to this C++ code:</p>
<pre><code>elapsed = time_call([&]
{
for_each (a.begin(), a.end(), [&](int n) {
results1.push_back(make_tuple(n, fibonacci(n)));
});
});
</code></pre>
<p>where time_call is:</p>
<pre><code>// Calls the provided work function and returns the number of milliseconds
// that it takes to call that function.
template <class Function>
__int64 time_call(Function&& f)
{
__int64 begin = GetTickCount();
f();
return GetTickCount() - begin;
}
</code></pre>
<p>I know the stopwatch way... anything more compact ?</p>
|
c# c++
|
[0, 6]
|
346,300
| 346,301
|
inserting arraylist values into database
|
<p>i have used a checkbox list in my project .am storing all the checked items values in arraylist using code below</p>
<pre><code> ArrayList services= new ArrayList();
for (int i = 0; i < chkservices.Items.Count; i++)
{
if (chkservices.Items[i].Selected == true)
{
services.Add(chkservices.Items[i].Text+',');
}
}
</code></pre>
<p>now the problem is when i insert data in to database instead of data in the arraylist it gets inserted as '<strong>System.Collections.ArrayList</strong>' how can i insert all values into database in a single insert statement?</p>
<p><strong>EDIT</strong></p>
<p>inserting into database </p>
<pre><code>con.Open();
SqlCommand cmd = new SqlCommand("insert into XXX(First_Name,Last_Name,ServicesProvided) values ('" + txtfrstname.Text + "','" + txtlastname.Text + "','" + services + "')", con);
cmd.ExecuteNonQuery();
con.Close();
</code></pre>
<p>or could anyone provide me a alternative for arraylist..i need to save checked items from checkboxlist and save it in database</p>
<pre><code>it should be saved in database as
First_Name Last_name ServicesProvided
user1firstname user1lastname selectedvalue1,
selectedvalue2,selectedvalue3
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,038,475
| 1,038,476
|
Read data of post method in PHP
|
<p>I am requesting to PHP server as below code snippet </p>
<pre><code>StringEntity stringEntity = new StringEntity(myString, "UTF-8");
httppost.setEntity(stringEntity);
httppost.addHeader("Accept", "application/xml");
httppost.addHeader("Content-Type", "application/xml");
</code></pre>
<p>Now I want to read that xml data into PHP server. </p>
<p>How can I read that?</p>
|
java php android
|
[1, 2, 4]
|
4,272,446
| 4,272,447
|
Avoiding having to write the same word over and over again
|
<p>I'm very new to javascript so this question might sound stupid. But what is the correct syntax of replacing certain words inside variables and functions. For example, I have this function:</p>
<pre><code>function posTelegram(p){
var data = telegramData;
$("#hotspotTelegram").css("left", xposTelegram[p] +"px");
if (p < data[0] || p > data[1]) {
$("#hotspotTelegram").hide()
} else {
$("#hotspotTelegram").show()
}
};
</code></pre>
<p>There is the word "telegram" repeating a lot and every time I make a new hotspot I'm manually inserting the word to replace "telegram" in each line. What would be a smarter way of writing that code so that I only need to write "telegram" once?</p>
|
javascript jquery
|
[3, 5]
|
2,901,795
| 2,901,796
|
Load images in jQuery modal only on modal open
|
<p>I have a modal div which is hidden by default.</p>
<p>The div contains a few images and I want to load the page as quickly as possible.</p>
<p>Is it possible to actually load the images only when the modal is opened and not before?</p>
|
javascript jquery
|
[3, 5]
|
5,836,139
| 5,836,140
|
Problem with blur and click event?
|
<p>I have a web application with asp.net and at code behind with Jquery.</p>
<p>In that there are text boxes and a grid. There is written blur event in jquery page for the text boxes and row click event for the row in table. </p>
<p>When click the row then as per row value its details will displays in text boxes. My problem is that when I update the text box value (also that present in grid row) then goes in next text box then every thing will goes fine, blur event fires and data saved and will refresh if click on the grid row. But when i update something in text box and without pressing tab directly click on the grid row then blur event not fired and data not been saved directly click event fired and error comes when grid event calls. Also if I place debug point at the blur event and click event then the control comes in blur event, data will be saved but without firing row click event at that time. </p>
<p>What the problem occuring? ow to solves the problem? Any Idea.</p>
<p>Thanks in advance.</p>
|
jquery asp.net
|
[5, 9]
|
899,126
| 899,127
|
Update multiple div with jquery load
|
<p>I want to update two div on same page with single jquery .load call</p>
<p><strong>Script</strong></p>
<pre><code> $('#ipc').load('/dashboard/details/options');
$('#inv').load('/dashboard/details/options');
</code></pre>
<p>I don't want to do this by traditional ajax call.
I also tried append method and .each() function.</p>
|
javascript jquery
|
[3, 5]
|
2,077,532
| 2,077,533
|
Token based Web Site logins?
|
<p>I'm really not sure how this works and can't seem to find much info on it.</p>
<p>I play a PC exe game where I can be logged in in-game. I then click the store button. It opens my browser. I see some token stuff in the url then it logs me in to the site with my profile and everything.</p>
<p>How would something like this typically work or be implemented?</p>
<p>Thanks</p>
|
php c++
|
[2, 6]
|
4,835,136
| 4,835,137
|
Add div to parent with absolute position
|
<p>I have one parent div with style position relative and couple divs inside that div with style absolute like </p>
<pre><code><div id="container" style="position:relative;width=400px;height=400px;">
<div style="top:20px;left:20px;width:20px;height:20px;"></div>
<div style="top:40px;left:40px;width:20px;height:20px;"></div>
<div style="top:60px;left:60px;width:20px;height:20px;"></div>
</div>
</code></pre>
<p>How to add new div to div with <code>id="container"</code> with <code>top="0px" left="0px"</code>?</p>
|
javascript jquery
|
[3, 5]
|
2,101,852
| 2,101,853
|
changing an images src value when the user scrolls jquery
|
<p>I'm trying to attach an event handler to the scroll event that changes the value of the image tag's src value by returning a random value from an array of src values (titles)</p>
<p>$( function(titlemagic){</p>
<pre><code>var titles =[
</code></pre>
<p>//ive omitted the actual array contents in consideration of post length</p>
<pre><code> ];
</code></pre>
<p>var rand = Math.ceil(100*Math.random())</p>
<p>$('#id').attr('src', function(){ return titles[(rand)] }).scroll();</p>
<p>});</p>
|
javascript jquery
|
[3, 5]
|
4,430,934
| 4,430,935
|
Starting and Stopping setInterval and clearInterval
|
<p>I'm very new to Javascript and jQuery and may have jumped into the deep end by trying to create a responsive slide show. I have the following code in terms of resizing the slider to fit the window, using a function that sets the individual slides to equal the width of the slider container by using setInterval: </p>
<pre><code>var slider = $('.slider'), // Get the div with a class of slider
sliderWidth = slider.width(), // Get the width of the slider
gallery = $('.slider ul'),
slides = $('.slider ul').children('li'),
noOfSlides = slides.length,
speed = 5000,
current = 0,
slideShowInt,
responseSlider;
// Initially set the width of the li to equal the width of the slider
$('.slider ul').children('li').width(sliderWidth);
// Run a function that keeps making the
// li width equal the slider when window is resized
function resizeSlider(){
responseSlider = setInterval(function(){
slider = $('.slider'),
sliderWidth = slider.width();
slides.width(sliderWidth);
console.log(sliderWidth);
},10);
}
$(window).resize(resizeSlider);
clearInterval(responseSlider);
</code></pre>
<p>This may not even be the right way to go about doing this but I would like to know if it is possible to stop the setInterval from running using clearInterval, until the window is resized again. In its current state, looking at the console, it just continues to log the width.</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
480,896
| 480,897
|
Asp.net need Simultaneous display in Second Text Box
|
<p>I have two text boxes I need a functionality like If I am typing in 1st text box The text should be getting displayed in 2nd text Box with some other font. This is a web Application. And so Text Box doesn't have OnKeyDown event? Do you suggest any way to implement this?</p>
<p><strong>Note:</strong> I don't want to implement this with Javascript.</p>
|
c# asp.net
|
[0, 9]
|
5,396,123
| 5,396,124
|
Getting last file input in a table
|
<p>Here is my html:</p>
<pre><code> <table>
<tbody><tr>
<td>
<label for="DocumentsName">Názov</label>
</td>
<td>
<input name="DocumentsName" class="input documentsName" value="" style="width: 10em;" type="text">
</td>
</tr>
<tr>
<td>
<label for="DocumentsDescription">Popis</label>
</td>
<td>
<textarea name="DocumentsDescription" id="DocumentsDescription" cols="15" rows="4" class="input" style="width: 340px; font: 1em sans-serif;"></textarea>
</td>
</tr>
<tr>
<td>
<label for="Document1">Doc 1</label>
</td>
<td>
<input name="Document1" class="input document1" style="width: 10em;" type="file">
</td>
</tr>
</tbody></table>
<a href="#" id="addDocumentFileInput">+++++</a>
</code></pre>
<p>I am trying to get the litest input with type="file" from the table upon clicking the #addDocumentFileInput link.</p>
<p>This returns null. Why?</p>
<pre><code> <script type="text/javascript">
$(document).ready(function() {
$("#addDocumentFileInput").click(function() {
var $lastFileInput = $(this).prev().children("tr").last().children("input");
alert($lastFileInput.html());
return false;
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
163,859
| 163,860
|
automatically authenticate user using c# membership provider
|
<p>I am using c# membership provider and I get the username from a query string. Now I need to check if the username exist if it does I need to automatically authenticate the user.</p>
<p>How do I check if the user exists in the membership database?</p>
|
c# asp.net
|
[0, 9]
|
4,156,396
| 4,156,397
|
Word Replacement with jquery
|
<p>Thanks in advance for the help.</p>
<p>I have been fooling around with browser extensions (a novice) and I have been trying to figure out some word swapping issues; specifically, I am trying to do something akin to a <a href="http://en.wikipedia.org/wiki/Rebus" rel="nofollow">rebus</a>.</p>
<p>I tested my code out on just a plain text page, and it works. But then, when making it an extension, it basically loses the styling on the page and turns it into text only.</p>
<p>I have been looking for a more unobtrusive way to swap a word like "shoe" with an image of a shoe. I have been working in jQuery and using the documentation to make what I already did below. </p>
<pre><code>$(document).ready(function () {
var newText = $("body").text().split(" ");
$.each(newText, function(index, value) {
if (newText[index] === "shoe") {
newText[index] = "<img src='http://.../shoe.png' alt='shoe'>";
}
});
var altText = newText.join("</span> <span>");
$("body").html(altText);
});
</code></pre>
<p>I see what I am doing: ripping the text out and then shoving back in. But I am at a loss of what I should use. </p>
<p>I am aware of the <code>replaceWith()</code> function and I suppose that is the right one to use. But how do I get to the "shoe" words in the first place? </p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,203,730
| 2,203,731
|
Find the date Last sunday of October in ASP.NET c#
|
<p>Hii,
Is there any way to find out the date in which last sunday of October in ASP.NET c#
I am using .net 2.0</p>
|
c# asp.net
|
[0, 9]
|
5,157,569
| 5,157,570
|
Android RSS Example
|
<p>How do you do you fetch a single RSS feed and show it in an ListView?</p>
<p>I realize there's hundreds of ways, but a clean and simple example would be appreciated.</p>
|
java android
|
[1, 4]
|
1,053,692
| 1,053,693
|
JQuery - Output the class name of checked checkboxes
|
<p>I am wondering whether or not it is possible to output the class name of checked checkboxes each time a checkbox is checked/unchecked? For example, I have 3 checkboxes. If I check one, it'll output its class name, if I then check a 2nd one it'll output the first checkbox class name + the 2nd class name. If I then uncheck the first checkbox, it'll only output the class name of the 2nd checkbox.. and so forth? I made a JSFiddle to get started... <a href="http://jsfiddle.net/LUtJF/">http://jsfiddle.net/LUtJF/</a></p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
208,298
| 208,299
|
Filter strings with jQuery/Javascript
|
<p>Im trying to use $.get to load pages without reloading the page. </p>
<pre><code><script>
$('#top_links a').click(function (e) {
e.preventDefault();
var link = $(this).attr('href');
$('#content').empty();
$.get(link, { },
function(data) {
$('#content').empty().append(data);
}
)
});
</script>
</code></pre>
<p>This works but the entire requested page is getting stuffed into <code>#content</code>. Instead of detecting the ajax request and filtering the data on the server-side, I would like to do it client-side. Is there a way to use javascript to effectively filter the string so that I only get certain divs? The content that I want to preserve will all be contained inside of a div called <code>#content</code> ( Im just trying to swap the current page's <code>#content</code> with the requested page's <code>#content</code>).</p>
|
javascript jquery
|
[3, 5]
|
5,644,272
| 5,644,273
|
how to use JSON for an error class
|
<p>Hey all. I was fortunate enough to have Paolo help me with a piece of jquery code that would show the end user an error message if data was saved or not saved to a database. I am looking at the code and my imagination is running wild because I am wondering if I could use just that one piece of code and import the selector type into it and then include that whole json script into my document. This would save me from having to include the json script into 10 different documents. Hope I'm making sense here.</p>
<pre><code>$('#add_customer_form').submit(function() { // handle form submit
</code></pre>
<p>The "add_customer_form" id is what I would like to change on a per page basis. If I could successfully do this, then I could make a class of some sort that would just use the rest of this json script and include it where I needed it. I'm sure someone has already thought of this so I was wondering if someone could give me some pointers.</p>
<p>Thanks!</p>
<p><hr /></p>
<p>Well, I hit a wall so to speak. The code below is the code that is already in my form. It is using a datastring datatype but I need json. What should I do? I want to replace the stupid alert box with the nice 100% wide green div where my server says all is ok.</p>
<pre><code>$.ajax({
type: "POST",
url: "body.php?action=admCustomer",
data: dataString,
success: function(){
$('#contact input[type=text]').val('');
alert( "Success! Data Saved");
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,662,892
| 5,662,893
|
JavaScript functions do not work when jquery loads an external page
|
<p>I have to make a div load an external file every minute. It does load the file but the JQuery functions don't work. Is there any other way I can load the file so that the JavaScript functions work?
My JQuery code-</p>
<pre><code>emaild = $("#hidden").val();
var refresh = setInterval(function() {
$("#load").load('aposts.php?id='+emaild);
}, 60000);
$.ajaxSetup({ cache: false });
</code></pre>
<p>Sorry for the bad English :P</p>
|
php jquery
|
[2, 5]
|
645,481
| 645,482
|
jquery .remove not working as expected
|
<p>I have the following which is supposed to remove the element ".mycontainer" when I click on a close button. It's not removing the element though. When I use firebug. I can see that it is just moving it to outside of the html tags at the beginning on the code.</p>
<pre><code> $('.closeButton').click( function() {
$(".mycontainer").slideUp( function() {
$(".closeButton").parent().appendTo(".ContentsHolder");
$(this).remove();
});
});
</code></pre>
<p>It works if I comment out the 3rd line <code>//$(".closeButton").parent().appendTo(".ContentsHolder");</code></p>
<p>but this removes the content so I can't access it again.</p>
<p>EDIT:</p>
<p>My html looks something like this if it helps to understand what I'm doing...</p>
<pre><code><div class='ContentsHolder'>
</div>
<div class='mycontainer'>
<div class='myContent'>
<a class='closebutton'>close</a>
... other content ...
</div>
</div>
</code></pre>
<p>I have also managed to make it work by putting a delay on the removal of mycontainer <code>$(this).delay(500).remove();</code></p>
<p>I would not think this is a great solution though.</p>
|
javascript jquery
|
[3, 5]
|
496,361
| 496,362
|
How to create custom view from xml-layout?
|
<p>I have the xml layout, and I want to create View from it - I need do it programatically. Is it possible? </p>
|
java android
|
[1, 4]
|
3,550,788
| 3,550,789
|
Android Extendable ListView Child Click
|
<p>At the moment I have this code running. I am working in eclipse and at the moment am getting this error</p>
<blockquote>
<p>The method getItem(int) is undefined for the type Expandable.MySimpleCursorTreeAdapter</p>
</blockquote>
<pre><code> public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
int childPosition, long id) {
// use groupPosition and childPosition to locate the current item in the adapter
Intent intent = new Intent(Categories.this, com.random.max.Random.class);
Cursor cursor = (Cursor) mscta.getItem(childPosition);
intent.putExtra("EMPLOYEE_ID", cursor.getInt(cursor.getColumnIndex("_id")));
//Cursor cursor = (Cursor) adapter.getItem(position);
//intent.putExtra("EMPLOYEE_ID", cursor.getInt(cursor.getColumnIndex("_id")));
startActivity(intent);
return true;
}
</code></pre>
|
java android
|
[1, 4]
|
2,926,469
| 2,926,470
|
Looping through a Listbox created on the fly
|
<p>I am working on exporting data and right now some fields export the value, instead of the text. So I am saving the object that returns the text and value to a list box and matching it to the value in the listbox from the object like so:</p>
<pre><code>MaterialDB materials = new MaterialDB();
DropDownList listBoxMaterials = new DropDownList();
listBoxMaterials.DataSource = materials.GetItems(ModuleId, TabId);
listBoxMaterials.DataBind();
string materialString = "";
foreach (ListItem i in listBoxMaterials.Items)
{
if (i.Value == row["MaterialTypeID"].ToString())
{
materialString = i.Text;
}
}
</code></pre>
<p>When I use this for the i.Value it always returns "System.Data.DataRowView" instead of the actual value. I'm doing this all in code behind. Anyway around this to get it to work?</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
5,999,300
| 5,999,301
|
OnTouchListener() will only execute once while button is pressed and held down
|
<pre><code>brown = (Button) findViewById(R.id.brownButton);
brown.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
count++;
Log.d("count", "" + count);
return true;
} else if (event.getAction() == (MotionEvent.ACTION_UP)) {
count--;
Log.d("count", "" + count);
return true;
}
return false;
}
});
</code></pre>
<p>When my finger presses and holds the button my count will only increment ONCE. When I let go it will decrement accordingly. Please can someone show me how I can get my code to increment as long as my finger is holding the button down. Thanks. </p>
|
java android
|
[1, 4]
|
4,191,332
| 4,191,333
|
Is it possible to send an event from a thread to an activity?
|
<p>If I want to send an event, e.g. OnClick, to an activity from a thread? Thanks.</p>
<p>The expected work flow is below:</p>
<pre><code>public class HelloAndroid extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Crate threadA
Start threadA
}
public void OnSomeEvent() {
do something that changes the views in this activity;
}
private class ThreadA extends Thread {
public void run() {
do something ...
Send Some Event to Activity HelloAndroid.
}
}
</code></pre>
|
java android
|
[1, 4]
|
120,913
| 120,914
|
Local js function to other site that will write a cookie
|
<p>im the owner of domain <code>A.com</code> and <code>B.com</code></p>
<p>in <code>B.com</code> i have handler (ashx) which writes a cookie.</p>
<p>now , im on A.com.</p>
<p>i want to call this handler from site <code>A.com</code> via <code>Js</code>(/jquery) that will activate the <code>B.com's</code> handler - and will write the cookie of B.com in My browser.</p>
<p>does jsonP will help me here ?</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
4,265,750
| 4,265,751
|
Find_java.exe in Android SDK doesn't find Java
|
<p>I've definitely got JDK 1.6.0 installed in <code>C:\Program Files\Java\jdk1.6.0_35</code>, but it never seems to be able to find it when I try to open the SDK Manager. In task manager, find_java.exe shows up until I stop it (will run for hours).</p>
<p>Are there some environment variables I have to set for this to work?</p>
|
java android
|
[1, 4]
|
5,785,414
| 5,785,415
|
Access private members of jQuery plugin
|
<p>jQuery plugins use a pattern like this to hide private functions of a plugin:</p>
<pre><code>(function ($) {
var a_private_function = function (opts) {
opts.onStart();
}
$.fn.name_of_plugin = function (options) {
a_private_function(opts);
}
})(jQuery);
</code></pre>
<p>jQuery then makes those fn functions available like this:</p>
<pre><code>some_callback = function() {};
jQuery('selector').name_of_plugin( { onStart: some_callback } );
</code></pre>
<p>Now I'd like to override <code>a_private_function</code>. Is there any way I can access it without patching the actual plugin code?</p>
<p>I thought maybe I could access the execution context of the private function by using caller but that did not work:</p>
<pre><code>some_callback = function() {
console.log(some_callback.caller.a_private_function); // -> undefined
};
jQuery('selector').name_of_plugin( { onStart: some_callback } );
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,917,998
| 5,917,999
|
how to remain the count down time not beginning at first each time?
|
<pre><code>$(function() {
var count = 20;
countdown = setInterval(function() {
$("p.countdown").html(count + "seconds remailing!");
if (count == 0) {
window.location = 'http://stackoverflow.com/';
}
count--;
}, 1000);
});
<p class="countdown">
</code></pre>
<p>Each time when i refresh the browser, the count down is beginning at 20. i want to when i refresh the browser. the count number not beginning at 20 each time. it begins from the actually time it beginning, how to do some changes to the code?</p>
|
javascript jquery
|
[3, 5]
|
1,466,408
| 1,466,409
|
Is enabling JavaScript in browser a MUST to get working ASP.NET pages?
|
<p>This is a newbie question (I'm sure it is). I have tried for the first time in a little ASP.NET web application I am working on what happens if I disable Javascript in a browser (I'm testing mainly with Firefox). </p>
<p>Result: My application is completely broken, although I didn't ever write any single line of Javascript.</p>
<p>For instance: I have a link button on a page from a LoginStatus control. Looking at the generated HTML code in my browser I see this:</p>
<pre><code><a id="ctl00_ctl00_LoginStatus" href="javascript:__doPostBack('ctl00$ctl00$LoginStatus$ctl02','')">Login</a>
</code></pre>
<p>Similar with some link buttons in a ListView control which allow to sort the list by certain data fields: The <code>href</code> of the generated anchor tag contains this: <code>javascript:WebForm_DoPostBackWithOptions(...)</code>.</p>
<p>So clicking on "Login" or trying to sort does not work without having Javascript enabled.</p>
<p>Does this mean: With disabled Javascript in the browser ASP.NET applications won't work properly? Or what do I have to do to get the application working with disabled Javascript? </p>
<p>Thanks for your feedback!</p>
|
asp.net javascript
|
[9, 3]
|
2,965,535
| 2,965,536
|
javascript countdown clock
|
<p>im trying to write a countdown clock to a certain day in js. I have the following which works if i output it to the page but I cant seem to write it to a div using innerhtml?</p>
<p>Can anybody see where im going wrong? </p>
<pre><code>today = new Date();
expo = new Date("February 05, 2012");
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (expo.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
document.getElementById('cdown').innerHTML = document.write(daysLeft);
</code></pre>
|
javascript jquery
|
[3, 5]
|
863,155
| 863,156
|
PHPs call_user_func_array in Python
|
<p>Is there an equivilant in Python for PHPs <a href="http://bit.ly/4b8WEk" rel="nofollow">call_user_func_array</a>?</p>
|
php python
|
[2, 7]
|
332,134
| 332,135
|
Expand / Collapse Checkbox tree view without plugin
|
<p>I was using the jQuery plug-in <a href="http://static.geewax.org/checktree/index.html" rel="nofollow">http://static.geewax.org/checktree/index.html</a> and I'm able to auto select Default check box based on radio button.</p>
<p>I have two radio buttons:</p>
<p>A)When we click on Default radio button some of check box have to check and its must be read only and rest of check box must be disable(read-only)</p>
<p>B)when we click on Custom button then all the checkbox must be unchecked and they must be editable</p>
<p>This is working fine when i Didn't call that checktree Plugin function , When I call that function the Expand and collapse function not working</p>
<p>Can I add Expand / collapse function for these check-box with any Plugin ... I tried But am not getting what I am looking for :(</p>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
2,404,293
| 2,404,294
|
How to find all elements that DON'T have specific CSS class in jQuery?
|
<p>I would like to get all form elements that don't have a specific CSS class.
Example:</p>
<pre><code><form>
<div>
<input type="text" class="good"/>
<input type="text" class="good"/>
<input type="text" class="bad"/>
</div>
</form>
</code></pre>
<p>What selector should I use to select all elements that don't have 'bad' css class?</p>
<p>Thank you.</p>
|
javascript jquery
|
[3, 5]
|
3,110,485
| 3,110,486
|
Cancelling all events using javascript
|
<p>I have a asp link</p>
<pre><code><asp:LinkButton ID="next" CssClass="Button Large" runat="server" OnClick="Next_Click" OnClientClick="showBillingRequiredState(this)">Next</asp:LinkButton>
</code></pre>
<p>When its clicked I want to cancel the page from continue , I want it to just cancel processing if my javascript return false. Right now I am showing an error but then the error dissapears and it doesnt stick.. something is causing it refresh and I lose my error. Here is the javascript, as I mentioned it passes fine through all my conditions and it shows the div, but then after a second it dissapears.</p>
<pre><code> function showrequired(evt) {
var code = document.getElementById('<%=codelist.ClientID%>').options[document.getElementById('<%=codelist.ClientID%>').selectedIndex].value;
var currentValue= document.getElementById('<%=statevalue.ClientID%>').value;
var eDiv = document.getElementById('reqDiv');
if (code == "US" && currentValue.trim() == '') {
eDiv.style.display = 'block';
return false;
}
else {
eDiv.style.display = 'none';
}
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,924,865
| 3,924,866
|
How to select checkbox and display values in textboxes and when checkbox not selected dont show value
|
<p>I have created a <code>Checkboxlist</code> , <code>Button</code> and two <code>TextBoxes</code>.</p>
<p>When selecting the first value in the <code>checkboxes</code> and press <code>button</code> I want to display it in one of the <code>textboxes</code> and when I uncheck the <code>checkboxes</code> I want the value to disappear from the <code>textboxes</code>.</p>
<pre><code>if (CheckBoxPersonalInfo.Items[0].Selected)
{
LabelFirstName.Text = CheckBoxPersonalInfo.Items[0].Text;
}
else
{
LabelFirstName.Text = "";
}
if (CheckBoxPersonalInfo.Items[1].Selected)
{
LabelLastName.Text = CheckBoxPersonalInfo.Items[1].Text;
}
else
{
LabelLastName.Text = "";
}
</code></pre>
<p>This code work fine , but when unchecking the LabelFirstName.Text & LabelLastName.Text = ""; dont get empty</p>
<p>UPDATE</p>
<pre><code>private void ButtonOKCheckBoxes()
{
EMPLOYEE theEmpl;
using (var db = new knowitCVdbEntities())
{
theEmpl = (from p in db.EMPLOYEES
where p.username == strUserName
select p).FirstOrDefault();
}
if (theEmpl != null)
{
PanelFullCv.Visible = true;
LabelPleaseRegister.Visible = false;
//CheckBoxPersonalInfo.Items[0].Text;
if (CheckBoxPersonalInfo.Items[0].Selected)
{
LabelFirstName.Text = theEmpl.firstname;
}
else
{
LabelFirstName.Text = "";
}
//CheckBoxPersonalInfo.Items[1].Text;
if (CheckBoxPersonalInfo.Items[1].Selected)
{
LabelLastName.Text = theEmpl.lastname;
}
else
{
LabelLastName.Text = "";
}
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,193,595
| 2,193,596
|
Opposite of not() function
|
<p>I have a simple question, I've the following lines which equals to <strong>not active links</strong>:</p>
<pre><code>$links.not($active).each(function()
{
//Do sth...
});
</code></pre>
<p>what is the opposite of the <code>.not(...)</code> function in JavaScript? because I need to know the active links, Any ideas !?</p>
|
javascript jquery
|
[3, 5]
|
2,177,248
| 2,177,249
|
Adding some custom session variables to a JavaScript object
|
<p>I currently have a custom session handler class which simply builds on php's session functionality (and ties in some mySQL tables).</p>
<p>I have a wide variety of session variables that best suits my application (primarily kept on the server side). Although I am also using jQuery to improve the usability of the front-end, and I was wondering if feeding some of the session variables (some basics and some browse preference id's) to a JS object would be a bad way to go.</p>
<p>Currently if I need to access any of this information at the front-end I do a ajax request to a php page specifically written to provide the appropriate response, although I am unsure if this is the best practice (actually I'm pretty sure this just creates a excess number of Ajax requests).</p>
<p>Has anyone got any comments on this? Would this be the best way to have this sort of information available to the client side?</p>
|
php jquery
|
[2, 5]
|
3,533,239
| 3,533,240
|
Dynamic Table navigation in JavaScript using mouse and keyoboard
|
<p>I am using dynamic table creation and I want to create table navigation using keyboard and mouse when the list is populated in the table. Below is the code that is printing the dynamic list in the table and now I want to navigate it. </p>
<pre><code>function validateInputs(dealerresult) {
alert("Hello");
var params = $("#getDealerdetails").serialize();
var url = '<fmt:message key="app.contextPath"/>/channels/getDealerListbyCriteria.htm?channel=1';
$.post(url, params, function (data) {
//alert("Hello");
//alert(data);
var dealerData = data;
var JSONObj = JSON.parse(dealerData).result;
var table = document.getElementById(dealerresult);
var rowCount = table.rows.length;
alert(rowCount);
//var row = table.insertRow(rowCount);
// var cell; = row.insertCell(0);
// cell1.innerHTML="Dealer"
// var cell2 = row.insertCell(1);
// cell2.innerHTML = 'Town'
for (i = 0; i < JSONObj.length; i++) {
var row = table.insertRow(rowCount);
//row.style.className = 'navigateable';
row.insertCell(0).innerHTML = JSONObj[i].bpName;
row.insertCell(1).innerHTML = JSONObj[i].bpTown;
rowCount++;
//alert(JSONObj[i].bpName);
}
});
document.getElementById('popupa').style.display = 'block';
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,460,580
| 1,460,581
|
Inner class Java
|
<p>Good evening. I have some troubles with getting response.
I have two classes:
MyHttpClient with method get(), and String for response.</p>
<pre><code>public class MyHttpClient {
private static final String BASE_URL = "http://pgu.com";
private static String response;
private static AsyncHttpClient client = new AsyncHttpClient();
public static void get(String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
client.get(getAbsoluteUrl(url), params, responseHandler);
}
private static String getAbsoluteUrl(String relativeUrl) {
return BASE_URL + relativeUrl;
}
public static String getResponse() {
return response;
}
public static void setResponse(String response) {
response = response;
}
</code></pre>
<p>}</p>
<p>In second class I'm using GET method. Html is printing in LogCat, but setResponse doesn't work. How can I get the response String as a field of MyHttpClient ? </p>
<pre><code>public class MyHttpClientUsage {
public MyHttpClientUsage(){
}
public void getInfoAbout() throws HttpException{
RequestParams params = new RequestParams();
params.put("a", "Static");
params.put("content", "47");
MyHttpClient.get("", params, new AsyncHttpResponseHandler(){
@Override
public void onSuccess(String response) {
System.out.println(response);
//Write HTML in LogCat(work)
MyHttpClient.setResponse(response); //doesn't work
}
});
}
</code></pre>
<p>}</p>
|
java android
|
[1, 4]
|
5,523,115
| 5,523,116
|
Make a submit input un-clickable
|
<p>I have the following input:</p>
<pre><code><input type="submit" name="next" value="Next">
</code></pre>
<p>How would I make this item un-clickable via jQuery? (i.e., it may only be clicked <strong>after</strong> certain validation criteria are met) ?</p>
<p>Here is a follow-up to this question: <a href="http://stackoverflow.com/q/10730633/651174">Make a submit clickable after validations are met</a></p>
|
javascript jquery
|
[3, 5]
|
3,483,623
| 3,483,624
|
Green screen photo merging
|
<p>I have 2 photo's, the first one is a background, the second one is a photo of someone with a greenscreen.
I'd like to merge the 2 of them using a android app.
So I'll end up with a image of someone with the background i chose.</p>
<p>Is this even possible with the android sdk? and if so could you explain to me how?</p>
<p>Thank you.</p>
|
java android
|
[1, 4]
|
4,963,117
| 4,963,118
|
anchor and onclick with asp.net postback
|
<p>I have a link like this</p>
<pre><code><a href="#thumb" id="ctl00_allContent_btnThumb" onclick="javascript:__doPostBack('ctl00$allContent$btnThumb','')"><img alt="" src="../../images/bullet-thumb.gif"></a>
</code></pre>
<p>On Firefox it does what it supposed to. But it won't work on IE or Chrome.</p>
<p>I know there are some questions on the subject here, but they haven't helped me. I'm guessing it's more specific since it envolves ASP.NET postback.</p>
<p>thank you</p>
|
asp.net javascript
|
[9, 3]
|
3,114,724
| 3,114,725
|
Is there TAB control and how to open page2 from button click?
|
<p>Is there TAB control and how to open page2 from button click ?</p>
<p>On asp.net ?</p>
<p>I work with C# and Visual Studio 2008 and ASP.NET</p>
<p>Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
2,165,178
| 2,165,179
|
Javascript if syntax
|
<p>i have syntax error when i'm trying to run a simple if statements</p>
<blockquote>
<p>[Break On This Error] }); </p>
</blockquote>
<p>invalid assignment left-hand side
[Break On This Error] container += </p>
<p>what is my problem
and how i can make:</p>
<pre><code>if this.ewCount != 0 then {}
elseif NotDoneh == 0 then {}
ELSE {}
</code></pre>
<p>this is my current code:</p>
<pre><code>var conta = '<div>';
$.each(items, function () {
if (this.ewCount != 0) {
if (DoneWidth == 0) {
conta += '<br/>dddddddddddddddddd<br/><br/>' +
});
if (NotDoneh == 0) {
conta += '<br/>dddddddddddddddddd<br/><br/>' +
});
});
container += '</div>' +
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,059,482
| 4,059,483
|
Break after so many divs
|
<p>I have 4 hard coded divs. After the third div I would like to break or put the 4th div on a new line. How do I do this and can I do this php or do I have to use javascript/jQuery? The divs are wrapped in a label tag btw. <strong><em>I forgot to mention that the labels are dynamically turned on. So not all labels are viewed at once.</em></strong></p>
<pre><code><label class="1">
<div id="div1">Stuff 1</div>
</label>
<label class="2">
<div id="div2">Stuff 2</div>
</label>
<label class="3">
<div id="div3">Stuff 3</div>
</label>
<label class="4">
<div id="div4">Stuff 4</div>
</label>
</code></pre>
|
php jquery
|
[2, 5]
|
4,651,120
| 4,651,121
|
Getting Repeater By String in ASP.NET
|
<p>I have a bunch of repeaters in an aspx page like "repeater1","repeater2", etc</p>
<p>I want to access them like </p>
<pre><code>for(int i = 0; i < 5; i++)
// get the repeater like FindRepeater("repeater"+i) and bind it
</code></pre>
<p>In the code behind Page_Load I tried</p>
<pre><code>Repeater repeater = (Repeater)this.FindControl("repeater"+i)
</code></pre>
<p>but it says I can't cast a Control to a Repeater. </p>
<p>How can this be done?</p>
|
c# asp.net
|
[0, 9]
|
2,759,910
| 2,759,911
|
Getting errorInfo back from tryParse()
|
<p>Im playing around with TryParse()</p>
<p>But lets say the parsing fails, then returns false, and ... nothing..
Is there a way to get info back about what failed the parsing?</p>
<p>I saw something like that at codeproject, but i didnt really understand it.</p>
<p>Thanks :)</p>
|
c# asp.net
|
[0, 9]
|
2,976,074
| 2,976,075
|
jquery Autocomplete click event
|
<pre><code><div id="display">
<div align="left" class="display_box">
<a class="test" href="#">
<img style="width:25px; float:left; margin-right:6px" src="user_img/gow.jpg">
</a>
<input type="hidden" id="uid" value="3">
<b>b</b>ack&nbsp;<b>b</b>ack<br>
<span style="font-size:9px; color:#999999">back</span>
</div>
<div align="left" class="display_box">
<a class="test" href="#">
<img style="width:25px; float:left; margin-right:6px" src="user_img/gow.jpg">
</a>
<input type="hidden" id="uid" value="3">
<b>b</b>ack&nbsp;<b>b</b>ack<br>
<span style="font-size:9px; color:#999999">back</span>
</div>
</div>
</code></pre>
<p>I am making this auto complete search function with images in thumbnail like facebook and getting this as html after ajax call .
what i want to do is that if user clicks on any div with class display_box i want to get the value of hidden field in the div... </p>
<p>I tried this code but its not capture click event how ever if I use #display click event capturing but that is for whole div.</p>
<pre><code>$('.display_box').click(function() {
var id =$(this).find('input[type=hidden]').val();
});
</code></pre>
|
php jquery
|
[2, 5]
|
1,444
| 1,445
|
help with NullReference exception in C#
|
<p>The following is a web method that is called from ajax, I have verified with firebug that the script is indeed passing two string values to my method:</p>
<pre><code>public string DealerLogin_Click(string name, string pass)
{
string g="adf";
if (name == "w" && pass == "w")
{
HttpContext.Current.Session["public"] = "pub";
g= "window.location = '/secure/Default.aspx'";
}
return g;
}
</code></pre>
<p>I'm passing "w" just for testing purposes. If I delete the if block then I don't get an error back from the server. I'm confused.</p>
|
c# asp.net
|
[0, 9]
|
3,054,002
| 3,054,003
|
Incorrect Url displaying after Response.Redirect
|
<p>When I use </p>
<blockquote>
<p>Server.Transfer("PageName.aspx");</p>
</blockquote>
<p>I am transferred to the correct page, but the url is the url of the first page. </p>
<p>In other words, say <strong>page1.aspx</strong> Server.Transfers to <strong>page2.aspx</strong>.</p>
<p><strong>page2.aspx</strong> is rendered, but the url reads <strong>page1.aspx</strong>.</p>
<p>The problem was I need to pass parameters to page2 in the url, and the params were not getting through. </p>
<p>I got around it by using </p>
<blockquote>
<p>Response.Redirect("PageName.aspx?parm=val");</p>
</blockquote>
<p>I had been using Server.Transfer because I was under the impression it was more efficient.</p>
<p>What are the other differences? Are there any other reasons for using one rather than the other? </p>
<p>So far I have:</p>
<p>Use Response.Redirect </p>
<ol>
<li>if you want to pass parms </li>
<li>if you want to transfer to a site on another server</li>
</ol>
<p>Use Server.Transfer for </p>
<ol>
<li>the efficiency of saving one server roundtrip</li>
</ol>
|
c# asp.net
|
[0, 9]
|
5,584,809
| 5,584,810
|
jquery how do I combine data() objects
|
<p>I have two data objects stored on different nodes in the dom</p>
<p>ie</p>
<pre><code>$('node1').data('id','1');
$('node2').data('id','1');
</code></pre>
<p>How do I combine these in order to attatch them to the <strong>data</strong> attribute in the ajax object</p>
<pre><code>$.ajax({
url: 'http://localhost:8080/test.html',
timeout: 3000,
cache: false,
data: // combined node1 and node2 here!,
success: function(data){
}
});
</code></pre>
<p>Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
1,184,567
| 1,184,568
|
jQuery.extend default action with only one input
|
<p>Given:</p>
<pre><code>jQuery.extend({
fooBar: function(){ return 'baz'; }
});
</code></pre>
<p>does it modify the base jQuery object?
so afterwards you can call <code>jQuery.fooBar(); // 'baz'</code></p>
<p>There's nothing in the documentation, but that's what the source does as far as I can tell.</p>
|
javascript jquery
|
[3, 5]
|
4,259,213
| 4,259,214
|
Date script for Dropdown using Javascript/JQuery
|
<p>I need to populate dropdown/ select list with calender dates in DD-MM-YYYY format, I have to do this in JavaScript and script should automatically fill Dropdown with dates for next 3 months.</p>
<p>I tried to look for such script but could not find. I would appreciate any help. i am open to use any jQuery if it works.</p>
<p>I have to fill dropdown with date in the format mentioned i cant use popup Calenders etc..</p>
<p>Example:</p>
<pre><code><select class="ddDates" id="Dates" name="Dates">
<option value="10-01-2012" selected>10-01-2012</option>
<option value="11-01-2012">11-01-2012</option>
<option value="12-01-2012">12-01-2012</option>
<option value="13-01-2012">13-01-2012</option>
</select>
</code></pre>
<p>I have searched google and i cant even find the logic how i can read system calender and populate the dropdown/ select list </p>
|
javascript jquery
|
[3, 5]
|
3,841,196
| 3,841,197
|
Accessing properties of SelectedRow during SelectedIndexChanged event in dynamically generated GridView
|
<p>I have an empty GridView object on a page that I bind to a LINQ qry result at run time. The GridView has a 'Select" button that fires the SelectedIndexChanged event and it's inside of this event that I'd like to access the data of one of the fields in the selected row.</p>
<p>So far, I can only find one way to do this, and it seems suboptimal:</p>
<pre><code>protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView2.SelectedRow;
string UserID = row.Cells[1].Text;
//Do stuff with the userID
}
</code></pre>
<p>So this just access the cell data directly based on the cell index. The UserID just happens to be in the second cell and so it works. But later down the road, the UserID may not be in that same column. It seems like I'd be better off looking up the value of this cell by accessing by the cell's header name, or by any method other than the cell index itself.</p>
<p>Any ideas?</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
1,404,883
| 1,404,884
|
Hide DIV when make selection
|
<p>I have 2 select.
If user submit form without dropdown selectioe, a message is displayed on a DIV.
There is a way to HIDE div (disappear?) when user select value?</p>
<p>SCRIPT:
</p>
<pre><code>$(document).ready(function () {
$("#go").click(function () {
if (document.getElementById('sel').selectedIndex == 0)
$("#msg").html("Please select 1");
if (document.getElementById('sel2').selectedIndex == 0)
$("#msg2").html("Please select 2");
});
});
</code></pre>
<p>FORM:</p>
<pre><code><form id="form1">
<div id="msg"></div>
<select id="sel">
<option value="">-- select --</option>
<option value="valor1">Valor 1</option>
<option value="valor2">Valor 2</option>
</select>
<div id="msg2"></div>
<select id="sel2">
<option value="">-- select --</option>
<option value="valor1">Valor 1</option>
<option value="valor2">Valor 2</option>
</select>
<input type="button" id="go" value="Go" />
</form>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,007,199
| 2,007,200
|
Toggle 2 divs with 2 links
|
<p>I'm pretty new to jquery and here's what I'm trying to do:</p>
<p>I have two links: link1 - link2
And 2 divs: div1, div2</p>
<p>What I would like to do:</p>
<p>If you click on link1 it slideDown the div1, if you click on link1 again, it slideUp div1
BUT
If you click on link1 and then on link2 I want the div1 to slideUp and then slideDown the div2</p>
<p>Here's the code that I was playing with:</p>
<pre><code>$(document).ready(function(){
$("#div1").hide();
$("#div2").hide();
$('.link1').click(function(){
$("#div2").slideUp();
$("#div1").slideToggle();
});
$('.link2').click(function(){
$("#div1").slideUp();
$("#div2").slideToggle();
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,764,595
| 3,764,596
|
How can I play .flv video in Android?
|
<p>I am trying to play Flash video in Android but it's not working. Here I used a WebView in my Android application but it has a problem. I've shown that code:</p>
<pre><code> WebView wbView=(WebView)findViewById(R.id.webView);
wbView.getSettings().setJavaScriptEnabled(true);
String htmlCode="<html>" +
"<head>" +
"<script src='http://www.exapmle.com/video/swfobject.js' type='text/javascript'></script>" +
"</head>" +
"<body>" +
"<div id='flvplayer'><img src='http://www.exapmle.com/video/trusted.jpg'></div>" +
"<script type='text/javascript'>" +
"var so = new SWFObject('http://www.exapmle.com/video/TrustedComputing_LAFKON_LOW.flv', 'swfplayer', '400', '327', '9', '#000000');" +
"so.addVariable('flv', 'http://www.exapmle.com/video/TrustedComputing_LAFKON_LOW.flv');" +
"so.addVariable('jpg','http://www.exapmle.com/video/trusted.jpg');" +
"so.addVariable('autoplay','false');" +
"so.addVariable('backcolor','000000');" +
"so.addVariable('frontcolor','ffffff');" +
"so.write('flvplayer');" +
"</script>" +
"</body>" +
"</html>";
wbView.loadData(htmlCode, "text/html", null);
</code></pre>
|
java javascript android
|
[1, 3, 4]
|
5,540,308
| 5,540,309
|
How to submit data array to server from PHP and jQuery
|
<p>I have an array of PHP with customer data. I will modify this values in jQuery. Then O would like to submit the changed values with an Id (<code>cashup_id</code>) to the server from jquery. Please see the PHP array below. Please help. Thanks.</p>
<pre><code>$Cashups = array(
array(
'cashup_id' => 146456,
'display_time' => 'Wed 16th Mar, 9:55pm',
'terminal_name' => 'Bar 1',
'calculated_cash' => 389.20,
'actual_cash' => 374.6,
'calculated_tenders_total' => 1,551.01,
'actual_tenders_total' => 1,551.01
),
array(
'cashup_id' => 146457,
'display_time' => 'Wed 16th Mar, 9:56pm',
'terminal_name' => 'Bar 2',
'calculated_cash' => 493.3,
'actual_cash' => 493.3,
'calculated_other' => 1509.84,
'actual_other' => 1509.84
)
);
</code></pre>
|
php jquery
|
[2, 5]
|
2,190,798
| 2,190,799
|
System.Timers.Timer not working every 5 minutes
|
<p>I have a method which must be run every 5minutes in order to show latest data in gridview.</p>
<p>I was experimenting with System.Timers.Timer and the following is my code:</p>
<pre><code> protected void Page_Load(object sender, EventArgs e)
{
try
{
lblError.Text = "";
t = new System.Timers.Timer(300000);//every 5min = 300000
t.Enabled = true;
t.Elapsed += new ElapsedEventHandler(t_Elapsed);
if (!Page.IsPostBack)
{
//t = new System.Timers.Timer(300000);//every 5min = 300000
//t.Enabled = true;
//t.Elapsed += new ElapsedEventHandler(t_Elapsed);
floor = ddFloors.SelectedValue.ToString();
GenerateStatus();
}
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
void t_Elapsed(object sender, ElapsedEventArgs e)
{
try
{
//Response.Redirect("Home.aspx");
floor = ddFloors.SelectedValue.ToString();
GenerateStatus();
}
catch (Exception ex)
{
lblError.Text = ex.Message;
}
}
</code></pre>
<p>the problem is that after 5minutes it is not going to t_Elapsed. Note this should keep being done at all times not just for once. any help pls?</p>
|
c# asp.net
|
[0, 9]
|
5,180,133
| 5,180,134
|
JQuery recursive function?
|
<p>How can I call a function from inside the function, so it becomes recursive? Here is my code, I have added a comment where I would like to start the recursion:</p>
<pre><code>$('a.previous-photos, a.next-photos').click(function() {
var id = $('#media-photo img').attr('id');
var href = $(this).attr('href');
href = href.split('/');
var p = href[href.length - 1];
var url = '/view/album-photos/id/' + id + '/p/' + p;
$.get(url, function(data) {
$('.box-content2').replaceWith('<div class="box-content2"' + data + '</div>');
});
// here I want to call the function again
return false;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,344,767
| 5,344,768
|
Redirect to url then again redirect to main url
|
<p>I know it is really confusing. Let me explain:</p>
<p>I want to open the urls on my site (http://domain.com) to a (http://domain.com/url='the submitted url') and then the submitted url is opened.</p>
<p>Eg: When we open any other site link from Google+ let the example</p>
<p><a href="http://www.youtube.com/watch?v=WRpX7tkwejU" rel="nofollow">http://www.youtube.com/watch?v=WRpX7tkwejU</a></p>
<p>it redirects to </p>
<p><a href="http://plus.url.google.com/url?sa=z&n=1333340186022&url=http://www.youtube.com/watch?v=WRpX7tkwejU&usg=whZv4BO7Gcrco_vivlnhaz27Wpk." rel="nofollow">http://plus.url.google.com/url?sa=z&n=1333340186022&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWRpX7tkwejU&usg=whZv4BO7Gcrco_vivlnhaz27Wpk.</a></p>
<p>and then the original site is opened. I want some thing similar.</p>
|
php javascript
|
[2, 3]
|
4,650,578
| 4,650,579
|
read individual img src from folder contents into HTML
|
<p>I am trying to write some simple code, but I am not sure what to use, javascript or PHP.
I have some structured HTML docs and I want to insert an image from a folder into each img src attribute.
So basically I would need to read in the contents and then insert each one, one by one.</p>
<pre><code><div class="slideshow">
<div class="wrapper">
<ul>
<li>
<div class="main">
<a href="product1.html"><img src="images/sample/name1-1.jpg" alt="" width="630" height="400" /></a>
</div>
<div class="second">
<img src="images/sample/name1-2.jpg" alt="" width="310" height="190" />
</div>
<div class="third">
<img src="images/sample/name1-3.jpg" alt="" width="310" height="190" />
</div>
</li>
</code></pre>
<p>Thanks to anyone who might be able to steer me in the right direction..</p>
<p>I am using the following code to get the images from the directory</p>
<pre><code><?php
Header("content-type: application/x-javascript");
function returnimages($dirname=".") {
$pattern="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
echo 'galleryarray['.$curimage.']="'.$file .'";';
$curimage++;
}
}
closedir($handle);
}
return($files);
}
echo 'var galleryarray=new Array();';
returnimages()
?>
</code></pre>
<p>but at this point I am not sure how to insert each file name into the src attribute</p>
|
php javascript
|
[2, 3]
|
2,403,696
| 2,403,697
|
jQuery to trigger CSS3 button
|
<p>I have this CSS3 enter button
<a href="http://dl.dropbox.com/u/2568/enter/enter.html" rel="nofollow">here</a>:</p>
<p>If you click it, it seems like it's pressed. I want to achieve the same effect (probably using jQuery), by pressing the enter key physically on my keyboard. </p>
<p>I did something like this: (sorry if it's completely wrong, I don't do jQuery at all)</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("enter").keypress(function(event){
if(event.keyCode == 13){
$(this).toggleClass(".button-clicked");
}
});
});
</script>
</code></pre>
<p>The CSS selector for the unpressed button is:
<code>.button</code> and <code>.button.orange {}</code></p>
<p>The CSS selector for the pressed button is:
<code>.button:active, .button-clicked {}</code></p>
<p>Thanks for your help!</p>
|
javascript jquery
|
[3, 5]
|
4,473,517
| 4,473,518
|
How to stop of running the keycodes 37 and 39 when there is a textarea selected
|
<p>Simply I have a js script that change the page with left and right arrows, but how to stop that if a specific textarea is selected ?</p>
<p>This is my js to change the page</p>
<pre><code>$(document).keydown(function(event) {
if(event.keyCode === 37) {
window.location = "http://site.com/pics/5";
}
else if(event.keyCode === 39) {
window.location = "http://site.com/pics/7";
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
846,517
| 846,518
|
Prevent scroll to top --Issue
|
<p>Ok, I am trying to prevent the page from scrolling to the top of the page when I click on an anchor. </p>
<p>I have done this many times before, but I am not understanding what I am missing this time. </p>
<p>Please have a look at this code:</p>
<pre><code>$('#regionMapNav a').click(function(event){
event.preventDefault();
var i = $(this).attr("class");
var name = $(this).attr("id");
name = name.replace(/\s+/g, '');
if(i != 'active'){
$('.active').removeClass('active');
$(this).addClass('active');
$('.map').hide();
$('#' + name + 'Map').fadeIn(3000);
return false;
}
});
</code></pre>
<p>thanks for any help. </p>
<p><strong>EDIT</strong>
I went ahead and create a hack to just scroll to bottom since nothing that should work is working....I know it is not the best, but it works...Here is the code just in case someone ever has the same issue. Keep in mind that this item I am creating is at the bottom of the page. Also, that there is a dynamically loaded large header on this page. I think my issue has something to do with that, but I just don't have the energy today to trace back my mistake. </p>
<pre><code>$('#regionMapNav a').click(function(event){
event.preventDefault();
var i = $(this).attr("class");
var name = $(this).attr("id");
name = name.replace(/\s+/g, '');
if(i != 'active'){
$('.active').removeClass('active');
$(this).addClass('active');
$('.map').hide();
$('#' + name + 'Map').fadeIn(3000);
window.scrollTo(0, document.body.scrollHeight);
return false;
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,964,204
| 4,964,205
|
Get Current Date time of the server on which my website is hosted
|
<p>Am working on a functionality that involves a few timing based tasks.I need to retrieve current EST time to continue with my functionality.I do not need the system time since it may be different for each users.Is it possible using javascript or c# to get Eastern Standard Time from another time server or get time from my hosted server so that i can convert it to Eastern Standard Time .</p>
<p>am currently using this line of code to get eastern standard time but this is not i wanted since it is based on system time.</p>
<pre><code> DateTime eastern = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.UtcNow, "Eastern Standard Time");
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,889,033
| 4,889,034
|
Android: why do some things not run on it?
|
<p>Why does some Java code not run/work when packaged as an APK and deployed to an Android device? Things like Google Guice, Apache Camel and many other projects. Isn't it all just plain ole' Java?</p>
|
java android
|
[1, 4]
|
5,412,996
| 5,412,997
|
Jquery plugin for user mappings?
|
<p>I am building a web application using asp.net, which has three types of user's admin, dealers, and employees (under dealers). The employees can be associated with more than one dealers and which can be done only by the "admin".</p>
<p>So what i need is to make a neat employee and dealers mapping page visible to the admin.
but am not getting any ideas, in order how to achieve that. The mappings can be in a graphical format (using any jquery plugin) or can be in a simple interactive tabular format.</p>
<p>Searched for jquery plugin, but had no luck.</p>
<p>Please help me out, need suggestions or demo page views of similar structure or any jquery plugins to be helpful. </p>
|
jquery asp.net
|
[5, 9]
|
1,376,393
| 1,376,394
|
Make back button go to a different page
|
<p>I'd like to JavaScript, or JQuery (or any plug in actually) to force the browser to load a specific page when the back button is clicked. </p>
<p>Basically insert a page into the browser's history.</p>
<p>I've found a way of doing it below, but it seems long winded. Am I missing something?</p>
<pre><code><html>
<head>
<title>Back button test</title>
</head>
<body>
<script type="text/javascript">
window.history.pushState('other.html', 'Other Page', 'other.html');
window.history.pushState('initial.html', 'Initial Page', 'initial.html');
</script>
Initial page <br />
<script type="text/javascript">
window.addEventListener("popstate", function(e) {
if(document.URL.indexOf("other.html") >= 0){
document.location.href = document.location;
}
});
</script>
</body>
</html>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,579,502
| 5,579,503
|
ASP.NET WebApp don't work with Custom Template (from store)
|
<p>I have jQuery based template from themeforest and
i building on this ASP.NET Web Application.</p>
<p>But i have a problem, when my javascripts files
from template are included, my asp.net things
don't work how should, eg. dropdownlist events
not rising... When i comment javascript templates
file then everything works fine.</p>
<p>Someone can help me solve this?</p>
<p>Thanks,</p>
|
javascript asp.net
|
[3, 9]
|
1,828,405
| 1,828,406
|
style switcher in jQuery without page refreshing
|
<p>I have now one page which has a default.css style<br>
I have one style1.css file and another one is style2.css file.<br>
I have one UI dropdownlist which has two options. </p>
<p>When I select one then apply style1.css and same thing for other.</p>
<p>The page should not be refresh.</p>
<p>How can I do this?</p>
|
javascript jquery
|
[3, 5]
|
2,597,754
| 2,597,755
|
converting js variable to php
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1515590/javascript-variable-into-php">javascript variable into php</a> </p>
</blockquote>
<p>Okay lets imagine I've a javascript variable "x"</p>
<pre><code><script>
var x="jsvar";
</script>
</code></pre>
<p>Now I want its value in php variable <code>$y</code> <code><?php $y; ?></code> How to do it.</p>
<p>Okay few people are confused i wanted to know is it possible if yes then how ??
if this isn't possible then comment here i'll remove it.</p>
|
php javascript
|
[2, 3]
|
4,053,355
| 4,053,356
|
How can I automatically turn an IEnumerable<T> into a csv file?
|
<p>I am trying to create a user control that accepts any generic list so I can iterate through it and create a CSV export. Is it possible to expose a public property that can accept any type? (i.e. <code>List<Product></code>, <code>List<Customer></code>, etc.) If yes, how?</p>
<pre><code>public IEnumerable<T> AnyList { get; set; }
</code></pre>
<p>Here's what I have as far as the utility methods I have:</p>
<pre><code>public static byte[] ToCsv<T>(string separator, IEnumerable<T> objectlist)
{
//Type t = typeof(T); Deleted this line.
//Here's the line of code updated.
PropertyInfo[] propertyNames = objectlist.First().GetType().GetProperties();
string header = String.Join(separator, propertyNames.Select(f => f.Name).ToArray());
StringBuilder csvdata = new StringBuilder();
csvdata.AppendLine(header);
foreach (var o in objectlist)
csvdata.AppendLine(ToCsvFields(separator, propertyNames, o));
return Encoding.ASCII.GetBytes(csvdata.ToString());
}
public static string ToCsvFields(string separator, PropertyInfo[] fields, object o)
{
StringBuilder linie = new StringBuilder();
foreach (var f in fields)
{
if (linie.Length > 0)
linie.Append(separator);
var x = f.GetValue(o, null);
if (x != null)
linie.Append(x.ToString());
}
return linie.ToString();
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,236,687
| 1,236,688
|
Get substring from a string
|
<p>I want to get the substring from a string when i ll give the part of the string ...</p>
<p>For example : I have the string "Casual Leave:12-Medical Leave :13-Annual Leave :03".</p>
<p>Partial code is here: </p>
<pre><code> Label label1 = new Label();
label1.Text = (Label)item.FindControl(Label1); //label1.Text may be casual Leave or medical leave or others...
if (label1.Text == substring(the given string ))
{
//suppose label1.Text ="Casual Leave" means i put 12 into the textbox
TextBox textbox = new TextBox();
textbox.Text= //corresponding casual leave value //
}
</code></pre>
<p>what i do?</p>
|
c# asp.net
|
[0, 9]
|
234,149
| 234,150
|
Moving data outside of the scope my jQuery AJAX call
|
<p>I have a little AJAX function that asks the server whether a particular checkbox should be checked. I'd like to pass the information to a variable outside of the scope of the AJAX function. Something along the lines of:</p>
<pre><code>isChecked = $.ajax({
type: "POST",
url: "/ajax/subscribe-query/",
data: "selfKey=" + commentData['selfKeyValue'],
success: function(isSubscribed){
if(isSubscribed == 'true'){
return = true;
}
else{
return = false;
}
}
})
</code></pre>
<p>or</p>
<pre><code>var isChecked;
$.ajax({
type: "POST",
url: "/ajax/subscribe-query/",
data: "selfKey=" + commentData['selfKeyValue'],
success: function(isSubscribed){
if(isSubscribed == 'true'){
isChecked = true;
}
else{
isChecked = false;
}
}
})
</code></pre>
<p>Neither of those works of course. How do I do this?</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.