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,181,066
| 5,181,067
|
how to open a aspx page inside a div with Jquery
|
<p>I'm building an asp.net app to avoid the most possible the postbacks using JQuery, the problem that I have is that I'm trying to show pages inside a div, but the only way that i can to show them is like this: </p>
<pre><code>$('#HomeUrl').click(function() {
$('#dvContent').load('Page_Documento.aspx', Load_Completed);
return false;
});
</code></pre>
<p>But i need to stored the pages in their respective folder, for example: (Pages/Administracion/Catalogos/Page_Documento.aspx), so I try to show the pages using something like this:</p>
<pre><code>$('#HomeUrl').click(function() {
$('#dvContent').load('/Pages/Administracion/Catalogos/Page_Documento.aspx',Load_Completed);
return false;
});
</code></pre>
<p>But the metod doesn't works, any suggeustions?.</p>
|
jquery asp.net
|
[5, 9]
|
382,443
| 382,444
|
Rename Pdf from Pdf title
|
<p>Dear all:
I want to organize my pdf file downloaded from the internet. It is clear that many of them are ill-named. I want to extract the real title from the file. Here many of them are generated from Latex and I think from the compiled pdf we can find the \title{} keyword or something like that. I want then use this to rename the file.</p>
<p>I can read the meta-data using pypdf. But most pdf does not contains that title in its metadata. I have tried it with all my collections and find none! </p>
<p>Two questions:
1. Is it possible to read pdf title compiled from the pdf compiled from latex.
2. Which library(mainly in C/C++, java, python) can I use to get that information.</p>
<p>Thanks in advance.</p>
|
java c++ python
|
[1, 6, 7]
|
2,824,946
| 2,824,947
|
getting a clicked elements id with jquery
|
<p>I have a series of Delete icons displays as such:</p>
<pre><code>echo '<img id="'.$items['id'].'" src="images/delete.png" />';
</code></pre>
<p>Where <code>$items['id']</code> is a reference to the id of the DB item I would like that icon to delete.</p>
<p>How can I access this id in jquery when the item is clicked so I can then call a:</p>
<pre><code>$.get('ajax/delete.php', { id: $('#id').val() },
function(data) {}
</code></pre>
<p>Or something of the sort.</p>
|
javascript jquery
|
[3, 5]
|
1,721,382
| 1,721,383
|
Listview DeleteButton onclick broken?
|
<p>I don't know if I'm just being stupid but I can't get bloody Javascript in my asp buttons onclick event :(</p>
<pre><code> <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" onclick="Javascript:returnConf();" />
</code></pre>
<p>I've tried variations including things like:</p>
<pre><code> <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete" onclick="<%= GetMyStupidCode() %>" />
</code></pre>
<p>but the compiler keeps picking it up as code it should interpret or something and gives me errors such as:</p>
<pre><code>Identifier expected
Invalid expression term )
Missing )
</code></pre>
<p>I'm lost, how do I do it?</p>
<p>Thanks in advance,</p>
|
javascript asp.net
|
[3, 9]
|
1,636,261
| 1,636,262
|
Javascript not working in IE and Chrome
|
<p>Please help!
I have a thumb image link swapping out on hover.
It works fine in Firefox and Safari but doesn't show on IE and Chrome.
I'm new to Javascript so please excuse me if I'm missing the obvious.
Thank you in advance.</p>
<p>Here is the script:</p>
<pre><code>$(document).ready (function(){
var fadingImage;
$(".fade").hover(function(){
fadingImage = $(this).find("img").eq(1);
fadingImage.stop(true, true).fadeIn(250);
}, function(){
fadingImage.stop(true, true).fadeOut(250);
});
});
</code></pre>
<p>HTML code:</p>
<pre><code><section class="brands_list">
<div style="display:block; width:290; height:160;"" class="fade">
<a href="<?php echo get_bloginfo('siteurl')."/".$urlSlug."/".$brandSlug; ?>"><img src="<?php echo $brandLogo ?>" class="brand" alt="<?php echo $brandName ?>" width="290" height="160"/>
<img src="<?php echo $brandImage ?>" class="brand" alt="<?php echo $brandName ?>" width="290" height="160"/>
</a>
</div>
</section>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,827,904
| 4,827,905
|
Identify which checkbox was clicked
|
<p>I have a set of checkboxes on my page. Code for one of them:</p>
<pre><code><div>
<label for="ViewAsWebpage">
{{#if this.ViewAsWebpage}}
<input type="hidden" id="ViewAsWebpage" name="ViewAsWebpage" value="true"/>
<input type="checkbox" class="enable-checkbox" checked />
{{else}}
<input type="hidden" id="ViewAsWebpage" name="ViewAsWebpage" value="false"/>
<input type="checkbox" class="enable-checkbox" />
{{/if}}
<span>View as Webpage</span>
</label>
</div>
</code></pre>
<p>I am trying to set the value to true/false based on user clicks and then want to post that value when the form is submitted as follows:</p>
<pre><code>$('input.enable-checkbox').click(function (e) {
if ($('input.enable-checkbox').parent().attr("for") == "ViewAsWebpage") {
var checked = $('#ViewAsWebpage').is(":checked");
$('#ViewAsWebpage').attr("value", checked);
}
</code></pre>
<p>Is there a better way to set the checkbox value to True/False by identifying the checkbox that was clicked on the page (there are multiple)?</p>
|
javascript jquery
|
[3, 5]
|
801,697
| 801,698
|
JQuery. Finding div which has specific data() associated to it
|
<p>Using the <code>data()</code> function I add two values to some <code>divs</code> (<code>$oRow</code> points to divs)</p>
<pre><code>$oRow.data("more", {moreValue: 750, moreIndex: 4});
</code></pre>
<p>Later on I'm trying to find the <code>div</code> (there is only one) which has a specific value for <code>moreIndex</code></p>
<p>I'm doing it like so:</p>
<pre><code>$oMore = $(".meter_battery_row").filter(function(){
return $.data(this, "more").moreIndex == 4;
});
</code></pre>
<p>But it doesn't seem to work. After the above line I display <code>window.alert($oMore)</code> but it seems it doesn't get to this line, so it runs in some kind of problem in the filter function.</p>
<p>Anyone got any ideas?</p>
<p><strong>EDIT</strong></p>
<p><code>.meter_battery_row</code> are the classes of <code>divs</code> to which i attach the data values. (<code>$oRow</code> is of class <code>.meter_battery_row</code>)</p>
|
javascript jquery
|
[3, 5]
|
5,049,696
| 5,049,697
|
How do I load a variable number of scripts with jQuery.getScript() before running javascript code?
|
<p>I need to load a variable number of javascript source files before running javascript code that depends on them. Sometimes 1 script needs to be loaded, other times 2. The getScript() method allows one script to be loaded - how could I use it to load x number of scripts before running its inner code?</p>
<pre>$.getScript("test.js", function(){
// code to run after script is loaded
});</pre>
<p>What I need:</p>
<pre>$.getScript(new Array("1.js","2.js"), function(){
// code to run after all scripts are loaded
});</pre>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,323,293
| 4,323,294
|
Login to .aspx from C# NET
|
<p>I don't use C# NET as often as I would like, but I am trying to make a small application that will basically let our clients have access to certain features in our game panel. Most of my experience is not web related so I am a bit new to this.</p>
<p>Right now I just need to figure out how to let them login via my C# NET application, when the game panel uses ASP .NET pages. Our login page is...</p>
<p><a href="http://my.xfactorservers.com/Templates/Default/login.aspx" rel="nofollow">http://my.xfactorservers.com/Templates/Default/login.aspx</a></p>
<p>This seems really simple, but I don't have any access to my dev computer for a few days so trying to figure it out now. Any help would be appreciated!</p>
|
c# asp.net
|
[0, 9]
|
3,375,177
| 3,375,178
|
Trying to set value on hidden parameter on click of submit button in form
|
<p>Trying to set a parameter on a hidden field on click of submit button.</p>
<pre><code> $('.delete').on('click', function() {
$('#id').val('1000');
});
</code></pre>
<p>This is the hidden field:</p>
<pre><code> <input type="hidden" name="itemId" id="id" />
</code></pre>
<p>And this is one of my submit buttons:</p>
<pre><code> <input type="submit" value="Delete item" class="delete" />
</code></pre>
<p>However at the server the itemId field is empty.</p>
|
javascript jquery
|
[3, 5]
|
888,918
| 888,919
|
Uncaught ReferenceError when executing on different computer
|
<p>The below script works fine on one of my computers but when executing it on another I get <code>uncaught referenceerror $ is not defined</code>. It is the same error on another similar page. Also it says unable to load resource of the ajax.google... source.</p>
<pre><code><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
//add dynamic fields to add more addresses
$(document).ready(function() {
$('#btnAdd').click(function() {
var $address = $('#address');
var num = $('.clonedAddress').length;
var newNum = new Number(num + 1);
var newElem = $address.clone().attr('id', 'address' +
newNum).addClass('clonedAddress');
//set all div id's and the input id's
newElem.children('div').each (function (i) {
this.id = 'input' + (newNum*11 + i);
});
newElem.find('input').each (function () {
this.id = this.id + newNum;
this.name = this.name + newNum;
});
if (num > 0) {
$('.clonedAddress:last').after(newElem);
} else {
$address.after(newElem);
}
$('#btnDel').removeAttr('disabled');
if (newNum == 2) $('#btnAdd').attr('disabled', 'disabled');//number of
field sets that can be added
});
$('#btnDel').click(function() {
$('.clonedAddress:last').remove();
$('#btnAdd').removeAttr('disabled');
if ($('.clonedAddress').length == 0) {
$('#btnDel').attr('disabled', 'disabled');
}
});
$('#btnDel').attr('disabled', 'disabled');
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,801,971
| 5,801,972
|
Redirect from subdomains to pages in global.asax
|
<p>I would like to redirect from subdomains:</p>
<pre><code>alpha.mydomain.com
beta.mydomain.com
*.mydomain.com
</code></pre>
<p>to </p>
<pre><code>http://mydomain.com/alpha.aspx
http://mydomain.com/beta.aspx
http://mydomain.com/*.aspx
</code></pre>
<p>in the </p>
<pre><code> void Application_BeginRequest Event
</code></pre>
<p>from the global.asax file</p>
<p>I want the webbrowser keep showing the subdomain url after the url.</p>
|
c# asp.net
|
[0, 9]
|
2,431,705
| 2,431,706
|
If one page executes a Response.Redirect() to a different web page, can the new page access values in asp.net controls from the original page?
|
<p>I have a text string value that I'd like to persist from one web page to another without using query strings or the session/view states. I've been trying to get the ASP HiddenField control to pass information from one web form to a <i>different</i> form.<br><br>
All the hiddenfield control examples that I've seen is to preserve round trips from the client to the server for the same form.<br><br>
Is there way for a form to access the ASP controls (and their values) from the previously-rendered form? Or is the initial form simply disposed of in memory by the time the second form executes it's <i>OnLoad</i> method?</p>
|
c# asp.net
|
[0, 9]
|
5,728,166
| 5,728,167
|
How can I prevent button-mashing when using anchors instead of buttons?
|
<p>I'm using buttons to submit data via Ajax. I'm using jQuery to disable and enable the buttons. This is to prevent "button-mashing," where a user can fire multiple requests either maliciously or unwittingly. </p>
<p>Is there an "element-agnostic" way to prevent this behavior in jQuery? For example, say I wanted to use anchors instead of buttons to submit the data. A button I can disable; but as far as I know you can not disable anchors.</p>
<p>Here is how I'm doing this now: (note I've removed some of the unnecessary code to make it shorter)</p>
<pre><code> $('.fav .button').click(function() {
$.ajax({
context: this,
dataType: 'json',
beforeSend: function() {
// Toggle state; disable button to prevent button mashing
$(".fav").toggleClass("fav-state-1");
$(".fav .button").attr("disabled", true);
},
error: function() {
// Rollback state and re-enable button on error
$(".fav").toggleClass("fav-state-1");
$(".fav .button").attr("disabled", false);
},
success: function(response) {
if (response.result == "success") {
$(".fav .button").attr("disabled", false);
}
else {
// Rollback state; re-enable button
$(".fav").toggleClass("fav-state-1");
$(".fav .button").attr("disabled", false);
}
}
});
return false;
});
</code></pre>
<p>HTML:</p>
<pre><code><input class="button" type="button" value="">
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,766,801
| 1,766,802
|
Javascript escape Asp.net encoding
|
<p>I have an html textbox and am entering double quotes in the text box.</p>
<p>E.g </p>
<pre><code>I "a a person
</code></pre>
<p>I am using the Javsacript escape function and it encodes the quote to <code>%22</code> which is correct</p>
<p>To the last point before hitting the server I have <code>%22</code> but when I get it at the server by Request as follows:</p>
<pre><code>Request["myJson"].Trim();
</code></pre>
<p>The <code>%22</code> is converted back to "</p>
<p>Please help</p>
|
javascript asp.net
|
[3, 9]
|
895,947
| 895,948
|
Make scrollTop to always check
|
<p>I'm doing a scrollTop jQuery function, and it is working very nice, see it below:</p>
<pre><code>$(function() {
$(window).scroll(function() {
var top = $(document).scrollTop();
if (top >= 1225) {
// Do something
}
});
});
</code></pre>
<p>However, if the user have his <code>scrollTop</code>, in that case, higher than 1225, and the script isn't fully loaded, the function will not happen, just if he scroll the page again. Isn't there a way to make the <code>scrollTop</code> to always check, not just if the user Scrolls the page?</p>
<p>Thanks a lot in Advance.</p>
|
javascript jquery
|
[3, 5]
|
5,005,363
| 5,005,364
|
Getting "invalid assignment left-hand side"
|
<p>In my JavaScript file I'm trying to load an external API JavaScript and calling function in callback. Its returning "invalid assignment left-hand side" on second line <code>window.loadApi = function(callback) {</code>. Totally confuse because syntactically it is looking okay.</p>
<pre><code>var apiUrl = window.location.protocol + "my url";
window.loadApi = function(callback) {
if (window.$MY) {
callback();
} else {
$.getScript(apiUrl, function() {
$($MY.docReady);
callback();
});
}
};
loadApi(function() {
//my function
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,457,292
| 4,457,293
|
jQuery checkbox and span that share a click event
|
<p>So I have a checkbox and a span</p>
<p><code><input type="checkbox" class="checker"> <span class="something">Label</span></code></p>
<p>From which the span already has some functionality based on clicking it, I am adding a checkbox to the equation for visual aid. What I am trying to do is, when the checkbox is checked/unchecked I want it to trigger the spans already existing click function. Which this I can do.</p>
<p>I also want the same click function on the span to check/uncheck the checkbox next to it, while continuing its base function. Which this I can do as well. </p>
<p>The snag it seems is when I have both logics in the script, one will always X out the other, leaving one working and the other not. So I am trying to figure out how to make this work in harmony and I apparently am having issues thinking outside the box at the time and need some assistance getting there.</p>
<p>Here is the JS I am attempting to use currently</p>
<pre><code>$('.checker').live('click', function(e){e.preventDefault();$(this).siblings('.something').trigger('click');});
$('.something').live('click', function(e)
{
e.preventDefault();
if($(this).siblings('.checker').is(':checked'))
{
$(this).siblings('.checker').attr('checked', false);
}
else
{
$(this).siblings('.checker').attr('checked', true);
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,225,339
| 1,225,340
|
Listening in Javascript to back button in Android
|
<p>I have a HTML5 app in Android. I would like to override this</p>
<pre><code>@Override
public void onBackPressed() {
}
</code></pre>
<p>so the js file, which has a method called back(), can "listen" when the user taps the back button in Android, in order to replicate the navigation behaviour that is currently in my app inside HTML5 from the WebView in Android.</p>
<p>I thought about creating a JavaScriptInterface, but I really don't see which could be the communication process to solve this. Probably it's not my day. Thanks.</p>
|
javascript android
|
[3, 4]
|
3,261,863
| 3,261,864
|
How to create array of a particular field of json string through collect() method of objx
|
<p>my json string is as follows:</p>
<pre><code>var data = [{"first":"3","second":"1"},{"first":"5","second":"5"},{"first":"7","second":"1"}];
</code></pre>
<p>Now i am calling - </p>
<pre><code>objx(data).collect("first")
</code></pre>
<p>and expecting to get an array like [3,5,7].
But i am getting javascript error : object doesn't support this property or method.
i have tried with </p>
<pre><code>objx(data).collect("first").obj() but with no avail.
</code></pre>
<p>i have included objx-2.3.6.js file from <a href="http://code.google.com/p/objx/" rel="nofollow">http://code.google.com/p/objx/</a> and i want to create the array with objx api to reduce no of lines of code.
i am using IE8</p>
<p>please suggest a way out.</p>
|
javascript jquery
|
[3, 5]
|
1,606,123
| 1,606,124
|
pnotify refuses to work
|
<p>I downloaded the pnotify jquery plugin from <a href="http://pinesframework.org/pnotify" rel="nofollow">Pines Notify</a></p>
<p>Simply it tells me to add the required js and css files and on document ready the following should work !</p>
<pre><code>$(document).ready(function() {
$.pnotify({
type: 'error',
title: 'Errors found in form',
text: 'Please check all form data, some items were invalid.',
opacity: 0.95,
hide:false,
history: false,
sticker: false
});
});
</code></pre>
<p>But it just keeps giving me the error </p>
<blockquote>
<p>Uncaught TypeError: Object function (e,t){return new v.fn.init(e,t,n)}
has no method 'pnotify'</p>
</blockquote>
<p>And the silliest thing is that im visual VS 2012 and from within the dev environment it shows me pnotify as a function of '$' as intellisense !</p>
<p>What could i be doing wrong ?</p>
|
javascript jquery
|
[3, 5]
|
5,503,362
| 5,503,363
|
During Javascript printing, the formatting not preserved
|
<p>I want to print an aspx page content. The page has several asp.net labels which display data. I am using javascript to print the page. It prints but the problem is the formatting is gone. For example, the first few rows of the page look like as shown below:</p>
<p>Field name Old Value New Value</p>
<p>Address1 1323 Bker street 5645 Lamar Road</p>
<p>In the preview and the printed page, the data are in six lines, instead of the two shown above. Looks like that a new line character is introduced after each label.</p>
<pre><code>function doPrint(s, e) {
var prtContent = document.getElementById('PrintPanel');
prtContent.border = 0; //set no border here
var WinPrint = window.open('', '', 'left=100,top=100,width=1000,height=1000,toolbar=0,scrollbars=1,status=0,resizable=1');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
</code></pre>
|
javascript asp.net
|
[3, 9]
|
1,679,951
| 1,679,952
|
How do I obtain information from the cell that was clicked in the GridView?
|
<p>I need to obtain information from the cell that was clicked in the GridView.</p>
|
c# asp.net
|
[0, 9]
|
4,513,408
| 4,513,409
|
Adding google account to my website in asp.net using c#
|
<p>i have a job portal website project in that i need to signup user by using his google account .. so that i can retrieve his/her account details like firstname,lastname,emailid, mobile number etc ..
similarly to yahoo also in asp.net using c# with sql server 2008</p>
|
c# asp.net
|
[0, 9]
|
124,844
| 124,845
|
How do I combine check all script and filtering?
|
<p>I am new to JavaScript and jQuery, but have used HTML and CSS before. In any case, I appreciate the help. I have implemented the script discussed here <a href="http://net.tutsplus.com/tutorials/javascript-ajax/using-jquery-to-manipulate-and-filter-data/" rel="nofollow">http://net.tutsplus.com/tutorials/javascript-ajax/using-jquery-to-manipulate-and-filter-data/</a> for filtering data and the one discussed here <a href="http://www.dustindiaz.com/check-one-check-all-javascript/" rel="nofollow">http://www.dustindiaz.com/check-one-check-all-javascript/</a> for a check one to check all script. The problem is, when I filter the list of items and then use the check all box, it is checking even the JS items that are hidden from the user due to filtering. Does this make sense?</p>
<p>I have been trying to figure out how to edit the check all script so that only items with the "visible" class (as added to visible checkboxes with the filtering script) are checked with the checkAll button. The original script had:</p>
<pre><code>var checks = document.getElementsByName('del[]');
</code></pre>
<p>I was trying to do something like this (it wasn't working, of course):</p>
<pre><code>var visiblechecks = $('input:del[]:checked.visible');
</code></pre>
<p>among other things.</p>
<p>Thank you! Also, if you have a recommended resource, I would appreciate it.</p>
|
javascript jquery
|
[3, 5]
|
1,869,335
| 1,869,336
|
How to determine given file is a class file?
|
<p>I need to determine that whether a given file is a class file or not. Suppose I change the extension to .exe/.xml or some other, I need to determine whether that given file, if a class file will be parsed differently and if it would be some other, it'll be parsed in that manner.</p>
<p>How can I read the class file format?</p>
|
c# java
|
[0, 1]
|
3,778,671
| 3,778,672
|
Need to access <input> data from a <form>, that has been appended with Javascript
|
<p>I have an admin page where I add and delete table rows on the fly.
The page comes loaded with the existent data in the database (mostly consisting in a sku_code and 5 different prices) but when I add rows on the fly, and fill them with the corresponding skus and prices, I want to save them as well in the database.</p>
<p>The problem is that what I do on the client-side with Javascript (add table rows on the fly) with <code>innerHTML = '<input type="text"></code> is not accesible via <code>$_POST</code> variables of the main <code><form></code></p>
<p>So basically i add via Javascript 's so i can fill them and save them as well in the database. But the $_POST values are empty.
Javascript code works fine. I have no clue where should i start debugging.</p>
<p>here's some Javascript code i'm using</p>
<pre><code>function insert_record(){
var my_table = document.getElementById('my_table')
var tr = my_table.insertRow(my_table.rows.length-1)
//id-ul curent, numar toate row-urile - 1 (care este butonul OK)
var c_id = my_table.rows.length-2
tr.id = 'row_' + c_id + ''
var tr_td_1 = tr.insertCell(0)
tr_td_1.className = 'text2'
tr_td_1.align = 'center'
tr_td_1.innerHTML = 'SKU'
var tr_td_2 = tr.insertCell(1)
tr_td_2.className = 'text3'
tr_td_2.width = '63'
tr_td_2.innerHTML = '<input name="sku_' + c_id + '" type="text" id="sku_' + c_id + '" size="33" value="">'
</code></pre>
<p>....this addes a inside the table just before the last which contains the submit button, after which there's the </p>
|
php javascript
|
[2, 3]
|
2,872,842
| 2,872,843
|
Parsing a string with Jquery or Javascript
|
<p>How do i pull out the 30 or the 55 basically the number before the last number</p>
<pre><code>http://something.com:9090/general/35/30/205
http://something.com:9090/general/3/55/27
http://something.com:9090/general/36/30/277
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,543,902
| 4,543,903
|
Is there any way to get "global" events when working with nested iframes?
|
<p>My problem is I need to capture a keypress but at any given time the user can be inside of an iframe inside of an iframe inside of an iframe.</p>
<p>At first, I thought I could just put the listener on document but that doesn't work if the user is inside of one of those iframes.</p>
<p>Next I thought of attaching the handler to window but ie doesn't support attaching event handlers to window. I'm not even sure if that would work though or it would be the same problem as with document.</p>
<p>Next, I thought I could just go through all the iframes and add individual handlers there but eventually realized that wouldn't work because the iframe doesn't have any html in the dom so there is no way to access iframes nested in it.</p>
<p>One other possible solution is to go to the js of all the iframes and add this code manually but that is way too extreme.</p>
<p>Any other ideas?</p>
|
javascript jquery
|
[3, 5]
|
4,812,526
| 4,812,527
|
Open file in C#
|
<p>In my Aspx page I have two buttons, btnGenerateReceipt is for generating receipt and btnAddNew for adding new receord. OnClick event of btnGenerateReceipt I am generating and opening a receipt as below.</p>
<pre><code> protected void onGenerateReceipt(object sender, EventArgs e)
{
try
{
byte[] document = receiptByte;
Response.ClearContent();
Response.ClearHeaders();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-word";
Response.AddHeader("content-disposition", "inline;filename=" + "Receipt" + ".doc");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(document);
//Response.Flush();
}
}
catch (Exception ex)
{
}
finally
{
//Response.End();
}
}
}
</code></pre>
<p>This opens Open/Save/Cancel dialog box, followings are my problems,</p>
<ol>
<li>I need the word document to open automatically without the dialog box.</li>
<li>My second button's click function doesn't fire after I click btnGenerateReceipt button.</li>
<li>How can I generate&Open PDF file instead of word Doc?</li>
</ol>
<p>Any idea?</p>
|
c# asp.net
|
[0, 9]
|
5,894,179
| 5,894,180
|
Set object param tag from code-behind
|
<p>I want to embed video in object tag and I want to put the value of param from code-behind. But I'm not able to put the value from code-behind. Any idea where I'm getting wrong?</p>
<p>This is my code so far:</p>
<pre><code><object runat="server" id="object1">
<param name="param1" value="www.youtube.com?id=123" runat="server" id="video1" />
<param name="size" value="large" />
<param name="category" value="wide" />
</object>
</code></pre>
<p>I want to change the value of <code>param1</code> from code-behind.</p>
|
c# asp.net
|
[0, 9]
|
1,768,708
| 1,768,709
|
Get value of asp:textbox with javascript .net 4 framework
|
<p>I thought I heard that in .net 4 we would be able to reference asp:textbox's by id and not have to use clientid to get the value. I can't find this documented anywhere. Just wondering if anyone knows if this works and what the syntax is? </p>
|
javascript asp.net
|
[3, 9]
|
5,552,681
| 5,552,682
|
ASP.Net: Using UpdatePanels in a GridView
|
<p>I'm trying to build a sort of Accordion effect using a GridView and UpdatePanels. And I have problems with tieing everything together:</p>
<pre><code><asp:GridView ID="gridMain"
runat="server"
...
>
<Columns>
...
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<span>Id:<%# Eval("Id") %></span>
<a href="/* javascript code to open the updatepanel??*/" title="Open"><img ..../></a>
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:PlaceHolder runat="server" Visible="false">
<asp:Label Text="??"/>
</asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</code></pre>
<p>How do I open the update panel using javascript? </p>
|
c# asp.net
|
[0, 9]
|
4,911,402
| 4,911,403
|
Listview RollOver RollOut
|
<p>What events do I need to listen to imitate rollover and rollout on a listview item. I want to change the colour of some text on rollover and change it back on rollover.</p>
|
java android
|
[1, 4]
|
5,561,032
| 5,561,033
|
How do I encapsulate a tag within another tag using jQuery or JavaScript?
|
<p>I have a container <code>div</code> that contains some <code>img</code> tags. When I click on a <code>img</code> tag, it returns me the index position of that <code>img</code> tag within the <code>div</code> tag. I would like to wrap this <code>img</code> tag within another <code>div</code> tag either using jQuery or JavaScript --- is there any way to do this?</p>
<p>I am Working With a Wordpress plugin (the Slide show gallery) which displays the thumbnails of large images on clicking the thumnail i want to show a arrow that shows which current slide is beiging displaying.. after exploring the js files that comes along with plugin found that they are using pure javascript.</p>
<p>Currently i am using this code.</p>
<pre><code> for(i;i<this.l;i++){
this.a[i]={};
var h=m[i], a=this.a[i];
a.t= tag('h3',h)[0].innerHTML;
a.d= tag('p',h)[0].innerHTML;
a.l= tag('a',h)[0]? tag('a',h)[0].href:'';
a.p= tag('span',h)[0].innerHTML;
if(this.thumbs){
var g = tag('img',h)[0];
this.p.appendChild(g);
w+=parseInt(g.offsetWidth);
if(i!=this.l-1){
g.style.marginRight=this.spacing+'px';
w+=this.spacing
}
this.p.style.width=w+'px';
g.style.opacity=this.thumbOpacity/100;
g.style.filter='alpha(opacity='+this.thumbOpacity+')';
g.onmouseover=new Function('TINY.alpha.set(this,100,5)');
g.onmouseout=new Function('TINY.alpha.set(this,'+this.thumbOpacity+',5)');
g.onclick=new Function(this.n+'.pr('+i+',1)');
//g.onclick = new Function(this.n)
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
481,636
| 481,637
|
run jquery code on loaded page via jquery ajax request (load)
|
<p>I am loading an entire middle div via JQuery Ajax call and I simply want to run $(document).ready on the loaded page </p>
<p>header.php loads part of the page </p>
<pre><code>var $next = $("<div class='nextab center'>").insertAfter('#content .current');
$next.load($this.attr('href')+ ' #content .center section' , function(resp) { ...
</code></pre>
<p>}</p>
<p>so for example when header.php loads career.php it does not run all the code that is inside the $(document).ready(function(){ that is on career.php</p>
<p>I was thinking of creating a function init on each page loaded but not sure how to call this function from the load callback</p>
<p>Thanks </p>
|
javascript jquery
|
[3, 5]
|
4,116,463
| 4,116,464
|
c# Convert string into URL friendly
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/37809/how-do-i-generate-a-friendly-url-in-c">How do I generate a Friendly URL in C#?</a> </p>
</blockquote>
<p>By URL friendly I mean turning:</p>
<blockquote>
<p>Convert string to DateTime in c#</p>
</blockquote>
<p>into</p>
<blockquote>
<p>convert-string-to-datetime-in-c</p>
</blockquote>
<p>Thank's for any help!</p>
|
c# asp.net
|
[0, 9]
|
5,553,760
| 5,553,761
|
Multiple parents with the same class with siblings with the same classes
|
<pre><code><div class="example">
<div class="test">Some text</div>
<div class="whatever"></div>
</div>
<div class="example">
<div class="test">Some more text</div>
<div class="whatever"></div>
</div>
</code></pre>
<p>How can I make each <code>.example</code>'s <code>.whatever</code> contain the contents of its <code>.test</code>?</p>
<p>For example, if the code were just this:</p>
<pre><code><div class="example">
<div class="test">Some text</div>
<div class="whatever"></div>
</div>
</code></pre>
<p>Then I could just do this:</p>
<pre><code>$('.whatever').text($('.test').text());
</code></pre>
<p>But I have multiple elements with the class <code>.whatever</code> and multiple elements with the class <code>.test</code>, and each <code>.test</code> contains different text.</p>
<p>So in other words, how can I make every element with the class <code>.whatever</code> contain the text of the element <code>.test</code>, but only the element <code>.test</code> that is in the sample <code>.example</code> element?</p>
<p>Sorry for the confusing wording.</p>
|
javascript jquery
|
[3, 5]
|
1,013,739
| 1,013,740
|
jquery optgroup selection according to label
|
<p>Hello i am getting value dynamically which is my label in optgroup. now using jquery i want to show only that optgroup which matches with my dynamic value. </p>
<pre><code><select class="form-select" id="test">
<option value="_none">- None -</option>
<optgroup label="Personal / Web Conferencing">
<option value="257"> 1 </option>
<option value="374"> dd </option>
<option value="332"></option>
</optgroup>
<optgroup label="Personanew">
<option value="257"> 1 </option>
<option value="374"> dd </option>
<option value="332"></option>
</optgroup>
<optgroup label="Personalsss">
<option value="257"> 1 </option>
<option value="374"> dd </option>
<option value="332"></option>
</optgroup>
<optgroup label="Personalsss">
<option value="257"> 1 </option>
<option value="374"> dd </option>
<option value="332"></option>
</optgroup>
</select>
</code></pre>
<p>How to do this using jquery. i dnt have any idea about this . how to play with optgroup
Thanks a lot</p>
|
javascript jquery
|
[3, 5]
|
4,698,280
| 4,698,281
|
Show the element if it has a class whose name is tested
|
<p>I got a class name after I clicked a element in the document. And then I want to select all elements that has this selected class. For example;</p>
<pre><code>$('.tabs1 li a').hover(function(){
var clicked = $(this).attr("class");
// this doesnt work
$('a[class="clicked"]').css("display","block");
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,607,177
| 3,607,178
|
How can I set a percentage width for my box that will be constant across devices?
|
<p>I have become confuddled, I'm trying to set a minimum width of a box, for all devices I want it to have a minimum width of say 20% of the screen width. how can I achieve this?</p>
<p>I've gotten the dpWidth of two screens from a tablet and my XHDPI Galaxy S3. The S3 has a dpWidth of 300 and the tablet 800. In which case I can do this programatically by calculating 20% of the dpWidth and setting that as my boxes dp value.</p>
<p>I'm guessing I can't use weight because it's just for the width. So how can I do this in the XML?</p>
<p>Also a follow-up question, how is dp useful at all? If one device can have 300 and the other 800 then the effect of the dp changes dramatically! i don't understand why there aren't more useful units to work with, i.e the screen divided into 100 units or something.</p>
|
java android
|
[1, 4]
|
5,302,082
| 5,302,083
|
Is there a way to bypass or throw away a mouse event?
|
<p>I was wondering if there was a way to "throw away", if that is the right term, or ignore a mouse event when it occurs.</p>
<p>For example,</p>
<p>Say I have a mouseenter bound to an object and I have a specific handler attached to it. Is there a way to ignore certain mouseenter events on that object so that the handler is not called during those instances?</p>
<p>Note: I realize you can do this with an 'if' statement but assume I do not have access to the handler function.</p>
|
javascript jquery
|
[3, 5]
|
4,542,374
| 4,542,375
|
converting c#.net application to andorid
|
<p>I know this is very vaque question but still I am asking.</p>
<p>Is there any one I can convert my existing WinForm built in c#.net and DB as SQLSERVER 2008, to andorid application ?
If no, then is thr any easier way to built an app as I am not familiar with any Mobile Application tools.</p>
|
c# android
|
[0, 4]
|
2,701,053
| 2,701,054
|
why does location.reload() break my $.post?
|
<p>I have a select element, that posts (just fine) when changed using $.post. But if I want to reload the page, and add a <code>location.reload()</code> then it doesn't post. If I remove the line, it posts fine. Any ideas?</p>
<pre><code> <script type="text/javascript">
$('#target').change(function() {
$.post('<?=$base_url?>orders/create-new/order-items/<?=$order_id?>/target',
{
use_sort_modifier: $('select#target').val(),
order_id: <?=$order_id?>
}
);
location.reload(); // Works without this line.
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,025,537
| 3,025,538
|
auto complete on asp.net control
|
<p>hey I want to use autocomplete jquery in asp.net on a control which is used on a default1.aspx page. My control is searchinput.ascx which is in Registration folder. My ploblem is I have written web method (getmylist) on code file of searchinput control. but that method is never called. can anyone help me </p>
|
c# asp.net
|
[0, 9]
|
2,131,997
| 2,131,998
|
Delete one row from DOM built table
|
<p>I have a table that is dynamically built using DOM. It has 10 cols, and on each row i have some data that i get from a websocket, text boxes and a submit button to add each row to the database.</p>
<p>How can i remove a row after i submitted it?<br>
Someone mentioned jQuery but can't figure it out how to do that.</p>
<p><strong>EDIT</strong></p>
<p>I'm using Chrome and had problems with all the scripts below. this is how i resolved it:
instead of <code>$('input')</code> I used <code>jQuery('input')</code> all the scripts are working fine.
thank you for your help.</p>
|
javascript jquery
|
[3, 5]
|
335,778
| 335,779
|
How do you convert JQuery event target to a wrapped set?
|
<p>In my recent project, I am using the click event like so:</p>
<pre><code>$(".nav-item").click(function(evt){
do something here...
})
</code></pre>
<p>Inside the event handler function, I want to look at the children of the event target using jQuery selectors. Something like</p>
<pre><code>$(event.target + " > .subitem").html()
</code></pre>
<p>assuming .subitem was a childnode with a class subitem.</p>
<p>This doesnt seem to work. Any clues? </p>
|
javascript jquery
|
[3, 5]
|
3,815,987
| 3,815,988
|
opening a specific section on an accordion from another page link
|
<p>I have a homepage that has two titles on. these titles link to another page (news.aspx). The news articles on news.aspx are stored in an accordion style. </p>
<p>What I want is: When the title of the news article is clicked on the homepage, it will redirect to that news.aspx page and the accordion section relating to that title will already be open. </p>
<p>Is there any way that this can be done please?</p>
<p>I know I need to create a <code>function ()</code> but im not too sure how to go about it. </p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,935,118
| 3,935,119
|
How Can I Override A Function In Javascript
|
<p>I have the following scripts:</p>
<pre><code><script ... jquery-1.9.1.js"></script>
<script ... dataTables.js"></script>
<script ... columnFilter.js"></script>
</code></pre>
<p>The following code exists in columnFilter.js:</p>
<pre><code>(function ($) {
$.fn.columnFilter = function (options) {
//some code...
function _fnCreateCheckbox(oTable, aData) {
//some code...
}
};
})(jQuery);
</code></pre>
<p>What I would like to do is override <code>function _fnCreateCheckbox(oTable, aData)</code> with my own code. Im fairly new to javascript, so would appreciate an example.</p>
<p>I have tried simply grabbing the code above and adding it to it's own <code><script></code> tags, but that didn't work. It completely stopped the columnFilter.js from working (which is as expected I guess). Not really sure what else to try.</p>
|
javascript jquery
|
[3, 5]
|
1,368,870
| 1,368,871
|
How can I embed a static HTML page in a aspx page?
|
<p>I have a static HTML page complete with client-side scripts and css (both are included in the html). I was wondering if it would be possible to embed this HTML page into an ASPX page and have the ASPX page be able to respond to javascript events that are raised from within the static html document? Does asp.net provide a specific control for this or can I use a frame?</p>
<p>Any help would be great. Thanks a lot!</p>
|
javascript asp.net
|
[3, 9]
|
16,725
| 16,726
|
Sharing an object between methods in same class (with postback)
|
<p>I have a user control with a number of methods. I also have a dataset object that I'm filling in one method, but I also need to access that same dataset (and the data in it) in another. </p>
<p>I am filling the dataset from some xml that I get from a webservice when someone clicks on a button. The data from the dataset is then bound to a listbox control. When someone selects an item in the list control (I have autopostback set to true on it) it then fires off another method and it's this method where I need to access the data in the dataset, but when I check the immediate window it's telling me that the dataset is set to null.</p>
<p>Where am I going wrong?</p>
<p><strong>Edited to add psuedocode</strong></p>
<pre><code>//Dataset
DataSet dsAddress;
protected void Page_Load(object sender, EventArgs e)
{
// Nothing happens to DataSet here
}
protected void btnPostCode_Click(object sender, EventArgs e)
{
try
{
// Dataset has data added here
}
catch (Exception ex)
{
lblError.Text = ex.Message.ToString();
}
if (!DataHelper.DataSourceIsEmpty(dsAddress))
{
//Dataset bound to listbox here
}
}
protected void lstAddressDropdown_SelectedIndexChanged(object sender, EventArgs e)
{
// Need to access dataset here
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,652,513
| 1,652,514
|
Replacing the content of a div with the content of another hidden div in Jquery
|
<p>i am trying to replace the content of a div with the content of another div(which is hidden). The code works for the first time only but the second time doesn't work at all.
I have a div where the titles of some articles are scrolling. I want to achieve that:everytime i am going to click the title of an article its content(the content is in hidden div) is going to appear in another div with the id="sreen".</p>
<pre><code><script type="text/javascript">
//everytime you click the title of an article
$("a.title").live("click", function(){
//replace the content of div screen with the content of an article
$('div#screen').replaceWith($(this).next('div.content'));
});
</script>
</code></pre>
<p>Any ideas???</p>
|
javascript jquery
|
[3, 5]
|
630,283
| 630,284
|
How to go back to previous page and preserve the previous page data in c#
|
<p>I am working on a Retail Website which is developed in Asp.net 3.0. I have a cart system so when user add some items to their cart they are being redirect to Basket page. And i have a button on Basket page for them to go back add some more items. i am not sure how to do that.</p>
<p>here is the case.</p>
<pre><code>Home Page -> Mens Clothing Product List -> Jeans Page -> Basket pgae
</code></pre>
<p>Now when users go to Mens Clothing they see all the items, then they select one Jeans they want to buy and they are redirected to Jeans Page. Now they add items to their basket and they are redirected to Basket Page, Now i have a button on Basket page called "Keep Shopping", When they click (as of now they are redirected to Home page) BUT i need them to redirect to Mens Clothing Product List instead of Home Page.</p>
<pre><code>CASE 1
</code></pre>
<p>I have googled it and found out that we can use URLReferrer and check it if it is null or not. BUT in my case it is always Basket Page URL as i am using Response.Redirect on Jeans Page. So i can not use URLReferrer.</p>
<pre><code>CASE 2
</code></pre>
<p>I have also found out that using Javascript History we can go back to 1 or 2 page. BUT as i want to preserve the user data and CART i can not use that as well because its gonna use the browser cache and will not save any users data.</p>
<pre><code>CASE 3
</code></pre>
<p>I was thinking of using the Context Or Session to store the current page URL on Jeans page and i can check it in Basket Page, if it not null then redirect to that page. BUT i want to go back one more step ie. Mens Clothing page not Jeans Page.</p>
<p>I am really not sure whether this will be a good idea or not. Please suggest.</p>
<p>Thanks...</p>
|
c# asp.net
|
[0, 9]
|
1,367,234
| 1,367,235
|
use javascript to test if server is reachable
|
<p>I have a javascript application that loads data asynchronously from a server within my company's firewall. We sometimes need to show this application outside of the firewall but it is not always possible to get on the VPN. For this reason, we configured the firewall to allow public requests for this data on a specific port. The catch: when I am inside the corporate network, I can only load data using the server's DNS name due to a peculiar configuration of the firewall. Outside of the corp network, I have to use the server's public IP address..</p>
<p>Currently we distribute two versions of the javascript application -- one which works within the firewall and one that works outside of it. We would like to distribute one app -- one that tests the URLs and then, depending on which is reachable, continue to use that address to load data. </p>
<p>I have been using jQuery's <code>$.ajax()</code> call to load the data and I noticed there is a <code>timeout</code> parameter. I thought I could use a short timeout to determine which server is unreachable.. However, this "countdown" doesn't seem to start until the initial connection to the server is made.</p>
<p>Any thoughts on how to determine, in javascript, which of two servers is reachable?</p>
|
javascript jquery
|
[3, 5]
|
3,532,485
| 3,532,486
|
Android WebView with Javascript calls behaving oddly
|
<p>I understand how to call Javascript from my WebView, that isn't the issue.</p>
<pre><code>if(javascriptCall!=null){
String hardCodedexample = "1959602";
webView.loadUrl("http://myappexample+ username);
webView.loadUrl("javascript:" + "window.application.relocateTo({location:'patients/details',params:{EMPIID:"+ hardCodedEMPIID +"}})");
}
</code></pre>
<p>javascriptCall is a String which is passed to my webview activity. hardCodedEMPIID is just an example for our testing. My problem is that when I allow the app the run normally on the device my javascript method doesn't seem to work. It loads the myappexample and I can't tell what happened with my javascript call.</p>
<p>When I debug the app and single step through the code it properly calls the method. I'm confused on how this is possible? the different between single step and normal execution.</p>
|
java javascript android
|
[1, 3, 4]
|
972,513
| 972,514
|
PHP error and JavaScript validation
|
<p>I have an error in my PHP on this line:</p>
<pre><code>var strRooms = <?=$js_var?>;
</code></pre>
<p>It is saying that this has an invalid markup, what does this mean?</p>
<p>You can look at the application here: <a href="http://jsfiddle.net/YYMJS/" rel="nofollow">application</a></p>
<p>Now if you type in nothing in the textbox, then it doesn't display a message saying "Please Enter in a Room Number", if you type in a invalid room number then it doesn't show a message stating "This Room is Invalid". Why is it not working?</p>
<p>I know the code doesn't work in jsfiddle but I have included my code in the jsfiddle so that you can see the whole code and the way it is laid out. <a href="http://jsfiddle.net/YYMJS/" rel="nofollow">jsfiddle</a></p>
<p>So how can this error be fixed and how can the JavaScript validation message appear as they should do?</p>
|
php javascript
|
[2, 3]
|
3,676,450
| 3,676,451
|
how to get value of more than one text box in a loop
|
<p>I have some text boxes in my page. I want to get all text box values in an array and insert in to table of database.</p>
<p>Is there any option to work by loop</p>
|
c# asp.net
|
[0, 9]
|
5,369,435
| 5,369,436
|
Set HTML <param> element via jQuery?
|
<p>JS/JQuery Newb here!</p>
<p>I have a value stored in variable, and I need to plug it into a particular <code><parameter></code> element associated with an <code><object></code>. Here's an example of what I was hoping I could do:</p>
<pre><code><script>
function SetParam(incomingValue){
$('#baz').value = incomingValue ;
}
$(document).ready (function() {
// jquery POST happens here, which takes a second or two to complete
// SUCCESS condition calls SetParam() with a value
});
</script>
<object class="foo">
<param name="bar" value="xyzzy" />
<param name="baz" value="" id="baz" />
</object>
</code></pre>
<p>No joy. The baz parameter controls how the object is visually rendered, and I see no changes to indicate I've successfully changed the value.</p>
<p>I'm not sure if: </p>
<p><strong>A.</strong> My syntax is wrong in terms of addressing the "baz" parameter in SetParam()</p>
<p><strong>B.</strong> My syntax is fine, but the object has already rendered by the time I hit SetParam(), so setting the value of baz does nothing useful</p>
<p><strong>C.</strong> All of the above</p>
<p>Can anyone kick me in the right direction?</p>
<p>(and if my problem includes scenario "B" - is there a way to delay the loading of that <code><object></code> until I've actually set the value of the <code><parameter></code> that I need to?)</p>
<p>Here's a "JSFiddle" of same - Just found about about this and jsbin. Woot!</p>
<p><a href="http://jsfiddle.net/sPhrw/" rel="nofollow">http://jsfiddle.net/sPhrw/</a> </p>
|
javascript jquery
|
[3, 5]
|
4,418,286
| 4,418,287
|
How would you draw a matrix in Android Development?
|
<p>The size of the matrix would be input by the user with variables h, w.</p>
<p>Given this how would I create a matrix of that size on the screen allowing the user to enter in values inside the matrix.</p>
|
java android
|
[1, 4]
|
3,566,232
| 3,566,233
|
jQuery 'Enter' and 'ESC' simulation
|
<p>I want to simulate a couple of clicks. A 'Save' and 'Cancel' anchor clicks.</p>
<p>I have this as my enter simulation</p>
<pre><code>$('.group').live('keypress', function(e){
code = e.keyCode ? e.keyCode : e.which;
if(code.toString() == 13){
$(this).find('a.saveChanges').click();
}
});
</code></pre>
<p>and this as my esc simulation</p>
<pre><code>$('.group').live('keypress', function(e){
code = e.keyCode ? e.keyCode : e.which;
if(code.toString() == 0){
$(this).find('a.discardChanges').click(function(){
GROUP.find('.group-text')
.text(GROUP.data('origText'))
.end().removeData('origText');
GROUP.find('.groupcount').fadeIn('slow');
GROUP.find('.group-image').fadeIn('slow');
GROUP.removeClass('editmode');
});
}
});
</code></pre>
<p>My enter seems to work perfect, but my esc doesn't. I'm running this in Firefox at the moment.</p>
|
javascript jquery
|
[3, 5]
|
2,234,489
| 2,234,490
|
How to call a function inside a function in Jquery?
|
<p>I am using <a href="http://flesler.blogspot.com/2008/02/jqueryserialscroll.html" rel="nofollow">jQuery.SerialScroll</a> so I can have a slider. In the code it has a function that looks like this:</p>
<pre><code>var j=jQuery.noConflict();
//some code here
jQuery(function(j)
{
//code goes here.
//Then i need to write a function here.
// (like the below one or a simple JS function)
jQuery(fucntion()
{
//some stuff
});
});
</code></pre>
<p>Now please help me in calling that function from a simple javascript in my web page "head" section ?</p>
|
javascript jquery
|
[3, 5]
|
1,867,710
| 1,867,711
|
Does jQuery support html escaping of data retrieved from ajax call?
|
<p>Most <code>MVC</code> frameworks support escaping of server data, before putting them on the web page. I couldn't find any option in <code>jQuery</code>'s <code>ajax</code> method to do the same. In fact, I couldn't even find a native jQuery function to escape strings for proper display on the page (Putting the contents in a <code>div</code>, and calling <code>.html(</code>) on it, is not guaranteed to preserve white space). Why is it that this function is not available in jQuery, but you can find it in <code>underscore</code> and <code>prototype</code> libraries ?</p>
|
javascript jquery
|
[3, 5]
|
2,244,502
| 2,244,503
|
Keep value of input which is generated by Javascript after submitting
|
<p>I have this code to append the input panel <code>#yearPanel</code> after the select box <code>#before</code> changed.</p>
<pre><code>$("#before").change(function() {
var selected = $('#before option:selected').text();
if(selected == bankShowYear) {
$(yearPanel).insertAfter("#yearAnchor");
var value = $("#yearHiden").val();
$("#year").val(value);
} else {
$("#yearPanel").remove();
}
});
</code></pre>
<p>I want to keep the input value of <code>#year</code> in <code>#yearPanel</code> after submitting by PHP. I tried to store the value in <code>#yearHidden</code> and assign it to <code>#year</code> after all the input are rendered but it doesn't work.</p>
<p>How to keep the input value?</p>
|
php jquery
|
[2, 5]
|
2,083,975
| 2,083,976
|
How can I ensure at least one checkbox is checked in a particular div?
|
<p>I have a <code><div class="answer" id="yesOptions"></code> and I need to check that at least 1 checkbox inside this particular is checked. If not, I need to return <code>alert('At least 1 checkbox must be checked from this div!');</code></p>
<p>How can I do this? </p>
|
javascript jquery
|
[3, 5]
|
389,565
| 389,566
|
Change filename on file upload in .net (asp)
|
<p>How to change file name on upload ?</p>
<p>I have such code :</p>
<pre><code><%@ WebHandler Language="C#" Class="Upload" %>
using System;
using System.Web;
using System.IO;
public class Upload : IHttpHandler {
public void ProcessRequest(HttpContext context) {
HttpPostedFile oFile = context.Request.Files["Filedata"];
string newFileName1 = HttpContext.Current.Server.MapPath(@context.Request["orderID"]);
string newFileName2 = HttpContext.Current.Server.MapPath(@context.Request["productCombinationString"]);
string newName;
if(newFileName2 != "" && newFileName2 != null && newFileName2 != "<!--@Ecom:productCombinationString-->") {
newName = newFileName1 + newFileName2 + oFile.ContentType;
} else {
newName = newFileName1 + oFile.ContentType;
}
string sDirectory = HttpContext.Current.Server.MapPath(@context.Request["folder"]);
oFile.SaveAs(sDirectory + "/" + oFile.FileName);
if (!Directory.Exists(sDirectory)) Directory.CreateDirectory(sDirectory);
context.Response.Write("1");
}
public bool IsReusable {
get { return false; }
}
}
</code></pre>
<p>And if i change oFile.Filename to newName it does not work ... what is the problem ? :)
Thank you</p>
|
c# asp.net
|
[0, 9]
|
4,256,865
| 4,256,866
|
Drawing Tournament Brackets
|
<p>I have have written some software that produces the draw for a tournament the problem i have is how to display the draw on a website. Are there any open source libraries that can draw tournament brackets in the right places and the line feeding to the next match in the tournament ? If not can someone recomend a way to do this myself.
I am using c# and asp.net</p>
|
c# asp.net
|
[0, 9]
|
1,845,980
| 1,845,981
|
ASP.Net, Copy image from clipboard using javascript for IE
|
<p>How to copy clipboard image to web browser.
Consider below sample. On button click , I would like to copy the clipboard image to div id , but this does not work. If I paste text from clipboard it works, Pls suggest.</p>
function PasteFromClipBoard() {
var _selection = document.getElementById('pasteTothis').contentWindow.document.selection.createRange();
_selection.execCommand("Paste");
}
<p>html content is -<br>
{
(input type="button" value="Paste From ClipBoard" onclick="PasteFromClipBoard()"/><br>
(div id="pasteTothis" /)
}</p>
|
javascript asp.net
|
[3, 9]
|
5,466,643
| 5,466,644
|
Rewinding HTML 5 video each time the page is loaded
|
<p>I want to make sure my HTML 5 videos start running from the beginning when the user enters a page.</p>
<p>At the moment, the first video is running fine, but if the user closes the pop-up while playing the video will start from where the user left it when they open the pop-up again.</p>
|
javascript jquery
|
[3, 5]
|
3,207,215
| 3,207,216
|
Auto Calculating for input field values
|
<p>My Html is like this:</p>
<pre><code><input class="gbTransform" type="text" name="maxdl" value=""/>
</code></pre>
<p>And javascript like this:</p>
<pre><code>$('.gbTransform').change(function(){
var sz = $(this).val().match(/(\d+)gb/i);
if(sz.length > 1){
$(this).val(parseInt(sz[1])*1024);
}
});
</code></pre>
<p>What this does is when a user types 1gb it will automatically calculate into mbs (1 * 1024 = 1024) and change the input fields value.</p>
<p>This works fine but when user types <code>1.5gb</code> its calculates <code>5 * 1024</code> which is incorrect it should be <code>1.5 * 1024</code></p>
<p>Thank You.</p>
|
javascript jquery
|
[3, 5]
|
4,721,443
| 4,721,444
|
Sending an array to a function in codeigniter
|
<p>I have the following codes which sends an array to the function /chat in codeigniter</p>
<pre><code>$(document).ready(function () {
$('#submit').live('click', function (eve) {
eve.preventDefault();
$.ajax({
url: "http://localhost/fq/index.php/splash/chat/",
type: 'JSON',
data: a,
success: function (html) {
alert(html);
}
});
});
</code></pre>
<p>Let us assume that array a contains names of people only. ( John, James, Smith) </p>
<p>I want to be able to retrieve the all the values from the array in the function chat. </p>
<p>How can it be done? </p>
<p>Edit: </p>
<p>I need to retrieve the values from the JSON encoded array in this function (codeigniter) </p>
<pre><code> public function chat()
{
//code to retrieve values
$this->load->view('chat');
}
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
3,745,058
| 3,745,059
|
javascript $ followed by curly braces
|
<p>I read a book called "Javascript web application" and it has the following lines of code:</p>
<blockquote>
<p>The example below, which includes logic inside views, is something you shouldn’t do:</p>
</blockquote>
<pre><code><div>
<script>
function formatDate(date) {
/* ... */
};
</script>
${ formatDate(this.date) }
</div>
</code></pre>
<p>I don't understand what { formatDate(this.date) } means in javascript even in jQuery I have never seen it yet (putting object in jQuery function then I've already seen but the above code is not the case).
Could you explain me what the meaning of it?
Thank you.</p>
|
javascript jquery
|
[3, 5]
|
1,365,009
| 1,365,010
|
about older android versions on google market
|
<p>I have developed my app in android 2.2, and put it on google market (munspel-appen).
I could see in the statistics that 4% are using android version 2.1 i dont have access to such device, so I wonder if my app will still work on that older version device if downloaded from market too or is it only working from 2.2 and up? How can one tell?</p>
|
java android
|
[1, 4]
|
1,224,806
| 1,224,807
|
Do the simplicity of PHP is in the languge itself or is there anonter thing that make it simple?
|
<p>Everyone says that PHP is simpler than ASP.NET and C#, why it is easier ans simpler?</p>
<p>Considering C# and PHP for web development, what is the thing that make PHP easier exactly? I want to understand this point please. </p>
|
c# php
|
[0, 2]
|
2,918,711
| 2,918,712
|
Is there a way to let a user view an image they are about to upload client side before uploading to the server?
|
<p>When a user is uploading an image, is there a way I can load the image client side and show it to them first, before uploading it to the server? Preferably using javascript/jquery only, but using flash would be acceptable too.</p>
|
javascript jquery
|
[3, 5]
|
2,466,356
| 2,466,357
|
insert array into an array
|
<p>Hello
In my android application i need to insert an array into an array and access its values.
Is there any way that i can get this done.</p>
<p>Please share your valuable suggestions
Thanks in advance :)</p>
|
java android
|
[1, 4]
|
2,340,574
| 2,340,575
|
How to implement __get __set methods PHP in Javascript?
|
<p>How to implement __get __set PHP in Javascript?</p>
|
php javascript
|
[2, 3]
|
4,587,418
| 4,587,419
|
Javascript space function
|
<p>I have a JS code that the function is to validate the form, now what I want to do is add 1 function to prevent space in textbox username with message too, "No space allowed". Here it's my JS code so far :</p>
<pre><code>$().ready(function()
{
$("#signupForm").validate(
{
rules:
{
full_name: "required",
username: {
required: true,
minlength: 2
},
password: {
required: true,
minlength: 5
},
email: {
required: true,
email: true
},
},
messages:
{
full_name: "Please enter your full name",
username:
{
required: "Please enter a username",
minlength: "Your username must consist of at least 2 characters"
},
password:
{
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long"
},
email: "Please enter a valid email address"
}
});
});
</code></pre>
<p>Anyone can give me idea ?
Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,181,589
| 1,181,590
|
Getting information from a form (textbox, combobox) and writing to an xml file (PHP/JAVASCRIPT)
|
<p>Hi how would i GET information from a form that a user enters into a textbox combobox or w.e
and write it to a xml file.</p>
<p>either HTML javascript or php will be appreciated.</p>
|
php javascript
|
[2, 3]
|
4,433,999
| 4,434,000
|
Android How to get Last Focused Activity after "Force Stop" the Application
|
<p>I am developing android Application having number of activities. The requirement of the application is <strong>When i "FORCESTOP" the application manually(Settings->Applications->ManageApplication->APP_NAME->FORCESTOP), the last focused activity(UI Page) to be displayed.</strong> Can i get the Last focused Activity after <strong>*FORCESTOP</strong>*ing the Application? Please help me with the sample code.</p>
|
java android
|
[1, 4]
|
1,572,624
| 1,572,625
|
Microsoft JScript runtime error: Can't execute code from a freed script
|
<p>I am getting this error
Microsoft JScript runtime error: Can't execute code from a freed script in my telerik's webresource.axd file.in this page there is a html page embedded in aspx page and we are firing page methods present in aspx page.it is not giving exceptions but errors in browser which is hampering other functions.</p>
<p>if(j)<strong>j(c,g,a)</strong>}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}</p>
<p>here g value is null. this scripts comes under the section of MicrosoftAjax.js. how can i resolve this..</p>
|
javascript asp.net
|
[3, 9]
|
3,804,378
| 3,804,379
|
jQuery: Update the value in one text box based on the value entered in another text box?
|
<p>I am trying to write a jQuery syntax that will Update the value in one text box, say txtInterest% based on the value entered/changed in another text box called txtAmt?</p>
<p>May some one please help me with the scenario?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
111,340
| 111,341
|
Use with XMLVM to convert android app to iphone app
|
<p>Do you know some good tutorial to use XMLVM for convert android app to iphone app??
I was watch a movie on youtube about this cross but there is not a tutorial for this.</p>
<p>Thanks!
Saar</p>
|
iphone android
|
[8, 4]
|
4,019,415
| 4,019,416
|
How to pre select radio button using AlertDialog?
|
<p>can someone help me with this? I have an AlertDialog box and its working fine, but what I want is when the alertdialog pops up, it will automatically check one of the radio button. </p>
<p>For an example "10 minutes" is checked when the alertdialog box pops up.</p>
<p>How to do that?</p>
<p>Below is my working code.</p>
<pre><code>final CharSequence[] deleteFilesBy = {"5 minutes","10 minutes", "15 minutes"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Delete Files by?")
.setSingleChoiceItems(deleteFilesBy,-1, new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
if(deleteFilesBy[which]=="5 minutes")
{
// do something
}
else if (deleteFilesBy[which]=="10 minutes")
{
// do something
}
else if (deleteFilesBy[which]=="15 minutes")
{
// do something
}
dialog.dismiss();
}
}).setNeutralButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
// TODO Auto-generated method stub
arg0.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
</code></pre>
<p>PLEASE HELP! </p>
<p>Thanks</p>
<p>RJUY</p>
|
java android
|
[1, 4]
|
5,410,555
| 5,410,556
|
Where not working in LINQ operation
|
<p>I have a problem where when I run the below, even if the call to OptionsMatch returns false (that method returns a bool) I still get the item in the resulting list finalItems</p>
<pre><code>public List<SavedItemOption> GetValidOrderOptions(OptionsList itemOptions, List<SavedItemOption> savedItemOptions)
{
List<SavedItemOption> finalItemOptions = savedItemOptions.Where(y => itemOptions.Any(x => OptionsMatch(x,y) && (y.actID == x.Id))).ToList();
return finalItems;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,885,067
| 1,885,068
|
Sending user results by Email
|
<p>Hi I am wondering is there a way of sending the user an email (from my Gmail address) with results of calculations that occurs within the app itself?</p>
<p>For example a form is filled out with values for electricity rates and these rates are then computed and processed into information on savings for a particular product.</p>
<p>What I have is a custom alert box popup with the results and a button saying email me the results and then a EditText becomes visible below asking for the email address of the user.</p>
<p>Is this possible or would a simple notification be easier to do?</p>
|
java android
|
[1, 4]
|
2,578,808
| 2,578,809
|
How to use MediaPlayer for this VideoView example
|
<p>So I've spent the past couple hours looking through the APIs and examples on here but I've still got a couple unclear topics. How exactly does one go about displaying the media player? I understand the SurfaceView and the buttons, but what about the actual video file so that I can make it clickable. I'm basically trying to take this code that I made and use MediaPlayer instead of VideoView. This is just for fun and I'm really new to Android so please forgive the elementary coding and questions. Thank you (: <br> </p>
<pre><code>import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.webkit.WebView;
import android.widget.MediaController;
import android.widget.VideoView;
public class MainActivity extends Activity {
public static VideoView videoView;
public static MediaController medCont;
public static String RTSP;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RTSP = "rtsp://v2.cache7.c.youtube.com/CjYLENy73wIaLQkFPOlBtC4qExMYDSANFEIJbXYtZ29vZ2xlSARSBXdhdGNoYJeOw_HjwJ6bUQw=/0/0/0/video.3gp";
videoView = (VideoView) findViewById(R.id.vidView1);
medCont = new MediaController(this);
medCont.setAnchorView(videoView);
Uri video = Uri.parse(RTSP);
videoView.setMediaController(medCont);
videoView.setVideoURI(video);
}
@Override
public void onStart(){
super.onStart();
videoView.setOnClickListener(handler1);
}
View.OnClickListener handler1 = new View.OnClickListener(){
public void onClick(View v){
videoView.start();
}
};
public void onCompletion(MediaPlayer mp){
videoView.stopPlayback();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
</code></pre>
|
java android
|
[1, 4]
|
2,228,276
| 2,228,277
|
jQuery: Hovering over an element brings fades in another element, but when hovering over that element it disappears
|
<p>I have a class called .description that shows up when ever the mouse is hovered over a class called .image
HTML:</p>
<pre><code><div class="image">
<a href="?page=page1>"><img src="images/1.jpg" width="80" height="80"></a>
</div>
<div class="description" style="display: none;"> description 1 </div>
<div class="image">
<a href="?page=page2>"><img src="images/2.jpg" width="80" height="80"></a>
</div>
<div class="description" style="display: none;"> description 2 </div>
<div class="image">
<a href="?page=page3"><img src="images/3.jpg" width="80" height="80"></a>
</div>
<div class="description" style="display: none;"> description 3 </div>
</code></pre>
<p>jQuery:</p>
<pre><code>$(".image").hover(function() {
$(this).next(".description").fadeToggle();
});
</code></pre>
<p>A working version of this was provided by another user, and I have slightly modified it and put it up here: <a href="http://jsfiddle.net/zakiaziz/qnWpy/2/" rel="nofollow">http://jsfiddle.net/zakiaziz/qnWpy/2/</a></p>
<p>When ever I hover over the .image class the .description class shows up fine. The problem I am having is that when ever the mouse is hovering over where the description class should show up the description class does show up and then disappear. Some times it blinks erratically. </p>
|
javascript jquery
|
[3, 5]
|
2,617,031
| 2,617,032
|
How to dynamically Order a listbox with a dropdown?
|
<p>I have a listbox with 20 colors. It looks something like this:</p>
<p>1:Red
2:Green
3:Blue
4:Orange
5:Red
6:Yellow
7:Orange
8:Red
9:Green
....</p>
<p>It gets the data from an ObjectDataSource which in turn gets it's data from a method which returns a datatable. I want a dropdown which basically has 2 items, Order By # and Order By Color. If the user chooses Order By #, it will Order the ListBox in ascending or descending order. If the user chooses Order By Color, it will Order By Color. How do I go about doing this?</p>
<p>Can I sort this using a DataView?</p>
<p>Thanks,
XaiSoft </p>
|
c# asp.net
|
[0, 9]
|
2,495,003
| 2,495,004
|
How do I disable or enable 2nd dropdownlist in aspx based on selected choice of the 1st dropdownlist box
|
<p>I am having a problem with disabling DropDownList based on the chice of 1st DropDownList, there is no post back occuring, and it is a template based web app here is the current code:</p>
<pre><code><script type="text/javascript">
$(function() { var dropDownList1 = $('#<%= ddlUserType.ClientID %>');
var dropDownList2 = $('#<%= ddlMember.ClientID %>'); dropDownList1.change(function(e) {
if ( jQuery("#ddlUserType").val() != "ETOC") dropDownList2.removeAttr('disabled'); e.preventDefault();
else
dropDownList2.removeAttr('enabled'); e.preventDefault(); }
} );
</script>
</code></pre>
<p>what is happening now is page is blank and if I remove the above code everything shows, where I am going wrong.</p>
<p>here is the plain and final javascript code which worked:</p>
<pre><code><script language="javascript">
function CheckDropDownState(lstbox)
{
if (lstbox.selectedIndex == 3) { document.forms[0].ddlMember.disabled = 1; }
else { document.forms[0].ddlMember.disabled = 0; }
}
</script>
</code></pre>
<p>and thew .aspx code:</p>
<pre><code><asp:dropdownlist id="ddlUserType" runat="server" onclick="CheckDropDownState(this);"></asp:dropdownlist>
</code></pre>
<p>Once again appreciate the help guys.</p>
|
c# asp.net javascript jquery
|
[0, 9, 3, 5]
|
766,442
| 766,443
|
add dynamic element into array
|
<pre><code> var x = 0;
var counter = 0 ;
$(function () {
$('#addBtn').click(function () {
x++;
if (counter < 5) {
counter++;
$('#content').append('<input type="text" id="mytxt' + x + '">');
$('#content').append('<input type="button" id="removeBtn' + x + '" value="Remove" onclick="removeRow(' + x + ')" />');
$('#content').append('<div id="br' + x + '"/></div>');
} else {
alert("you cannot added more than 5 element");
}
}
);
});
function removeRow(index) {
$('#mytxt' + index).remove();
$('#removeBtn' + index).remove();
$('#br' + index).remove();
counter--;
alert(counter);
}
</code></pre>
<p>this is my function to create dynamic button, when i clicked "addBtn", new element will be created and id start with 1,eg: mytxt1, and when i clicked "removeBtn" and "addBtn" again,the id will become mytxt2, the result is out of my expected,
what i want is when i clicked "removeBtn" and "addBtn" ,the id will start from 1 again,but not 2</p>
<p>new updated</p>
<p>that is one of my question also, if i added more element let said 4 element,the id i get will be mytxt1,mytxt2,mytxt3 and mytxt4, and if i remove mytxt2, the next element i added will become mytxt1,mytxt3,mytxt4,and mytxt5, and this is not what i want,what i want is mytxt1,mytxt2,mytxt3 and mytxt4</p>
|
javascript jquery
|
[3, 5]
|
3,963,582
| 3,963,583
|
How to encode text using jquery?
|
<p>I'm using ajax() to send POST request to a php page. This is the code:</p>
<pre><code> date = $.trim($('#date').val())
expiry = $.trim($('#expiry').val())
priority = $.trim($('#priority').val())
note = $.trim($('#note_text').val())
$.ajax({
type: "POST",
url: "client?method=addNote&id=10",
data: "date="+date+"&expiry="+expiry+"&priority="+priority+"&note="+note,
success: function(msg){
alert(msg);
}
});
</code></pre>
<p>my problem is that the last variable named note could has many "strange" characters, like: <code>& % $ / : ; , .</code></p>
<p>I have seen that the php page is no receiving all the "note" string correctly. If it found (&) it js "truncate" the string. <em>how could I encode that text?</em></p>
|
javascript jquery
|
[3, 5]
|
3,715,232
| 3,715,233
|
Why is opacity not added to divs that are added?
|
<p>I am having that problem that opacity is not added to tfrhe selected divs.</p>
<p>Here do I have a fine working example what I am trying to do:
<a href="http://jsfiddle.net/PRZ5J/13/" rel="nofollow">http://jsfiddle.net/PRZ5J/13/</a></p>
<p>Here have I added the code from the first example with some other Jquery:
<a href="http://jsfiddle.net/gDChA/74/" rel="nofollow">http://jsfiddle.net/gDChA/74/</a></p>
<p>The problem is that the added input field and its divs does not have the same function and opacity as the first example. </p>
|
javascript jquery
|
[3, 5]
|
4,378,675
| 4,378,676
|
How to make a checkbox checked in a gridview using DataBinder.Eval
|
<p>I am trying to make a checkbox checked if the value is 1 or 0 basically in my database i have
a field called <code>Active (bit, not null)</code> and i can pass the value to the gridview.. but now i am trying to make it checked if the bit is 1 or not checked if the bit is 0 but its not working.. it just shows unchecked but the bit is 1.</p>
<pre><code> <ItemTemplate>
<asp:CheckBox ID="ItemCheck" runat="server"
Enabled='<%# (DataBinder.Eval(Container.DataItem, "Active")) %>' />
</ItemTemplate>
</code></pre>
<p>Any help would be much appreciated</p>
|
c# asp.net
|
[0, 9]
|
5,301,778
| 5,301,779
|
jQuery toggle question
|
<p>I have a question concerning using the toggle function. I have a template that is being populated at the end of an AJAX call with data returned from a web service. What I'm trying to accomplish is load the onClick function so that a hidden textbox will be shown and toggled to be hidden on the next click. </p>
<p>What's happening is that when I click the link once everything's fine the textbox shows and hides. But if I keep clicking the Edit link the textbox will show and hide the number of times that the link has been clicked (ie. I click the link for the second time it fadesIn/Out twice, the third time it fades In/Out 3 times, etc).</p>
<p>Would someone please look at my code and help me?</p>
<p>Thanks!</p>
<p>PS. I was also trying to toggle the link to go from "Edit" to "Cancel" as well; I haven't spent much time on that but if you want to throw me a bone on that too, I'll take it! ;-)</p>
<pre><code> function showSCs(data) {
$('#sometmpl3').tmpl(data.d)
.appendTo($('#subCats'))
.find(".aEdit").toggle(function() {
$(this).click(function() {
$(this).parent().find('.scEditHide').fadeIn();
$(this).text = "Cancel";
return false;
});
}, function() {
$(this).click(function() {
$(this).parent().find('.scEditHide').fadeOut();
return false;
});
});
}
</code></pre>
<p>The structure of the elements referenced is:</p>
<pre><code> <div>
<h4>${ProblemSubCategory}</h4>
<input id="text${ProblemSubCategoryID}" type="text" value=${ProblemSubCategory} class="scEditHide"/>
<a href="#" id="${ProblemSubCategoryID}" class="aEdit">Edit</a>
<a href="dummyWebservice.asmx\DeleteSC\${ProblemSubCategoryID}">Delete</a>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,173,839
| 5,173,840
|
Jquery get text value of option on change
|
<p>I have code like this:</p>
<pre><code><select name="caffe" id="caffe">
<option value="5">Red</option>
<option value="6">nmfxnsdnx</option>
</select>
<div id="gll_select">
<script>
var caffe = $("#caffe").val();
var cff_name = $("#caffe option:first").text();
$("#gll_select").load("http://localhost/010/form/galleries", {id : caffe}, function(){
$("#gll").on('change', function(){
var cff_name = $("#caffe").text();
get_gallery(cff_name);
console.log(cff_name);
});
});
</script>
</div>
</code></pre>
<p>How can I get text value of the option that has been selected? </p>
|
javascript jquery
|
[3, 5]
|
2,403,586
| 2,403,587
|
can't access C# method using jquery
|
<p>I am trying to call a C# method from java script ,I am new to web development and after a bit of searching decided on using jquery to do the same,the way I try to call the method is:</p>
<pre><code>$.ajax({
type: "POST",
url: "Default.aspx/IncrementJ",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
alert("success!")
}
});
</code></pre>
<p>here IncrementJ is my function name defined in C# which I want to call.here is the definition:</p>
<pre><code> [WebMethod]
public static void IncrementJ()
{
try
{
j++;
}
catch (Exception ex)
{
throw ex;
}
}
</code></pre>
<p>when I run my program web console throws an error "cannot locate resource incrementJ";please tell me where I am going wrong,</p>
<p>Thanks .</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
5,509,177
| 5,509,178
|
How to timestamp with jQuery based off user's selection
|
<p>I'm attempting to produced a timestamp based off user's selection.</p>
<p>I have a form with an input value that will be empty:</p>
<pre><code><input type="hidden" name="sub_enddate" value=" " />
</code></pre>
<p>I need to have the empty value filled in with a time stamp based a certain value of time in the future off a user's selection:</p>
<pre><code><select name="Membership Duration">
<option value="">Select A Membership Duration</option>
<option class="6" value="6 Months">6 Month Membership</option>
<option class="3" value="3 Months">3 Month Membership</option>
<option class="1" value="1 Months">1 Month Membership</option>
</select>
</code></pre>
<p>The format will be the following: 20110325 (2011-03-25). So if the user chooses from the drop down menu:</p>
<ul>
<li>"6 Month Membership" the value in the hidden input field will be: 20110925 (6 months in the future from today, March 25th, 2011).</li>
<li>"3 Month Membership" the value in the hidden input field will be: 20110625 (3 months in the future from today, March 25th, 2011).</li>
<li>"1 Month Membership" the value in the hidden input field will be: 20110425 (1 month in the future from today, March 25th, 2011).</li>
</ul>
|
javascript jquery
|
[3, 5]
|
1,531,909
| 1,531,910
|
Android/Java Getting Exception : java.util.MissingFormatArgumentException: Format specifier: w
|
<p><br>I Am newbie to MissingFormatArgumentException..Can anyone help me when will it me thrown..
<br>i am getting Exception as in below code </p>
<pre><code> public String getIpAddress() {
try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
NetworkInterface intf = en.nextElement();
for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
InetAddress inetAddress = enumIpAddr.nextElement();
if (!inetAddress.isLoopbackAddress()) {
**return inetAddress.getHostAddress();**//Exception
}
}
}
} catch (SocketException ex) {
Logger.e(TAG, ex.toString());
}
return null;
}
</code></pre>
<p>Thanks
Nithin</p>
|
java android
|
[1, 4]
|
4,575,148
| 4,575,149
|
Finding out what's slowing down ASP.NET pages
|
<p>I have a rather 'heavy' ASP.NET page, and currently the speed is fairly unacceptable - there is a <em>lot</em> of database communication, and displaying large grids. But I effectively want to find out what's actually causing the most slowdown, and working from there.</p>
<p>Are there any tools built into Visual Studio 2008, or any third party tools, that'll allow me to do this?</p>
|
c# asp.net
|
[0, 9]
|
3,384,778
| 3,384,779
|
Strip away all HTML tags and formatting (RegEx)
|
<p>I have RSS feed that I want to modify on fly, all I need is the text (and linefeeds) so everything else must be removed ( All images, styles, links )</p>
<p>How can I do this easily with ASP.NET c#</p>
|
c# asp.net
|
[0, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.