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 |
---|---|---|---|---|---|
5,322,926 | 5,322,927 | Default select issue for JQuery UI 'selectable' | <p>Below is my JS. When the page loads, I want it to automatically run the function as if its being clicked on. The default selection makes it started selected, but doesn't initiate the function. Any idea on how to make that work?</p>
<pre><code>$(function() {
$( "#selectable" ).selectable({
selected: updatefilters
});
function updatefilters(ev, ui){
// get the selected filters
var template, html;
var pagego;
if(! pagego){
var page = 0;
}
var $selected = $('#selectable').children('.ui-selected');
// create a string that has each filter separated by a pipe ("|")
var filters = $selected.map(function(){return this.id;}).get().join("\|");
$.ajax({
type: "POST",
url: 'updatefilters',
dataType: 'json',
data: { filters: filters, page: page },
success: function(data){
html = "Do Something";
$('#board').html(html);
}
});
}
$('#lets').addClass('ui-selected')
});
</code></pre>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
2,015,733 | 2,015,734 | export datatable to CSV with Save File Dialog box - C# | <p>Struggling to get my CSV export to display the Save File dialog box up. It saves to file ok, but doesn't let the user save. Can anybody see where I might be going wrong with the code please?</p>
<pre><code>string filename = Server.MapPath("~/download.csv");
StreamWriter sw = new StreamWriter(filename, false);
int iColCount = dt.Columns.Count;
for (int i = 0; i < iColCount; i++)
{
sw.Write(dt.Columns[i]);
if (i < iColCount - 1)
{
sw.Write(",");
}
}
sw.Write(sw.NewLine);
foreach (DataRow dr in dt.Rows)
{
for (int i = 0; i < iColCount; i++)
{
if (!Convert.IsDBNull(dr[i]))
{
sw.Write(dr[i].ToString());
}
if (i < iColCount - 1)
{
sw.Write(",");
}
}
sw.Write(sw.NewLine);
}
sw.Close();
Response.Clear();
Response.ContentType = "application/csv";
Response.AddHeader("Content-Disposition", "attachment; filename=download.csv");
Response.WriteFile(filename);
Response.Flush();
Response.End();
</code></pre>
<p>I thought the Content Disposition line that brought up the dialog box, but maybe there is something else I need to do.</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
2,376,045 | 2,376,046 | User control click event | <p>In user control i have a customised button. Iam using this user control on aspx page. when the button in the user control is clicked checkboxes and label in the aspx page should be cleared. Can you please let me know how to accomplish this?</p>
| c# asp.net | [0, 9] |
3,464,459 | 3,464,460 | Transversing the DOM in jQuery | <p>I have a bunch of these little bits of HTML code repeated over and over again:</p>
<pre><code><div class="collapse" id="any_mins">
<fieldset>
<legend><img title="Click to expand" class="plus" alt="+" src="" />Heading</legend>
<table class="mins_table">
lots of rows and cells go here
</table>
</fieldset>
</div>
</code></pre>
<p>Inside the tables there are form elements, mainly textboxes and selects. I have a bit of jQuery that makes the <code><legend></code> heading highlighted if there are non-blank form elements in the containing table. It looks like this:</p>
<pre><code>// input td tr tbody table legend img
$("input[type='text'][value!=0]").parent().parent().parent().parent().show();//the table
$("input[type='text'][value!=0]").parent().parent().parent().parent().siblings().children().attr("src", minus_path);//the image
$("input[type='text'][value!=0]").parent().parent().parent().parent().siblings().addClass("highlighted")//the legend
// option select td tr tbody table legend img
$("option:selected[value!=0]").parent().parent().parent().parent().parent().show();//the table
$("option:selected[value!=0]").parent().parent().parent().parent().parent().siblings().children().attr("src", minus_path);//the image
$("option:selected[value!=0]").parent().parent().parent().parent().parent().siblings().addClass("highlighted")
</code></pre>
<p>This works, but is obviously the wrong way. Whats the right way?</p>
| javascript jquery | [3, 5] |
5,328,085 | 5,328,086 | pass JQuery Variable in a Form Dynamically | <p>I'm trying to pass a jQuery variable through a Form, but I keep getting an error. How can I pass the values variable correctly. When I pass it to the next page, it spits out the intialized variable and does not change, when I change the slider. How can I get this to change?</p>
<pre><code> <input id="column" type="hidden" name="column" value="";>
<script>
$(function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
$( "#values" ).val(ui.values[ 0 ]);
}
});
$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
" - $" + $( "#slider-range" ).slider( "values", 1 ) );
$( "#column" ).val($( "#slider-range" ).slider( "values", 0 ));
});
</script>
</code></pre>
| php jquery | [2, 5] |
4,162,924 | 4,162,925 | Cleaner way to randomly get a string from multiple arrays with JS/jQuery? | <p>Multiple arrays are automatically generated server side with no way of modifying it with the names: section1, section2, section3 so on and so forth. There is always a minimum of one value per array and a maximum of 50 in each array.</p>
<p>Example array list:</p>
<pre><code>section1 = ['ABC100', 'ABC105', 'ABC209'];
section2 = ['ABC400', 'ABC705', 'ABC629'];
section3 = ['ABC176', 'ABC136', 'ABC279'];
</code></pre>
<p>I currently need to randomly select one value from each array and update an image src attribute. I do have access to the image HTML, so can change classes etc. </p>
<p>Current HTML example:</p>
<pre><code><div id="wrapper">
<img class="section1" src="">
<img class="section2" src="">
<img class="section3" src="">
</div>
</code></pre>
<p>My javascript and jQuery for randomly selecting a value from it's matching array and updating the image src is:</p>
<pre><code>var $pathName = '/images/gallery/';
var $fileExtension = '.jpg';
var $section1R = section1[Math.floor(Math.random()*section1.length)];
var $section2R = section2[Math.floor(Math.random()*section2.length)];
var $section3R = section3[Math.floor(Math.random()*section3.length)];
$('.section1').attr('src', $pathName + $section1R + $fileExtension);
$('.section2').attr('src', $pathName + $section2R + $fileExtension);
$('.section3').attr('src', $pathName + $section3R + $fileExtension);
</code></pre>
<p>This seems really messy. Is there a way of making this cleaner without repeating so much code? I know it works, but I'd like to learn better ways of coding repeated functions.</p>
| javascript jquery | [3, 5] |
5,280,535 | 5,280,536 | How can i delete the first word from a line with javascript or jquery? | <pre><code>Mon 25-Jul-2011
</code></pre>
<p>I want to delete the first word "Mon" with javascript jQuery.
How can i do this ?</p>
| javascript jquery | [3, 5] |
5,058,376 | 5,058,377 | ASP page hit counter | <p>Please tell me basic steps for coding and server coding and steps of server connection for Simple page hit counter using asp C#. Thanks in advance.</p>
| c# asp.net | [0, 9] |
4,058,654 | 4,058,655 | creating relationships VIA? | <p>I'm reading packtpub asp.net social networking and I have problems with understanding following</p>
<p>"Here are the relationships that we need for the tables"</p>
<ul>
<li>Friends and Accounts via the owning account</li>
<li>Friends and Accounts via the friends account</li>
<li><p>...</p>
<p>What does really means? What type of relationship would you use? </p>
<ul>
<li>Friends and Accounts via the owning account (many to one?)</li>
<li>Friends and Accounts via the friends account (ony to many?)</li>
</ul></li>
</ul>
| c# asp.net | [0, 9] |
2,630,275 | 2,630,276 | Why setInterval is not working properly after a while? | <p>I have written a javascript code to show users a random quote every 10 second. I use jquery to update the div and setInterval to repeat the action. I'm fetching a random quote from a javascript array. </p>
<p>But when i tested this, it seems, it is not working properly after a while (like 3-5 mins) , I have some jquery effects like fadeIn and fadeOut but they are executed before the quote changes. Here is the js code;</p>
<pre><code>var quotes = [
"Some String",
"Some String",
"Some String"
];
$(function() {
var $rand = $('div#randomQuote > p');
var random_quote = quotes[Math.floor(Math.random() * quotes.length)];
$rand.html(random_quote);
$rand.animate( {"opacity" : 0}, 0);
$rand.animate( {"opacity" : 1}, 500);
$rand.delay("9000");
$rand.animate( { "opacity" : 0 }, 500 );
});
function randomQuote () {
var $rand = $('div#randomQuote > p');
var random_quote = quotes[Math.floor(Math.random() * quotes.length)];
$rand.html(random_quote);
$rand.animate( {"opacity" : 1}, 500 );
$rand.delay("9000");
$rand.animate ( {"opacity" : 0}, 500 );
}
$(function () {
setInterval(randomQuote, 10000);
});
</code></pre>
<p>Although I'm not sure, I think, these lines take some time to calculate and it breaks the loop. </p>
<pre><code>var $rand = $('div#randomQuote > p');
var random_quote = quotes[Math.floor(Math.random() * quotes.length)];
</code></pre>
<p><strong>Q:</strong> How can i improve this code to get it working as expected? </p>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
245,124 | 245,125 | bx slider vertical scroll jumping and other issues | <p>I am using bx slider to create an auto, vertical scrolling slideshow. I am currrently having two issues:</p>
<ol>
<li>It jumps quite a bit when it gets back to the first slide.</li>
<li>After three or four cycles, the last slide rolls out of the div and then the screen is white for a good three or four seconds and the scroll begins at the bottom again. So a giant blank space in the scroll basically after about three or four passes.</li>
</ol>
<p>What kind of things do I need to look for here to diagnose and solve this problem? Pseudo code of what I am using:</p>
<pre><code>$('#example_container').bxSlider({
mode: 'vertical',
ticker: true,
tickerHover: true,
tickerSpeed: 1500,
displaySlideQty: 3
});
<div id ="example_container">
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
5,909,364 | 5,909,365 | jQuery(? or any other weblanguage), is it possible to see if the client is downloading a file | <p>I want to make a website containing a frame (div would work as well) with an external page inside of it, once the user downloads a file on the page in the frame, I want to trigger an event. Filedownload is triggered by a form submission. Is this possible?
Thanks.
EDIT: I can code PHP, ASP, jQuery and a tiny bit of Java, but I'm always willing to learn more.</p>
<p>Could I replace the form's action to a different file which'll redirect the POST data to the original form action page but will also receive the GET data.
I'm sorry I'm probably not using the right terms.</p>
| php jquery | [2, 5] |
509,530 | 509,531 | slideToggle numerous elements on a page | <p>I have a map of a state with off of its counties sliced up as an image map. Instead of having a different function to click on each county and show its statistics is there a way to use something other than:</p>
<p><code>$('#county).click(function(){$(#countystats).slideToggle('fast');</code> 100+ times for all the different counties?</p>
| javascript jquery | [3, 5] |
3,484,712 | 3,484,713 | How to delay the changing of a value in jQuery? | <p>I'm making a map using Raphael and jQuery. I've got a search box - when the mouse enters a region, the search box displays the name of that region, and when the mouse exits it, the search box changes to a preset text (along the lines of "type here to search").</p>
<p>However, when I move the mouse across the map, the search box's contents flicker quickly between region names and the preset text. I tried fixing it using <b>.delay()</b>, but it didn't work - only then did I read that delay() only works with effects.</p>
<p>How do I delay a value change using <b>.val()</b>?</p>
| javascript jquery | [3, 5] |
764,917 | 764,918 | on alert script working and without it not working | <p>If some body can answer.</p>
<pre><code> <script type="text/javascript">
$(document).ready(function(){
//alert("Before..");
$('#myGallery').galleryView({
panel_width: 960,
panel_height: 424,
frame_width: 160,
frame_height: 70,
panel_scale: "nocrop",
frame_opacity: 0.6,
pause_on_hover: true
});
//alert("AFter....");
$('#homeGallery').innerfade({
speed:900,
timeout: 8000
});
});
</script>
</code></pre>
<p>above is the code it is not working<br>
if I remove the alert("before.") it will work.</p>
| javascript jquery | [3, 5] |
5,249,996 | 5,249,997 | Disabling controls within a table - JQuery/Javascript | <p>I have a complex UI with several nested tables, a repeater control and several other HTML controls that have their disable attribute set based on business logic in JQuery.</p>
<p>I need a way to disable the entire table (including nested controls, UI elements etc) and re-enable them when a user toggles a button. </p>
<p>I could iterate through the controls, find each of them and apply the "disable" attribute, but when the user chooses to enable, I will need to go through the trouble of checking if each of the control was initially enabled or not (based on the business logic as explained in para 1)</p>
<p>All I need is a way to leave the initial UI alone and overlay the disable/enable functionality on the UI.</p>
<p>Is there a easy way of accomplishing this?</p>
| javascript jquery | [3, 5] |
5,845,962 | 5,845,963 | Incorrect syntax near '=' ... Error in .ashx file | <p>I am trying to retrieve an image from database & showing it to gridview.But It shows the Error in .ashx file that</p>
<pre><code>SqlCommand command = new SqlCommand(
"select Image from ImageStore where ImageID=" + imageid, connection);
SqlDataReader dr = command.ExecuteReader(); dr.Read();
context.Response.BinaryWrite((Byte[])dr[0]);
</code></pre>
<blockquote>
<p>Incorrect syntax near '=' </p>
</blockquote>
<p>How to solve it</p>
| c# asp.net | [0, 9] |
67,188 | 67,189 | Url rewriter in ASP.NET: Resource cannot be found | <p>I am using the url rewriter described <a href="http://msdn.microsoft.com/en-us/library/ms972974.aspx" rel="nofollow">here</a>.</p>
<p>On production, it works great but locally, for any links that uses url rewrite, it says:</p>
<blockquote>
<p>The resource cannot be found.</p>
<p>Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. </p>
</blockquote>
<p>Do you have any idea why?
Do I have to install IIS locally and configure something?</p>
<p>Some rules I use:</p>
<pre><code><RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>/Payment/Secure/Order.htm</LookFor>
<SendTo>/Payment/Secure/Order.htm</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>/Payment/Secure/Result.htm</LookFor>
<SendTo>/Payment/Secure/Result.htm</SendTo>
</RewriterRule>
<RewriterRule>
</code></pre>
<p>..</p>
<p>They are all defined well because they work in production...</p>
<p>Thanks a lot!</p>
| c# asp.net | [0, 9] |
2,361,528 | 2,361,529 | jQuery MouseEnter Error | <p>As I am writing an plugin for websites which uses jQuery I am wondering, why some of the sites which are using the script get the error:</p>
<pre><code>Uncaught TypeError: Object #<Object> has no method 'mouseenter'
</code></pre>
<p>The code:</p>
<pre><code>plugin.setBehavior = function() {
jQuery('#divname').mouseenter(function() {
show();
});
}
</code></pre>
<p>Are there any versions of jQuery without the mouseenter event or what could be the reason for the failure?</p>
<p>Thx</p>
| javascript jquery | [3, 5] |
4,089,977 | 4,089,978 | How to prevent input field inside form from submitting when enter key is pressed? | <p>I have a simple form. </p>
<p>Input fields, checkboxes, radio buttons and finally SUBMIT button.</p>
<p>I use jQuery to perform AJAX validation, however when a user presses ENTER inside the input field it submits the form!</p>
<p>How do I stop this from happening on this form (not all input fields)?</p>
| php javascript jquery | [2, 3, 5] |
1,621,356 | 1,621,357 | java.lang.NoClassDefFoundError: android.media.ThumbnailUtils | <p>i try to use the <a href="http://developer.android.com/reference/android/media/ThumbnailUtils.html" rel="nofollow"><code>android.media.ThumbnailUtils</code></a> class to fetch the video thumbnails from the video which is locate under specified path, for that i use the following code,</p>
<pre><code>Bitmap thumb = android.media.ThumbnailUtils.createVideoThumbnail("/sdcard/video/sample.mp4",
MediaStore.Images.Thumbnails.MINI_KIND);
return thumb;
</code></pre>
<p>but it generates this exception.<br>
<code>java.lang.NoClassDefFoundError: android.media.ThumbnailUtils</code> </p>
<p>Anyone suggest some idea to solve this.</p>
<p>Thanks. </p>
| java android | [1, 4] |
4,804,320 | 4,804,321 | Writing jQuery Plugins using OOP | <p>I was wondering what's the current "<strong>state-of-the-art"</strong> to write a jQuery Plugins.
I read a lot of different approaches and I don't know which one fits best.</p>
<p><strong>Can you recommondation usefull links/templates for writing jQuery Plugins using OOP.</strong> </p>
<p>Thanks </p>
| javascript jquery | [3, 5] |
5,016,252 | 5,016,253 | Toggle element visibility with jQuery! | <p>I have the following markup:</p>
<pre><code><div class="header">Text</div>
<div class="hiddenArea">sdsada</div>
<div class="header">Text2</div>
<div class="hiddenArea">sdsada</div>
</code></pre>
<p>and the following jQuery:</p>
<pre><code>$('.header').click(function() {
var t = $(this).next('.hiddenArea').slideToggle();
});
</code></pre>
<p>When the hiddenArea is revealed I want to hide the other hiddenArea if it is visible?
I want to make this so that I can add other headers and hiddenAreas if I need them.</p>
<h3>Update:</h3>
<p>Thanks Guys, ended up doing this:</p>
<pre><code>$('#messages .header').click(function() {
if (!$(this).next().is(':visible')) {
$('.hiddenArea').slideToggle();
}
});
</code></pre>
| javascript jquery | [3, 5] |
1,655,393 | 1,655,394 | How to include variables in javascripts strings | <p>I have the script as as follows:
I want to inclde th index value as shown below. How can I do that? With my actual code,I am having error</p>
<pre><code>for(var index = 1; index < 6; index++){
$("#myTable thead td:nth-child(index + 2).html("here");
}
</code></pre>
| javascript jquery | [3, 5] |
1,658,845 | 1,658,846 | Window.showModalDialog() using javascript | <p>I am opening a child window using window.showModalDialog() method.
In the child page i have few server side controls whenever a postback happens the child page opens in a new window.</p>
<p>I have also set in my head tag,but it is not working. </p>
<pre><code><base target ="_self/>
</code></pre>
<p>For example
In Page 1: i have an anchor on whose click i open a child page(page2).
In my child page Page2: I have an asp.net button to search based on the criteria. when i enter the criteria and click search, the search results are show in new window rather then the same window.</p>
<p>similar to the post
<a href="http://forums.asp.net/p/1246676/2297583.aspx" rel="nofollow">http://forums.asp.net/p/1246676/2297583.aspx</a></p>
| javascript asp.net | [3, 9] |
1,130,981 | 1,130,982 | Using "this" from event handler in jquery | <p>I have the following javascript code found also in this fiddle: <a href="http://jsfiddle.net/periklis/k4u4c/" rel="nofollow">http://jsfiddle.net/periklis/k4u4c/</a></p>
<pre><code><button id = "element_id" class = "myclass">Click me</button>
<script>
$(document).ready(function() {
this.myfunc = function() {
console.log('Hello world');
}
this.myfunc();
$('#element_id').select('.myclass').bind('click', function() {
this.myfunc(); //Obviously this doesn't work
});
});
</script>
</code></pre>
<p>How can I call this.myfunc() when the element is clicked? I don't want to define the myfunc() in the global space.</p>
<p>Thanks as always</p>
| javascript jquery | [3, 5] |
1,143,391 | 1,143,392 | accessing controls in datalist headertemplate from codebehind | <p>I have a datalist in my application whose headertemplate has a lable.Now i need to access the lable from codebehind.How can i do that..</p>
<p><strong>CODE</strong>:</p>
<pre><code> <asp:DataList ID="Dlitems" runat="server" RepeatDirection="Horizontal" RepeatColumns="4"
CellPadding="0" CellSpacing="15" OnItemCommand="Dlitems_ItemCommand">
<HeaderTemplate>
<asp:Label ID="lblcat" runat="server" Text="" />
</HeaderTemplate>
</code></pre>
<p><strong>NOTE</strong>:I need to access the lable <code>lblcat</code> from headertemplate..</p>
| c# asp.net | [0, 9] |
4,508,740 | 4,508,741 | Changing css dynamically | <p>I have css like so:</p>
<pre><code>.myTabs .JustForFun .ajax__tab_inner:hover
{
width: 109px;
background: url ("/images/csc_tr.png") no-repeat 100% 0%; margin-right: 2px;
background-color: #BBC614;
}
</code></pre>
<p>Using javascript, jquery or asp.net code behind c# I would like to manipulate <code>background-color</code> attribute.</p>
<p>How can I do this, what are the pros and cons of the solution you've recommended me is what I would like to know.</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
604,877 | 604,878 | Javascript Reference Comprehension | <p>I have been learning some of the more detailed loopholes of JS here and there, and have a few things I need to get help on.</p>
<pre><code>;(function($){
$.fn.makeRed1 = function() {
return $.each(this, function() {
$(this).css('background-color', '#FF0000');
});
}
})(jQuery)
;(function($){
$.fn.makeRed2 = function() {
$(this).css('background-color', '#FF0000');
}
})(jQuery)
</code></pre>
<p><b>Both</b> of these work correctly. Why?</p>
<p>Anyone who talks about writing plugins always says to use the 'return each' method. What is the reason? I need someone to tell me exactly what happens when each of these methods are used, so I can understand the flow.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
56,642 | 56,643 | Jquery access function outside of var | <p>I'm trying to access my newTokenText function which is outside of my var from within my var. </p>
<pre><code>(function ($) {
// Default settings
var DEFAULT_SETTINGS = {
resultsFormatter: function(item, resultSize, index){
return "<li>" + newTokenText(item[this.propertyToSearch], resultSize, index) + "</li>"
},
}
init: function(url_or_data_or_function, options) {
var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
}
function newTokenText(value, resultSize, index) {
if(settings.newTokenText && resultSize == index) {
return value + " " + settings.newTokenText;
}
return value;
}
function populate_dropdown (query, results) {
if(results && results.length) {
var resultSize = results.length - 1;
$.each(results, function(index, value) {
var this_li = settings.resultsFormatter(value, resultSize, index);
}
}
}
</code></pre>
<p>getting error, newTokenText is not a function. Could somebody tell me how to access this function? </p>
| javascript jquery | [3, 5] |
678,103 | 678,104 | window.opener.document.getElementById not working | <p>In my asp.net web app, I create a popup window with a button. When that button is clicked, I want to set the value of an asp:TextBox (id=TextBox1) contained in the parent window. However, it doesn't work like all the examples I've read indicate. </p>
<p>I've tried the following lines of code in my javascript onclick handler:</p>
<ol>
<li>window.opener.document.getElementById('<%= TextBox1.ClientID %>').value = "abc";</li>
<li>window.opener.document.getElementById("TextBox1").value = "abc"; </li>
<li>window.opener.document.getElementById("ctl00_ContentPlaceHolder1_TextBox1").value = "abc";</li>
</ol>
<p>Only example 3 works. All the stuff I've read indicates that #1 is the preferred method, but I can't seem to make it work at all. Does anyone have any ideas what I'm doing wrong?</p>
<p>I've tried this in Firefox, Chrome and IE.</p>
<p>Thanks</p>
| asp.net javascript | [9, 3] |
2,752,198 | 2,752,199 | Controlling overall system volume from app? | <p>I'm building an application in which I would like to let the user control the volume via the app (instead of pressing down the side volume buttons). </p>
<p>Is there a way to control the "overall" system volume from within the app? If not, I would be content controlling media player volume and phone (ringer + in-call) volume. I create my own local MediaPlayer object, so I think that shouldn't be so hard to control. </p>
| java android | [1, 4] |
3,654,162 | 3,654,163 | Create a link from text | <p>I have code</p>
<pre><code><div class="row1">
<em>My text</em>
</div>
</code></pre>
<p>How can I make a link like:</p>
<pre><code><div class="row1">
<em><a href="/mylink">My text</a></em>
</div>
</code></pre>
<p>I understand that the issue is a primitive but can not find the same simple solution.</p>
| javascript jquery | [3, 5] |
168,918 | 168,919 | how to show in asp.net grid total rows and actual rows without slowing the performance | <p>we have a asp.net1.1 3 tiers project in <strong>production</strong> .</p>
<p>right now for fetching data to asp.net grid, we have a constant call maxRows, and we don't fetch more than that (for performance reason).
we have a new request from the customer, "show me the num of total rows in the asp.net grid and the num of actual rows that have been fetch <strong>for each grid in the project</strong>."</p>
<p>between the presentation layer and the business layer we use .net remoting, and we are passing dataset between the tiers.</p>
<p>the database is ms sql server 2005.</p>
<p>we plan to upgrade this project to .net4.0</p>
<p>what is the solution for this request for .net1.1 and for .net4.0 ?</p>
<p>does asp.net grid have a built in feature to handle paging so we don't get outOfMemory exception for fetching a large amount of records ?</p>
| c# asp.net | [0, 9] |
2,641,215 | 2,641,216 | Format date to MM/dd/yyyy in javascript | <p>I have a dateformat like this <code>'2010-10-11T00:00:00+05:30'</code>. I have to format in to <code>MM/dd/yyyy</code> using javascript or jquery . Anyone help me to do the same.</p>
<p>Thanks
Pradeep</p>
| javascript jquery | [3, 5] |
68,295 | 68,296 | set drop down value using Jquery | <p>I am new to jquery.</p>
<p>In my appllication i am using a cascading drop down, and once i get value in list from c# i call below function and pass the list as response and drop down as control.</p>
<p>below code is working fine however instead of appending and selecting 'None', i want to select 'None' in my drop down as 'None' is already available in my list.</p>
<pre><code>control.empty().append('<option selected="selected" value="0">None</option>');
</code></pre>
<p>Please help in </p>
<pre><code>function PopulateControl(response, control)
{
if (response.length > 0)
{
control.removeAttr("disabled");
control.empty().append('<option selected="selected" value="0">None</option>');
$.each(response, function(){control.append($("<option></option>").val(this
['Value']).html(this['Text'])); }); }
else {
control.empty().append('<option selected="selected" value="0">
Not available<option>');
}
}
</code></pre>
| c# jquery | [0, 5] |
2,134,655 | 2,134,656 | Formatting Eval into a currency, forcing en-US | <p>I have this line of code:</p>
<pre><code><%# Eval( "Balance", "{0:C}" )%>
</code></pre>
<p>How do I always force that to display currency in en-US regardless of what locale they have setup?</p>
| c# asp.net | [0, 9] |
4,534,208 | 4,534,209 | Constants across ASP.NET and C# code | <p>I have an .aspx page which creates a column of check boxes within a table using the ID to name it as such</p>
<pre><code><asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="testCheck" runat="server" AutoPostBack="true" />
</ItemTemplate>
</asp:TemplateField>
</code></pre>
<p>Later in the C# portion of the code I am attempting to retrieve the value of the check box by using the following code</p>
<pre><code>CheckBox chk = (CheckBox)gridRow.FindControl("testCheck");
</code></pre>
<p>Ideally I would like to remove the two string and hold the value in a common constant, is there any way to do this?</p>
| c# asp.net | [0, 9] |
646,686 | 646,687 | How does Foxfi work? | <p>There is an android ap called Foxfi. It creates a hotspot on any android phone and broadcasts a wifi signal. It doesnt require root accesss but it does the same thing as tether aps that require root. I was wondering how they managed to do this without needing root. I tried decompiling the apk but its obfuscated and I couldnt make heads or tails of it. Here is the link to the ap if anyone is interested. They just upgraded to a paid version now but you can still test it out until you use x amount of data.</p>
<p>Google play
<a href="https://play.google.com/store/apps/details?id=com.foxfi&feature=nav_result#?t=W251bGwsMSwxLDMsImNvbS5mb3hmaSJd" rel="nofollow">https://play.google.com/store/apps/details?id=com.foxfi&feature=nav_result#?t=W251bGwsMSwxLDMsImNvbS5mb3hmaSJd</a></p>
<p>Their site
<a href="http://foxfi.com/" rel="nofollow">http://foxfi.com/</a>
http://foxfi.com/bin</p>
| java android | [1, 4] |
3,511,928 | 3,511,929 | Make moveable image button static once moved | <p>I currently have this code that allows me to move the image button around the screen. but i want to know how i would be able to move the image button to another position and once at the point it changes allows me to click the button but not movable. Yeah i would like the button to be moved the first time they move it and then the next time that they come back to the site the button is not movable. </p>
<pre><code> var x;
var y;
var bool;
bool =1;
function move(event){
x= event.clientx;
y = event.clienty
document.getElementByID('img_btn').style.top=y+'px';
document.getElementByID('img_btn').style.left=y+'px';
}
</code></pre>
| javascript jquery | [3, 5] |
865,807 | 865,808 | Jquery Find if response contains element | <p>How do you find if the response contains the element form </p>
<pre><code> $.ajax({
url : $(this).attr('action'),
type : 'POST',
success : function(response){
if($(response).find('form').length)
{
alert("hii");
}
}
});
</code></pre>
<p>Form could be the topmost element of the response or somewhere in middle </p>
| javascript jquery | [3, 5] |
2,653,064 | 2,653,065 | Highlight the text using jquery | <p>I have one textbox, button and and list box with some text.</p>
<p>When I click on button what ever the text I enter in text if it matches the text in the list box I am trying to highlight that text using jquery I used this code.</p>
<p>Jquery Code</p>
<pre><code>$("#btnhighlight").click(function () {
alert("yes");
var htext = $("#txthighlighttext").val();
alert(htext);
$("#lstCodelist").highlight('MD');
});
</code></pre>
<p>Style sheet I used to hightlight and i downloaded the highlight plug in added to the project</p>
<pre><code><style type="text/css">
.highlight { background-color: yellow }
</style>
</code></pre>
<p>Please can any one help me out how to do this. or if I am doing wrong?
Can an</p>
| javascript jquery | [3, 5] |
4,003,288 | 4,003,289 | How to package apk with external library to android mobile | <p>I have added the external library using eclipse. Everything is fine in the emulator. However, when I tried to install the apk file in real android mobile, it cannot be installed.
Actually, I followed this steps to add external library.</p>
<p><a href="http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary" rel="nofollow">http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary</a></p>
<p>Hope someone can help. Thank You.</p>
| java android | [1, 4] |
926,216 | 926,217 | How to display the latest called object on top? | <p>I'm creating a custom select plugin. Everything is going great, but the dropdowns (<code><ul></code>-objects) are overlapping on each other :(</p>
<p>I understand, that the overlapping order is set after the elements order on page or when they are created. So my question is: <strong>What is the method to make the latest opened/shown object (<code><ul></code>) on top of the hierarchy?</strong></p>
<p>I just need the correct method. I'm not going to copy the full code, but a little example:</p>
<pre><code>$('#trigger').click(function () {
new_dropdown.slideDown();
});
</code></pre>
<p><em>(A picture is worth of 1000 words)</em></p>
<p><img src="http://i.stack.imgur.com/QTWlz.png" alt="enter image description here"></p>
<p>So lets say, that I open the green select the last.. How can I make it on top of the yellow one?</p>
<p><strong>EDIT</strong></p>
<p>For easier testing I created jsfiddle. For future references I'll post the link: <strong><a href="http://jsfiddle.net/hobobne/uZV5p/1/" rel="nofollow">http://jsfiddle.net/hobobne/uZV5p/1/</a></strong> This is the live demo of the problem at hand.</p>
| javascript jquery | [3, 5] |
4,083,737 | 4,083,738 | How to use javascript to get an ASP.NET's Textbox Control's Value | <p>Suppose I have an ASP.NET Text Box as Below : </p>
<pre><code><asp:TextBox ID="txtQuantity" runat="server" Text="0"></asp:TextBox>
</code></pre>
<p>I want to get this box's current value in javascript. How can I access this element? If it was a normal html text box, with id="txtQuantity", then I could access it using "document.getElementById("txtQuantity")". But how can I access ASP.NET text box in javascript?</p>
| asp.net javascript | [9, 3] |
867,223 | 867,224 | Is having too many setTimeout()s good? | <p>I'm using mostly Javascript on my scripting. I have some scripts which do several tasks every 1 second, and some every 0.02 seconds, etc. My intervals do tasks like checking of ifs, doing some innerHTML, little animation, etc. Now I have 4, but I think it would increase in the future; maybe I'll control myself to less than 10. Though it doesn't lag at all in my computer.</p>
<ol>
<li>Generally, will it be good for a site? </li>
<li>Since it's client-side obviously there won't be any issues with internet connection, right?</li>
<li>Is it a bad practice, or is it not much of an issue at all?</li>
</ol>
<p>Also, I have a question for jQuery. There are things that normal Javascript and jQuery can do similarly (like innerHTML and .html()), right? Given this situation, which should I prefer to use, jQuery or Javascript?</p>
<p>Thank you.</p>
| javascript jquery | [3, 5] |
6,033,393 | 6,033,394 | Action Bar Tabs at the bottom? | <p>I'm trying to place the action bar tabs at the bottom of my app, but I need some help with it (if it's even possible).</p>
<p>The code:</p>
<pre><code>actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
ActionBar.Tab tabA = actionBar.newTab().setText("Games");
ActionBar.Tab tabB = actionBar.newTab().setText("Apps");
ActionBar.Tab tabC = actionBar.newTab().setText("Themes");
tabA.setTabListener(new ActionBarTabListener());
tabB.setTabListener(new ActionBarTabListener());
tabC.setTabListener(new ActionBarTabListener());
actionBar.addTab(tabA);
actionBar.addTab(tabB);
actionBar.addTab(tabC);
</code></pre>
| java android | [1, 4] |
1,965,754 | 1,965,755 | Exported activity does not require permission | <p>So, I am going over tutorials to learn android and I have the bellow code which is giving me this warning in the title and the app will not run for some reason any help?</p>
<p>This is the code:</p>
<pre><code><application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.learn.tam.Splash"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.SPLASH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.learn.tam.StartingPoint"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.STARTINGPOINT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</code></pre>
<p>The part that is showing the error is the Second
< activity </p>
| java android | [1, 4] |
25,558 | 25,559 | What are the key points to be consider while developing Web site in asp.net? | <p>I am new to .net And want to develope the web site..</p>
| c# asp.net | [0, 9] |
2,671,277 | 2,671,278 | Empty FileUpload Text Using Javascript | <p>I've a fileupload controller in my asp.net form.I've to empty the fileupload text using javascript on radiobutton click.</p>
<p>How will we do that.Here's my code...</p>
<pre><code><asp:RadioButton ID="rbnImage" runat="server" Text="Image" GroupName="a"
onclick="SetVisibility(this.id)"
</code></pre>
<p>Javascript goes here</p>
<pre><code>function SetVisibility(id) {
if (id == 'rbnImage') {
document.getElementById('fupLogo').style.visibility = 'visible';
document.getElementById('fupLogo').value = '';
document.getElementById('txtText').style.visibility = 'hidden';
}
}
</code></pre>
<p>This code is not working.Its working for textbox. </p>
| javascript asp.net | [3, 9] |
5,379,853 | 5,379,854 | From a dynamic table how can i transfer current rows value to a js function | <p>I have this table <a href="http://jsfiddle.net/abhisheksimion/vAYFL/4/" rel="nofollow">here</a></p>
<p>here <code>{name}</code> and <code>{host}</code> gets populated by from a spry XMLDataset, and <code>{name}</code> value will be dynamic, so how can i get the current row values to be passed as a parameter to a JS function?</p>
<p><strong>eg</strong>: When I click any of the rows <code>{name}</code> hyperlink it should get the <code>{host}</code> value and passes it to the JS function</p>
| javascript jquery | [3, 5] |
4,295,397 | 4,295,398 | how to traverse a file in python and c++ in backward way? And also store data in backward (bottom to top) way? | <p>Suppose i want to store 3 lines in a file both in python and C++ .
I want to store it like this </p>
<pre><code>aaa
bbb
ccc ..
</code></pre>
<p>But i am giving <code>ccc</code> input first then <code>bbb</code> then <code>aaa</code>. How will I traverse the file from bottom to top and also store from bottom to top/?</p>
| c++ python | [6, 7] |
606,886 | 606,887 | How to refresh the parent page and closing the child window using javascript | <p>How to refresh the parent page and closing the child window using javascript when I click the button in parent page asp.net
I am able to refresh the parent page but my child window is not closing.
My C# Code is </p>
<pre><code> string script = @"<script>
function RefreshParent()
{
window.close();
window.opener.location.reload();
}RefreshParent();
</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "ssr", script);
</code></pre>
| c# javascript | [0, 3] |
5,200,772 | 5,200,773 | add title when exporting grid to excel | <p>I use the following code to export a datatable to excel</p>
<p>Is there a way to add a title to the excel sheet??</p>
<p>Here is the code I use to generate the excel sheet.</p>
<pre><code>enter code here
public void export2(DataTable dt)
{
System.Web.UI.WebControls.DataGrid grid =
new System.Web.UI.WebControls.DataGrid();
grid.HeaderStyle.Font.Bold = true;
grid.DataSource = dt;
grid.DataBind();
using (StreamWriter sw = new StreamWriter("C:\\Reports\\Report.xls"))
{
using (HtmlTextWriter hw = new HtmlTextWriter(sw))
{
grid.RenderControl(hw);
}
}
}
</code></pre>
<p>The output from this looks like this</p>
<pre><code>Name Employee ID
abc 123
def 456
ghi 789
jkl 987
mno 654
</code></pre>
<p>is it possible to get the output as shown below??</p>
<pre><code>Employee Report
Name Employee ID
abc 123
def 456
ghi 789
jkl 987
mno 654
</code></pre>
<p>Thanks in advance!!</p>
| c# asp.net | [0, 9] |
4,278,014 | 4,278,015 | Android - Broadcast Receiver screen off to Intent, not working....? | <p>I have code below that I have inserted into my onCreate method, but it dosent seem to work.
I want it to launch other activity when screen goes off/battery button press. </p>
<p>CODE:</p>
<pre><code>protected void onStartCommand() {
// TODO Auto-generated method stub
super.onStart();
ScreenReceiver();
}
public class ScreenReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
lock.reenableKeyguard();
Intent s = new Intent(Activity1.this , Activity2.class);
startActivity(s);
}
else if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
lock.disableKeyguard();
}
}
}
</code></pre>
<p>Any help would be VERY appreciated? </p>
| java android | [1, 4] |
2,679,673 | 2,679,674 | Parse numbers in singe textbox for query | <p>I’ve built a webform in Visual Web Developer Express 2008 to help me with my work. I use a webform to run query requests that are emailed to me. The inputs are in this format</p>
<p>12312 12312</p>
<p>12312 12312</p>
<p>12312 12312</p>
<p>12312 12312</p>
<p>I enter the first number in a textbox and the second number in another textbox and click a button that runs a query and returns the results in a gridview(single row).</p>
<pre><code>string strConn, strSQL;
strConn = AppConfig.Connection
strSQL = 'select fields from table where FirstNum=:FirstNum and SecondNum=:SecondNum';
using (OracleConnection cn = new OracleConnection(strConn))
{
OracleCommand cmd = new OracleCommand(strSQL, cn);
cmd.Parameters.AddWithValue(":FirstNum", txtFirstNum.Text);
cmd.Parameters.AddWithValue(":SecondNum",
txtSecondNum.Text);
cn.Open();
using (OracleDataReader rdr = cmd.ExecuteReader())
{
dgResults.DataSource = rdr;
dgResults.DataBind();
}
cn.Close();
}
</code></pre>
<p>I had an idea to help me speed up my work. I’d like to be able to past both numbers in a single textbox </p>
<p>( like this 12312 12312 )</p>
<p>and have the code parse out the nubmers for the query. Or even better would be to past all of them in a multiline textbox like this</p>
<p>12312 12312</p>
<p>12312 12312</p>
<p>12312 12312</p>
<p>12312 12312</p>
<p>And have them all parsed and the query run for each line and the results all output to one gridview. I’m just not sure how to approach this. Any suggestions would be appreciated.</p>
<p>Thank you.</p>
| c# asp.net | [0, 9] |
3,661,120 | 3,661,121 | How to Display 1 record of DataBase in 1 row of asp:GridView | <p>multi field in each line and multi lint in 1 row ,instead all field in 1 row
for example:</p>
<p><code>
id name family
<br/>
description date</p>
<p></code></p>
<p>instead:</p>
<p><code>
id name family description date
</code></p>
| c# asp.net | [0, 9] |
4,363,922 | 4,363,923 | Running a javascript file within Java (Android) | <p>I have a website that I want to log into from an android app and in order to submit the POST request with right information, they need some hashed values. The way that the website does it is through a javascript file. I tried tracing through it but I couldn't get the same result as the native website.</p>
<p>So i've decided to download their javascript file and run it within java. </p>
<p>My issue is that I can't figure out how to run specific methods within their file.</p>
<p>Here's my code so far and it's extremely bare bones. </p>
<pre><code>public void hashIt(String valueForMethod1, String valueForMethod2){
final ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine engine = sem.getEngineByName("JavaScript");
try {
engine.eval(new java.io.FileReader("res/raw/theirFile.js"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (ScriptException e) {
e.printStackTrace();
}
}
</code></pre>
<p>Any help would be much appreciated :)</p>
<p>Thanks </p>
| java javascript android | [1, 3, 4] |
1,271,240 | 1,271,241 | How to get jQuery dialog to wait before displaying? | <p>I'd like my jQuery dialog to display exactly 3 seconds after a user hovers over an image. Currently I have:</p>
<pre><code>$(".imgLi").live('hover', function() {
showDialog();
});
function showDialog()
{
$('#imageDialogDiv').dialog({
modal:true
});
}
<div id="imageDialogDiv" title="Blah">...</div>
</code></pre>
<p>Not sure where too put the time code or how to implement jQuery's timer object here. If the use "mouses away" (moves the mouse away from the image) at any point during that 3 second timeframe, I <em>do not</em> want the dialog to display. Thanks in advance for any help here.</p>
| javascript jquery | [3, 5] |
1,184,782 | 1,184,783 | how do i install a driver (.sys) file | <p>I've downloaded a NDIS driver to packet filtering. (a .sys file)
To use this file (NDIS driver) I need to install this file
how do i install it ?
I have windows 8</p>
| c# c++ | [0, 6] |
5,279,806 | 5,279,807 | Singleton through several processes? | <p>How can I write singleton to work through several processes? Is it possible?
For example I have code that works with Remote Service in Android. How can I write singleton for this purpose?</p>
| java android | [1, 4] |
724,547 | 724,548 | jQuery: contains selector for <option>VALUE</option> | <p>I'm trying to add a class to the H1 tag that matches the current select option.</p>
<p>jQuery</p>
<pre><code> var option = $('#fruits').val()
$("h1:contains(option)").addClass('selected')
</code></pre>
<p>html</p>
<pre><code><select>
<option>Select One</option>
<option>apple</option>
<option>orange</option>
<option>lemon</option>
</select>
<h1>apple</h1>
<h1>orange</h1>
<h1>lemon</h1>
</code></pre>
| javascript jquery | [3, 5] |
3,396,101 | 3,396,102 | Select first element that doesn't have a specific class | <p>I want to write a selector that targets the first element that doesn't have a specific class.</p>
<pre><code><ul>
<li class="someClass">item 1</li>
<li>item 2</li> <-- I want to select this
<li class="someClass">item 3</li>
<li>item 4</li>
</ul>
</code></pre>
<p>I know how to select all elements that doesn't have "someClass":</p>
<pre><code>$('li not:(.someClass)').dostuff();
</code></pre>
<p>But I don't know how to only select the first element that doesn't have "someClass".</p>
<p>Anyone knows how to do this?</p>
| javascript jquery | [3, 5] |
1,597,381 | 1,597,382 | Response.redirect working In FF but problem with IE | <p>I want to redirect from one page to another based on condition .</p>
<p>For e.g I want to redirect from www.abcd.com/Doc/blogs.aspx to www.abcd.com/movies based on condition which I need to check from code behind C#</p>
<p>I was trying to use <code>Response.Redirect("movies.aspx");</code> </p>
<p>but its not working in IE7</p>
<p>I am getting Http 400 bad request....
whereas in Firefox its working fine any idea how to resolve this problem</p>
<p>If anyone knows how to achieve this? </p>
<p>Thanks,</p>
| c# asp.net | [0, 9] |
4,582,376 | 4,582,377 | JQuery - Wrap divs in groups of 50 after sorting | <p>I have the following html :</p>
<pre><code><div class="backpack_all"> //wrapper for all on screen content
...
<div class="backpack"> //main content to display
<div class="item1">
<div class="item2">
<div class="item3">
...etc
</code></pre>
<p>I will have anywhere from 200-500 items in this format. I'm also actively sorting this data by various attributes on these items. When unsorted, they are partitioned in sets of 50 by a class="backpack_partition" which wraps around 50 items. To sort them I have to unwrap all items from their respective partitions. How can I use jquery/javascript to rewrap them? </p>
| javascript jquery | [3, 5] |
4,105,126 | 4,105,127 | server tags in markup | <p>Morning all I have frequently used the old </p>
<pre><code><asp:Label ID="lblWas" runat="server" Text='<%# XPath("FACEVALUE") %>'></asp:Label>
</code></pre>
<p>This type of thing. when I first came across it I loved it, i'm using it again today but not quite so simply.</p>
<p>I have a number of extra things I would like to achieve.</p>
<ol>
<li>Apply formatting to the value. Like <code>Text='<%# string.Format(XPath("FACEVALUE"), "{0:c}") %>'></code></li>
<li><code><asp:LinkButton ID="lnkBook" runat="server" PostBackUrl='/THEATRE/' + XPath("FACEVALUE")>Book</asp:LinkButton></code></li>
</ol>
<p>For option number 2 the URL is not as I would expect, and for number 1 I cannot get the syntax correct if it's even possible.</p>
<p>I have not been able to find something suitable in google. Hopefully what I am trying to achieve is obvious from the example :)</p>
| c# asp.net | [0, 9] |
614,494 | 614,495 | Writing file from PHP page android | <p>In my project a compressed file is displayed on a php in bytes.
I am trying to find a way to read the php page, decompress the file using <strong>GZIP</strong>, and write it out to the assets folder.
The file that I am reading in has to be placed in the <code>data/data/package/database</code> file. </p>
<p>I have a class that reads a file from the assets folder and places the file into <code>data/data/package/database</code>. </p>
<p>Is it possible to write to the assets folder during runtime? If not is there a better way to do this?</p>
| java php android | [1, 2, 4] |
2,911,653 | 2,911,654 | Fade In after initial fade | <p>I'm working on a site trying to get the navigation to fade in after the initial fade up of the background. HEre is the site: <a href="http://mccraymusic.com/newsite/" rel="nofollow">http://mccraymusic.com/newsite/</a></p>
<p>I know the navigation doesn't work and is not styled yet. If you click "enter site" you'll see the fade action I'm talking about with the background. You'll also notice the current way that the navigation acts currently as well. </p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
3,861,756 | 3,861,757 | jquery .html works but .add doesn't | <p>my code:</p>
<pre><code>$(document).ready(function() {
$(this.body).html("<p>using .html</p>"); // works
$(this.body).add("<p>using .add</p>"); // doesn't work
});
</code></pre>
<p><a href="http://jsfiddle.net/ZLzw8/" rel="nofollow">some jsfiddle</a></p>
<p>What am I doing wrong?</p>
| javascript jquery | [3, 5] |
2,086,326 | 2,086,327 | Issues submitting form with jquery | <p>I have been trying to submit a form with jquery ajax but have been having issues.
When i check through firebug i see the value posted but it shows error from the url. I have this html</p>
<pre><code><form method="post" name="tForm" id="tForm">
<table>
<tr>
<td>Age</td>
<td><input name="age" id="age" value="" /></td>
</tr>
<tr>
<td><input type="button" id="submit" value="submit"/></td>
</tr>
</table>
</form>
</body>
</code></pre>
<p>My js file that submits the form has this piece of code</p>
<pre><code>$(document).ready(function() {
$('#tForm').submit(function(){
var age = $('#age').val();
var msg ='';
$.ajax({
url:'testp.php',
type:'post',
data: {age:age},
beforeSend:function(){
alert(age);
},
success:function(data){
msg=data;
alert(msg);
},
complete:function(){
alert(msg);
}
})
})
});
</code></pre>
<p>My testp.php file just has this</p>
<pre><code><?php
echo 'ok';
?>
</code></pre>
| php jquery | [2, 5] |
5,769,046 | 5,769,047 | How to prevent an ajax call when already it's been initiated? | <p>Suppose there is a form. When the form is being submitted I'm calling an ajax request to server. While it's being executing I don't want that ajax call to be triggered again.
Once I the ajax call is complete then only the ajax call can be trigger again.</p>
<p>How can I implement this? Here I want to use JQUERY library to implement this.</p>
| javascript jquery | [3, 5] |
2,988,563 | 2,988,564 | Is it possible to set the width of an element to that of the preceding element? | <p>My input elements are followed by a div. I would like to set the width of that div to be that of the preceding input element.</p>
<pre><code><input type="text" class="input" size="100" name="data"/>
<div class="inputHelp"> enter data above </div>
<input type="text" class="input" size="80" name="moredata"/>
<div class="inputHelp"> enter more data above </div>
</code></pre>
<p>In each instance, the class .inputHelp should have the same width as the input element before it.</p>
<p>Using the <strong>next</strong> selector, I was able to grab the width of input elements followed by the inputHelp div.
However, when attempting to set the width of the following inputHelp div, it instead set the width of ALL inputHelp divs on the page. How can I limit it to only set the width of the next inputHelp, and then iterate through all the other input + inputHelp combinations on the page?</p>
<p>Here's my current JQuery code:</p>
<pre><code>$('.input + .inputHelp').width( $('.inputHelp').prev('.input').width() );
</code></pre>
| javascript jquery | [3, 5] |
1,748,941 | 1,748,942 | What is the equivalent for C++ const size_t in C#? | <p>I'm trying to translate some Ogre code to it's C# version and I ran into a problem :</p>
<pre><code> const size_t nVertices = 8;
const size_t vbufCount = 3*2*nVertices;
float vertices[vbufCount] = {
-100.0,100.0,-100.0, //0 position
-sqrt13,sqrt13,-sqrt13, //0 normal
//...
-sqrt13,-sqrt13,sqrt13, //7 normal
};
</code></pre>
<p>Basically, const size_t doesn't exist in C#, and const int can't be used to declare array's size.</p>
<p>I was wondering how to declare arrays with a constant value?</p>
| c# c++ | [0, 6] |
88,706 | 88,707 | What's the difference between Admob and Adwhirl? | <p>I'm trying to figure what the difference is and which one would be more profitable for my app?</p>
| android iphone | [4, 8] |
1,700,436 | 1,700,437 | In Javascript, what is an options object? | <p>Now I have googling this a lot, but I cant seem to find what I am looking for. I am not talking about the options object that does drop down menus, I am talking about seeing stuff like </p>
<pre><code>options.remove, options.enable, options.instance,
</code></pre>
<p>To be honest, I am not sure if the code I am trying to figure out already created some object called "options" or if its a pre-built javascript object. It lights up purple in my dreamweaver editor so I have a feeling its a pre-built object. I am new, sorry.</p>
| javascript jquery | [3, 5] |
4,763,236 | 4,763,237 | Pedometer App for a phone | <p>Where could someone get the code or guidelines to create a universal pedometer app for various phones?
or would you have to create a different app for each phone?
or could you just create an app for android & iphone?</p>
<p>How would a coder go about doing the task? where to look for help?</p>
| iphone android | [8, 4] |
5,566,003 | 5,566,004 | Prevent users from re-clicking "Like" button on page refresh | <p>I want to stop a user from clicking a <em>Like</em> button multiple times. I can disable the button on the first click using jQuery, but when the page is refreshed, the user can again click the button. How do I prevent a user from re-clicking the button on page refresh?</p>
| php jquery | [2, 5] |
2,707,044 | 2,707,045 | javascript ask by attempting to do | <p>Why does this cause an 'Aw, Snap!' Error (like a plugin failed, showing a file with a face that has its eyes crossed out)?</p>
<pre><code>var vid;
var youtube;
var youtube1='<object style="margin:5px;height:175px; width:235px"><param name="movie" value="';
var youtube2='"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="';
var youtube3='" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" height="175" width="235"></object>';
if(vid=vid.replace('http://www.youtube.com/watch?v=','')){
vid=vid.slice(0,11);
vid='http://www.youtube.com/v/'+vid+'?version=3&feature=player_detailpage&autohide=1';
}else{}
youtube=youtube1+vid+youtube2+vid+youtube3;
$('#TV').html(youtube);
</code></pre>
<p>it used to work when my code was like so:</p>
<pre><code>if(youtube.search('http://www.youtube.com/v/')== -1){
vid=vid.replace('http://www.youtube.com/watch?v=','');
vid='http://www.youtube.com/v/'+vid+'?version=3&feature=player_detailpage&autohide=1';
}else{}
</code></pre>
<p>I would have thought that asking if js can do something whilt attempting it would work and be faster!? I'm sure I've seen this done in php.</p>
<p>Is something like this possible?</p>
| javascript jquery | [3, 5] |
890,255 | 890,256 | javascript, jquery idk | <p>I got this array:</p>
<pre><code>backgrounds:
{
bc2: '/images/layout/images/backgrounds/bc2.jpg',
codmw2: '/images/layout/images/backgrounds/codmw2_6.jpg',
bf2: '/images/layout/images/backgrounds/bf2.jpg',
bf2142: '/images/layout/images/backgrounds/bf2142.jpg',
codbo: '/images/layout/images/backgrounds/codbo.jpg',
cod5waw: '/images/layout/images/backgrounds/cod5waw.jpg'
}
</code></pre>
<p>and I want to access this like <code>backgrounds[0] = '/images/layout/images/backgrounds/bc2.jpg'</code>.
Is this possible or do I need to create the array in another way?</p>
| javascript jquery | [3, 5] |
1,798,068 | 1,798,069 | Adding confirm javascript to asp.net generated links | <p>I have a number of buttons generated on the server, each of which is unique.</p>
<p>I want to be able to have a popup to ask if the user definitely wants to click, and then for it to follow through with the postback.</p>
<p>The generated button code is:</p>
<pre><code><a id="ctl00_ContentPlaceHolder1_btnID9994"
href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$btnID9994','')">
<img src="mt_locked.gif"/>
</a>
<a id="ctl00_ContentPlaceHolder1_btnID9995"
href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$btnID9995','')">
<img src="mt_locked.gif"/>
</a>
</code></pre>
<p>The buttons are generated using this method:</p>
<pre><code> objBtn.ID = "btnID" & room_id.ToString
objBtn.CommandArgument = "Unblock"
AddHandler objBtn.Click, AddressOf btnClicked
</code></pre>
<p>Is there anyway I can add the Confirm javascript code while generating the buttons above, so it will be rendered somewhere in here:</p>
<pre><code>href="javascript:***confirm code here somewhere - if ok then continue to:... __doPostBack('ctl00
</code></pre>
<p>Thanks for any help,</p>
<p>Mark</p>
| javascript asp.net | [3, 9] |
1,321,751 | 1,321,752 | empty tbody on click | <p>I am trying to empty all the rows inside the tbody on click of a new row. This is the javascript i am using:</p>
<pre><code>$('#pro tr').click(function() {
$('#pro_basket > tbody').empty();
$.ajax({
type: "post", url: "data.php", data: "index="+index,
success: function(data) {
$('#pro_basket > tbody').after(data);
}
});
});
</code></pre>
<p>My table markup is simple:</p>
<pre><code><table id='pro_basket'>
<thead>
<th>Column 1</th>
<th>Column 2</th>
</thead>
<tbody>
</tbody>
</table>
</code></pre>
<p>I want to empty the rows that exist in pro_basket but <code>$('#pro_basket > tbody').empty();</code> isn't really helping.</p>
| javascript jquery | [3, 5] |
5,684,106 | 5,684,107 | Add table column cells with input textbox and without | <p>I am adding the values of a column in a table with the following javascript function:</p>
<pre><code>function sumOfColumns(tableID, columnIndex, hasHeader) {
var tot = 0;
$("#" + tableID + " tr" + (hasHeader ? ":gt(0)" : ""))
.children("td:nth-child(" + columnIndex + ")")
.each(function() {
tot += $(this).html();
});
return tot;
}
</code></pre>
<p>I would like to modify it so it adds not only the numbers in the cell, but also include the value of textboxes in cells. A cell can either have a number or a textbox with a number.</p>
<p>The following cells should add up to 2115:</p>
<pre><code><table>
<tr><td>100</td></tr>
<tr><td><input type="text" value="5" /></td></tr>
<tr><td>10</td></tr>
<tr><td><input type="text" value="2000" /></td></tr>
</table>
</code></pre>
<p>How can I do this most efficiently?
Thanks for your input!</p>
| javascript jquery | [3, 5] |
2,692,981 | 2,692,982 | jquery html returns null | <p>I am trying to download a webpage and extract the body.</p>
<p>Given I have the following code:</p>
<pre><code>$.ajax({
url: someAccessiblePublicUrlOnSameWebServer,
dataType: 'html',
success: function (data) {
//data is correct at this point
var body = $(data).find('body').html();
//body is null. why ?
}
});
</code></pre>
<p><code>success</code> is called and <code>data</code> contains the expected html but <code>body</code> is always null. Why ?</p>
| javascript jquery | [3, 5] |
3,273,853 | 3,273,854 | Including simple PHP code into Javascript | <p>How do I make this work? I've googled and even saw some examples here on Stackoverflow which show this kind of coding, but it doesn't work for me.</p>
<pre><code><script type="text/javascript">
var infoClass = "";
infoClass = <?php echo('test'); ?>;
alert(infoClass);
</script>
</code></pre>
<p>The alert box displays empty box.</p>
| php javascript | [2, 3] |
4,552,845 | 4,552,846 | Save values between 'Steps' in Wizard ASP.NET | <p>I get this error in ASP.NET Wizard when I try to use values of TextBox control of previous step. </p>
<p>Error:</p>
<pre><code> The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Contact_Emp".
The conflict occurred in database "KKSTech", table "dbo.Emp", column 'EmpID'.
</code></pre>
<p>Is it a problem to access control's values of different steps? </p>
| c# asp.net | [0, 9] |
3,878,804 | 3,878,805 | Display second dropdown list if a value is selected in the first dropdown (using variables)? | <p>Is there any way I can select a certain value in a dropdown list and according to that selection display a second dropdown list?
I know how to do it with just normal words, but what if I use variable names?</p>
<pre><code>University Name: <select name="university" id="university">
<?php
while($row = mysql_fetch_array($uniName)) {
echo "<option>" . $row['uni_name'] . "</option>";
}
?>
</select>
<br/>
Course Name: <select name='course' id='course'>
<?php
while($row = mysql_fetch_array($courseNames)) {
echo "<option>" . $row['course_name'] . "</option>";
}
?>
</select>
</code></pre>
<p>So as you can see, in the first dropdown list I've added all the retrieved university names from my database. I did the same for the courses as well.</p>
<p>Now how can I modify the code below:</p>
<pre><code>$(document).ready(function() {
$('#course').hide();
$('#university').change(function () {
if ($('#university option:selected').text() == "Harvard University"){
$('#course').fadeIn('slow');
}
else {
$('#course').fadeOut('slow');
}
});
});
</code></pre>
<p>Instead of "Harvard University", I want to put a variable there according to what the user has selected. Something like $university_name and then I'll create a new query and display only the courses belong to a certain $university_name.</p>
| php javascript jquery | [2, 3, 5] |
3,574,510 | 3,574,511 | $(document).click(): does not fire alerts | <p>Might be simple but I can find a reasonable explanation for that</p>
<pre><code>$(document).ready(function(){
$(document).click(function () {
alert('ok');
});
});
</code></pre>
<p>Does not fire the alert();
I am using the newest google chrome. Does browser put some restriction for that as there is in ajax callback functions?</p>
<p><strong>Edit 1:</strong> Code is within <code>$(document).ready();</code></p>
| javascript jquery | [3, 5] |
4,705,381 | 4,705,382 | How to load a php file on page load (jQuery provided) | <p>Each article of my site has a unique ID number. When a user clicks to read an article I use a function to get the current's article ID, so the option of the same value in a drop down list to be selected automatically. </p>
<p>For example if I click in the article with ID = 79</p>
<pre><code><option value="0" >Please Choose</option>
<option value="97" <?php echo $postid == '97' ? 'selected="selected"' : '';?> >This is 97</option>
<option value="98" <?php echo $postid == '98' ? 'selected="selected"' : '';?> >This is 98</option>
</code></pre>
<p>my dropdown list will have "This is 97" option selected.</p>
<p>The problem here is that I use a jQuery script that displays a form upon selection as below:</p>
<pre><code><script language='JavaScript'>
$(document).ready(function() {
$('#termid').change(function() {
var val = $(this).val();
$('#reservationdetails').empty().addClass('loading').load('../kratisis/forms/' + val + '.php', function(){$('#reservationdetails').removeClass('loading') });
});
});
</script>
<div id="reservationdetails"></div>
</code></pre>
<p>When a user enters to read article 97, the selected option will be "This is 97" but the requested php file (from jQuery) will not be shown unless I choose 98 and then back to 97.</p>
<p>My question is how to handle this? I mean how to show the additional php file when a user enters the article at first but replace it when the dropdown value is changed?</p>
<p>I thought of using <code><?php include("") ?></code> but assuming that I am on 97 and click on 98 there will be 2 additional php files.</p>
<p>Thank you for your ideas. </p>
| php javascript jquery | [2, 3, 5] |
1,101,483 | 1,101,484 | Is there a way to execute external Javascript from PHP when Javascript is disabled client side? | <p>I am using PHP to generate a dynamic web form that uses an external (to my site) javascript file to set a hidden form input value. My form submits to my own PHP page before reposting to an external site. The external site requires this hidden value for any submission.</p>
<p>Many of the browser that are using my form do not have javascript enabled, so the tracking fails and I can not submit to the external site. Is there any method of executing the javascript file to get the tracking information from my php code without sending it to the clients browser? </p>
<p>This is a pseudo code mock up of the code that I want to handle the form's post:</p>
<pre><code>if ($doPOST) {
//Check POSTed parameters for tracking id ($tid)
if ($tid == ''){
//Execute external javascript to get tid
}
//Post form data to external site
}
</code></pre>
<p>I have looked around and could not find any relevant information, but if you know of a site where this is explained let me know. For clarification, I am not looking for information about to incude a javascript file client side.</p>
<p><strong>Edit:</strong>
This is the Javascript executed by the form. I have no power to change this script. The number 48891 is not hardcoded in the script it changes with execution:</p>
<pre><code>onReady=(function(ie){var d=document;return ie?function(c){var n=d.firstChild,f=function(){try{c(n.doScroll('left'))}catch(e){setTimeout(f,10)}};f()}:/webkit|safari|khtml/i.test(navigator.userAgent)?function(c){var f=function(){/loaded|complete/.test(d.readyState)?c():setTimeout(f,10)};f()}:function(c){d.addEventListener("DOMContentLoaded",c,false)}})(/*@cc_on 1@*/);
var test_track=function(data){onReady(function(){document.getElementById('test_track').value = data.TID})}
test_track({"TID" : "488891"});
</code></pre>
| php javascript | [2, 3] |
3,309,575 | 3,309,576 | Calling functions - Why doesn't function fire? | <p>I have 2 jquery/javascript scripts containing the same function. 1 fires, 1 doesn't. Unfortunately this is not my bag and can't understand why.</p>
<p>SCRIPT1 - THIS DOES NOT FIRE</p>
<pre><code>function popupTerms() {
$(".popup-terms").click(function (e) {
pd(e);
window.open(this.href, this.target, 'menubar=0, toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, width=980, height=640, left=50, top=50');
});
}
</code></pre>
<p>Script1 is initialised in pageLoad</p>
<pre><code>pageLoad();
</code></pre>
<p>SCRIPT2 - THIS DOES FIRE</p>
<pre><code>jQuery(function ($) {
$(".popup-terms").click(function (e) {
pd(e);
window.open(this.href, this.target, 'menubar=0, toolbar=0, location=0, directories=0, status=0, scrollbars=1, resizable=0, width=980, height=640, left=50, top=50');
});
});
</code></pre>
<p>Anyone point me in the right direction?</p>
<hr>
<p>UPDATE 11:12</p>
<p>Firstly I can confirm that both functions do fire in $(document).ready.</p>
<p>The reason function 1 is called from ajax pageLoad is because the website is asp.net and makes use of ajax update panels.</p>
<p>After the page is posted back, the function no longer fires when initiated via $(document).ready.</p>
<p>After more testing, I've found the cuprit to be the function pd(e);</p>
<pre><code>function pd(e) {
if (e.preventDefault)
e.preventDefault();
else
e.returnValue = false;
}
</code></pre>
<p>If I call it from my popupTerms function it doesn't work, however if I copy the code into the popupTerms function it does work.</p>
<p>Any ideas what i'm doing wrong?</p>
| javascript jquery | [3, 5] |
3,041,052 | 3,041,053 | Android - Multi-Task? | <p>I want to know if I can have the recognizer open while using other programs?
I'm looking for an example or tutorial on multi-tasking like this. Point and I will follow.</p>
| java android | [1, 4] |
3,173,654 | 3,173,655 | How to get the name of a custom attribute with jQuery? | <p>Hi I have an attribute which might look like this abcjQuery12345. The numbers might change. Is there a way to determine an attribute which contains a substring in jQuery?</p>
<p>E.g. abcjQuery12344353452343452345="12"</p>
<p>And the only thing I know is that the attribute will contain abc.</p>
| javascript jquery | [3, 5] |
5,953,954 | 5,953,955 | what is a more effecient way to create and bind data to a dropdownlist? | <p>I would like to speed up the loading time for an asp.net project I have been working on. One of the <code>dropdownlists</code> is a list of managers that is obtained by comparing a list of employees from a sql table to Active Directory membership. </p>
<p>This is called from <code>Page_Load</code></p>
<pre><code> SqlDataSource empDB = (SqlDataSource)Page.Master.FindControl("EmployeeData");
DataView dv = (DataView)empDB.Select(DataSourceSelectArguments.Empty);
foreach (DataRowView drv in dv)
{
employeeList.Add(new Employee(int.Parse(drv["EMP_ID"].ToString()), drv ["FULL_NAME"].ToString()));
}
managerTest();
managerDropDownList.DataSource = managerList;
managerDropDownList.DataTextField = "fullName";
managerDropDownList.DataValueField = "emp_Id";
managerDropDownList.DataBind();
</code></pre>
<p>The manager test method:</p>
<pre><code> private void managerTest()
{
PrincipalContext domainContext = new PrincipalContext(ContextType.Domain, "the_domain");
GroupPrincipal managersGroup = GroupPrincipal.FindByIdentity(domainContext, "Managers and Supervisors");
GroupPrincipal offManagersGroup = GroupPrincipal.FindByIdentity(domainContext, "Office Managers");
GroupPrincipal executivesGroup = GroupPrincipal.FindByIdentity(domainContext, "Executives");
GroupPrincipal managers2Group = GroupPrincipal.FindByIdentity(domainContext, "Managers");
foreach (Employee emp in employeeList)
{
UserPrincipal user = UserPrincipal.FindByIdentity(domainContext, emp.fullName);
if (user != null)
{
if (user.IsMemberOf(managersGroup) || user.IsMemberOf(offManagersGroup) || user.IsMemberOf(executivesGroup) || user.IsMemberOf(managers2Group))
{
managerList.Add(emp);
}
}
}
}
</code></pre>
<p>Employee is just a simple class that separates the values for first name, last name and full name. </p>
<p>The issue is that the page loads really slow and there are several controls on the page that postback and causes the postback to take a long time. Is there anything I can do to make this work more efficiently?</p>
| c# asp.net | [0, 9] |
2,067,254 | 2,067,255 | Importing other classes into this class | <p>I'm trying to learn Java, I know this is a noob question, but bear with me please :)</p>
<p>Ctrl+Shift+O isn't loading my other .java file I created and I'm not sure how to tell it to. The file is called "MyWebViewClient.java". I'm also wondering, if I were to put this file within a folder, would it change how it's imported?</p>
<pre><code>package com.myPackage;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
public class MyPackageClass extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//init webview
WebView DCWebView = (WebView) findViewById(R.id.webview);
WebSettings webViewSettings = DCWebView.getSettings();
//when a link is clicked, use the WebView instead of opening a new browser
DCWebView.setWebViewClient(new MyWebViewClient());
//enable javascript
webViewSettings.setJavaScriptEnabled(true);
}
}
</code></pre>
<p>Both classes are part of the <code>package com.myPackage;</code> package... I'm not entirely sure when I should change the name of a package. They're also siblings of each other within /src</p>
| java android | [1, 4] |
4,200,798 | 4,200,799 | How to write easy to debug/maintain JavaScript Event Handlers | <p>Event Handler can be written in mainly two ways:</p>
<pre><code><input type="button" onclick="clickFunction()" />
</code></pre>
<p>or </p>
<pre><code> $('#btnID).click( function(){ .. });
</code></pre>
<p>Someone has to debug/maintain this code at a later stage. In the first case, we can do "inspect Element" and quickly find what is executed. In the second case, we have to find the right Document Loader code to find where it is assigned. </p>
<p>What is the recommended way?</p>
| javascript jquery | [3, 5] |
2,314,368 | 2,314,369 | php jquery auto load content | <p>i would like to know what its a good way of auto load new content without page refresh. for example, previously in twitter trending, when someone posted related trending contents, it will auto load the newly submitted content without page load.</p>
<p>i tried a few methods, for example (pull methods), in my javascript i would set intervals to load frm sql query:</p>
<pre><code>var auto_refresh = setInterval(function () {
$('#myLinks').load('http://domain.com/link/loadlatestnews').fadeIn(2000);
}, 400); // refresh every 400 milliseconds
</code></pre>
<p>but is this a good idea because it requires the client to constantly trying to load from sql every 400 milliseconds.</p>
<p>is it possible to have push methods whereby if there's a new content in mysql, set a event callback??</p>
| php javascript | [2, 3] |
4,010,522 | 4,010,523 | 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] |
237,057 | 237,058 | How to read file from Visual Studio solution/project? | <pre><code> FileInfo template = new FileInfo(@"C:\Users\bryan\Desktop\ReportTemplate.xlsx");
template.IsReadOnly = false;
</code></pre>
<p>This is fine for test, but I have the ReportTemplate.xlsx inside of my project solution. How can I use that file instead of a local one on my desktop? How do I reference the file inside the solution?</p>
| c# asp.net | [0, 9] |
2,338,948 | 2,338,949 | jQuery select option elements by value | <p>I have a select element wrapped by a span element. I am not allowed to use the select id but I am allowed to use the span id.
I am trying to write a javascript/jquery function in which the input is a number i, which is one of the values of the select's options. The function will turn the relevant option to selected.</p>
<pre><code><span id="span_id">
<select id="h273yrjdfhgsfyiruwyiywer" multiple="multiple">
<option value="1">cleaning</option>
<option value="2">food-2</option>
<option value="3">toilet</option>
<option value="4">baby</option>
<option value="6">knick-knacks</option>
<option value="9">junk-2</option>
<option value="10">cosmetics</option>
</select>
</span>
</code></pre>
<p>I wrote something as follows (this does not completely work, which is why I am posting this question):</p>
<pre><code>function select_option(i) {
options = $('#span_id').children('select').children('option');
//alert(options.length); //7
//alert(options[0]); //[object HTMLOptionElement]
//alert(options[0].val()); //not a jquery element
//alert(options[0].value); //1
//the following does not seem to work since the elements of options are DOM ones not jquery's
option = options.find("[value='" + i + "']");
//alert(option.attr("value")); //undefined
option.attr('selected', 'selected');
}
</code></pre>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
2,060,295 | 2,060,296 | how do i remove style from other than img tag in javascript | <p>I want to remove style from all html tags but not from img tag in javascript.</p>
<p>I am using like this ..</p>
<pre><code>content.replace(/(<[^>]+) style=".*?"/g, '$1');
</code></pre>
<p>but it replace style from all the tags.</p>
| php javascript | [2, 3] |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 49