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 |
|---|---|---|---|---|---|
641,556
| 641,557
|
how do I subtract one week from this date in jquery?
|
<p>this is my code</p>
<pre><code>var myDate = new Date();
todaysDate = ((myDate.getDate()) + '/' + (myDate.getMonth()) + '/' + (myDate.getFullYear()));
$('#txtEndDate').val(todaysDate);
</code></pre>
<p>I need txtEndDate's value = today's date - one week</p>
|
javascript jquery
|
[3, 5]
|
1,702,561
| 1,702,562
|
using jquery FileTree to access a different server?
|
<p>I am currently attempting to access files on a different server using <a href="http://abeautifulsite.net/blog/2008/03/jquery-file-tree/http://abeautifulsite.net/blog/2008/03/jquery-file-tree/" rel="nofollow">file tree.</a> I was wondering if this was possible? It's using PHP script to pull the data. I am able to get to the root of my own server, but I can't seem to direct link into another server.</p>
|
php javascript jquery
|
[2, 3, 5]
|
963,654
| 963,655
|
Adding Value into an Input Field
|
<p>I am working on an iPhone Web App using HTML & CSS. I have currently got the JavaScript/HTML5 Geolocation picking up my current location and showing me it on a Google Map using Lat & Long values.
I also want to add these Lat & Long Values into the 'address' text field on the page so I can submit the details.</p>
<p>Here is the link: <a href="http://m.belfi.co.uk/form.html" rel="nofollow">http://m.belfi.co.uk/form.html</a></p>
<p>When I click 'find me' I would like the lat and long to be added to the 'address' input field. Have no idea how to do this though :(</p>
|
javascript jquery
|
[3, 5]
|
4,526,690
| 4,526,691
|
Why is jQuery.ajax() Calling my Objects Functions?
|
<p>I'm having an issue where jQuery.ajax() is calling my data objects functions. For example, I have an object structure similar to the following:</p>
<pre><code>var TestFactory = (function () {
var _id;
var _attributes;
return {
createObject: function (objectId) {
var value = null;
_id = objectId;
_attributes = {};
function _showErrorStatus() {
$('label')
.css('background-color', 'red')
.css('color', 'black')
.text('jQuery called me...');
}
function _attr(key, value) {
if (value == null) {
return _attributes[key];
}
_attributes[key] = value;
return this;
}
return {
id: _id,
attributes: _attributes,
showErrorStatus: _showErrorStatus,
attr: _attr,
}
}
}
})();
</code></pre>
<p>I'd like to use this object as the data value for my jQuery.ajax() call, as follows:</p>
<pre><code>var myObject = TestFactory.createObject(12345);
myObject.attr('name', 'Fred Flinstone');
$.ajax({
url: '/echo/json/',
type: 'GET',
data: myObject,
dataType: 'json',
});
</code></pre>
<p>The issue I'm running into is jQuery.ajax() is calling the showErrorStatus() function from the object returned by the factory --nowhere in my code do I call this function.</p>
<p>I like the OOP qualities I get out of using this object, so is there any way to handle this case without a significant rewrite (e.g., dropping all my functionality from the "class")?</p>
<p><strong>NOTE:</strong> I found it difficult to explain this problem, so here is a complete running <a href="http://jsfiddle.net/HJ9AS/8/" rel="nofollow">example on jsfiddle</a>.</p>
|
javascript jquery
|
[3, 5]
|
614,600
| 614,601
|
Call Javascript from code behind function in asp.net
|
<p>How to Call Javascript function from code behind after button click event;</p>
<pre><code> string popupScript = "<script language='javascript'>" +
"alert('hai');" +
"</script>";
ClientScript.RegisterStartupScript(Page.GetType(), "script", popupScript, true);
</code></pre>
<p>I tried above script but not working</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,104,145
| 1,104,146
|
Android App Development
|
<p>I am a Java beginner , I want to develop Android app , what all is essential to learn in Java before I start developing ?</p>
|
java android
|
[1, 4]
|
2,408,871
| 2,408,872
|
jquery count to number
|
<p>I have a piece of code that counts from 0 to a specified number with a specified delay.</p>
<p>The problem is that it adds by 1 and I want it to add by 0.01</p>
<p>How to do it? the code is as follows:</p>
<pre><code> <!DOCTYPE HTML>
<html>
<head>
<style>body{font:11px verdana;color:#555;}</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var max = 20;// set with php
$(incCounter);
function incCounter() {
var currCount = parseInt($('.counter').html());
$('.counter').text(currCount+1);
if (currCount+1 != max) {
setTimeout(incCounter,50);
}
}
</script>
</head>
<body>
<div class="counter">0</div>
</body>
</html>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,216,167
| 5,216,168
|
In jQuery, how to test whether an element is the first of many elements of same class?
|
<p>I have 3 div's:</p>
<pre><code><div class='squares' id='div1'></div>
<div class='squares' id='div2'></div>
<div class='squares' id='div3'></div>
</code></pre>
<p>With jQuery, I would like to apply a css property (a border-right) to all div's, except the first one.</p>
<p>What is the if statement that I should use? I want to use the class in the if statement (not the id's).</p>
<p>Thanks very much.</p>
|
javascript jquery
|
[3, 5]
|
5,747,212
| 5,747,213
|
How to change a DateTime Format
|
<pre><code>List<DateTime> datetimerange = new List<DateTime>();
DateTime StartDate = Convert.ToDateTime(txtDate.Text);
DateTime EndDate = Convert.ToDateTime(TextBox1.Text);
foreach (DateTime day in EachDay(StartDate, EndDate))
{
datetimerange.Add(day.Date);
Session["SelectedDatess"] = datetimerange;
}
</code></pre>
<p>When I displays it to a list box the date looks like <code>8/28/2012 12:00:00</code> whereas I just want to display <code>8/28/2012</code>.</p>
<p>How can I change the format of the date to <code>MM/dd/yyyy</code>?</p>
|
c# asp.net
|
[0, 9]
|
1,452,017
| 1,452,018
|
Best way to package a class for use in another app?
|
<p>I've written an Android app wich various abstract classes that perform useful functions. These functions could be leveraged in other apps.</p>
<p>I want to share a class module with another programmer, but I don't want to share the source code. I would like to share a .class file but I'm not sure how to do the following:</p>
<ul>
<li>Compile an Android .java file into .class</li>
<li>What does the receiver of the .class file have to do to use that .class in their project? (using Eclipse environment)</li>
</ul>
<p>Thank you very much</p>
|
java android
|
[1, 4]
|
1,753,521
| 1,753,522
|
the code for retrieving an image url from gridview
|
<p>hallo</p>
<p>I have a gridview with the image displayed in the gridview(the image was uploaded and the path posted to the database) and by setting the DataImageUrlField of the gridview to the field in the database that contains the image path I can display the picture.</p>
<p>What code can I use to retrieve this image path again from the gridview(so that I can store it in a session variable to display the same image on a different page)
or do i have to physically access the path again from the Database?</p>
<p>regards
A</p>
|
c# asp.net
|
[0, 9]
|
3,884,827
| 3,884,828
|
onkeyup key-value in Javascript
|
<p>I have a standard textbox and I've got jQuery on the page. I want to act when the user types a space into the textbox, I am however unsure of how to do this.</p>
<p>Can anybody give me a hand with this please?</p>
|
javascript jquery
|
[3, 5]
|
2,601,867
| 2,601,868
|
jquery smooth scroll to an anchor?
|
<p>is there any way to scroll down to an anchor link with jquery?</p>
<p>like: </p>
<pre><code>$(document).ready(function(){
$("#gotomyanchor").click(function(){
$.scrollSmoothTo($("#myanchor"));
});
});
</code></pre>
<p>?</p>
|
javascript jquery
|
[3, 5]
|
1,285,922
| 1,285,923
|
how to test whether grid is empty or not in jquery
|
<p>i have a grid and adding elements to is in jquery like below:</p>
<pre><code>$('#MyGrid tbody').append('<tr><td><a href="#" >' + htmlString.ID+ '</a></td></tr>');
</code></pre>
<p>before that i need to test whether this MYgrid is empty or not. how to do that with jquery.</p>
<p>thanks,</p>
<p>michaeld</p>
|
javascript jquery
|
[3, 5]
|
2,887,028
| 2,887,029
|
Jquery- Checkbox selection should lead to popup form
|
<p>I have a list of elements which are displated in the tabular form as show below . These are being fetched from a rails backend.</p>
<p><img src="http://i.stack.imgur.com/mNRKK.png" alt="enter image description here"></p>
<p>Now i want to be able to set up remainders based on the selection of each check list. If i select one of the elements in a checklist i should get a popup which reads 'Store name','Category' and generates a form. Once this form has been successfully submitted i want to enable the corresponding checkbox as enabled. I need a Jquery expert to help me on how to achieve this . I can put a popup based on selection of a checkbox , but how do i bind it to the specific record? The form submission will happen via JSON and i will take care of that .</p>
|
javascript jquery
|
[3, 5]
|
5,726,618
| 5,726,619
|
How to Loop over ten questions
|
<p>I'm in the process of creating a simple maths game. I'm trying to create a loop that will display ten questions, one at a time, to a textview. The user will enter the answer into an edittext, press a button, and then question will be validated and the next question in the series of ten will appear in the textview.</p>
<p>I'm just not quite sure how to get to the next question. Any help will be greatly appreciated.</p>
<p>Here's what I've done so far:</p>
<pre><code>int x = 0;
while (x < 10) {
if (i1 == 1) {
answer = q1;
editTextEquation.setText(random1 + "+" + random2);
x++;
}
if (i1 == 2) {
answer = q2;
editTextEquation.setText(random1 + "-" + random2);
x++;
}
if (i1 == 3) {
answer = q3;
editTextEquation.setText(random1 + "/" + random2);
x++;
}
if (i1 == 4) {
answer = q4;
editTextEquation.setText(random1 + "*" + random2);
x++;
}
}
</code></pre>
<p>and then the validation button calls this method</p>
<pre><code>private void questions() {
int score = 0;
int i = Integer.parseInt(editText.getText().toString());
if (i == answer) {
editText.setText("Correct");
score++;
} else {
editText.setText("Incorrect");
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,515,062
| 5,515,063
|
manipulate css on multiple spans with javascript
|
<p>I am trying to manipulate spans based on what is contained in them. on my company's ecommerce site there are two spans that contain the price of an item and the sale price of an item. not all items have sale prices. problem is the original price span is shown with the text-decoration set to line-though regardless of whether or not there is a sale price. since i can't interact with the database that contains product info (platform won't allow it) i have to use javascript to correct this. I need to hide the span that contains the sale price if no sale price is present and remove the text-decoration on the other span that contains the original price. currently the code (below) i have will hide the sale span, but i can only get it to remove the text-decoration on all or none of the list price spans. Any ideas?</p>
<pre><code>$(function(){
$(".container > .special").each(function(){
var specialContents = $(this).text();
var isEmpty = specialContents.substr(0, 7);
if(isEmpty != "Sale: $"){
$(this).hide();
}
});
});
</code></pre>
<p>
</p>
<p>each set of spans is wrapped in a div with class container and the spans have the classes 'list' for the original or list price and 'special' for the sale price, Also, the first 6 characters of every special span will be "Sale: " regardless of if it has a price or not.
Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
2,752,512
| 2,752,513
|
Jquery: get all html source of a page but excluding some #ids
|
<p>I'm trying to use .html() or .contents() but i have strange behaviours</p>
<p>I basically need to get the entire dom of the page, exclude some elements (ex. #first, #second)
and the pass it as a string, not a dom anymore...</p>
<p>is it possible?</p>
|
javascript jquery
|
[3, 5]
|
3,982,727
| 3,982,728
|
Android byte array batches
|
<p>I am sending image through Bluetooth pro-grammatically. When i send image as Byte array at the sending side the byte array length is = 83402 and at the receiving side i am getting byte bacthes of 1024.</p>
<p>I want to combine these 1024 batches into single byte array so that i again convert it as an image.</p>
<p>Here in the msg.obj i get 1024 bacth of byte array.</p>
<p>case MESSAGE_READ:</p>
<pre><code> byte[] readBuf = (byte[]) msg.obj;
Bitmap bmp=BitmapFactory.decodeByteArray(readBuf,0,readBuf.length);
</code></pre>
<p>After that i am also getting this warning..</p>
<p>"Default buffer size used in BufferedOutputStream constructor. It would be better to be explicit if an 8k buffer is required"</p>
<p>any help would be appreciated.</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
1,964,392
| 1,964,393
|
Closest previous element with certain ID (with prev())?
|
<p>I have a big div wit a lot of smaller divs within it. Say,</p>
<pre><code> <div id="parent">
<div id="child1">
</div>
<div id="child1">
</div>
<div id="child2">
</div>
<div id="child1">
</div>
<div id="child1">
</div>
</div>
</code></pre>
<p>If I'm currently at the last 'child1', how dow I get to the top most child1 with prev()? For me it breaks when it reaches 'child2'.</p>
|
javascript jquery
|
[3, 5]
|
1,244,212
| 1,244,213
|
jQuery shortening this query down?
|
<p>Is it possible to shorten this query's down into one at all?</p>
<pre><code>$('p:contains(Tel:)').html(function() {
return $(this).html().replace('Tel:', '<strong>Tel:</strong>');
});
$('p:contains(Fax:)').html(function() {
return $(this).html().replace('Fax:', '<strong>Fax:</strong>');
});
</code></pre>
<p>My code looks for Tel: and Fax: and wraps them with the <code><strong></code> tag</p>
|
javascript jquery
|
[3, 5]
|
4,277,384
| 4,277,385
|
String.equals() with multiple conditions (and one action on result)
|
<p>Is it possible to do something like this in Java for Android (this is a pseudo code)</p>
<pre><code>IF (some_string.equals("john" OR "mary" OR "peter" OR "etc."){
THEN do something
}
</code></pre>
<p>?</p>
<p>At the moment this is done via multiple <code>String.equals()</code> condition with <code>||</code> among them. </p>
|
java android
|
[1, 4]
|
2,948,728
| 2,948,729
|
How can this Javascript be expressed more succinctly?
|
<p>I have some Python code that I'm porting to Javascript:</p>
<pre><code>word_groups = defaultdict(set)
for sentence in sentences:
sentence.tokens = stemmed_words(sentence.str_)
for token in sentence.tokens:
word_groups[sentence.actual_val].add(token)
</code></pre>
<p>I don't know a lot about Javascript, so this was the best I could do:</p>
<pre><code>var word_groups = {}
for(var isent = 0; isent < sentences.length; isent++) {
var sentence = sentences[isent]
sentence.tokens = stemmed_words(sentence.str_)
for(var itoken = 0; itoken < sentence.tokens.length; itoken++) {
var token = sentence.tokens[itoken]
if(!(sentence.actual_val in word_groups))
word_groups[sentence.actual_val] = []
var group = word_groups[sentence.actual_val]
if(!(token in group))
group.push(token)
}
}
</code></pre>
<p>Can anyone suggest ways to make the javascript code look more like the python?</p>
|
javascript python
|
[3, 7]
|
5,067,483
| 5,067,484
|
Naming Functions in jQuery
|
<p>So I just started with jQuery and the functions are confusing me. I want to be able to just name a jQuery function and then call it, without saying when it should be called in the function. I've looked and I can't seem to understand any of the answers. My code is below:</p>
<pre><code><script type="text/javascript">
$(function() {
$('a').click(function() {
$('#box').slideUp();
});
});
</script>
</code></pre>
<p>I want it to do something more like this however:</p>
<pre><code>$(function slideBox() {
$('#box').slideUp();
});
</script>
</code></pre>
<p>And then call it through a OnClick event or something on a button.</p>
|
javascript jquery
|
[3, 5]
|
2,586,708
| 2,586,709
|
whole number in javascript?
|
<p>I get 28.6813276578 when i multiply 2 numbers a and b, how can i make it whole number with less digits </p>
<p>and also, when i multiply again i get results after first reult like 28.681321405.4428.68 how to get only one result ?</p>
<pre><code><script>
$(document).ready(function(){
$("#total").hide();
$("#form1").submit(function(){
var a = parseFloat($("#user_price").val());
var b = parseFloat($("#selling").val());
var total = a*b;
$("#total").append(total)
.show('slow')
.css({"background":"yellow","font-size":50})
;
return false;
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
384,302
| 384,303
|
Ajax url navigation
|
<p>I'm trying to make something similar to GitHub that loads content based on the url.</p>
<p>I saw this <a href="http://stackoverflow.com/questions/2586661/url-navigation-in-an-ajax-based-website">article</a>, but I do not want to use a plugin. I would like to write my code manually.</p>
<p>One article I saw <a href="http://yensdesign.com/2008/11/creating-ajax-websites-based-on-anchor-navigation/" rel="nofollow">here</a>, they kept checking the document.location.hash for any changes, then load the content. Is there a better way to achieve this? </p>
<p>The following are what Im thinking about:</p>
<ol>
<li>Load content on page load.</li>
<li>Load content on url change.</li>
<li>Change url from anchor tag without reloading page.</li>
<li>SEO.</li>
<li>Back button.</li>
</ol>
|
javascript jquery
|
[3, 5]
|
3,987,139
| 3,987,140
|
Which is correct way to check for Null exception?
|
<p>Which is the most correct code?</p>
<pre><code>if (HttpContext.Current.Response.Cookies[authCookieName] != null) {
HttpContext.Current.Response.Cookies[authCookieName].Value = "New Value";
}
</code></pre>
<p>or </p>
<pre><code>if (HttpContext.Current != null)
if (HttpContext.Current.Response != null)
if (HttpContext.Current.Response.Cookies != null)
if (HttpContext.Current.Response.Cookies[authCookieName] != null)
HttpContext.Current.Response.Cookies[authCookieName].Value = "New Value";
</code></pre>
|
c# asp.net
|
[0, 9]
|
476,517
| 476,518
|
Background-position +/- X pixels
|
<p>How do I offset the <code>background-position</code>, let's say 20px, from its original position?</p>
<p><strong>Like:</strong></p>
<pre><code>$(".selector").animate("slow").css("backgroundPosition", "center -=20px");
</code></pre>
<p>(That obviously doesn't work... But how do I do this??)</p>
|
javascript jquery
|
[3, 5]
|
4,461,039
| 4,461,040
|
Sort dropdown list by text rather than value
|
<p>I have dropdown list as follow:</p>
<pre><code><select id="DropdownID">
<option value="1">Ccc</option>
<option value="2">Aaa</option>
<option value="3">Bbb</option>
</select>
</code></pre>
<p>but i want dropdown elements sorted by text not value, in alphabetical order:</p>
<pre><code><select id="DropdownID">
<option value="2">Aaa</option>
<option value="3">Bbb</option>
<option value="1">Ccc</option>
</select>
</code></pre>
<p>I fill it on this way:</p>
<pre><code>Dictionary<int, string> myDataDictionary = new Dictionary<int, string>();
// (...)
DropdownID.DataSource = myDataDictionary;
DropdownID.DataTextField = "value";
DropdownID.DataValueField = "key";
DropdownID.DataBind();
</code></pre>
<p>Even if values in dictionary are sorted correctly, in dropdown they are always ordered by value.</p>
<p>How to sort items in dropdow by text rather than by value ?</p>
|
c# asp.net
|
[0, 9]
|
2,390,795
| 2,390,796
|
JQuery Show Animation From a Different Direction
|
<p>How do you change the direction of jQuery's hide('slow')/show('slow') animation? By default it uses a combination of fading and sliding to/from the top-left. How would I change that to slide to/from the bottom-center or some other arbitrary direction? </p>
<p>For an example of a modified hide('slow') that slides to bottom-center, I tried doing <code>$(el).animate({opacity:0, height:0, marginBottom:0})</code>, but this doesn't seem to work.</p>
|
javascript jquery
|
[3, 5]
|
1,339,832
| 1,339,833
|
android add text line at the beginning of .txt file
|
<p>I have this code</p>
<pre><code> File gpxfile = new File(root, "mesaje.txt");
BufferedWriter bW;
bW = new BufferedWriter(new FileWriter(gpxfile, true));
bW.write(format + " " + message + "\n-----------------------\n");
bW.newLine();
bW.flush();
bW.close();
</code></pre>
<p>It writes a .txt file adding text after the last line. I would like to add text on the first line, so that it will appear as the lastest information. How can i do that? Thanks!</p>
|
java android
|
[1, 4]
|
1,637,530
| 1,637,531
|
Why is Post back not triggered when user navigates away from page, but triggered on close?
|
<p>I have the following code to detect user navigation or close.
The post back is triggered on close but not when navigated away.
If i place a alert message it is triggered at all times.</p>
<p>Oh and there is a timer on the page which is actually disabled after first tick. but there is always a post back triggers when navigating away with eventtarget timer. I think this may be because i have cleared cache for the previous page.</p>
<pre><code><script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(window).bind("beforeunload", function () {
alert("u r navigating away"); // this message gets triggered at all times.
__doPostBack('callPostBack');
});
</script>
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
string eventTarget = this.Request["__EVENTTARGET"];
string eventArgument = this.Request["__EVENTARGUMENT"];
if (eventTarget != String.Empty && eventTarget == "callPostBack")
{
//do task
}
}
}
</code></pre>
<p>Thanks in advance.</p>
|
javascript asp.net
|
[3, 9]
|
1,152,799
| 1,152,800
|
Java and what to do with it
|
<p>I've been browsing through several websites and several topics on this website.</p>
<p>Now I'm just a starting programmer and I want to make a good decision.</p>
<p>From what I understand is that Java is used alot for server stuff, and web applets but not really for computer applications running on a client, it's also used for Android programming and several other mobiles.</p>
<p>I'm really interested in Android programming, I really love to program for mobile devices, in this case Android because I really think it has a lot of potential and I don't like the iPhone.</p>
<p>If I want to program on Android I have to learn Java (aside from Mono).
but if my decision changes over the next couple of years I don't think Java is the right language to get a job that programs computer applications.</p>
<p>I think I get a job where I have to program server stuff, rather than computer applications.</p>
<p>That's why I think C# is a good choice. I can program for Windows Phone 7 (I hope that will get big). and I have the feeling C# is more widely used for computer applications.
so I think C# is more versatile looking at Mobile programming and computer programming.</p>
<p>Or am I totally wrong thinking this?</p>
|
java c# android
|
[1, 0, 4]
|
3,866,222
| 3,866,223
|
Detect if link opens in a new window/tab or the current window
|
<p>I want to add AJax-like transitions to my links if a link opens in the current window. However, I don't want the transitions to execute if the link is opened in a new window/new tab. Is this possible?</p>
<p>P.S. I have jQuery loaded.</p>
|
javascript jquery
|
[3, 5]
|
2,518,684
| 2,518,685
|
PHPCode Refresh and Redirect
|
<p>If user do refresh page (do f5 or re-write url) i want redirect him to logout.php or homepage.
If user leave to page i dont want redirect.</p>
<p>I needed code for it to in .php maybe javascript, meta or anything.</p>
|
php javascript
|
[2, 3]
|
3,306,667
| 3,306,668
|
how to call this script in an .aspx file?
|
<pre><code>var text = '';
$('p').bind('keypress', function(e) {
e.preventDefault();
$(this).text('');
$(this).empty();
text += String.fromCharCode(e.keyCode);
var text2 = text.substr(0, text.length - 1);
var lastChar = text.substr(text.length - 1);
$(this).text(text2);
$(this).append('<span class="char">' + lastChar + '</span>');
$(this).append('<span class="cursor"></span>');
});
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,359,054
| 5,359,055
|
js is not defined error
|
<p>How can I get the error message on a good way to solve? Error message: timetotal is not defined.</p>
<pre><code> $(document).ready(function() {
if (typeof(timeleft) !== 'undefined') {
Chrono.update();
}
$('a.add_other_answer').click(function() {
addAnswer();
});
});
Chrono = {
warning: timetotal * 0.25,
critical: timetotal * 0.05,
update: function() {
...
...
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,644,389
| 1,644,390
|
Still stuck on my php calling javascript problem. Please help in this
|
<p>Still stuck on my PHP calling a JS script problem </p>
<p>On the click of a button this Javascript is called:</p>
<pre><code>var xmlhttp;
function register()
{
xmlhttp=GetXmlHttpObject();
alert("pass");
if(xmlhttp==null)
{
alert("Your browser does not support AJAX!");
return;
}
var url="register.php";
url=url+"?id="+uniqueid+"&name="+name+"&passwrd="+passwrd1+"&email="+email;
xmlhttp.onreadystatechange=statechanged;
xmlhttp.open("GET", url, true);
xmlhttp.send(null);
}
function statechanged()
{
//alert("statechanged function");
if(xmlhttp.readyState==4)
{
//alert(xmlhttp.responseText);
document.getElementById("response").innerHTML=xmlhttp.responseText;
}
}
function GetXmlHttpObject()
{
if(window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
if(window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
function testing()
{
document.getElementById("mainbody").innerHTML="This is my first JavaScript!";
}
</code></pre>
<p>And then this PHP script is called:</p>
<pre><code><?php
echo "<script type=\"text/javascript\">testing();</script>";
?>
</code></pre>
<p>The HTML has two <code>DIV</code> tags with IDs of <code>mainbody</code> and <code>response</code>:</p>
<pre><code><HTML>
<HEAD>
<SCRIPT SRC=javascriptname.js></SCRIPT>
</HEAD>
<BODY>
<DIV ID=mainbody>
<DIV ID=response>
</DIV>
</DIV>
</BODY>
</HTML>
</code></pre>
<p>I am unable to call the javascript from my php.
If anyone know what am i doing wrong, or has a idea what should i do, it will be very helpful. </p>
<p>Thank you
Zeeshan</p>
|
php javascript
|
[2, 3]
|
5,825,164
| 5,825,165
|
Which event in a PageIndicator can I use to get a click on the current tab?
|
<p>I have to catch the tab click event even when the current tab is the same clicked tab.
I tried the setOnPageChangeListener but none of the events are dispatched.
Also onClick and onTouch for the indicator don't dispatch.
How can I do that?</p>
<p>I'm using TabPageINdicator from Jake Wharton</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
5,688,896
| 5,688,897
|
setting value of textbox using javascript in asp.net
|
<p>i am using .aspx page where i used html textarea to get the teat from user.
i am also have a asp:textbox say "txtbox1" control where i want to have the value of that textarea in txtbox1. but it is not setting the value..
i am using javascript as:</p>
<pre><code> document.getElementById('txtareahead').readOnly= true;
document.getElementById('txtareahead').innerHTML=document.getElementById('txtareahead').value;
document.getElementById(’<%= txtbox1.ClientID %>’).value = document.getElementById('txtareahead').value;
</code></pre>
<p>how can i set the value of asp:textbox using javascript..</p>
|
javascript asp.net
|
[3, 9]
|
5,630,929
| 5,630,930
|
Find if table has a specific string in jquery
|
<p>I have a html table:</p>
<pre><code>Name Length Description x
Name1 444 Blabd x.png
Name2 55 Blabla x.png
Name3 11 Blaaa x.png
</code></pre>
<p><code>table id="firsttable"</code> <code>img class="delete"</code> </p>
<p>I have a value (from other table):</p>
<pre><code>var value = $(this).closest('tr').find('td:first').html();
</code></pre>
<p>I want to find that value in first column of a table and delete x.png of a row, which has that value. </p>
<p>Something like: (with mistakes)</p>
<pre><code>$('#firsttable tr td:first:contents("'+value+'")').closest('tr').find('td:last').remove();
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,606,716
| 4,606,717
|
How to handle StreamReader?
|
<p>I use StreamReader to read my csv file.
The problem is : i need to read this file twice, and in second time then i use StreamReader
StreamReader.EndOfStream is true and reading not executed.</p>
<pre><code>using (var csvReader = new StreamReader(file.InputStream))
{
string inputLine = "";
var values = new List<string>();
while ((inputLine = csvReader.ReadLine()) != null)...
</code></pre>
<p>Can enybody help</p>
|
c# asp.net
|
[0, 9]
|
1,157,581
| 1,157,582
|
Literature suggestions for best practices / good coding techniques
|
<p>I am a mid level developer. Currently I work in C# ASP.NET but I have worked in PHP, classic ASP, and a tiny bit in Java (would like to get more into this in the future). I am looking for a few suggestions on good books to help me continue growing in my coding techniques.</p>
<p>Basically a book with lots of best practices, coding tricks, rarely used but very useful features and operators (e.g. the ?? operator), stuff like that. I am NOT looking for a book to teach me a specific language. I don't particularly care about what language the code samples are in but C or Java would probably be best. The suggestions don't need to be limited to pure code objects either. Books with information about database connection management ect. would be good.</p>
<p>Thanks for your suggestions.</p>
|
c# java asp.net
|
[0, 1, 9]
|
5,756,058
| 5,756,059
|
Application Runs when Debugging but not when Published
|
<p>When publishing my web application and then running it will return the error </p>
<p><strong>"Could not load file or assembly 'BaseApplicationName' or one of its dependencies. An attempt was made to load a program with an incorrect format."</strong></p>
<p>However if I run the application through <strong>debugging (f5) it runs correctly</strong>. </p>
<p>I guess what it comes down to is </p>
<p><strong>what differences are there when running an application through debugging vs publishing it that would cause a problem like this?</strong></p>
<p><em>When publising I have it set to delete all existing.</em></p>
<p><strong>History of how it started...</strong> I added the 32 bit Oracle.DataAccess dll to my 64 bit system. It would not work and crash giving the same error as above but with the Oracle.DataAccess name instead of the baseApplicationName. I have since removed all references to it and removed the dll to try and get it to run without it once again. </p>
<p>Any advice?</p>
|
c# asp.net
|
[0, 9]
|
2,009,715
| 2,009,716
|
how to convert this javascript to jquery?
|
<p>I have this code, but I'm not sure how to convert it to jquery because of the <code>check</code> variable which I am using to see if the stuff inside the <code>if</code> statement happened at least once. <code>gph_img_list</code> is the name tag for lots of radio buttons.</p>
<pre><code> var check = false;
for (var i=0; i < gph_img_list.length; i++) {
if (gph_img_list[i].value == var_gph_img.innerHTML) {
gph_img_list[i].checked = true;
check = true;
break;
}
}
if (!check) {
var_gph_img.innerHTML = "";
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
134,236
| 134,237
|
Counting Rows in C# after dynamically adding them with jQuery
|
<p>I just have a simple ASP Table seen here:</p>
<pre><code><asp:Table ID="tblCategories" runat="server" CssClass="oneColTable padded-table dataTable">
<asp:TableHeaderRow CssClass="tableHeader">
<asp:TableHeaderCell>Category Name</asp:TableHeaderCell>
<asp:TableHeaderCell Width="50">Delete</asp:TableHeaderCell>
</asp:TableHeaderRow>
</asp:Table>
</code></pre>
<p>And if the user wants to add an additional row I use the jQuery Clone method to copy and append a new row.</p>
<p>My issue comes when I want to count the rows present on the C# side it always lists 1 Row. The row for the header entry.</p>
<p>How can I correctly grab the accurate row count on the C# (Codebehind) side?</p>
<p>Thanks,</p>
<p>-Seth</p>
|
c# asp.net jquery
|
[0, 9, 5]
|
5,229,292
| 5,229,293
|
How can I randomly show a set of elements using jQuery?
|
<p>Using jQuery, how would you <code>show()</code> every <code>div.foo</code> on a page in a random order, with a new one appearing every X milliseconds?</p>
<p><strong>Clarification</strong>: I want to start with all these elements hidden and end with all of them showing, so it wouldn't make sense to <code>show()</code> the same element twice.</p>
<p>I originally thought I'd make an array listing all the elements, randomly pick one, show that one, remove it from the array using <code>splice()</code>, and then randomly pick the next one from the remaining list - etc. But since my array is part of a jQuery object, <code>splice()</code> is not available.</p>
|
javascript jquery
|
[3, 5]
|
1,105,215
| 1,105,216
|
stopping random choose existing option
|
<p>In my game, when the "next-question" button is clicked, it should choose a new word in the grid for the user to spell. It does this, but the problem is that instead of going to another word, sometimes the randomization brings it back to the word it is already on. I need to make it so that it chooses any other than the one its on.</p>
<pre><code> //Next question click event
$('.next-question').on('click', function () {
$('td').removeClass('highlight-problem');
var r = rndWord;
while (r == rndWord) {
rndWord = Math.floor(Math.random() * (listOfWords.length));
}
//Adds and removes nesesary classes
$('td[data-word="' + listOfWords[rndWord].name + '"]').addClass('highlight-problem');
$('td[data-word=' + word + ']').removeClass('wrong-letter').removeClass('wrong-word').removeClass('right-letter');
var spellSpace = $('td[data-word="' + listOfWords[rndWord].name + '"]').hasClass('right-word');
if (spellSpace) {
$(".next-question").eq(($(".next-question").index($(this)) + 1) %$(".next-question").length).trigger("click");
} else {
$("#hintSound").attr('src', listOfWords[rndWord].audio);
hintSound.play();
$("#hintPic").attr('src', listOfWords[rndWord].pic);
$('#hintPicTitle').attr('title', listOfWords[rndWord].hint);
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,418,417
| 2,418,418
|
Java doesn't want me to close outputStream before using an inputStream?
|
<p>I've got (an admittedly strange) try/catch block that checks if a <code>File</code> exists. If it doesn't, then I create it and write a <code>File</code> to it. Then I read the <code>File</code>. </p>
<p>I have an <code>ArrayList</code> that is being initialized by reading an object from an <code>ObjectInputStream</code>. In the original writing of the file using a <code>FileOutputStream</code> and an <code>ObjectOutputStream</code>, if I call <code>close()</code> on them, then my <code>ArrayList</code> remains <code>null</code>. If I simply remove the calls to <code>close()</code>, everything goes as planned.</p>
<p>This seems backwards to me. I would think that the file system is somehow "locked" if I've got some type of <code>stream</code> open to it. That's why I thought to close the <code>outputStreams</code> before using an <code>inputStream</code>. But no, Java won't let this work unless I keep the <code>outputStreams</code> open. </p>
<p>Here's my code, including the commented out calls to <code>close()</code> which allows this to work properly:</p>
<pre><code>try {
File file = context.getFileStreamPath("file");
} catch (Throwable e) {
e.printStackTrace();
try {
FileOutputStream fileOutputStream = context.openFileOutput("file", Context.MODE_PRIVATE);
ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
reminders = new ArrayList<Reminder>();
objectOutputStream.writeObject(reminders);
// fileOutputStream.close();
// objectOutputStream.close();
} catch (Throwable t) {
t.printStackTrace();
}
}
try {
FileInputStream fileInputStream = context.openFileInput("file");
ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
if (objectInputStream != null) {
reminders = (ArrayList<Reminder>) objectInputStream.readObject();
}
} catch (Throwable t) {
t.printStackTrace();
}
</code></pre>
|
java android
|
[1, 4]
|
2,140,839
| 2,140,840
|
How to cut the picture into equal parts?
|
<p>I have images on my android app. How cut this picture into 9 or 12 equal parts and add this parts an array?</p>
|
java android
|
[1, 4]
|
590,081
| 590,082
|
How to detect chrome and safari browser (webkit)
|
<p>I am trying to detect the chrome and safari browser using jquery or javascript.
I thought we are not supposed to use jQuery.browser. Are there any suggestions here? Thanks a lot!</p>
|
javascript jquery
|
[3, 5]
|
2,417,878
| 2,417,879
|
Development feature: disable jQuery ajax
|
<p>is it possible to disable jQuery <code>ajax()</code> calls? As a developer, I ofttimes need to test site without ajax (without actually turning js off).</p>
<p>I would create a script that utilizes local database: when certain link is clicked, it would toggle a property. Ie. how can I effect global bindings such as</p>
<pre><code>$("a.ajax").live("click", function (event) {
event.preventDefault();
$.get(this.href);
});
</code></pre>
<p>without actually changing the code itself? Could I replace the <code>ajax()</code> function? How would you deal with this?</p>
|
javascript jquery
|
[3, 5]
|
2,859,615
| 2,859,616
|
How to increment a numeric string by +1 with Javascript/jQuery
|
<p>I have the following variable:</p>
<pre><code>pageID = 7
</code></pre>
<p>I'd like to increment this number on a link:</p>
<pre><code>$('#arrowRight').attr('href', 'page.html?='+pageID);
</code></pre>
<p>So this outputs 7, I'd like to append the link to say 8. But if I add +1:</p>
<blockquote>
<p>$('#arrowRight').attr('href', 'page.html?='+pageID+1);</p>
</blockquote>
<p>I get the following output: 1.html?=71 instead of 8.</p>
<p>How can I increment this number to be pageID+1?</p>
|
javascript jquery
|
[3, 5]
|
3,974,958
| 3,974,959
|
writing generic filter using grep in jQuery
|
<p>Is there a way i can write the following piece of code to be more generic?</p>
<pre><code>var result = $.grep(myObjectArray, function(e){
return e.Prop1 == 'SomeVal';
});
</code></pre>
<p>This is what i want to do.</p>
<p>A generic function that will accept <code>myObjectArray</code> (Object Array to filter), <code>Prop1</code>(Property name) and <code>SomeVal</code> (Value to filter) as an argument. </p>
<p>The problem i am facing is that i dont know how will i find the PropertyName in the object as it can be anything.</p>
<p>Any help will be highly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,479,046
| 5,479,047
|
Enable and disable button using javascript and asp.net
|
<p>I am checking if user exists in database if exists I am showing message as "existed user" and then I need to disable the signup button if not I need to enable it.</p>
<p>I am unable to enable and disable the sign Up button.</p>
<p>Can anyone help me in this issue?</p>
<p>Here is my code:</p>
<pre><code> <script type="text/javascript">
$(function () {
$("#<% =btnavailable.ClientID %>").click(function () {
if ($("#<% =txtUserName.ClientID %>").val() == "") {
$("#<% =txtUserName.ClientID %>").removeClass().addClass('notavailablecss').text('Required field cannot be blank').fadeIn("slow");
} else {
$("#<% =txtUserName.ClientID %>").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");
$.post("LoginHandler.ashx", { uname: $("#<% =txtUserName.ClientID %>").val() }, function (result) {
if (result == "1") {
$("#<% =txtUserName.ClientID %>").addClass('notavailablecss').fadeTo(900, 1);
document.getElementById(#<% =btnSignUp.ClientID %>').enabled = false;
}
else if (result == "0") {
$("#<% =txtUserName.ClientID %>").addClass('availablecss').fadeTo(900, 1);
document.getElementById('#<% =btnSignUp.ClientID %>').enabled = true;
}
else {
$("#<% =txtUserName.ClientID %>").addClass('notavailablecss').fadeTo(900, 1);
}
});
}
});
$("#<% =btnavailable.ClientID %>").ajaxError(function (event, request, settings, error) {
alert("Error requesting page " + settings.url + " Error:" + error);
});
});
</script>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
1,796,283
| 1,796,284
|
Javascript - I'd like to show the checkbox check before a long running function runs
|
<pre><code><input type="checkbox" onclick="myFunc()" />
</code></pre>
<p>myFunc is somewhat long running, about a second, and the browser shows the check for the checkbox AFTER the function completes. This causes lots of issues with users.</p>
<p>I'd like the check to show up immediately and then the onlick function to run. Can that be done?</p>
<p>I know I should get the function to run faster, or redesign the user interface, but that's another issue for another time.</p>
<p>thanks</p>
|
javascript jquery
|
[3, 5]
|
2,566,145
| 2,566,146
|
Android - Same content in multiple tabs
|
<p>My application consists of a tab layout with six tabs. Each tab represents a player in a game.</p>
<p>I would like the activities within each tab to contain the exact same XML layout and code as the activities in the other tabs. Each player will get access to the same widgets and input fields.</p>
<p>Is there a way to write one activity and have each tab use that activity as a template? I am trying to avoid copying the code for the six activities.</p>
|
java android
|
[1, 4]
|
184,939
| 184,940
|
C# equivalent of PrivilegedAction
|
<p>What is C# equivalent of <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/security/PrivilegedAction.html" rel="nofollow">PrivilegedAction</a> and <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/security/PrivilegedExceptionAction.html" rel="nofollow">PrivilegedExceptionAction</a> class of Java?</p>
|
c# java
|
[0, 1]
|
5,847,143
| 5,847,144
|
jQuery.data() with CSS
|
<p>I change with <code>setAttribute('color', 'black')</code> the CSS of some element. After this element will be stored in a jQuery.data() object. But in my data() object the CSS which I defined before won't be stored. </p>
<p>What am I doing wrong?</p>
<p>Thanks for the help!</p>
|
javascript jquery
|
[3, 5]
|
4,726,963
| 4,726,964
|
Use C# to trigger java script code inside an html page
|
<p>If I have an html page with all the scrips in it, how can feed this html to some sort of egine in .NET and use C# could to simulate user interaction with that page (like problematically presses a buttom or cause the web page to request a next page of a grid inside the html file) which would cause the page to to do whatever server interaction it would have done if it was inside the browser and get the C# engine to recieve the respose from the server? </p>
<p>Does such engine exist that could host html file and be sent events programtically? What does such approach called? </p>
|
c# javascript
|
[0, 3]
|
3,140,569
| 3,140,570
|
How to fix these type
|
<p>I have html data like text including image src.when I alert using jquery it works fine. Entire html is displayed in alert box.And then I want to send that entire html data and text and something's id using quary string of JQuery like:</p>
<pre><code>$.post('something.php','socialprofileid='+socialprofileid+
'&txtMsg='+msg+'&postedHtmlMsg='+HtmlMsgresult)
</code></pre>
<p>But I need that entire html data including text and id in php page like get html data, text, id in JQuery alert box</p>
<p>I try to use window.btoa function(base64 encoded format) for HtmlMsgresult. After doing base64 encoded format in javascript, when I try to send in php page, it doesn't get any print in php page.</p>
<p>Another thing is there any solution Text and htmldata(html text and img src) are combined and then it is done the base64 encode.And then it is send in php page using query string like:</p>
<pre><code>if(txtmsg='') {
var result=window.btoa(htmldata);
} else {
var content=text+htmldata;
var result=window.btoa(content);
}
$.post('something.php','socialprofileid='+socialprofileid+'&result='+result)
</code></pre>
<p>Is it possible to do that? </p>
<p>And then I want to insert into database in something.php and then in another page I want to fetch the htmldata and text which are encodded by base64 using jquery. Then it is converted by base64_decode function.</p>
<p>But within text and htmldata, How to extract text , htmltext, htmlimgsrc differently from the database table.</p>
<p>If u know about these type of problems, please reply me
I need your hand
Thank you</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,428,654
| 5,428,655
|
How to disable onCreate action when will orientation be changed?
|
<p>How can I disable onCreate event when I turn my device from portrait orientation? Because when application start it will get much data from Internet, and it will be badly to download data every time when user turn his device. </p>
|
java android
|
[1, 4]
|
2,725,461
| 2,725,462
|
Conditional Toggle of Class using JQUERY
|
<pre><code>$('.showall').css("cursor","pointer").click(function() {
$('.value-container').toggle();
$('.dim-header').toggleClass($('.dim-header').toggleClass() == 'dim-header' ? 'dim-header active' : 'dim-header');
$('.showall').html($('.showall').html() == '+ Expand All' ? '- Hide All' : '+ Expand All');
return false;
});
</code></pre>
<p>I have a series of boxes that I let users expand and collapse at will. The JQUERY for that works great and the box gets a class of 'active' added to it upon expand and has that class removed upon collapse.</p>
<p>I have a link that fires off the code above that toggles all the boxes to expand or collapse and changes the header image to switch from + to -.</p>
<p><strong>My problem is that if someone has a box or two expanded already before clicking the expand all or collapse all, the toggle won't force ALL the boxes to expand or collapse, the ones already expanded or collapsed do the opposite of the others.
I think I need to check to see if the 'active' class is present and if so, either add expand to all or remove from all so the toggle does not get the boxes out of sync...</strong></p>
<p>Can anyone help me with the logic to do this? I think I am close...</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,160,983
| 3,160,984
|
JQuery Load a page into a div and onload change content of second div
|
<p>I have a page with 2 divs one is called menu and the other is called content. The content div loads a log in page. When a user tries to log in I call a script into the content div and if unsuccessful it reloads the log in page.</p>
<p>If it is successful I use header location to redirect to the logged in page. When this page loads in the content div i need it to change the menu div to a different menu. I have tried using the following but to no avail. Is there any way that when the successful page loads into the content div that it can automatically change the content of the menu div</p>
<p>this is what i have tried in logged in page that is loaded into content div the body tag of that page has</p>
<blockquote>
<p>onLoad="$('div#menu').load('Includes/logged-menu-page.php')"</p>
</blockquote>
|
php jquery
|
[2, 5]
|
2,272,937
| 2,272,938
|
Show message if user has entered content on page and not saved
|
<p>How can I show a message like a popup modal if a user has entered some content and then not saved it and try to leave the page?</p>
<p>Something like:</p>
<p><img src="http://i.stack.imgur.com/ZFQF9.png" alt="enter image description here"></p>
<p>This appears if you try to go to another page within Facebook BUT if you type in the URL then you get a native alert box like:</p>
<p><img src="http://i.stack.imgur.com/P5dRO.png" alt="enter image description here"></p>
<p>1.) What is the difference? Is the alert something that is built into browsers?</p>
<p>2.) How can I use jQuery to create my own custom modal boxes when similar events happen?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,401,507
| 4,401,508
|
Why am I having problems with setInterval?
|
<p>I'm a novice javascript programmer and I always have trouble with the <code>setInterval</code>. W3Schools makes it look so easy but I can never get it to work when i need to. Here I have a span I want to make 'flash'.</p>
<pre><code>var id = window.setInterval(function(){
if($("#span1").css("color") == "red"){
$("#span1").css("color","blue");
}
else{
$("#span1").css("color","red");}
}, 100);
</code></pre>
<p>I keep getting a <code>SYNTAX ERROR: Unexpected token ILLEGAL</code>. What am I doing wrong here?</p>
<p>NOTE: I know there's some jQuery method that could handle this easily. I'm trying to gain a better understanding of this JS function.</p>
<p><strong>UPDATE</strong> I fixed the syntax error. (Missing quotation). Now I get an error <code>undefined</code>.</p>
|
javascript jquery
|
[3, 5]
|
5,965,111
| 5,965,112
|
Async Task Can it partially run?
|
<p>It is definitely working as postData sends to my site and forwards an email which it is doing. But loadingDialog does not execute ( it may be but it is a very quick process). The last process sentdialog is not executing as it brings up a new dialog saying sent and is not happening.
I have this script for the async</p>
<pre><code> protected class sendReport extends AsyncTask<Void, Void, Void> {
protected void onProgressUpdate() {
progressdialog();
}
protected void onPostExecute() {
sentdialog();
loadingDialog.dismiss();
}
@Override
protected Void doInBackground(Void... arg0) {
postData();
publishProgress();
return null;
}
}
</code></pre>
<p>Below is the sent dialog script.</p>
<pre><code>public void sentdialog(){
//set up dialog
final Dialog sentdialog = new Dialog(context);
sentdialog.setContentView(R.layout.sentdialog);
sentdialog.setTitle("Sent");
sentdialog.setCancelable(true);
final Button button = (Button) sentdialog.findViewById(R.id.Button01);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
sentdialog.dismiss();
}
});
sentdialog.show();
}
</code></pre>
|
java android
|
[1, 4]
|
5,062,608
| 5,062,609
|
Access value set using javascript in code behind in Master Page
|
<p>Im executing javascript on a master page that is onClick event of a Menu item i set it to a hidden field and on Init of the Master page im not able to access this hidden field value.</p>
<p>Regards</p>
|
asp.net javascript
|
[9, 3]
|
1,573,577
| 1,573,578
|
trailing comma problem, javascript
|
<p>I'm currently trying hard to get my jQuery to work in IE7, when I Lint the following:</p>
<pre><code>$(".regflow").validate({
errorLabelContainer: $("#error-message"),
rules: {
txtTextOnly: {required: true,textOnly: true},
txtNumbersOnly: {required: true,numbersOnly: true},
txtPhoneOnly: {required: true,phoneOnly: true},
txtAreaCodeOnly: {required: true,numbersOnly: true},
txtSimCodeOnly: {required: true,simCodeOnly: true},
txtCprOnly1: {required: true,numbersOnly: true},
txtCprOnly2: {required: true,cprOnly1: true},
txtMailOnly: {required: true,mailOnly: true}
},
messages: {
txtTextOnly: {required: "Dette felt skal udfyldes"},
txtNumbersOnly: {required: "Dette felt skal udfyldes"},
txtPhoneOnly: {required: "Dette felt skal udfyldes"},
txtAreaCodeOnly: {required: "Dette felt skal udfyldes"},
txtSimCodeOnly: {required: "Dette felt skal udfyldes"},
txtCprOnly1: {required: "Dette felt skal udfyldes"},
txtCprOnly2: {required: "Dette felt skal udfyldes"},
txtMailOnly: {required: "Dette felt skal udfyldes"}
},
});
</code></pre>
<p>... I get this error from Lint: <em>"warning: trailing comma is not legal in ECMA-262 object initializers"</em></p>
<p>Does anyone know what this means, and how do I fix it?</p>
|
javascript jquery
|
[3, 5]
|
5,071,739
| 5,071,740
|
Proxy setings for web service(client or service hosted server)
|
<p>I am trying to add the a web service through Web reference, i am able to find the service while trying to add it, not able to add, the option is disabled. I suspect this is because of the proxy settings, What do you suggest? While mentioning he proxy in the the client application which proxy should i mention,the proxy of my machine in which client application is hosted which is consuming the web service or the proxy of the machine in which the web service is hosted?</p>
|
c# asp.net
|
[0, 9]
|
3,623,388
| 3,623,389
|
How can I make these three statements more secure against SQL injection?
|
<h2>1.</h2>
<pre><code>$con = mysql_connect("localhost","","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("jbell2", $con);
$sql="INSERT INTO Profile (username, Date, Height, Weight, WaistSize, WeightforHeight, Blood_Pressure, Medication, Total_Cholesterol, Bad_Cholesterol, Good_Cholesterol, Triglycerides,KidneyFunctionTest)
VALUES
('$_Post[username]', '$_POST[Date]', '$_POST[Height]', '$_POST[Weight]', '$_POST[WaistSize]','$_POST[WeightforHeight]', '$_POST[Blood_Pressure]','$_POST[Medication]' ,'$_POST[Total_Cholesterol]' ,'$_POST[Bad_Cholesterol]' ,'$_POST[Good_Cholesterol]','$_POST[Triglycerides]','$_POST[KidneyFunctionTest]' )";
</code></pre>
<h2>2</h2>
<p>.</p>
<pre><code> MySqlConnection con = new MySqlConnection("host="";user="";password=""; database="";");
con.Open();
MySqlCommand cmd = new MySqlCommand("INSERT INTO Patients(username, password, FirstName, SecondName, DiabetesType, Email,Phone, Phone2, Question1, Question2,TreatmentPlan)"
+ "values" + "('" + uname.Text + "','" + password.Text + "','" + fname.Text + "','" + lname.Text + "','" + Dtype.Text + "','" + email.Text + "','" + phone.Text + "','" + phone2.Text + "','" + q1.Text + "','" + q2.Text + "','" + treatment.Text + "')");
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
</code></pre>
|
c# php
|
[0, 2]
|
2,078,689
| 2,078,690
|
Jquery - looping with nested functions and setInterval()
|
<p>Probably not the clearest title, but here goes - I need to display two independent countdowns on a page, accepting a user input for the starting value for each. When one reaches zero, the other starts and counts down to zero. Code for this is below, and working as expected.</p>
<p>I call the Timer1 function, which checks a variable for the starting value, if it exists, the count starts. When the count is zero, I clear the interval, reset the display to the starting value, and fire the second timer, if it has a value assigned:</p>
<pre><code> function Timer1() {
var gDuration = goTime;
countdown = setInterval(function () {
if (gDuration >= 0) {
$("#durationValue").html(ToTime(gDuration));
gDuration--;
}
else {
clearInterval(countdown);
$("#durationValue").html(ToTime(goTime));
if (restTime != 0) {
Timer2();
}
}
}, 1000);
}
function Timer2() {
var rDuration = restTime;
countdown = setInterval(function () {
if (rDuration >= 0) {
$("#restValue").html(ToTime(rDuration));
rDuration--;
}
else {
clearInterval(countdown);
$("#restValue").html(ToTime(restTime));
}
}, 1000);
}
</code></pre>
<p>The next step is to allow that process to run for a set number of loops - I've tried wrapping setInterval in Timer1 in a for loop, which doesn't work. Any ideas how to better go about this?</p>
|
javascript jquery
|
[3, 5]
|
3,348,840
| 3,348,841
|
Why can't i run a javascript function from c# code?
|
<p>This is a part of the C# code where i want to insert the network graph:</p>
<pre><code>DetailsBody3.Text = "<tr class=\"space\">";
DetailsBody3.Text += "<td>" + "<div id=\"center-container\"><div id=\"infovis\"></div> />";
DetailsBody3.Text += "</div></td>";
DetailsBody3.Text += "</tr>";
</code></pre>
<p>In the "infovis" div in the graph code, the graph exists.
And in the graph javascript file:</p>
<pre><code>function init1(){
// init data
}
var fd = new $jit.ForceDirected({
//id of the visualization container
injectInto: 'infovis',
// some other code,
}
</code></pre>
<p>I want to call the int1() function and draw the graph in the table created in C# above.</p>
|
c# asp.net
|
[0, 9]
|
2,973,198
| 2,973,199
|
non-jQuery equivalent of :visible in JavaScript?
|
<p>So jQuery provides this awesome pseudo to query in DOM on ':visible', unfortunately, its rather heavily tied into the core of jQuery and Sizzle (or whatever engine you may use). Is there a good equivalent in plain JavaScript when only a given element is known?</p>
<p>A reminder on the jQuery :visible rules:</p>
<ul>
<li>They have a CSS display value of none.</li>
<li>They are form elements with type="hidden".</li>
<li>Their width and height are explicitly set to 0.</li>
</ul>
<p>An ancestor element is hidden, so the element is not shown on the page.</p>
<p>Note: checking just style of the given element will not always work: a parent might be hidden instead hiding all children.</p>
|
javascript jquery
|
[3, 5]
|
5,285,805
| 5,285,806
|
How to disable SMS notification programmatically?
|
<p>This not work:</p>
<pre><code>try {
Context mmsContext = context.createPackageContext("com.android.mms", Context.CONTEXT_IGNORE_SECURITY);
mmsContext.grantUriPermission(context.getPackageName(),
Uri.parse("file:///data/data/com.android.mms/shared_prefs/com.android.mms_preferences.xml"),
Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mmsContext);
Editor editor = settings.edit();
editor.putBoolean("pref_key_enable_notifications", false);
editor.commit();
} catch (NameNotFoundException e1) {
e1.printStackTrace();
}
</code></pre>
<p>Error: "Attempt to read preferences file /data/data/com.android.mms/shared_prefs/com.android.mms_preferences.xml without permission"
Help, please!</p>
|
java android
|
[1, 4]
|
5,154,830
| 5,154,831
|
Simulate click on spacebar each 5 secondes in jQuery
|
<p>i want to simulate a click on spacebar each 5 minutes, how can i do that , i know that the ascii code for spacebar is 32
In jQuery how i we do that ? </p>
|
javascript jquery
|
[3, 5]
|
1,509,878
| 1,509,879
|
JQuery syntax error for init
|
<p>Hey guys I'm getting a syntax error on my var url line but I can't seem to figure out
what or why it is, help appreciated </p>
<pre><code>SW.wmode = {
init: function() {
$('iframe').each(function()
var url = $(this).attr("src")
$(this).attr("src",url+"?wmode=transparent")
);
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
141,363
| 141,364
|
How to convert a MySql selection into an string?
|
<p>I have a webform made in ASP.NET C# with a MySql database. The database contains a field named id wich is primary, auto-increment and of type INT.</p>
<p>I want to select a specific record, say number 10, convert it to a string so i can compare it with another string.</p>
<p>Query</p>
<p><code>query = "SELECT id FROM applys WHERE id = 10";</code></p>
<p>.ToString(); doesn't work.
I don't know wich step to take for the conversion.</p>
<p>C#</p>
<pre><code>if (variable == "10")
{
// some compare code
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,725,709
| 3,725,710
|
progress bar in asp.net
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/9080470/progress-bar-on-a-survey-using-c-sharp">progress bar on a survey using c#</a> </p>
</blockquote>
<p>I made an on-line survey in ASP .NET using C#. My survey contains 30 questions with each question on a different page. I want to display a progress bar that will show the user how much he completed. How can I do that?</p>
<p>I think that if I know the total number of pages, on each page when I hit the submit button the progress bar will fill according to the page the user is on. For example, if i am on the 5th page out of 30 then the progress bar should fill with 5 / 30 or something like this.</p>
|
c# asp.net
|
[0, 9]
|
3,981,144
| 3,981,145
|
Jquery calls to page method vs web service vs web api
|
<p>I'm working on an asp.net webforms application and I see a lot of areas where the page posts back after a dropdownlist selection is made, during which a small amount of data is retrieved from the server to populate another control (like a textbox). It's not a nice user experience to have the page posting back everytime you make a selection, especially if there are 5+ dropdowns on the page. To eliminate these posbacks I'm thinking of implementing JQuery ajax calls (which I already have experience with). </p>
<p>My questions: Which is recommended - page methods or asmx web services? Aren't asmx web services considered 'older' technology? And further, I have been reading up on Web API...could this be an alternative to the page method and web service? Would web api be overkill simply to eliminate a bunch of simple postbacks?</p>
|
jquery asp.net
|
[5, 9]
|
3,318,613
| 3,318,614
|
How do I refresh dynamic content loaded into a web part inside my existing jvacscript/jquery code?
|
<p>I have the code that I've pasted below, helpfully supplied by another stackoverflow member. I've added this code into a Kentico web part, and set the cache minutes=0, thinking that would solve my caching issue. It does, but not in IE. Is there any way I can tweak this code to refresh the content when the user comes to the page, or when we have to update the html file?</p>
<pre><code> <SCRIPT type=text/javascript>
// article footer
Date.prototype.getWeek = function() {
var onejan = new Date(this.getFullYear(),0,1);
var today = new Date(this.getFullYear(),this.getMonth(),this.getDate());
var dayOfYear = ((today - onejan +1)/86400000);
return Math.ceil(dayOfYear/7)
};
jQuery(function(){
//Quotes/Testimonials
var today = new Date();
var weekno = today.getWeek();
jQuery('#quotes-wrapper').load('/quotesroller.html div.quote-'+weekno);
});
</SCRIPT>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,229,645
| 1,229,646
|
Return Multiple CheckBox Values if Checked in jQuery
|
<p>I have multiple checkbox in my page. i want to retrieve its values if checked.</p>
<p>Here is HTML Code..</p>
<pre><code><input name="ctl1189" type="checkbox" id="chkTicket_189310" class=" chkTicket" value="189310">
<input name="ctl1190" type="checkbox" id="chkTicket_189311" class=" chkTicket" value="189311">
</code></pre>
<p>And So on..</p>
<p>Javascript Code:</p>
<pre><code>function updateTicketAction() {
var allUpdatedVendorTickets = $('.chkTicket').filter(function() { return this.value != $input.is(':unchecked'); });
var sFinalUpdateList = '';
allUpdatedVendorTickets.each(function() {
var ids = $(this).attr('id').split('_')[1];
sFinalUpdateList += ((sFinalUpdateList == '') ? '' : '|') + ids + ',' + $(this).val();
});
alert(sFinalUpdateList);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,761,545
| 2,761,546
|
How does Python's handling of line-breaks differ from JavaScript's automatic semicolons?
|
<p>Javascript has a feature called Automatic Semicolon Insertion where basically if the parser encounters an invalid token, and the last token before that was a line break, then the parser will insert a semicolon where the linebreak is. This enables you to basically write all your javascript code without semicolons, but you have to be aware of some edge cases, mostly if you have a return keyword and then the value you want to return on a new line.</p>
<pre><code>function test(){
// This will return 'undefined', because return is a valid statement
// and "john" is a valid statement on its own.
return
"john"
}
</code></pre>
<p>Because of these gotchas there are dozens of articles with titles like 'Automatic semicolon insertion is Evil', 'Always use semicolons in Javascript' etc.</p>
<p>But in Python no one ever uses semicolons and it has exactly the same gotchas.</p>
<pre><code>def test():
# This will return 'undefined', because return is a valid statement
# and "john" is a valid statement on its own.
return
"john"
</code></pre>
<p>Works exactly the same, and yet no-one is deadly afraid of Pythons behaviour. </p>
<p>I think the cases where the javascript behaves badly are few enough that you should be able to avoid them easily. Return + value on a new line? Do people really do that a lot? </p>
<p>Any opinions? Do you use semicolons in javascript and why?</p>
|
python javascript
|
[7, 3]
|
3,331,116
| 3,331,117
|
Passing Arraylist between activities? Using Parcelable
|
<p><strong>EDIT:</strong> I've updated my question considerably and am now going with Parcelable as my method.</p>
<p>I'm attempting to a pass an ArrayList from one activity to another. I've been reading around and can't seem to find any answers to my problem.</p>
<p>I've got an <code>ArrayList<SearchList></code> which <code>implements Parcelable</code> SearchList has the following code...</p>
<pre><code> public class SearchList implements Parcelable {
private String title;
private String description;
private String link;
public SearchList(String name, String phone, String mail) {
super();
this.title = name;
this.description = phone;
this.link = mail;
}
public SearchList(Parcel source){
/*
* Reconstruct from the Parcel
*/
title = source.readString();
description = source.readString();
link = source.readString();
}
public String gettitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
public int describeContents() {
// TODO Auto-generated method stub
return 0;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(title);
dest.writeString(description);
dest.writeString(link);
}
public static final Creator<SearchList> CREATOR = new Creator<SearchList>() {
public SearchList createFromParcel(Parcel source) {
return new SearchList(source);
}
public SearchList[] newArray(int size) {
return new SearchList[size];
}
};
}
</code></pre>
<p>However, when I try and do...</p>
<pre><code> List<SearchList> listOfResults = new ArrayList<SearchList>();
intent.putParcelableArrayListExtra("results", listOfResults);
</code></pre>
<p>I get <code>not applicable for type (String, List<SearchList></code> why?</p>
|
java android
|
[1, 4]
|
1,914,506
| 1,914,507
|
object literal not defined unless wrapped in jQuery onready; need ideas for debugging
|
<p>Adopted some javascript code that I'm rearranging into smaller files to make it more managable; I'm never been a full-time javascript engineer but have worked with it for awhile but don't feel super comfortable with it. </p>
<p>I have an object literal that handles most of our controller level activities for our site. We've rearranged the code and put it in different files but there's one specific object where I'm getting an undefined error. Looking at the load order of the files, it comes in before the jQuery piece. Also wrapping this object literal in another jQuery onready wrapper fixes the problem. If I check via somethign like this:</p>
<pre><code>if (typeof arc.event_handler === "undefined"){
alert("something is undefined");
}else{
alert("something is defined");
}
</code></pre>
<p>then with jQuery onready wrapping, it is defined but without it is undefined. Like (I know that this code will work either with or without the jQuery onload)</p>
<pre><code>// file-1.js
var arc={};
$(document).ready(function(){
arc.event_handler={
do_something: function(){
alert('do something');
}
}
});
</code></pre>
<p>and then later in different file</p>
<pre><code>// later in load order z-file.js
$(document).ready(function(){
if (typeof arc.event_handler === "undefined"){
alert("something is undefined");
}else{
alert("something is defined");
}
$('.some').on('click',function(){
arc.event_handler.do_something();
});
});
</code></pre>
<p>I'm a little bit at a loss what could causing this behavior. My understanding is that even if an external file, the part in the jQuery onready should essentially cause it to wait until these other pieces are loaded. I'm probably not getting something really simple but wanted to see if there were any ideas about what next to look at next? </p>
<p>thx in advance</p>
|
javascript jquery
|
[3, 5]
|
955,703
| 955,704
|
Refresh parent page with tabs
|
<p>I'm using an page with 4 tabs. Those are labeled #tab1/#tab2/#tab3/#tab4. I have an edit function which opens a new window. If that window is closed through clicking submit or just closing it the parent window should be refreshed. Well this works now but it always refreshes the first tab. Could you tell me how to adjust my code so it only takes an specific tab?</p>
<pre class="lang-js prettyprint-override"><code>$(document).ready(function() {
$("li").click(function(){
$(this).toggleClass("active");
$(this).next("div").stop('true','true').slideToggle("slow");
});
});
window.onunload = refreshParent;
function refreshParent() {
window.opener.location.reload();
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,715,832
| 5,715,833
|
Why is it null the elements of the array?
|
<p>I have an activity which has the following variable</p>
<pre><code>static CharSequence[] categories;
</code></pre>
<p>I'm receiving data using JSON</p>
<pre><code>try
{
Thread cThread = new Thread(new getStringContent("http://192.168.0.101/curltest/getcategories.php"));
cThread.start();
}
catch(Exception ex)
{
Log.i("YGo", ex.toString());
}
public class getStringContent implements Runnable {
String suri;
public getStringContent(String uri)
{
suri = uri;
}
@Override
public void run() {
try {
JSONArray jsonArray = new JSONArray(getPageContent(suri));
for (int i = 0; i < jsonArray.length(); i++) {
JSONArray jsonSArray = jsonArray.getJSONArray(i);
categories = new CharSequence[jsonArray.length()];
categories[i] = jsonSArray.getString(0);
Log.i("YGo", categories[i].toString());
}
} catch (JSONException e) {
// TODO Auto-generated catch block
Log.e("YGo", e.toString());
}
dialog.dismiss();
}
}
</code></pre>
<p>In the GUI thread if I click on the button, I would like to display the received data:</p>
<pre><code>for(int i=0; i<categories.length; i++)
{
Log.i("Ygo", String.valueOf(categories[i]));
Log.i("Ygo", String.valueOf(selectedData[i]));
}
AlertDialog.Builder builder = new AlertDialog.Builder(PreferencesClass.this);
builder.setTitle("Pick categories");
builder.setMultiChoiceItems(categories, selectedData, onClickCatChooser);
builder.setPositiveButton("Ok", clickedOnClickCatOk);
AlertDialog alert = builder.create();
alert.show();
</code></pre>
<p>but in the <code>categories</code> variable I have <code>null,null,Data3</code>, instead of <code>Data1</code> and <code>Data2</code> I have only <code>null</code>. Why?</p>
|
java android
|
[1, 4]
|
4,627,879
| 4,627,880
|
how does this js function work? Title too small to explain
|
<p>I've been digging into jquery to find out how it works and I see it uses a construct i've never seen in JS before. The following code seems to execute when the browser loads, it's almost like a function that invokes itself. I've searched for docs for this feature but not sure what its called. Can someone tell me the principle so I can google further info on this?</p>
<pre><code>(function test() {
alert('test');
})();
</code></pre>
|
javascript jquery
|
[3, 5]
|
407,996
| 407,997
|
How to show the text at lock screen in Android
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7569812/how-can-i-interact-with-the-lockscreen-layout-to-display-text-into-it-like-this">How can I interact with the Lockscreen layout to display text into it, like this app:</a> </p>
</blockquote>
<p>I want to show some text to the Android lock screen same as like 'I Like It' android app has implemented. You can see the app on Google play from <a href="https://play.google.com/store/apps/details?id=com.ilikeit.main" rel="nofollow">https://play.google.com/store/apps/details?id=com.ilikeit.main</a></p>
|
java android
|
[1, 4]
|
866,259
| 866,260
|
Trouble creating a multiple Row Table from Server Side Code
|
<p>I am trying to create a table dynamically in my code behind. My problem is I have a count of how many controls I want added to each TableRow after which I want to add that TableRow to the table and then start a new row. Here is the code I have no far but it just adds one row and does not move any of the controls to a seperate new row. </p>
<pre><code>public void FillTable(string DB, int? appID, string function, int? rID, string UserId, int ControlsperRow)
{
OneEvaDataContext datacontext = new OneEvaDataContext();
var results = datacontext.sp_Build_Menu_Field_Names(DB, appID, function, rID);
int controlCount = 0;
TableRow tr = new TableRow();
foreach (sp_Build_Menu_Field_NamesResult result in results)
{
TableCell tcLabel = new TableCell();
TableCell TcControl = new TableCell();
Control control = new Control();
control = DynamicControlReturn.ReturnControl(result.Param_Name, result.Build_Options_Type_NAME, UserId);
control.ID = "control" + controlCount.ToString();
_controlClientIDList.Add(control.ClientID);
tcLabel.Text = result.Param_Label;
TcControl.Controls.Add(control);
tr.Cells.Add(tcLabel);
tr.Cells.Add(TcControl);
controlCount = controlCount + Convert.ToInt32(result.TD_Len);
if (controlCount == ControlsperRow)
{
base.Controls.Add(tr);
controlCount = 0;
}
}
}
</code></pre>
<p>I would have thought that doing the .Add only when I am finished building that row would work but I guess since I'm using the same TableRow "tr" It is only putting in just one row.</p>
<p>EDIT: in the is context base is my class which looks like this:</p>
<pre><code> public class Dynamic_Search_Table : System.Web.UI.WebControls.Table
{
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,937,871
| 3,937,872
|
How to detect radio button deselect event?
|
<p>Is there an easy way to attach a "deselect" event on a radio button? It seems that the change event only fires when the button is selected.</p>
<p>HTML</p>
<pre><code><input type="radio" id="one" name="a" />
<input type="radio" id="two" name="a" />
</code></pre>
<p>JavaScript</p>
<pre><code>$('#one').change(function() {
if(this.checked) {
// do something when selected
} else { // THIS WILL NEVER HAPPEN
// do something when deselected
}
});
</code></pre>
<p><a href="http://jsfiddle.net/WZND9/" rel="nofollow">jsFiddle</a>
</p>
|
javascript jquery
|
[3, 5]
|
5,501,235
| 5,501,236
|
HTTP Web Requst is sending twice (How to fix?)
|
<p>I've got the following code to perform a web request and fetch HTTP response. What I'm trying to do is, IF HTTP Response is </p>
<blockquote>
<p>200 OK</p>
</blockquote>
<p>I need to read the response body without sending the web request again (I know my code is currently sending it twice).</p>
<pre><code> try
{
using (WebResponse response = request.GetResponse())
{
HttpWebResponse httpResponse = (HttpWebResponse)response;
if (httpResponse.StatusCode == HttpStatusCode.OK)
{
using (var webClient = new WebClient())
{
string result = webClient.DownloadString(request.RequestUri);
if(result.StartsWith("NUMBER NOT IN LIST"))
{
return "Number Not In List";
}
return result;
}
}
else if (httpResponse.StatusCode == HttpStatusCode.Unauthorized)
{
return statusCode = HttpStatusCode.Unauthorized.ToString();
}
else if (httpResponse.StatusCode == HttpStatusCode.BadRequest)
{
return statusCode = HttpStatusCode.BadRequest.ToString();
}
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,114,184
| 5,114,185
|
Jquery .get() - How to pass the value of a text box into the data parameter?
|
<p>There is one form with a <code>textbox id="name"</code> and a button.</p>
<p>After the user clicks the button, I want to execute the <code>$.get()</code> to capture the reply. (I got the .click() correctly so far)</p>
<p>How to I pass the value the user enters to the text box as the {data} parameter in the get function?</p>
<p>Thank you!</p>
|
javascript jquery
|
[3, 5]
|
5,711,009
| 5,711,010
|
Jquery/Javascript : Negative of a Variable
|
<p>What's the best way to check for the negative of a variable?</p>
<p>Here are my variables:</p>
<pre><code>var frameWidth = 400;
var imageWidth = parseInt($('#' + divId).find('#inner-image').css('width'), 10);
var imageMargin = parseInt($('#' + divId).find('#inner-image').css('margin-left'), 10);
var numberOfFrames = imageWidth/frameWidth;
</code></pre>
<p>I want to perform a check kind of like this:</p>
<pre><code>if (imageMargin == -numberOfFrames*frameWidth-400 )
</code></pre>
<p>But I don't know how.</p>
<p>In other words, if numberOfFrames*frameWidth-400 equals 800, I need it to return -800.</p>
<p>Thanks again for any direction you can provide.</p>
|
javascript jquery
|
[3, 5]
|
5,224,760
| 5,224,761
|
jquery how to select all the class elements start with "text-"?
|
<p>I have got some classes</p>
<pre><code>.text-1
.text-2
.text-3
</code></pre>
<p>I want to select them all, how to do that?
Thanks for the help</p>
|
javascript jquery
|
[3, 5]
|
5,045,534
| 5,045,535
|
Viewing PDF files without calling the installed pdf reader applications
|
<p>I'm developing an android application which needs to read the pdf files without calling other installed applications( using Intent.ACTION_VIEW). I searched a lot about this on internet and then i downloaded one <strong>PdfViewer.jar</strong> file. After using it in my project i found that it is a bit slow to load the pages.</p>
<p>can anyone suggest me any pdf reader libraries which is most efficient and faster?</p>
<p>Thanks in advance...</p>
|
java android
|
[1, 4]
|
3,849,142
| 3,849,143
|
How to Call Class on page load in Html
|
<p>I have jquery with class= modal i want to call that class when page load how to do using javascript or php</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,133,014
| 5,133,015
|
Jquery, Add elements every 2 seconds
|
<p>I'm trying to create a growth map similar to <a href="http://projects.flowingdata.com/walmart/" rel="nofollow">http://projects.flowingdata.com/walmart/</a>.</p>
<p>I am using <a href="https://github.com/marioestrada/jQuery-gMap" rel="nofollow">https://github.com/marioestrada/jQuery-gMap</a> to do the maping</p>
<p>What i've got so far is a button that when I click it I want to start the animation. The onclick code is: </p>
<pre><code><script>
$("input.buttonB").click(function(){
window.setTimeout(function() {
$('#map_canvas').gMap('addMarker', {
latitude: 41.60252,
longitude: -100.32855,
content: 'Some HTML content'
}
);
}, 2000);
window.setTimeout(function() {
$('#map_canvas').gMap('addMarker', {
latitude: 11.60252,
longitude: -110.32855,
content: 'Some HTML content'
}
);
}, 2000);
});
</script>
</code></pre>
<p>Problem is, the markers don't appear on screen every 2 seconds. The window waits 4 seconds then displays both of them at the same time.</p>
<p>Any suggestions?</p>
|
javascript jquery
|
[3, 5]
|
5,316,849
| 5,316,850
|
Is there a JQuery event to determine when an element's list of children has changed?
|
<p>I'm hoping to find a JQuery event that will tell me when an element collection has grown or shrunk after the addition/removal of a child element.</p>
|
javascript jquery
|
[3, 5]
|
5,687,530
| 5,687,531
|
Android EditText, make it fill the whole screen and write anywhere in it
|
<p>As the title say I am trying to have a EditText field that takes more or less the whole screen. That's not a problem to do, but the problem is when you start write then it start's in the midle of the screen. And you can't select where to write. what I try to achieve is to make it to be like a note. That I can write where I select, anyone know how to make this work:)?
thank's!</p>
|
java android
|
[1, 4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.