Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
3,860,337 | 3,860,338 | Orbit Object Around Center Point | <p>I am attempting to orbit an object around a center point, much like the sun and our planets. However I am having no luck at all. Any help would be really great. Thanks. I'm writing in luna and I dont think there is a category for that here, but this probably is just general code. But if its in the wrong place, my apologies.</p>
<pre><code>local function animate(event)
local rads = degrees * (Math.PI / 180);
ballOne.x = 20 * Math.cos(rad);
ballOne.y = 20 * Math.sin(rad);
degrees = degrees + 1
end
Runtime:addEventListener("enterFrame", animate)
</code></pre>
| iphone android | [8, 4] |
249,211 | 249,212 | Switch between Android activities when listview item clicked | <p>I searched for hours to find good tutorial about switching between Android activities when a list view item clicked. All tutorials describe about calling different activities for different list view item clicked, but I want to run same activity without considering what item is clicked Here is the code I have used but this is not work.</p>
<pre><code> list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> paramAdapterView, View paramView, int paramInt,
long paramLong) {
Intent newActivity = new Intent(getApplicationContext(), OrderDetails.class);
startActivity(newActivity);
}
});
</code></pre>
<p>Activity called in Manifest.xml</p>
<pre><code></activity>
<activity android:name=".OrderetDetails"></activity>
</application>
</code></pre>
<p>How can I do that if it is possible ?</p>
<p>Thanks!</p>
| java android | [1, 4] |
681,670 | 681,671 | Dynamically change an application's icon / name Android | <p>I'm writing a security feature for Android which helps the user recover lost or stolen phones. I want to allow the user to change the application icon and name as it appears on the app page. I'm new to Android programming, so excuse me if this is a silly question.</p>
<p>To put it another way, I want to allow the user to check a box in my app which will change the name from "Android Recovery App" to something like "Stopwatch+". Is this possible? If so, can someone point me in the right direction as to how I could start implementing this?</p>
| java android | [1, 4] |
4,178,624 | 4,178,625 | $(document).ready not work in IE 7 | <p>i am using following code in other browser(mozilla, chrome etc.) then working fine but if i use that same code in IE 7 then it's not working(work in IE 8+). no error given to me. </p>
<pre><code>$(document).ready(function(){
alert("hello");
});
</code></pre>
| javascript jquery | [3, 5] |
1,881,912 | 1,881,913 | jQuery, show all elements by class name | <p>I want to show all elements with some class name (<strong>string</strong>). Something like:</p>
<pre><code>var somevar = "apple"
$( .... select all elements with class == somevar ).show();
</code></pre>
<p>How can it be done?</p>
| javascript jquery | [3, 5] |
1,871,431 | 1,871,432 | How to press a button with Enter Key | <p>How to bind click(from Button1's click event) event in textbox When I pressed the enter key </p>
| javascript jquery | [3, 5] |
689,696 | 689,697 | Code won't execute in $(document).ready but will in developer console | <p>I have some code wrapped in <code>$(document).ready(function(){ /*code*/ });</code>, and all of it works fine, except for one line. The code above it works fine, the code below it works fine, I'm not getting any errors in my console.</p>
<pre><code>$('.main-right.category').height( $('.footer').height() + $('.main-right.category').height() );
</code></pre>
<p>That doesn't fire. However, if I paste that exactly in the developer console and press enter after the page has loaded, it works. All of the elements exist at page load (meaning none are built dynamically via javascript). Same result in chrome, firefox, IE. </p>
<p>Any ideas?</p>
<p>edit: I should add that my css is loaded before my javascript, and I've done other CSS related tweaks in this same javascript file that have worked fine.</p>
<p>Also, if I console.log $('.main-right.category').height() and $('.footer').height() right above that line of code, they both give non-zero integer values like I'd expect.</p>
| javascript jquery | [3, 5] |
3,171,806 | 3,171,807 | how to use classes from imported package in android | <p>I have a package pkg1 which say I will import in pkg2. </p>
<pre><code>secondactivity.java:
package seconddemoapp.demoapp.demo;
public class seconddemoappActivity extends Activity
{
----
}
firstactivity.java:
package firstdemo.firstdemoapp.demo;
import seconddemoapp.demoapp.demo.seconddemoappActivity;
public class firstactivity extends Activity
{
------
Intent i = new Intent(firstactivity.this, seconddemoappActivity.class);
startActivity(i);
}
</code></pre>
<p>I am getting "NoClassDefFoundError" for <code>seconddemoappActivity.class</code></p>
<p>Where am I going wrong?
How can I use the <code>seconddemoactivity</code> class in the <code>firstactivity</code>?</p>
| java android | [1, 4] |
742,900 | 742,901 | Response.BinaryWrite DIV | <p>Is there a way to write PDF to a div from DataBase i.e. Retrieve a Byte[] from Database and Reponse.BinaryWrite to a div.</p>
<p>We do similar thing for Images using src = "anotherpage.aspx" where image is written on anotherpage.</p>
<p>Is it possible with PDF without using IFrame?</p>
| c# asp.net | [0, 9] |
1,412,600 | 1,412,601 | define an array in JavaScript | <p>how would you define an array in JavaScript like the one below and retrieve values by doing a search for country and gets the list of region.</p>
<pre><code>region['US'] = {'Region 1': 'East', 'Region 2': 'West'}
</code></pre>
| javascript jquery | [3, 5] |
3,360,335 | 3,360,336 | How should I choose where to store an object in C++? | <blockquote>
<p><strong>Possible duplicate</strong><br />
<a href="http://stackoverflow.com/questions/599308/proper-stack-and-heap-usage-in-c">Proper stack and heap usage in C++?</a></p>
</blockquote>
<p>I'm beginning to learn C++ from a Java background, and one big difference is the fact that I'm no longer forced to:</p>
<ol>
<li>dynamically allocate memory for objects
</li>
<li>always use pointers to handle objects
</li>
</ol>
<p>as is the case in Java. But I'm confused as to when I should be doing what - can you advise?</p>
<p>Currently I'm tempted to start out doing everything Java-style like</p>
<pre><code>Thing *thing = new Thing();
thing->whatever();
// etc etc
</code></pre>
| java c++ | [1, 6] |
5,085,362 | 5,085,363 | Check Date and Display Until Event Date | <p>I want to list an event in the sidebar and have it automatically disappear on the day after the event.</p>
<pre><code><h6>Next Meeting</h6>
<dl id="nextmeeting">
<dt><a href="members-meetings.html">Oct 15, 2011</a></dt>
<dd>La Quinta Inn & Suites</dd>
<dd>303 Blum, San Antonio</dd>
</dl>
</code></pre>
<p>So, on October 16th, I want that info to be hidden. I am sure there is a simple PHP or JavaScript solution.</p>
<p>Thanks in advance.</p>
| php javascript | [2, 3] |
5,024,118 | 5,024,119 | ui Dialog works once in IE | <p>I hope someone can help with this problem. I am using ui Dialog that pops up on clicking a link with the same class. The problem is that the link work great once but if i click it again or another link with the same class then only the overlay loads but not the content box in IE only. It works great in firefox.
My script includes an ajax post, if i remove the ajax code then the box works fine on every click.</p>
<p>My code:</p>
<pre><code>$().ready(function() {
$('#dialog').dialog({
autoOpen:false,
title: $(this).attr("title"),
modal: true, width: 450, height:"auto", resizable: false,
close: function(ev, ui) { $(this).remove(); },
overlay: {
opacity: 0.5,
background: "black"
}
});
$(".mybutton").click(function(){
$.post($(this).attr("href"), { },
function(data) {
$('#dialog').html(data);
}
);
$('#dialog').dialog('open');
return false;
});
});
</code></pre>
<p>I have multiple links with the class "mybutton" and a div with the id #dialog . I am also using the latest version of jQuery and ui.
Any help would be greatly appreciated. Thanks</p>
<p>I am using IE8, jQuery 1.3.2, jQuery UI 1.7.1 </p>
| javascript jquery | [3, 5] |
3,590,173 | 3,590,174 | chaining methods and selectors using jquery inside of a loop | <p>Is it possible to generate a chain of selectors and methods inside of a loop?</p>
<p>For example, I have an array of elements:</p>
<pre><code>array[0] = '.type1value1, .type1value2, .type1value3';
array[1] = '.type2value1, .type2value2, .type2value3';
array[2] = '.type3value1, .type3value2, .type3value3';
</code></pre>
<p>I somehow need to build a chain of methods using the array elements as selectors (by looping or any other possible means!) so that I would end up with the following:-</p>
<pre><code>$('.type1value1, .type1value2, .type1value3').filter('.type2value1, .type2.value2, .type2value3').filter('.type3value1, .type3value2, .type3value3');
</code></pre>
| javascript jquery | [3, 5] |
1,377,117 | 1,377,118 | JQuery / JS variable to alert text | <p>I have this code:</p>
<pre><code>$('#output').html("<strong>id:</strong>"+id);
</code></pre>
<p>then</p>
<pre><code><div id="output">this element will be accessed by jquery and this text replaced</div>
</code></pre>
<p>The above works fine but what I need is for the output to go into an alert so....</p>
<pre><code><a href="#" onclick="alert('OUTPUT GOES HERE')">Alert Me</a> <- See here
</code></pre>
<p>How can this be done?</p>
| javascript jquery | [3, 5] |
468,065 | 468,066 | jscript/jquery: fade in divs 1 by 1, with pause inbetween | <p>I am totally stumped here.</p>
<p>I have a bunch of messages, each within a div "msg_feed_frame_$i" which increases, so message 1 is in div "msg_feed_frame_1", msg 2 is in "msg_feed_frame_2", etc etc. I want to fade these messages in one by one using jquery, but for some reason no matter what I do with settimeout and setinterval, the code immediately fades them all in simultaneously.</p>
<p>This is what i've got so far:</p>
<pre><code>function feed(i)
{
var div = "#msg_feed_frame_";
var fader = div.concat(i);
$(fader).fadeIn(2000);
}
function timefade()
{
var num = 1;
for (num=1; num<=10; num++)
{
var t=setTimeout(feed(num),1000);
}
}
$(document).ready(function(){
timefade();
});
</code></pre>
| javascript jquery | [3, 5] |
4,736,943 | 4,736,944 | Highlighting search words like Chrome with jQuery | <p>I have recently done a very simple highlighting with jQuery and a highlight plugin. It looks like this:</p>
<blockquote>
<p>$('myButton').click(function() {</p>
<p>$('body').highlight($('#myInputText').val());</p>
<p>});</p>
</blockquote>
<p>But I wonder how can I do the Chrome like highlighting, I mean highlight the letters whenever I type in some letter in textbox without submitting. I think maybe use a keyup event... Any ideas?</p>
<p><strong>Thanks Andy, i changed 'this[0]' to 'search[i]' in your code and it works if there is only one 'p' tag</strong></p>
<pre><code>$(document).ready(function(){
var search = ['p', 'div', 'span'];
$("#highlighter").bind('keyup', function(e){
var pattern = $(this).val();
$.each(search, function(i){
var str = search[i];
var orgText = $(str).text();
orgText = orgText.replace(pattern, function($1){
return "<span style='background-color: red;'>" + $1 + "</span>"
});
$(str).html(orgText);
});
});
});
</code></pre>
| javascript jquery | [3, 5] |
4,025,200 | 4,025,201 | jquery remove element and also list selection | <p>I have a select list that when the user selects an item it builds an <code>li</code> element on the fly, when the users clicks the <code>li</code> element, the <code>li</code> is removed. Below is the code that I currently have,</p>
<p>The below adds the li on select of an option</p>
<p><code>$('#sectors').change(function(e){<br>
$('#selected_sectors').empty();<br>
$(this).find(':selected').each(function(i,e<br>
{$('#selected_sectors').append($('<li>').text($(e).val()));
});
});</code></p>
<p>The below removes the generated li </p>
<p><code>$('ul#selected_sectors li').live('click', function(){
$(this).fadeOut('slow').remove();
$('#selected_sectors').val($(this).text()).attr('selected', false);
});</code></p>
<p>What I am wanting is when an <code>li</code> is removed the select option with the same value as the li's text is also unselected?</p>
| javascript jquery | [3, 5] |
2,352,599 | 2,352,600 | time that does not depend in system time | <p>I am developing a game in C++ for iPhone. I need to give hourly bonus to the player. I implemented this using time(NULL) method to check for next. But that can cheated easily by changing the device time. So what alternative I have to prevent this?</p>
<p>I of my friend told me to sync that to my server. But that is not an option as no server communication is there at present. Please help...</p>
<p>Thanks in advance!!!</p>
| c++ iphone | [6, 8] |
118,288 | 118,289 | remove , from string if present | <p>What is the best way to remove <code>,</code> from following strings.</p>
<ol>
<li>one,two,three,</li>
<li>three,four,five</li>
<li><p>six,seven,eight,nine,ten,</p>
<blockquote>
<pre><code>int strLength = someString.Length;
if (strLength > 0)
{
findString = findString .Substring(0, str.Length - 1);
}
if (findString ==",")
{
someString.Remove(someString.Length - 1)
}
</code></pre>
</blockquote></li>
</ol>
<p>I have quickly compiled this code directly in StackExchange editor as an example (It may be have syntax error.</p>
<p>Please take above as logic purpose only.</p>
<p>I would appreciate if someone can provide optimized code for above logic.</p>
<p><strong>UPDATE</strong>: I actually want to remove <code>,</code> from string if present at the end of string not in middle.</p>
| c# asp.net | [0, 9] |
2,183,638 | 2,183,639 | What does $ do when using JQuery? | <p>I am reading JavaScript and JQuery, The Missing Manual</p>
<p>and they start of with this Snippet : </p>
<pre><code>$(document).ready(function(){});
</code></pre>
<p>I know that <code>function(){}</code> is an anonymous function, and that document is an object with properties I can set / read, and that ready() is a JQuery function defined in the library, but I don't know what the rest of the syntax is for and it is not explained in the book.</p>
<p>Particularly,</p>
<pre><code>$(document)
</code></pre>
<p>Can someone explain what this does or point me to a link? Also, someone said that you can identify JQuery by this alone, is this true? </p>
| javascript jquery | [3, 5] |
3,519,231 | 3,519,232 | how to give confirm message box when selecting previous date in asp.net | <p>hello i have created one webpage in asp.net & in that webpage i am using Asp calendar control. I want to display message box whenever user selects the previous dates from that calendar control how can i do it please suggest me any solution.</p>
| c# javascript asp.net | [0, 3, 9] |
5,708,592 | 5,708,593 | Dynamically replace HTML element in UIWebView | <p>I have some HTML loaded in WebView like this: </p>
<pre><code><html><head></head><body>before <myTag>Content</myTag> after</body></html>
</code></pre>
<p>I want to replace element <code>myTag</code> with custom text so it should look like:</p>
<pre><code> <html><head></head><body>before ____MY_CUSTOM_TEXT___ after</body></html>
</code></pre>
<p>Also I can't change initial HTML.
How I can do this with JavaScript?</p>
<p>My not finished code:</p>
<pre><code>var elements = document.getElementsByTagName( 'myTag' );
var firstElement = elements[0];
var parentElement = firstElement.parentNode;
var html = parentElement.innerHTML;
parentElement.innerHTML = html.replace(?????, '____MY_CUSTOM_TEXT___');
</code></pre>
<p>I don't know how to get string value of element to replace (?????).</p>
| javascript iphone | [3, 8] |
1,265,336 | 1,265,337 | How to get DataTextField of DropDownList in javascript? | <p>I am using a DropDownList as </p>
<pre><code><asp:DropDownList
ID="ddlLocationName"
runat="server"
DataValueField="Guid"
DataTextField="LocationName"
AppendDataBoundItems="false"
AutoPostBack="false"
onchange="LocationChange()"
></asp:DropDownList>
</code></pre>
<p>and when I select item from dropdown the DataTextField should be displayed in the textfield. For that i am using following javascript: </p>
<pre><code>function LocationChange()
{
document.getElementById ("ctl00_mainContent_ctl02_txtEventLocation").value = document.getElementById ('ctl00_mainContent_ctl02_ddlLocationName')[document.getElementById ('ctl00_mainContent_ctl02_ddlLocationName').selectedIndex].value
}
</code></pre>
<p>It works fine when dropdown's DataValueField is not used. But how to do desired task when DataValueField property of dropdown is also used?</p>
<p>Thanks in advance.</p>
| c# asp.net javascript | [0, 9, 3] |
4,145,714 | 4,145,715 | Creating web controls inside a content placeholder programmattically | <p>I've got a master page and a content page. How can I add controls to the master page's content placeholders programattically?</p>
| c# asp.net | [0, 9] |
5,266,925 | 5,266,926 | Server.UrlEncode vs. HttpUtility.UrlEncode | <p>Is there a difference between Server.UrlEncode and HttpUtility.UrlEncode?</p>
| c# asp.net | [0, 9] |
1,798,908 | 1,798,909 | Determine if SelectBox containing no options exists using jQuery | <p>So this question is asked a lot on the net and I see the answer is to check if the .length is > 0. </p>
<p>So in my case a select box may or may not exist. If it exists, it may have no options. </p>
<p>I have to code for the following:</p>
<p>If selectbox exists ...
if there are no select box options ...
disable a text area</p>
<p>I have therefore written the following:</p>
<pre><code>$(document).ready(function () {
"use strict";
alert('running globals');
// Only process this block if the contactEmailAddress select box exists
if ($('contactEmailAddress').length > 0) {
alert('on the comm page');
// If there are no contacts ...
if ($('#contactEmailAddress option').size() === 0) {
alert('disabling the message box');
$('#message').attr("disabled", "disabled");
}
}
});
</code></pre>
<p>The problem is, because the select box has no options, it's decided the selectbox.length is 0. So this block never fires. </p>
<p>I need another way. </p>
| javascript jquery | [3, 5] |
4,916,339 | 4,916,340 | How to put image in HashMap by giving a specific url | <pre><code>private static final String picpic = "picpic";
private ArrayList < HashMap < String, Object>> myBooks;
myBooks = new ArrayList<HashMap<String,Object>>();
HashMap < String, Object> hm;
hm = new HashMap<String, Object>();
drawable=LoadImage("http://www.wauhaha.com/smart/company/album/pic.jpg");
hm.put(picpic, drawable);
myBooks.add(hm);
final ListView listView = (ListView)findViewById(R.id.list);
SimpleAdapter adapter = new SimpleAdapter(this, myBooks, R.layout.listbox, new String[]{picpic}, new int[]{R.id.image1});
listView.setAdapter(adapter);
</code></pre>
| java android | [1, 4] |
5,606,835 | 5,606,836 | windows Service / Web Service | <p>I've a application here that should automatically deploy the web service on local server(not in IIS). It is ok with running like windows service. Has any one help with Idea??</p>
| c# asp.net | [0, 9] |
688,625 | 688,626 | Tips for moving from C# to Java? | <p>So I'm going to a job interview next week at a Java place, and would like to not come across as clueless. I'm a pretty confident C#/.NET developer and am (clearly!) willing to consider jumping ship to Java - I'd like links to resources people would recommend for doing this. I'm interested in answers to questions like:</p>
<ul>
<li>Any guides that are a rough equivalent to <a href="http://www.codethinked.com/post/2008/07/21/Learning-Ruby-via-IronRuby-and-C-Part-1.aspx">Justin Etheridge's Ruby for C# developers</a>? That was really useful when I decided I wanted to learn Ruby's rake (and thus at least a little Ruby). There seem to be more pages for people going the other way, though...</li>
<li>Which IDE to use? I've actually already bought my own IntelliJ because I love its HTML/CSS/JS, but haven't touched its actual raison d'etre of, well, "that Java stuff". I suspect the place I'm going to uses Eclipse, however. So - recommended resources to get up and running on a Mac or Windows (I'm not fussy)?</li>
<li>It's probably going to be a TDD coding interview; I guess JUnit is the de facto choice to learn a little about here?</li>
</ul>
<p>Thanks in advance.</p>
| c# java | [0, 1] |
5,407,446 | 5,407,447 | From jquery back to JavaScript | <p>I need a pure JavaScript equivalent of this Jquery code:
because the use of libraries isnt allowed in my current project,</p>
<p>File handler.js</p>
<pre><code>$(document).ready(function(){
$("#some_button").click(function(){
alert('ok. works');
});
});
</code></pre>
<p>File index.html</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="handler.js"></script>
<head>
<body>
<button id="some_button">Btn</button>
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
1,456,484 | 1,456,485 | Slide Effect happening too many times | <p>I call this functions on onmouseover and onmouseout for several divs. </p>
<pre><code>//Takes effect on divs with id, 62,63,64,65...
function slide_it(id){
$('#options_'+id).slideToggle('slow');
}
</code></pre>
<p>The problem is that if I move my mouse over and then mouse out, then again, mouse over and then mouse out. If I do this several times, the slide effect happens the same number of times I moved my mouse over and out of the div, as expected.</p>
<p>But I can't figure out how I can do this <strong>once</strong>? I can set a variable, but I have several divs that this function is used by and I can't think of a simple way of doing this rather than storing things into an array, but this is messy!</p>
<p>I really appreciate any help on this that is simple to implement!</p>
<p>Thanks all for any help</p>
| javascript jquery | [3, 5] |
3,024,046 | 3,024,047 | Defaulting hidden field value using inline server code | <p>I have an ASP.NET page where I defined a property in the code behind as follows:</p>
<pre><code> public int testProperty { get; set; }
</code></pre>
<p>In my page I define a hidden field and want to set the value using an inline server code as follows:</p>
<pre><code><asp:HiddenField ID="hftestProperty" runat="server" Value="<%= testProperty.ToString() %>" />
</code></pre>
<p>The problem I am having is that when the control renders in the browser, it renders the value the same way I defined it:</p>
<pre><code><input type="hidden" name="hftestProperty" value="<%= testProperty.ToString() %>">
</code></pre>
<p>Any idea why this is happening?</p>
| c# asp.net | [0, 9] |
3,207,908 | 3,207,909 | How to trigger .click() on disabled checkbox | <p>js/jQuery:</p>
<pre><code>$('input[type=checkbox]').click(function(){
// Does not fire if I click a <input type="checkbox" disabled="disabled" />
});
</code></pre>
<p>How do I make something happend in jQuery when someone clicks a disabled checkbox?</p>
| javascript jquery | [3, 5] |
3,386,827 | 3,386,828 | How should I code my jQuery so when I hover over my div, the image in it dissolves into another image? | <p>I know I need to use the hover function on the div, then change the images src attribute, but I don't know how to make it dissolve from one to the other. If I hide it, it just fades back in from white. But I want it to dissolve image to image.</p>
| javascript jquery | [3, 5] |
238,983 | 238,984 | adding values to the dropdownlist via loop in asp.net | <p>I'm developing web-application, in this I want to add all months values on the client side browser in registration form.</p>
<p>I'm doing it manually by adding all months' values one-by-one. I want to know is it possible to add all months with by putting one for loop in my code or not.</p>
<p>Suggest me if it's possible.</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
4,548,787 | 4,548,788 | Compiling default android applications | <p>Can i compile applications that are part of android separately? Probably modify them? </p>
<p>I downloaded them from <a href="http://grepcode.com/snapshot/repository.grepcode.com/java/ext/com.google.android/android-apps/2.3.4_r1" rel="nofollow">here</a> but have had no luck importing them into eclipse. I create a new android project then import the files. This shows missing Class errors, but I've downloaded all the dependencies listed on that page and included them in the compile path. I also tried hunting down the separate classes from <a href="http://grepcode.com" rel="nofollow">grepcode</a> but they also require other files.</p>
<p>Of particular interest though is the STK App. I'd like to modify it so i can make STK calls from my application.</p>
<p>If anyone has successfully compiled any default android apps, i'd be glad to hear your experience.</p>
| java android | [1, 4] |
3,453,199 | 3,453,200 | delete rows and change pagination counters? | <p>I want change <code>1 تا 6 از 36</code>=translator to EN=> <code>1 to 6 of 36</code> after delete row(s)(with click on link <strong>DELETE</strong>) in table.<br>
<strong>EXAMPLE:</strong> total rows is <code>36</code> if we delete <code>3</code> rows, this total row online change to <code>33</code> (like when that select value of select box and change this part of table).<p>
You see this link that be clear: <a href="http://binboy.gigfa.com/admin/accommodation/show" rel="nofollow">http://binboy.gigfa.com/admin/accommodation/show</a> <br>
Here is my full js code: <a href="http://binboy.gigfa.com/files/js/admin.js" rel="nofollow">http://binboy.gigfa.com/files/js/admin.js</a><p></p>
<p>With respect</p>
| javascript jquery | [3, 5] |
3,597,083 | 3,597,084 | Find element within div and add text with jQuery | <p>I'm trying to write a small snippet of jQuery that validates my input fields. If they don't validate I want to write an error message to an empty <code><p></code> tag, only I can't seem to target it correctly. Can anybody see/explain where im going wrong?</p>
<p><a href="http://jsfiddle.net/xG2KS/19/" rel="nofollow">http://jsfiddle.net/xG2KS/19/</a></p>
<pre class="lang-js prettyprint-override"><code>$(".nextform").click(function() {
var empty = $(this).parent().find("li input").filter(function() {
return this.value === "";
});
if(empty.length) {
$(this).find('p.feedback').html('error');
}
});
</code></pre>
<pre class="lang-html prettyprint-override"><code><div>
<li><input type="text" /><br /></li>
<li><input type="text" /><br /></li>
<li><input type="text" /><br /></li>
<li><p class="feedback"></p>
<input type="submit" value="next" class="next" /></li>
</div>
</code></pre>
| javascript jquery | [3, 5] |
4,694,897 | 4,694,898 | How to call javascript on user control | <p>I have webapplication in c# asp.net 4.0 </p>
<p>I have User Control in that I have written javascript :-</p>
<pre><code><script>
function SetValue() {
alert(document.getElementById('offSetClient').value);
}
</script>
<asp:HiddenField ID="clientDateTime" runat="server" />
<asp:HiddenField ID="offSetClient" runat="server" Value="Test"/>
</code></pre>
<p>and this User Control added into a web form.
Please suggest me how can I call this javascript on User Control page load.</p>
| c# javascript asp.net | [0, 3, 9] |
654,768 | 654,769 | Parsing a date in long format from ATOM feed | <p>I get this date in javascript from an rss-feed (atom):</p>
<pre><code>2009-09-02T07:35:00+00:00
</code></pre>
<p>If I try Date.parse on it, I get NaN.</p>
<p>How can I parse this into a date, so that I can do date-stuff to it?</p>
| javascript jquery | [3, 5] |
5,170,623 | 5,170,624 | how can i make $(document).on('touchstart') function work on ipad? | <p>I'm simply toggling the class when a specific button is clicked, when the user clicks outside document i then want to remove the class. This works fine if I change the event to click and test on desktop but on iPad nothing seems to happen. Can anyone offer any suggestions on how to make this work?</p>
<pre><code>$shoppingIcon.on('click', function(e) {
var $this = $(this);
$this.prev($productInfo).toggleClass('active');
});
$(document).on('touchstart', function() {
$productInfo.removeClass('active');
});
</code></pre>
| javascript jquery | [3, 5] |
446,384 | 446,385 | how to create a GCM to send notification using Android phonegap and php | <p>I need the code to send push notification to android device from the php server. i am using phonegap technology. i need the gcm code for android phonegap and php.</p>
<p>Thanks in advance..</p>
| php android | [2, 4] |
3,399,522 | 3,399,523 | Get last child of div in Javascript function | <p>I am taking a fairly simple piece of code and wrapping into a function, the code builds a slide out menu from the items inside a div. I'm now trying to get the last child from a div:</p>
<pre><code>experimentOne('#experimentOne');
function experimentOne(masterContainer) {
var experimentOneMenuButton = $('masterContainer :last-child');
... etc
</code></pre>
<p>However, this returns [] in the log. When I check the width, instead of the 100px it should be, it's 1420 which I'm guessing is the window width.</p>
<p>If I just get the last child of the ID by coding it in everything is fine, but I want the function to be as reusable as possible.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
1,144,107 | 1,144,108 | flexigrid how to access url posted parameters when they are sent to script | <p>Edit to answer:</p>
<p>I have tried the following</p>
<pre><code>$(document).ajaxSuccess (function(ev, xhr, s) {
document.write('url: ' + s.data);
});
</code></pre>
<p>And I just get a blank page - it does write out the right data though, just not the rest of the page</p>
<p>Hi, I am using flexigrid, and im posting parameters to from flexigrid.js to a php script to return json to the grid.
Flexigrid allows me to sort, filter etc. just as jquery should allow.</p>
<p>I want to catch the last posted parameters to flexigrid so that I can build a csv to allow download of the same (full) information.</p>
<p>However, flexigrid wont allow me to access the posted parameters.</p>
<p>Is this because flexigrid script keeps all those parameters in its own scope? I notice a variable/object called sitems inside firebug that basically has all the info I need, but javascript wont let me access it. Is there any way to access parameters sent to flexigrid? any help is much appreciated.</p>
<p>Cheers Ke</p>
| php jquery | [2, 5] |
3,940,697 | 3,940,698 | Is there anything you can do in C++ that you cannot do in C#? | <p>I am trying to figure out if there is anything that you can do in c++ that you absolutely cannot do in c#?</p>
<p>I know that there are platforms that are targeted to native libraries, but I want to know if the lowest level c# can compare with the lowest level c++.</p>
| c# c++ | [0, 6] |
4,806,351 | 4,806,352 | filter to a gridview in c# | <p>I Have a gridview having column
names(batchname,firstname,schedule,startdate,enddate,labname)</p>
<p>I want to add a filter to a gridview. Can I add a filter bellow each column of the gridview header.Or Should i use it outside the gridview? Here I m using it outside the gridview.And fire a event of TextChanged.I have done following code but it doesnt work anymore.Please Suggest a solution.</p>
<p>I have to access data from three tables to show in gridview.The three
table formats are as below,</p>
<pre><code>BatchMaster(batchmasterid,usermasterid,labmasterid,batchname,batchcode,batchdays,startdate,enddate)
UserMaster(usermasterid,title,firstname,middlename,lastname,phoneno);
LabMaster(labmasterid,labname);
</code></pre>
<p>I write a code on textbox change event whitch is taken outside the gridview.</p>
<pre><code>protected void txtSearch_TextChanged(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data
Source=.\\SQLEXPRESS;Initial Catalog=EMS;User ID=sa;Password=sa123");
string query = "SELECT
batchmasterid,usermasterid,labmasterid,batchname,faculty,batchdays,startdate,enddate,LabMaster.labname
FROM BatchMaster,UserMaster Where batchname LIKE '%" + txtSearch.Text
+ "%'";
SqlCommand cmd = new SqlCommand(query, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
gvHeadload.DataSource = ds;
gvHeadload.DataBind();
}
</code></pre>
<p>also I have tried a Join Query. But it doesnt work anymore.
Pls suggest a solution as early as possible.
advanced thank u for ur suggation..</p>
| c# asp.net | [0, 9] |
1,929,591 | 1,929,592 | Div is hidden but again showed up | <p>I have a situation where I have no of Divs on my page , based upon the autorization I want to hide show the data in those Divs , Problem is Divs are not Hidden ,this is my client script code.</p>
<pre><code>function ShowDiv(obj, condition) {
var dataDiv = document.getElementById(obj);
//alert(obj);
if (condition == true) {
dataDiv.style.display = "none";
}
else {
dataDiv.style.display = "block";
}
}
</code></pre>
<p>this is a sample code, when I call this code on button click</p>
<pre><code><asp:Button ID="Button1" runat="server" onclick="Button1_Click" OnClientClick="ShowDiv('Div1','True');" Text="Button" />
</code></pre>
<p>by this code it does hide the div but gain displays it on postback.
also can I hide no of Div on one go. i.e now I'm using getelementbyid is there any grouping alowed in HTML.</p>
<p>Thanks</p>
| javascript asp.net | [3, 9] |
1,005,440 | 1,005,441 | jQuery: Getting value from input array | <p>We have the following form:</p>
<pre><code><form>
...
<table width="100%" cellspacing="0" class="datagrid_ppal">
<tbody>
<tr>
<th scope="row">Area 1 <input name="config_line" type="hidden" value="0,5,50" /></th>
<td class="gantt"> </td>
<td class="gantt"> </td>
<td class="gantt"> </td>
...
</tr>
</tbody>
</table width="100%" cellspacing="0" class="datagrid_ppal">
...
<form>
</code></pre>
<p>What we need is to get the first, second or third from the hidden input value. We have tried this and didn't work:</p>
<pre><code> var value = $('th').children('input:hidden').val();
</code></pre>
<p>Can anyone help us? We would really appreciate it.</p>
| javascript jquery | [3, 5] |
35,140 | 35,141 | Property Scope Issue? | <p>I'm attempting to reference the <code>discount_code</code> property from within the object, but I keep getting the following error. How can I access <code>discount_code</code>?</p>
<p>Error:</p>
<blockquote>
<p>Uncaught TypeError: Cannot call method 'val' of undefined</p>
</blockquote>
<p>HTML:</p>
<pre><code><input type="text" name="txt_discount_code" value="12345" />
</code></pre>
<p>JS:</p>
<pre><code>var cart = {
transaction: {},
discount_code: $('input[name=txt_discount_code]'),
get_cart_items_params: {
page: 'checkout',
s_method: 'get-cart-items',
txt_discount_code: this.discount_code.val()
// txt_discount_code: cart.discount_code.val()
}
};
</code></pre>
| javascript jquery | [3, 5] |
1,691,604 | 1,691,605 | Row_DataBound or Row_Created event in GridView | <p>I have doubt about the <code>Row_DataBound</code> and <code>Row_Created</code> events :</p>
<ol>
<li><p>What is the difference between <code>Row_DataBound</code> and <code>Row_Created</code> events?</p></li>
<li><p>What are the parameters for choosing between these two events?</p></li>
</ol>
| c# asp.net | [0, 9] |
556,886 | 556,887 | Why does it compile? | <pre><code> var cv = (new CustomValidator()
{
ErrorMessage="Formato de telefone inválido",
ControlToValidate = "txtTelefoneIni", //<-- see the extra comma
});
</code></pre>
| c# asp.net | [0, 9] |
4,890,438 | 4,890,439 | jQuery function similar to closest that will return elements outside of the parent chain | <p>Is there any jQuery function similar to closest() that will return elements outside of the parent chain, traversing sideways? For example, I want to call a function foo() on the div source that would return the div target. I know I could navigate using parent() and siblings(), but I need something generic that would go as many levels as needed, up, sideways and down?</p>
<pre><code>var allsources = $('.source');
allsources.click(function()){
$(this).closest('.target').hide();
});
<div class="row">
<div>
<div class="target" ></div>
</div>
<div>
<div>
<div class="source"></div>
</div>
</div>
</div>
<div class="row">
<div>
<div class="target" ></div>
</div>
<div>
<div>
<div class="source"></div>
</div>
</div>
</div>
</code></pre>
<p>EDIT: </p>
<p>My definition of closest: you have an element source. Try to find it down. If find more than one, return one that is less node hoops down/next/prev. If not found, go one level up, and try to find again. Repeat until no parent.</p>
| javascript jquery | [3, 5] |
5,349,567 | 5,349,568 | How to redirect to login page on session time of any of the session created on multiple pages? | <p>I have developed a project having multiple .aspx pages. I am making use of many sessions in almost all the pages. If any of the session gets expire the application is throwing error. I dont want to check the session expiration on all the pages for all the session that i have created. Can anyone suggest me how can i solve this issue.</p>
<p>Thanks in advance</p>
| c# asp.net | [0, 9] |
4,258,694 | 4,258,695 | how a cursor blinks in jQuery text editor? | <p>I am just trying to know a text editor works ( jquery ), I found many jquery text editors on web. My question,the editor itself is not a textarea but an iframe I think, but How the cursonr blinks like a cursor in text area</p>
<p>please check this <a href="http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html" rel="nofollow">http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html</a></p>
<p>If you have a url to how to make a text editor, please let me know</p>
| javascript jquery | [3, 5] |
3,051,599 | 3,051,600 | Astree view not working properly when we embedd this in to div which has scroll | <p>I am using as treeview which is downloaded from the following location:
<a href="http://www.codeproject.com/Articles/43057/ASTreeView-Free-ASP-NET-TreeView-Control" rel="nofollow">http://www.codeproject.com/Articles/43057/ASTreeView-Free-ASP-NET-TreeView-Control</a></p>
<p>There is two images when we drag a node (1. arrow, 2. line )
arrow indicate that dropped node will be child position.
line indicate that dropped node will be parent location.</p>
<p>but we face the problem when i embedd this into div and div has scroll then the arrow sign is not woving properly it slightly displaced below from the original position.
It works fine when there is no scroll bar in the div.</p>
<p>Can anyone have the idea about that, how to set the arrow and line position .</p>
<p>Thanks,</p>
| c# asp.net | [0, 9] |
3,960,982 | 3,960,983 | Jquery Not able to fetch changed value of input field | <p>I am trying to fetch the changed input filed value using jquery which is getting changed javascript event of drop down select.
I simply am not getting where exactly the things are getting wrong. It is something related to dom tree refresh (.live)? Any help/suggestions would be great. Thanks.</p>
<pre><code>/* adding the value to user_val input field id in javascript onload function based on drop down select event*/
document.getElementById('user_val').Value = "abcd";
/* then trying to get value which changed */
$(document).ready(function() {
$("#submits").click(function() {
alert($("#user_val").val());
});
</code></pre>
| javascript jquery | [3, 5] |
5,388,076 | 5,388,077 | How do i buffer an image from external link | <p>I have a external link with an image which i want to stream, but i get this error when i try.</p>
<p>error
"URI formats are not supported."</p>
<p>I tried to stream:
Stream fileStream = new FileStream("http://www.lokeshdhakar.com/projects/lightbox2/images/image-2.jpg", FileMode.Open);
byte[] fileContent = new byte[fileStream.Length];</p>
<p>can anyone put some light on this.</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
860,511 | 860,512 | jQuery DatePicker set time and date | <p>Hello I was asked to modify some code. We got something like this:</p>
<pre><code>$("#expiration_datepicker").datetimepicker( "option", "disabled", false ).attr('value', '');
$("#expiration_datepicker").datetimepicker(
{
dateFormat: 'mm-dd-yy',
showOn: 'button',
buttonImage: '../chassis/images/calendar.gif',
buttonImageOnly: true,
minDate: 0,
maxDate: '+5Y',
duration: '',
<c:if test="${formIsReadonly or form.newsItemId == '-1'}">disabled: true,</c:if>
constrainInput: false,
timeFormat: 'hh:mm'
});
</code></pre>
<p>Looks like this is setting up the date picker</p>
<p>How Can I set it up to default show todays date and time??
like dd-m-yy hh:mm</p>
| javascript jquery | [3, 5] |
5,315,467 | 5,315,468 | Use jQuery $ inside an iframe | <p>I would use an expression like this </p>
<pre><code>$("a[href*='2']").offset().left
</code></pre>
<p>but for iframe's elements ...</p>
<p>I tried this:</p>
<pre><code>$("#inside-slider").contents().attr("a[href*='2']").offset().left
</code></pre>
<p>but nothing. </p>
<p>(inside-slider is my iframe's id)</p>
| javascript jquery | [3, 5] |
2,718,415 | 2,718,416 | User control "ascx" file with C# | <p>I have a user control, basically consists of a tree view and also a drop down list..
The user control shows something like</p>
<p>(For the tree view)</p>
<pre><code> Books
Learn Algebra in 24hrs (30)
Learn Calculus in 1 week (16)
</code></pre>
<p>(For the Drop Down)</p>
<pre><code>--- Books ----
Learn Algebra in 24hrs (30)
Learn Calculus in 1 week (16)
</code></pre>
<p>the designer wants to be able to set a property to "true" or "false" in the ascx file that will hide the count on the right (if true shows, if false hides). The count comes from a database along with the product name.</p>
<p>How can I achieve this?, the do not want to deal with C#, but want to be able to deal with the "ascx" file.</p>
<p>Thank you in advance</p>
| c# asp.net | [0, 9] |
2,747,646 | 2,747,647 | setting up an if else statement to check for a querystring | <p>I'm looking to make an if else statement that does one action if it detects a query string and another action if there isn't one detected. My trouble is in the syntax, I haven't been able to find a good example.</p>
<p>I'm looking for something along the lines of:</p>
<pre><code>if (requisition_id = null)
do this action
else
do this action
</code></pre>
<p>I'm basically looking for the syntax needed to identify the querystring, the rest of the code I've got ready for it.</p>
<p>Any help appreciated</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
2,966,112 | 2,966,113 | If URL contains string then run jQuery function? | <p>On my website id like to run a jQuery function if my url contains the word 'test'</p>
<p>All im trying to do is if my url contains the 'rest' string then add a margin to an element on the page? </p>
<p>Ive added a jSfiddle to try and show what Ive done so far. </p>
<pre><code>$(document).ready(function(){
// How can I check to see if my url contains the word 'TEST' then run the below function?
$('.block-widget').css('margin-top, 252px')
});
</code></pre>
| javascript jquery | [3, 5] |
970,446 | 970,447 | set tooltip based on different element id | <p>i am trying to get different elemenet id and set tooltip to each of them but i cant make it </p>
<pre><code><script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
var data = {
name: "enter your name",
family: "enter your family",
testfamily: "enter your family",
uc1_txtname: "enter your name for Control 1 (User Control1)",
uc2_txtname: "enter your name for Control 2 (User Control2)"
}
function tooltipshow() {
//trying to get different element id and set tooltip, the below code is just a sample
document.getElementbyID(dynamicID).Title = "DynamicTooltip based on element ID";
}
};
</code></pre>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
5,919,885 | 5,919,886 | jQUERY - accordion active state asp.net code behind | <p>Can anyone inform me how to maintain the jquery accordion active state panel when changing pages. Ideally i would like to change in the code-behind however really happy to just get it working.</p>
<p>developing in asp.net 3.5 </p>
<p>Hope this helps</p>
<p>Thanks</p>
| asp.net jquery | [9, 5] |
2,953,703 | 2,953,704 | Adding a line break to box | <p>I have a javascript box popping up with some message in it but I have not found how to add line breaks from code behind and I am asked to make it to do so, here is how it currently works:</p>
<pre><code> Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key",
"function SendBox() {location.href = 'movetopage.aspx';}
if(confirm('Move the items:" + myListOfItems + ". Do you want to continue? ') == true)
{SendBox();};", true);
</code></pre>
<p>That shows ok on the page, but now I need to add the following line</p>
<pre><code>"Clicking OK: Moves the items and continues"
</code></pre>
<p>So the end bos should show like this</p>
<pre><code>Move the items: Books, Magazines, Newspapers. Do you want to continue?
Cliking OK: Moves the items and continues.
</code></pre>
<p>Notice the break between the first line and second line?, I am not sure how to add that into the box given the code I provided for the Page.ClientScript... etc..</p>
<p>How can I add that break line there to the pop up box?</p>
<pre><code> Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key",
"function SendBox() {location.href = 'movetopage.aspx';}
if(confirm('Move the items:" + myListOfItems + ". Do you want to continue?
<BR>
Clicking OK: Moves the items and continues') == true)
{SendBox();};", true);
</code></pre>
<p>I tried adding a break <br> but would not work (makes sense) but i have exhausted options.</p>
| c# javascript asp.net | [0, 3, 9] |
228,079 | 228,080 | Get the element that triggered focusout event | <p>How can i find, what element triggerd focusout event ?</p>
<p>I mean, if i'm focused on some text box, and i click on some element for example div with name (results)), i wan't to get that div attributes.</p>
| javascript jquery | [3, 5] |
1,243,851 | 1,243,852 | Listview getFirstVisiblePosition | <p>i am trying to get the position of the first visible row,which is entirely visible to screen. end of scrolling,if the portion of the row is visible in first row, i need to select next position. how to do this?</p>
| java android | [1, 4] |
4,270,605 | 4,270,606 | jquery blockUI and unblocui | <p>Having issue with unblockUI. It gives compile timne error. syntax error $.unblockUI();</p>
<pre><code><SCRIPT type="text/javascript">
var $ = jQuery.noConflict();
$('#toHide').show().blockUI();
setTimeout('document.getElementById("safeForm15").submit()', 100);
$.unblockUI();
</SCRIPT>
</code></pre>
<p>Purpose is blockUI for a period of time show laoding please wait message then unblockit or go to next page.</p>
<p>after removing } im getting another error: ie </p>
<blockquote>
<p>$("#toHide").show().blockUI is not a
function</p>
</blockquote>
| javascript jquery | [3, 5] |
4,280,900 | 4,280,901 | IE Login Issue (Login page redirecting to itself) | <p>We have a login page in our website named Login.aspx, whenever a user enters username and password and clicks on submit button the user is again redirected to the login page itself.</p>
<p>The status in the page header changes to Logout but the user is redirected to the login page again.This is only happening in IE browser and specially IE8.</p>
<p>After the site is added to Trusted site zone list everything works perfect but if the site is not added to Trusted site zone list then this issue arises.</p>
<p>The website uses a trusted valid SSl certificate then there should be no point of adding site in to Trusted site zone list.</p>
<p>Any Idea guyz ???? </p>
| c# asp.net | [0, 9] |
1,801,864 | 1,801,865 | Get text written in Anchor tag | <pre><code><td class="td1">
<input name="CheckBox" id="c1" type="checkbox" CHECKED="" value="on"/>
<a class="a_c" id="a1">
</td>
</code></pre>
<p>If I know ID of Check box $(#c1) then how can i get text of Anchor tag?</p>
| javascript jquery | [3, 5] |
1,379,552 | 1,379,553 | Is it possible to stop redirection to another link page? | <p>I have already searched a lot, but it seems this can't work.</p>
<p>At the program, there is a jquery ready function to make the click event redirect.</p>
<pre><code>if($.isFunction(link.attr('onclick'))){link.click();return false;}
else{document.location.href=link.attr('href');}
</code></pre>
<p>so in the hyperlink, there are 2 events can make this page redirect to new page, one is <code><a href="aaa">Link1</a></code> the other is onclick event (sorry I am still confused which executes first).</p>
<p>Unfortunately, I can't delete the jquery code..so I can only append new code.</p>
<p>I want to open anew window instead of redirecting, but how can I stop redirecting the action?</p>
| javascript jquery | [3, 5] |
3,156,148 | 3,156,149 | Looking for an image change on mouseover link | <p>Does anyone know of a jquery plugin or a simple javascript which could allow me to change the image depending on the text link I hover over with a mouse.</p>
<p>The image is fixed in one spot, and the links are displayed below. As I hover down the list of links, the image above changes. Any ideas?</p>
<p>Thanks in Advance</p>
| javascript jquery | [3, 5] |
2,788,074 | 2,788,075 | hide on second click | <p>I have a bubble that pops up when you select some text on a document. Now when you select some text, the body click event fires too. On body event, I have code to hide the bubble that pops up when you select some text. The problem is, I want to show the bubble when the text is selected (even though body event has fired) but I want to hide it when clicked anywhere except inside the bubble.</p>
<pre><code>$('body').live('click', function(e) {
if($(e.target).parents('.discuss').length == 0) {
$('.discuss').fadeOut(150);
}
});
</code></pre>
<p>... there is the body event code, now the discuss bubble shows up when some text is selected on the body, the discuss bubble is positioned near the selected text </p>
| javascript jquery | [3, 5] |
1,511,487 | 1,511,488 | dblclick event is triggered after jquery drag and drop | <p>I'm trying to add a double click event to a jquery connected list item. I add the double click event as shown below;</p>
<pre><code>$(a_elements[i]).dblclick(duplicate_building(a_elements[i]));
</code></pre>
<p>this is part of a function that is run after an li drop and loops through each element using the a_elements array. the problem is that once I drop the element in the list the function "duplicate_building" runs anyway, even though I only dropped the element in to the list and that 's just using a single click anyway, can anyone tell me why the double click event is running without a double click and how to stop it?</p>
<p>Many thanks in advance if anyone can spot my mistake</p>
| javascript jquery | [3, 5] |
6,027,188 | 6,027,189 | Passing values from one page to another page in JS | <p>I have one query on JavaScript.</p>
<p>How we can pass values from one page to another page?</p>
<p>I am working with ASP.NET. My requirement is, I need to validate the user, whether his session expired or not. If the session expired then I need to show a pop up with two textboxes to enter his credentials.</p>
<p>In which case I was unable to do that in ASP.NET. So though of doing with the help of JS. But not getting ideas.</p>
<p>I know we can pass values from one page to another using querystring. But as per the security purpose that is not to be used in my app.</p>
<p>Please help me out.</p>
<p>Thanks in Advance.</p>
| javascript asp.net | [3, 9] |
2,264,910 | 2,264,911 | get id parameter and increment count for each click in jquery | <p>I want to get the id value of <strong>c_i</strong>. And each time <strong>c_i</strong> is clicked I want to increment the value at <strong>chk_count</strong>, using jquery</p>
<pre><code><div id='d<? echo $i; ?>' style='margin-bottom:8px; border:#cccccc thin solid; height:25px;'>
<span style='color:#cccccc; margin-right:5px;'><? echo $i; ?></span>
<span><? echo $row_dw_all['d1e']; ?></span>
<span style='position:absolute;right:0px;'>
<input type='checkbox' name='c_i<? echo $i; ?>' id="c_i<? echo $i; ?>" value='<? echo $row_dw_all['dle']; ?>'>
</span>
</div>
<input type="hidden" name="chk_count" id="chk_count" value="" />
</code></pre>
<p>Thanks
Jean</p>
| php jquery | [2, 5] |
3,329,529 | 3,329,530 | changing an images src value when the user scrolls jquery | <p>I'm trying to attach an event handler to the scroll event that changes the value of the image tag's src value by returning a random value from an array of src values (titles)</p>
<p>$( function(titlemagic){</p>
<pre><code>var titles =[
</code></pre>
<p>//ive omitted the actual array contents in consideration of post length</p>
<pre><code> ];
</code></pre>
<p>var rand = Math.ceil(100*Math.random())</p>
<p>$('#id').attr('src', function(){ return titles[(rand)] }).scroll();</p>
<p>});</p>
| javascript jquery | [3, 5] |
477,820 | 477,821 | how to catch multiple ids? | <p>My button is dynamic. So, It has multiple ids say view-123, view-324, view-423 etc. On button click I am calling a <code>jQuery</code> file having:</p>
<pre><code> $(document).ready(function() {
$('tr[id^view-]').click(function() {
alert(this.id)
});
});
</code></pre>
<p>To catch the <code>id</code>, But it is not working?</p>
<pre><code> $('.view').click(function() {
alert(this.id)
});
</code></pre>
<p>This is returning nothing.
html is:</p>
<pre><code>{% for item in users %}
<tr class="row">
<td class="number">{% if item.phone_number %}{{ item.phone_number }}{% else %}-{% endif %}</td>
<td><input type="submit" class="view" name="view-{{ item.phone_number }}" value="View"></td>
</tr>
{% endfor %}
</code></pre>
| javascript jquery | [3, 5] |
5,404,857 | 5,404,858 | disable jquery datepicker | <p>I have used jquery datepicker in my .aspx page. The control is working fine. What i need is to disable the control if the textbox on which it is linked is disabled. For ex. I am showing datepicker on textbox "txtDateOfAssignment". If the Enabled property of this textbox is false then datepicker should not be active on that. </p>
<p>Anybody have an idea?</p>
<p>Thanks in advance.</p>
| asp.net jquery | [9, 5] |
3,416,054 | 3,416,055 | How to Pass Hidden field value in HyperLink control in navigateURL attibute? | <p>Can any one tell me how to pass any hidden filed value in Query string with hyperlink control.please see the problem in below code:</p>
<pre><code><asp:HyperLink ID="hlnkComment" runat="server"
onclick="return GB_show('Comment', this.href, 500, 650)"
ImageUrl="~/Images/Resources/forum.png" ToolTip="Comment" Text="Comment"
NavigateUrl="~/Recruiter/ViewForumComment.aspx?Id=<% hdnReqId.Value %>&Type=R">
</asp:HyperLink>
</code></pre>
| c# asp.net | [0, 9] |
5,198,116 | 5,198,117 | Which thread invokes SensorEventListener.onSensorChanged | <p>From my records it seems that SensorEventListener.onSensorChanged callback is
called by the same thread that registered the callback. I.e there must
be some message-queue synchronization going on in the background which
allows the activitys UI-Thread to handle the callbacks. </p>
<p>That leads to my question: Is there a need to synchronize
SensorEventListener.onSensorChanged with the activitys UI-thread,
assuming that the activitys UI-thread registered the
SensorEventListener?</p>
<p>I cannot find any documentation references, but can see various examples calling invalidate() unsychronized or synchronize the entire callback.</p>
<p>I used something along the lines of </p>
<pre><code>Log.i(TAG, "" + Thread.currentThread().getId());
</code></pre>
<p>to retrieve threading information. </p>
<p>I'm running android 2.1 update1. </p>
<p>Best regards,
Christoph </p>
| java android | [1, 4] |
32,724 | 32,725 | jQuery.get() Variables Scope | <p>I'm working with jQuery's Ajax but in my case I need to store the response in global variables:</p>
<pre><code>var points = Array()
$.get("/data", {"id": 1}, function(data) {
for (var i=0; i < data.length; i++) {
points[data[i].someid] = data[i];
}
alert(points[22].someid.toString()); // it works fine
});
alert(points[22].someid.toString()); // undefined
</code></pre>
<p>However when I try to access the variable points outside of the scope of $.get() I just get an undefined object. But I get the right object inside $.get().</p>
<p>What's the best way/standard to manage context and scope in this case?</p>
| javascript jquery | [3, 5] |
475,757 | 475,758 | JQuery/JavaScript : refactoring nested functions | <p>I have this interesting jQuery function. It basically adds a click handler to link, and when that is clicked, it will load a form to allow the user to edit the content. and the form is submitted by AJAX, and will display a success message when it's done. </p>
<p>The outline is below; needless to say, this is messy. I could have each of the callback as a class method. What other ways are there to refactor nested functions? I am also interested to see if there are ways that variables declare in a parent function still retain its value down to the nested function after refactoring</p>
<pre><code>$('a.edit').click( function() {
// ..snipped..
// get form
$.ajax({
success: function() {
// add form
// submit handler for form
$(new_form).submit(function() {
// submit via ajax
$.ajax({
success: function(data) {
// display message
}
})
})
}}
)
}
</code></pre>
| javascript jquery | [3, 5] |
4,028,754 | 4,028,755 | The notification can't skip to another activity? | <p>my code is</p>
<pre><code>public class AlarmReceiver extends BroadcastReceiver {
public Notification mNotification = null;
public NotificationManager mNotificationManager = null;
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "time up!", Toast.LENGTH_SHORT).show();
mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotification = new Notification(R.drawable.icon, "tip!",
System.currentTimeMillis());
mNotification.contentView = new RemoteViews(context.getPackageName(),
R.layout.notification);
mNotification.contentView.setTextViewText(R.id.tv_tip, "click to see the description");
Intent notificationIntent = new Intent(context,NotificationTip.class);
notificationIntent.putExtra("description", intent.getStringExtra("description")) ;
//notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
notificationIntent, 0);
mNotification.contentIntent = contentIntent;
mNotificationManager.notify(0, mNotification);
}
</code></pre>
<p>}</p>
<p>While when I click the item in notification ,I can't get to NotificationTip activity,so what's wrong with this code?</p>
| java android | [1, 4] |
2,078,657 | 2,078,658 | How can I display a rendered object inside a different class layout? | <p>Okay, so I'm using Rajawali (See: <a href="http://www.rozengain.com/blog/2011/08/23/announcing-rajawali-an-opengl-es-2-0-based-3d-framework-for-android/" rel="nofollow">http://www.rozengain.com/blog/2011/08/23/announcing-rajawali-an-opengl-es-2-0-based-3d-framework-for-android/</a>) to create a 3D sphere with an image of the Earth on it.</p>
<p>I already have the sphere successfully created but now I'm starting to add UI elements around the rotating sphere. Up top, I have a header image and my end goal is to add a click event to the image and have it load up a menu on click. However, I think the reason why my onclick event isn't working is because Rajawali doesn't support touch events yet.</p>
<p>So, now what I'm looking into is somehow creating a normal xml layout with the header image and then <em>loading</em> the render of the 3D sphere into the middle of the layout. Is this possible? How?</p>
<p>If not, then I think I will look into using a different framework for my 3D sphere. Which one is the easiest or has a nice tutorial for a 3D sphere?</p>
| java android | [1, 4] |
1,706,170 | 1,706,171 | Trouble having java and javascript interact | <p>I have seen several questions similar to mine, but none seem to quite answer my question. </p>
<p>I have some javascript in my assets folder, and i want to use a WebView (or any other way that works) to bind a java object to it so that my server can send updates to my js, and then have my js call my java object. </p>
<p>I have tried loadUrl() and loadDataWithBaseURL() and neither seem to work, I use the getURL() after setting it to check it and it always returns null. After looking at the other questions, I can tell I'm referencing the path correctly (or at least the same as them). </p>
<p>I should note that it is a .js file, not an html file with js in it. However, I haven't seen anything saying that doesn't work / I shouldn't do that. </p>
<p>Here is my code to set it:</p>
<pre><code> interacter = (WebView) findViewById(R.id.interact);
interacter.getSettings().setJavaScriptEnabled(true);
interacter.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
interacter.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
interacter.setClickable(true);
interacter.addJavascriptInterface(game, "Android");
//loadDataWithBaseURL was here
Log.i("Path is", interacter.getUrl() +" ");
</code></pre>
<p>Am I doing something wrong, is there a better way to do it, does this even work?</p>
<p><strong>EDIT</strong></p>
<p>I noticed used the loadDataWithBaseURL() wrong (the commented line in my code was where it was), and I am looking into that at the moment. Help on this still appreciated </p>
| java javascript android | [1, 3, 4] |
2,764,744 | 2,764,745 | radio button change style on checked | <p>i have a set of radio buttons. </p>
<pre><code><ul class="ProductOptionList">
<li>
<label>
<input class="RadioButton" type="radio" value="157" name="variation[1]"/>
Lemon (200 ml)
</label>
</li>
<li>
<label>
<input class="RadioButton chosen" type="radio" value="160" name="variation[1]"/>
Lemon and Herbs (200 ml)
</label>
</li>
</ul>
</code></pre>
<p>i want to highlight the one that is selected. </p>
<p>i used this code:</p>
<pre><code>$('input.RadioButton').click(function() {
var chkbox = $(this);
chkbox.is(':checked') ?
chkbox.addClass('chosen') : $chkbox.removeClass('chosen');
</code></pre>
<p>but if a person clicks one variation it works and applies the class, then if they click a second it applies the class to the second but doesnt remove the class from the first. how do i remove the class?
thanks!</p>
| javascript jquery | [3, 5] |
2,296,708 | 2,296,709 | Help translating c++ code to java in the cutting sticks problem | <p>Im not used to code in java so i need help to translate this code to from c++ to java in a functional way. I tried it myself but the result was always 0. It is the CUTTING STICKS PROBLEM.</p>
<pre><code>#include <iostream>
#define MAXINT 2147483647
#define NCUTS 50
using namespace std;
int main() {
int len;
int nc;
int arr[NCUTS+2];
int dp[NCUTS+2][NCUTS+2];
while((cin >> len) && (len != 0)) {
cin >> nc;
for(int i=0; i<nc; i++) {
cin >> arr[i+1];
}
arr[0] = 0;
nc++;
arr[nc] = len;
for(int i=0; i<=NCUTS+1; i++) {
for(int j=0;j<=NCUTS+1;j++) {
dp[i][j] = MAXINT;
}
}
for(int i=0; i<=nc; i++) {
dp[i][i] = 0;
dp[i][i+1] = 0;
dp[i][i+2] = arr[i+2] - arr[i];
}
for(int k=3; k<=nc; k++) {
for(int i=0; i<=nc-k; i++) {
for(int j=i+1; j<=i+k-1; j++) {
if((dp[i][j] + dp[j][i+k] + arr[i+k] - arr[i]) < dp[i][i+k]) {
dp[i][i+k] = dp[i][j] + dp[j][i+k] + arr[i+k] - arr[i];
}
}
}
}
cout << "The minimum cutting is "<< dp[0][nc] << "." << endl;
}
}
</code></pre>
| java c++ | [1, 6] |
2,129,193 | 2,129,194 | jquery sucess dropdown | <p>//codes</p>
<pre><code> success: function(html){
// this is for input box - working
document.getElementById('val').value='';
$('#val').value='';
// how do i set it for dropdown box to reset after sucess?
document.getElementById('val2').value='';
$('#val2').value='';
}
</code></pre>
<p>Once user submit dropdown box, i need it to reset to value="" but now it sticks with user option even after submitted.</p>
<p>Any idea how to achieve that?</p>
| javascript jquery | [3, 5] |
5,559,780 | 5,559,781 | issue with HttpURLConnection OutputStream | <p>I have the following code:</p>
<pre><code>String urlString = API_URL + "/checkins/add";
String inputdata = "v=20111111"+"&venueId="+venueid+"&broadcast="+broadcast+"&oauth_token="+mAccessToken;
String content="";
try {
URL url = new URL( urlString );
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setDoOutput( true );
con.connect();
Log.v("RESPONSE MESSAGE", con.getResponseMessage());
OutputStreamWriter out = new OutputStreamWriter(con.getOutputStream());
out.write(inputdata);
out.flush();
</code></pre>
<p>and I am getting an error:</p>
<pre><code>Exception: OutputStream unavailable because request headers have already been sent!
</code></pre>
<p>why is this?</p>
| java android | [1, 4] |
3,426,741 | 3,426,742 | Android - how to close notification in service started by startForeground? | <p>Say I start a notification via the following in a service of my app:</p>
<pre><code>notification = new Notification(R.drawable.icon, getText(R.string.app_name), System.currentTimeMillis());
Intent notificationIntent = new Intent(this, mainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
initService.notification.setLatestEventInfo(this, getText(R.string.app_name), "ibike rider", pendingIntent);
startForeground(ONGOING_NOTIFICATION, notification);
</code></pre>
<p>How would I go about <code>shutting down/cancelling</code> this service? And would it be possible to do this in another activity? </p>
<p>Thanks.</p>
| java android | [1, 4] |
2,793,899 | 2,793,900 | Load php page results into div with ajax with link? | <p>I am trying to replace an iframe, essentially. I would like to load the result of a php page into a div. The results are being parsed through URL - <a href="http://example.com/view.php?id=1" rel="nofollow">http://example.com/view.php?id=1</a> - for exmaple. Sorry, I don't have much experience with javascript. </p>
<p>The closest example I could find is here: <a href="http://www.w3schools.com/PHP/php_ajax_database.asp" rel="nofollow">http://www.w3schools.com/PHP/php_ajax_database.asp</a></p>
<p>But that is for a select box.</p>
<p>Could anyone else possibly?</p>
| php javascript | [2, 3] |
3,696,056 | 3,696,057 | What is the most cheap way to mix `this` and other selectors in JQuery | <p>what is the best way to mix <code>this</code> with other selectors in JQuery <code>:filter</code>,<code>[id=""]</code> and stuff like this, lets assume we wanna read <code>.val()</code> of an input with <code>name="input"</code> in form with that function is bind to it. </p>
<p>and if possible do they cost different ? if so why ?</p>
<p>here is the form </p>
<pre><code><form>
<input type="text" name="input">
</form>
</code></pre>
<p>like we have this </p>
<pre><code> $("form").submit(function(){
if($(this).valid() == true){ //here i wanna read the value of input with name test}
</code></pre>
| javascript jquery | [3, 5] |
2,357,160 | 2,357,161 | jQuery calling post URL | <pre><code> $.post('controller/method', $("#form").serialize , function(data) {
//alert data
});
</code></pre>
<p>It works if domain name is www.domain.com
It doesn't work if domain name is domain.com/category/</p>
<p>What should I do here? Or I must use PHP to help me? Thanks.</p>
| php jquery | [2, 5] |
1,146,559 | 1,146,560 | Return dynamic object | <p>I have a simple data layer routine that performs a password update, the user passes in the following:</p>
<ul>
<li>Current Password, New Password, Confirm New Password.</li>
</ul>
<p>In my data layer (proc) checks a couple things such as:</p>
<ol>
<li>Is the current password correct?</li>
<li>Is the new password and confirm password correct?</li>
<li>Has the new password been assigned in the past?</li>
</ol>
<p>And so on... </p>
<p>Now I know I can simply create a class and returned a couple booleans:</p>
<pre><code>public class UpdatePasswordResponse{
public bool CurrentPasswordCorrect {get;set;}
....(and so on)
}
</code></pre>
<p>But is there a way I can dynamically return that information to the biz layer in properties instead of creating a new class everytime (for every data layer routine)? I seem to remember thinking this was possible. I am pretty sure I read it somewhere but don't remember the syntax, can someone help me?</p>
| c# asp.net | [0, 9] |
3,784,876 | 3,784,877 | why can't I access this.property in my object literal? | <p>I've just been restructuring my code into objects and using the this keyword, I've got this problem whereby, setting the prop works, but then when the second method fires, <code>myProp</code> is undefined. I've noticed if I use <code>myObj</code> to set and get rather than this it works fine. What's the difference here? What am I doing wrong? I though this was referring to the instance of which there is only one which was automatically instantiated by the object literal.</p>
<pre><code>var myObj = {
SetProp: function (id) {
this.myProp = "abc";
Ajax.GetJSONAfterStandardLogic(Utility.PrefixURL("/ajax/mymethod"), this.SetPropSuccess);
},
SetPropSuccess: function (response) {
console.log("test " + this.myProp);
}
}
</code></pre>
| javascript jquery | [3, 5] |
439,445 | 439,446 | Dialing phone number from Windows Gadget | <p>I'm calling JavaScript function from my Gadget application to dial phone number.</p>
<p>C# code:</p>
<pre><code>HtmlPage.Window.Invoke("CallPhone", string.Format("callto://{0}", Number));
</code></pre>
<p>Java script code:</p>
<pre><code>function CallPhone(Number) {
wnd = window.open(Number);
</code></pre>
<p>}</p>
<p>The function is working well but it opening internet explorer window, i do not know JavaScrip and in a first glance didn't found any other solution.
So is there better solution that allow to dial number wihout opening browser window. </p>
| c# javascript | [0, 3] |
5,216,960 | 5,216,961 | How to organize the custom utility JS functions of my website | <p>During the time my number of custom functions plus initialize calls of my jQuery plugins have grown causing a visual and functional mess.</p>
<p><strong>MY CUSTOM FUNCTIONS</strong></p>
<p>I am looking for a method to organize my custom functions into a library. </p>
<ul>
<li>should I create an object and organize them as methods?</li>
</ul>
<p>e.g.</p>
<pre><code>(function($) {
$.myCUSTOMOBJECT = {};
$.fn.myCUSTOMOBJECT = function(settings) {
var var1 = ...
var var2 = ...
var var3 = ...
function onTextSelectionDoSomething() {...}
function onTextClickDoSomethingElse() {...}
}
});
</code></pre>
<p><strong>MY CONTRIB FUNCTIONS</strong></p>
<p>I have contrib jQuery libraries as fancybox, jcarousel, parallax</p>
<ul>
<li>is it recommended to mergem them into one minified file ?</li>
</ul>
| javascript jquery | [3, 5] |
5,898,990 | 5,898,991 | Web application to accept Tamil font | <p>I am just developing a web application using ASP.Net, which accepts TAMIL font. Here, if I type something in the textbox in tamil, it should be getting saved with the same values whatever I type in it. </p>
<p>For this I just changed the font style of that textbox to BAMINI, with this BAMINI style I can type the words in Tamil, but when I debug the code, the value of the textbox is showing in English only, but I want it should be in Tamil only.</p>
<p>I thought I can fix this by using CultureInfo, and I tried with that. But its not happening. How can I fix this. Can anyone help me out here. Thanks in advance</p>
<p>here is my Style for the textbox,</p>
<pre><code>.tamilTextBox
{
font-family: bamini;
font-size: large;
font-style: oblique;
width: 50%;
}
</code></pre>
<p>and in the code behind am trying like this,</p>
<pre><code>customer.FirstName = txtFirstName.Text.ToString(new
System.Globalization.CultureInfo("ta-IN"));
</code></pre>
| 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.