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,572,395 | 3,572,396 |
Divide columns into groups (rows) based on their cumulative width with jquery
|
<p>I have a number of columns (of varying widths) being generated and I need to divide them into groups or rows based on their widths. Every time the cumulative width of the columns reaches 100% I'd like to group those columns in a new div. </p>
<p>I asked a friend to look into this for me and he came back with this, but I still can't get it working. If anyone can offer any help it would be much appreciated.</p>
<pre><code>$.fn.gridRows = function() {
var cumulativeWidth = 0;
var items = [];
$('.column',this).each(function(index){
var col = $(this);
col.data('index', index);
var percentageWidth = (100 * parseFloat(col.css('width')) / parseFloat(col.parent().css('width')));
cumulativeWidth += percentageWidth;
items.push(index);
if(cumulativeWidth >= 100){
if(items.length == 1){
col.wrap('<div></div>');
}else{
var selector = '*' + items.join('][data-index=').substring(1) +']';
$(selector).wrap('<div></div>');
}
items = [];
cumulativeWidth = 0;
}
});
}
$(document).ready(function() {
$('body .group').gridRows();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,136,534 | 2,136,535 |
How do I redirect page using Javascript to page.php#sample
|
<p>I want refresh page using javascript and go to div id.</p>
<p>Example what I have done is</p>
<pre><code>echo "<script type='text/javascript'>top.location.href = '" . $url . "/page.php#contact';</script>";
</code></pre>
<p>Example the <code>#contact</code> div is on half of page and it's not working, unless I hit the enter button and it goes to the <code>#contact</code>.</p>
<pre><code><div id="contact">Contact</div>
</code></pre>
<p>If with php can be done</p>
<pre><code>header('Location:/page.php#contact');
</code></pre>
<p>Let me know the correct way to do this</p>
|
php javascript
|
[2, 3]
|
2,031,104 | 2,031,105 |
user control using javascript
|
<p>I want to make a kind of user control using javascript.</p>
<pre><code><div id="myDiv">
<input type="text" id="myText" />
</div>
</code></pre>
<p>I want to insert this div in my HTML markup, wherever I required. Purpose is to make it reusable at various places in my HTML and maintain a single point of change, if I need to change the control in future. I would like to have a javascript function for it. I need best possible ways to do it maybe using jquery.</p>
|
javascript jquery
|
[3, 5]
|
136,984 | 136,985 |
I am confused between PHP and ASP.NET to choose as a career in Indian software development context
|
<p>I need your help(specially from the software professionals of India). </p>
<p>I have completed MCA in 2009. After that instead of joining software company I did a Teaching job nearby by home. In the mean time I prepared myself for public sector jobs(bank). I continued my job for 1 year more and left it in 2010. </p>
<p>Now in 2012 ,I feel that I should have done the software jobs,so that I could earn my bread and butter and in the mean time I could have prepared for the job.Because,according to my qualification it will give me the best salary.</p>
<p>Now I want to go back in software industries. Now all of them are asking for experiences.And I don't have any.....So which language should I learn?</p>
<p>And what should I do,because I have two year gap. Some of my friends suggested me to go with PHP as its easier and quicker to get job in India. But Here the PHP guys are getting less salary as compared to ASP.NET.</p>
<p>I am planning to begin with PHP and but is it possible to switch to ASP.NET after two years experience.</p>
<p>JAVA: I know upto servlet & JSP. Which is nothing in current market.</p>
<p>ASP.NET: I know the basics of asp.net upto database connection ie(Gridview).</p>
<p>PHP: Only the basics. </p>
<p>So what should I do now. Which is most demanding. Does PHP is good, I feel its more like JSP pages. </p>
<p>Please guide me, All your suggestions are needed for me.</p>
|
php asp.net
|
[2, 9]
|
2,919,191 | 2,919,192 |
javascript stacking bug
|
<p>I have this code:</p>
<pre><code> $jq('.pop-tip').click( function(event) {
width = '';
height = '';
var img = new Image();
img.onload = function() {
width = 'width='+(this.width + 240);
height = 'height='+(this.height + 360);
}
img.src = 'http://www.domain.com/uploads/2011/10/dealoftheweek.jpg';
destination = $jq(this).attr('title');
postPop = $jq(this).attr('href');
alert ( width );
window.open(postPop, 'tip_pop',''+ width +', '+ height +', scrollbars=0' ).focus();
window.open(destination, '_parent','' );
event.preventDefault();
)};
</code></pre>
<p>For some reason it only works with the alert() just above the window.open call why is this and how can i fix it?</p>
|
javascript jquery
|
[3, 5]
|
3,312,182 | 3,312,183 |
filtering the records in the second grid according to the selection in the first in .Net
|
<p>which control can i use?, how to do this .Net?</p>
|
c# asp.net
|
[0, 9]
|
5,721,803 | 5,721,804 |
How to create jQuery if statements from php array?
|
<p>I have array with both image colour and image id values.</p>
<p>I can echo this info, but I don't know how to get this into js file.</p>
<p>My js file is like this:</p>
<pre><code>$(document).ready(function(){
var colour = false;
$('.options').click(function(){
colour = $(this).val();
console.log(colour);
if(colour == 'White'){
var imageid = 758;
}
else if(colour == 'Black') {
var imageid = 752;
}
else if(colour == 'Light Oak') {
var imageid = 755;
}
else if(colour == 'Rosewood') {
var imageid = 757;
}
else if(colour == 'Green') {
var imageid = 754;
}
else if(colour == 'Red') {
var imageid = 756;
}
else if(colour == 'Blue') {
var imageid = 753;
}
else {
var imageid = colour;
}
$('.options-input').val(imageid);
console.log(this);
$.post("index.php", { image_id: imageid }, function(results) {
$('body').html(results);
console.log(results);
});
console.log(url);
});
});
</code></pre>
<p>I am doing this manually at the moment and on click I can post imaged to my index.php</p>
<pre><code>$_POST['image_id'];
</code></pre>
<p>Works from there.</p>
<p>Problem is that I want to create js statement dynamically depending on what values new array will have.</p>
|
php jquery
|
[2, 5]
|
4,749,254 | 4,749,255 |
Restarting countdown clock
|
<p>This is how it looks currently:</p>
<pre><code>final CountDownTimer countdown = new CountDownTimer(5000, 1000) {
public void onTick(long millisUntilFinished) {
clock.setText("Seconds Remaining: " + millisUntilFinished / 1000);
}
public void onFinish() {
qcount++;
if (qcount < 10)
{
this.start();
switch (diff) {
case 0: //Novice difficulty
</code></pre>
<p>but it says the countdown variable isn't used and it doesn't run at all in the app.</p>
|
java android
|
[1, 4]
|
5,579,130 | 5,579,131 |
accessing multiple instances in jquery
|
<p>so i have a page of products, and for each one i want to cycle through some images on mouseover, and have it stop on mouseout. the following code is my current state...</p>
<p>initially i had it working where it checked a global variable called repeatCycle to see if it should rotate to the next image. this caused problems because all the instances of this function were checking & setting the same variable. i would often get multiple instances running at once. so i want to set something for each instance instead, but was not able to do it.</p>
<p>i also tried passing it in as an argument to the function, but on the mouseout event when i passed in repeatCycle: false, it would just initialize another instance.</p>
<p>anyone have any suggestions as to how to accomplish this?</p>
<pre><code>$.fn.image_cycler = function(options){
// default configuration properties
var defaults = {
fade_delay: 150,
image_duration: 1500,
};
var options = $.extend(defaults, options);
this.each(function(){
var product = $(this);
var image = $('div.image>a.product_link>img', product);
var description = $('div.image>div.description', product);
var all_images = $('div.all_images', product);
var next_image = ($(all_images).find('img[src="' + $(image).attr('src') + '"]').next('img').attr('src')) ? $(all_images).find('img[src="' + $(image).attr('src') + '"]').next('img') : $(all_images).children('img').first();;
// mouseover
image.fadeOut(options.fade_delay, function(){
image.attr('src', next_image.attr('src'));
image.fadeIn(options.fade_delay);
});
if (this.repeatCycle){
var loop = function() {
return this.image_cycler(options);
}
setTimeout(loop,options.image_duration);
}
});
};
$(document).ready(function() {
$('div.product').hover(function(){
$(this).image_cycler();
}, function(){
$(this).image_cycler.repeatCycle = false;
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,358,876 | 1,358,877 |
JavaScript not detecting change
|
<p>I am sure this is easy but I've looked all over with no luck. I have written a paging jQuery script that animates a list on my page. I have next and previous buttons which I am showing/hiding depending on where you are in the list however it doesnt pick up the position change the first time. Here is my code in jsFiddle:</p>
<p><a href="http://jsfiddle.net/mikeoram/t4787/" rel="nofollow">http://jsfiddle.net/mikeoram/t4787/</a></p>
<p>I'm sure I'm only missing something simple, all suggestions would be helpful.</p>
<p>Please only answer my question, there are reasons I'm doing it the way I am, and i no it can be done differently.</p>
<p>Thanks,</p>
<p>Mike</p>
|
javascript jquery
|
[3, 5]
|
3,329,622 | 3,329,623 |
How check at lease one checkbox is checked inside ASP.NET repeater control in Javascript
|
<p>In my asp.net website; i have REPEATER control having child control checklistbox , dynamically generates in code behind.</p>
<p>I would like to know how can i write javascript function where i have to check at least one checkbox should be checked.</p>
<p>Ho can i acheive? Please Help?</p>
|
javascript asp.net
|
[3, 9]
|
3,994,155 | 3,994,156 |
jQuery : displaying a div according to which image i clicked on
|
<p>i'm having a trouble to display text according to images i clicked on.</p>
<pre><code><ul id="boutique1">
<li><a href="#first"><img src="images/image1.jpg">nothing</a></li>
</ul>
</code></pre>
<p>When i click on these first link, i want to display that : </p>
<pre><code> <p id="first" style="display:none;">Hello World</p>
</code></pre>
<p>Into this div :</p>
<pre><code><div id="alert"></div>
</code></pre>
<p>Now, i have this jQuery function :</p>
<pre><code>$('#boutique1 a').live('click',function(){
$('#alert').html( $($(this).attr('href')) ).slideDown();
setTimeout(function(){ $('#alert').slideUp() },5000)
});
</code></pre>
<p>I don't know why it's not working.</p>
<p><strong>I only got the #alert div who is showing up empty</strong></p>
<p>thanks</p>
|
javascript jquery
|
[3, 5]
|
1,356,569 | 1,356,570 |
Javascript IF loop takes false and execute the true loop with jquery
|
<p>Here is jquery code in rails app. The purpose of the code is to eval the value of #rfq_need_report and show the #rfq_report_language if need_report is true or hide if false:</p>
<pre><code>$(document).ready(function() {
var rpt = $('#rfq_need_report').val();
alert(rpt);
if (rpt) {
alert(rpt);
$('#rfq_report_language').show();
alert('show');
} else {
$('#rfq_report_language').hide();
alert(rpt);
alert('hide');
}
}); // end ready
</code></pre>
<p>The alert here is just for debug. The rpt is false, however alert('show') gets executed. It seems that the if loop is taking false and decided to execute the loop for true. Sometime If loop is working and sometime it does not. What could cause this strange behavior? Thanks.</p>
|
javascript jquery
|
[3, 5]
|
4,103,669 | 4,103,670 |
Escaping special characters in JavaScript
|
<p>I need a method in JavaScript to escape all characters which are not ( a-z / A-Z / 0-9 / - / _ )</p>
<p>If the character is ø it should be replaced with oe, if it's å then replaced with aa, and more.... if characters are not on the list, they should be replaced with an underscore.</p>
<p>If there are 2 underscores in a row ( __ ) they should be replaced with a single underscore.</p>
<p>I need this done in JavaScript and/or PHP.</p>
|
php javascript
|
[2, 3]
|
5,101,824 | 5,101,825 |
How to create a working array with images in Android?
|
<p>I have been struggling to work with images using an array for my android application , i had created an array with a few images but even after i use a loop only 1 image gets loaded on the imageview i.e the last image present in the array so here only 'fourofclubs.png' is getting loaded. Basically i want to load images as a sequence using a loop on a single ImageView 'image1'.</p>
<p>this is my code:-</p>
<pre><code> ImageView image1=(ImageView)findViewById(R.id.imageView1);
int[] cardsdeck =
{
R.drawable.aceofclubs,
R.drawable.deuceofclubs,
R.drawable.threeofclubs,
R.drawable.fourofclubs,
};
for ( int i = 0; i < cardsdeck.length; i++ )
{
image1.setImageResource(cardsdeck[i]);
}
</code></pre>
|
java android
|
[1, 4]
|
2,285,108 | 2,285,109 |
libEGL called unimplemented OpenGL ES Api Android
|
<p>I have looked through the solutions on stackoverflow and none of them seem to fix my problem. I have included the API in my manifest file:</p>
<p>
</p>
<pre><code><uses-sdk android:minSdkVersion="10" />
<uses-feature android:required="true" android:glEsVersion="0x00020000"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".HidderActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</code></pre>
<p></p>
<p>and my wrapper code is:</p>
<pre><code>class GLSurface extends GLSurfaceView
{
final renderer r;
public GLSurface(Context context)
{
super(context);
setEGLContextClientVersion(2);
r = new renderer();
setRenderer(r);
setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
}
</code></pre>
<p>}</p>
<p>Other than that I don't know what else to supply. Let me know if anything else is needed! Right now the error is:</p>
<pre><code> Called unimplemented OpenGL ES API
</code></pre>
|
java android
|
[1, 4]
|
4,064,117 | 4,064,118 |
ASP.NET Button causes a postback
|
<p>I have an asp.net button on the page. I am trying to do this:</p>
<pre><code> $("#btn").click(function(e) {
e.preventDefault();
alert('hi');
}
</code></pre>
<p>But the alert never shows up. I have to use an ASP.NET button only and not a HTML one. </p>
|
asp.net jquery
|
[9, 5]
|
4,300,546 | 4,300,547 |
Get string from url using jQuery?
|
<p>Say I have <code>http://www.mysite.com/index.php?=332</code></p>
<p>Is it possible to retrieve the string after <code>?=</code> using jQuery? I've been looking around Google only to find a lot of Ajax and URL vars information which doesn't seem to give me any idea.</p>
<pre><code>if (url.indexOf("?=") > 0) {
alert('do this');
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,961,493 | 5,961,494 |
Button won't re-enable it self using jQuery
|
<p>I can't figure out why my button won't re-enable when another button is clicked. Any help will be most appreciated</p>
<p>My code is as follows: </p>
<pre><code>$(document).ready(function() {
$('#btnAdd').click(function() {
// enable the "remove" button
$('#btnDele').attr('disabled','');
}
});
</code></pre>
<p>demo here: <a href="http://jsfiddle.net/ATzBA/2/" rel="nofollow">http://jsfiddle.net/ATzBA/2/</a></p>
|
javascript jquery
|
[3, 5]
|
2,018,371 | 2,018,372 |
What's the best way to detect a 'touch screen' device using JavaScript?
|
<p>I've written a jQuery plug-in that's for use on all browsers and mobile devices and I wondered if there was a way with JavaScript to detect if the device has touch screen capability. I'm using the jquery-mobile.js to detect the touch screen events and it works on iOS, Android etc but I'd like to be write conditional statements based on whether it has a touch screen.</p>
<p>Is that possible?</p>
<p>Many thanks</p>
|
javascript jquery
|
[3, 5]
|
879,865 | 879,866 |
AndroidHttpClient and DefaultHttpClient
|
<p>Is there much difference between those two and which one is preferably to use?</p>
|
java android
|
[1, 4]
|
1,177,159 | 1,177,160 |
Measure window Non-Html Height?
|
<p>Is there any way of measuring the Height of the selected section by Javascript / JQuery ?</p>
<p><img src="http://i.stack.imgur.com/74hzT.jpg" alt="enter image description here"></p>
|
javascript jquery
|
[3, 5]
|
3,513,997 | 3,513,998 |
android html links
|
<p>Using this code <code>map.put(TAG_LINK, "" + Html.fromHtml(link));</code> i am able to parse json hyperlinks into my view. But the problem is it will only show me the word and i`m not able to click on it. For example if i have </p>
<pre><code><a href="http://something"> CLICK </a>
</code></pre>
<p>, i can only see CLICK but i cant click it. I understand there is more to html.fromhtml to work, setMovementMethod. BUt i don't know how to use it with map.put. Can someone help me with this?</p>
|
java android
|
[1, 4]
|
2,330,565 | 2,330,566 |
What's the best way to reuse Javascript routines in VS2008?
|
<p>Probably a dumb question, but is it still using "Include files"?</p>
|
asp.net javascript
|
[9, 3]
|
4,237,052 | 4,237,053 |
Should i check if a custom object is dirty before updating
|
<p>So i was wondering about this today. Is there really any need to check if a custom object of mine is dirty or not before updating the object? The way i look at it is, checking and setting the object for a dirty state is just more calls the server has to make as opposed to making one call to the database. If the object has not changed then nothing will change but i will still have the information on lastupdated and lastupdatedby to see someone did that. What are other peoples thoughts on this? Is it just a matter of personal preference?</p>
|
c# asp.net
|
[0, 9]
|
3,101,812 | 3,101,813 |
Ringtone saving but have to set manually
|
<p>I have a soundboard app and i am wanting to get the sounds to save as ringtone or notification when the button is long clicked which works fine but then the user would have to go and set the ringtone in the sound tab.</p>
<p>I would like if its possible for the ringtone to save and be set as defualt so it overrides the current ringtone that is being used is this possible.</p>
<p>Thanks in advance.</p>
<pre><code>sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));
File k = new File(path, filename);
ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());
values.put(MediaStore.MediaColumns.TITLE, "Benton");
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values.put(MediaStore.Audio.Media.ARTIST, "weee");
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, false);
values.put(MediaStore.Audio.Media.IS_ALARM, true);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);
//Insert it into the database
this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);
return true;
}
</code></pre>
|
java android
|
[1, 4]
|
11,839 | 11,840 |
Is there a way to display the content of a http link in a feed?
|
<p>If I have www.google.com, and I am displaying it in a feed, is there a way to show the contents of that link the way facebook does? I.e. when I paste the link into the text input, it will display part of the contents of the link and a picture of it?</p>
<p>Edit:
Sorry I meant something like the attached.Do you see how when NBA Jam puts the link there is content underneath? <img src="http://i.stack.imgur.com/oj2IF.png" alt="enter image description here"></p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,312,807 | 1,312,808 |
Keep app running in background
|
<p>i made an application which keep the screen awake, and it works fine until it gets killed by the system.
How can i keep my app running in background?
I see a lot of apps that uses notifications to stay running and avoid being killed, but i don't know how to implement it.
Can someone help me achieve this?</p>
|
java android
|
[1, 4]
|
628,461 | 628,462 |
How to work around Response / Server which does not exist in the context?
|
<p>I have this C# ASP.NET 4 website.</p>
<p>I would like to have a general method in a class which will include a Response.Redirect or Server.Transfer in it to a specific page.</p>
<p>Both names, Response and Server, does not exist in the context.</p>
<p>How to work this around?</p>
<hr>
<p>as for the comment by @Maess, please consider something like this (edited):</p>
<p><strong>ASPX:</strong></p>
<pre><code><asp:Button onclick="MyClass.btnRedirect_Click" ID="btnMyButton" Text="MyButtonText" runat="server" />
</code></pre>
<p><strong>Code behind:</strong></p>
<pre><code>public static void btnRedirect_Click(object sender, EventArgs e)
{
Response.Redirect("~/SomePage.aspx");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
142,099 | 142,100 |
stream webcam via webpage asp.net
|
<p>H,</p>
<p>How do I stream my webcam through a webpage in c# using asp.net</p>
<p>Thanks
Sp</p>
|
c# asp.net
|
[0, 9]
|
923,332 | 923,333 |
Why is the dblclick event working like the click event?
|
<pre><code>$('#ajax-links a').live('click', function(e) {
var url = $(this).attr('href');
url = url.replace(/^.*#/, '');
$.history.load(url);
return false;
});
</code></pre>
<p>Whenever I replace 'click' with 'dblclick' it still behaves as the click event. The demo is here (http://www.serpere.info/jquery-history-plugin/samples/ajax/) and the source can be download from here : <a href="https://github.com/tkyk/jquery-history-plugin/tree/master/samples/" rel="nofollow">https://github.com/tkyk/jquery-history-plugin/tree/master/samples/</a></p>
|
javascript jquery
|
[3, 5]
|
389,308 | 389,309 |
get to the label inside an iframe
|
<p>Can someone please show me how to get to <strong>label1</strong> inside the iframe via JavaScript?</p>
<p><strong>WebForm1.aspx</strong></p>
<pre><code><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div class="calendar">
<iframe src="WebForm2.aspx"></iframe>
</div>
</form>
</body>
</html>
</code></pre>
<p><strong>WebForm2.aspx</strong></p>
<pre><code><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr><td class="default"><label id="label1">Label1</label></td></tr>
</table>
</div>
</form>
</body>
</html>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
3,489,405 | 3,489,406 |
Is java still a relevant language?
|
<p>I want to learn a nice easy to use versatile language. I do know some Java, but is it relevant? Or should I move on too JavaScript with the advent of HTML5?</p>
|
java javascript
|
[1, 3]
|
4,271,006 | 4,271,007 |
how can i create dynamic page in asp.net (C#)?
|
<p>i add one page First.aspx in website. on First.aspx page i have one button
on click of that button the new dynamic page can be open.
how can i do this.
remember the new page is not in website this page create at runtime and dynamic also
please help me out</p>
|
c# asp.net
|
[0, 9]
|
4,796,706 | 4,796,707 |
jquery ui datepicker like input widget
|
<p>i' like to make some jquery widget, which will have behavior like jquery ui datepicker:
it should appears when focus on input tag and this widget and should be hidden when
user mouse focus not in this widget and input tag,
can you help me to say the right way to implement this behavior</p>
<p>thanks</p>
|
javascript jquery
|
[3, 5]
|
2,207,837 | 2,207,838 |
Added javascript and now links don't work
|
<p>I added javascript to detect when a link is clicked, which works properly, however now the links aren't working (ie. they don't take the user to the linked page).</p>
<p>HTML:</p>
<pre><code><div class="designflow" style="padding-left:50px;padding-right:0px;padding-top:0px;padding-bottom:15px;margin-top:0px;float:left; font-size:18px; color: gray; height:150px; width:150px;margin-left:auto;margin-right:auto;display:inline-block;">
<a href = "/manufacturing/" class = "designflow" id = "manufacturing">
<img src="{{STATIC_URL}}pinax/images/manufacturing.png" width = "150px" style=margin-bottom:0px;" alt=""><br>
<p style="position:absolute;bottom:25px;padding-left: 0px; padding-right:0px; width:150px;text-align:center;">Manufacturing</p></a>
</div>
</code></pre>
<p>JQUERY:</p>
<pre><code>jQuery( 'div.designflow a' )
.click(function() {
do_the_click( this.id );
return false;
});
function do_the_click( designstage )
{
alert(designstage);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,172,497 | 4,172,498 |
Creating a generic data editing user control
|
<p>I have a user control which has a Gridview and a listview, I want to make this control generic so that I can just pass the type of the class I want to edit, which would be a linq entity, and then it would automatically do the rest, so far I havent had any success and I was wondering if anybody knows a tutorial or some info about doing this?</p>
|
c# asp.net
|
[0, 9]
|
3,254,079 | 3,254,080 |
Caching data in fields in form input
|
<p>I have a small form with two fields: login + password.
I would like when a user gets connected by entering valid credentials, and when he comes back for new login, to cache data in form fieds. Like when we go to the gmail interface and find the email address and password are already in the fields and we just have to submit.</p>
<p>This does not work on my website.</p>
|
php javascript
|
[2, 3]
|
809,897 | 809,898 |
Switching Views inside a TimerTask - Android
|
<p>I have the following code that responds to a button click, changes the view and then after 5 seconds switches the view back:</p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu);
Button test = (Button)findViewById(R.id.browseLocation);
test.setOnClickListener(testListener);
}
private TimerTask revert = new TimerTask(){
@Override
public void run() {
setContentView(R.layout.menu);
}
};
private OnClickListener testListener = new OnClickListener() {
public void onClick(View v) {
setContentView(R.layout.test);
Timer tim = new Timer();
tim.schedule(revert, 5000);
}
};
</code></pre>
<p>However this code does not work. The run method of the timetask is hit but setContentView fails. I assume it has something to do with scope inside the timetask.
How can I achieve the desired result?</p>
|
java android
|
[1, 4]
|
3,577,161 | 3,577,162 |
load dynamically jquery
|
<p>I'm using the following script to load jquery in the head in case if is not already loaded.</p>
<pre><code><script type="text/javascript">
if(!window.jQuery)
{
var script = document.createElement('script');
script.type = "text/javascript";
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(script);
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$("#nav li:has(ul)").hover(function(){
$(this).find("ul").slideDown();
}, function(){
$(this).find("ul").hide();
});
});
</script>
<style>
#nav {position: fixed; white-space:nowrap;}
#nav ul{ list-style-type:none; margin:0; padding:0; }
#nav li { float:left; padding:0; margin:0;list-style: none;}
#nav li a { width:220px; display:block; text-align:center; color:#000; margin-right:5px; height:35px; line-height:35px; text-decoration:none; font-size:90%; border:1px solid #ccc;text-transform: uppercase;font-weight: bold; }
#nav li a:hover { color:#f00; }
#nav ul ul { display:none; position:absolute; z-index:999; }
#nav li li { float:none; }
#nav li li a { background:#EBE7E6!important; text-align:left; height:auto; line-height:1; width:auto; padding:8px 20px 8px 22px; border:1px solid #D0D0D0; border-top:none; margin-right:0;width: 178px; }
* html li li { display:inline; } /* IE6 Bugfix... */
</style>
</code></pre>
<p>but it doesn't appear in the head. </p>
|
javascript jquery
|
[3, 5]
|
3,362,921 | 3,362,922 |
AES encryption for iOS and Android
|
<p>We are creating same project in android and iPhone. Now the problem is that we need to send some information to php server using web service in aes encrypted form. We both have implemented it but results are different so is there a common AES encryption method which will produce same result and can be parsed at the php server.</p>
|
android iphone
|
[4, 8]
|
215,484 | 215,485 |
Get raw data from Http Request?
|
<p>I want to save the raw, full data of an <code>HttpRequest</code>. At the moment I have this:</p>
<pre><code>Request.ContentEncoding.GetString(Request.BinaryRead(int.MaxValue));
</code></pre>
<p>But this only gets the body of the HttpRequest. I also want to get the headers. In the raw form, http requests are transfered as header fields followed by the body, so it should be possible to get the raw text representation of the whole request, but I can't work out how.</p>
|
c# asp.net
|
[0, 9]
|
3,359,943 | 3,359,944 |
javascript method extension
|
<p>I need to call "MyOtherFunction" when "MyFunction"(which creates an element) completes, without MyFunction knowing what MyOtherFunction is to update according to created elements.</p>
<p>The reason I need this is for extension of a jquery powered fileupload User Control that is used in several places with different functionality. A specific page shows a header and file count for it, and when the upload completes, I need to modify the file count according to how many files are displayed(by created elements) I thought :</p>
<pre><code>$(UserControl).on(MyFunction, UploadElem, MyOtherFunction);
</code></pre>
<p>but this route is not accomplishing anything. The most I can alter the User Control is add in a function call, but without effecting the original user control functionality.</p>
<p>I'm not sure if because MyFunction isn't an event and doesn't bubble up or if it just isn't possible to use a defined function as a parameter of .on() is the reason I cannot get this code to work. Any suggestions?</p>
|
javascript jquery
|
[3, 5]
|
2,879,254 | 2,879,255 |
Call focus() after jQuery append() is completed
|
<p>I have an <code>append()</code> and a <code>focus()</code> which is set to focus the first input in the appended <code>dom</code>. </p>
<p>IE is taking time to append and so the focus is not working. Is there a way (other than <code>setTimeout</code>) to set the focus after the <code>dom</code> is fully appended? </p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
5,286,249 | 5,286,250 |
How to count online people connected to my web site with jQuery or st?
|
<p>i created a web site with asp.net 4.0 and now i need to count online people that connected to my web site.
how do i do this with JQuery?</p>
|
jquery asp.net
|
[5, 9]
|
3,472,883 | 3,472,884 |
Public class with only public static members
|
<p>I have a public class that only contains public static members.</p>
<p>I know this is not the best thing to do but I was just wondering why on my Android, if I pause the application, open a few others and come back to mine, all variables seems to be (null).</p>
<p>Questions:</p>
<ol>
<li>Is it because of some kind of a memory release made by Android?</li>
<li>What then could be a better way to keep such variables?</li>
<li>Is a class that extends Application a good option?</li>
</ol>
<p>Here is my code:</p>
<pre><code>public class Session {
public static String ID = null;
public static String UNIQID = null;
public static String TOKEN = null;
public static String SESSIONID = null;
}
</code></pre>
|
java android
|
[1, 4]
|
2,250,943 | 2,250,944 |
Select some images in android
|
<p>I am learning touch and working on a project in which there are many images of alphabets say</p>
<p><code>X I A O W I E P</code> Now i want to select few images using touch and drag to select more than two images. Lets say i selected <code>xia</code> , now i want to show this on <code>editText field</code>. </p>
<p>How can I do that? suppose the names of images are x.jpg and I.jpg etc to make it easy</p>
<p>Best Regards</p>
|
java android
|
[1, 4]
|
4,909,641 | 4,909,642 |
JQuery how to apply on list of selectors
|
<p>I'm newby with Jquery and I'm trying to find out how to apply on a list of selectors. Sometimes I need to be able to differentiate c1,c2 and c3. For others I'd like to apply to the three something</p>
<pre><code>$c1 = $div.find('#widget-row-c').sortedList();
$c2 = $div.find('#widget-col-c').sortedList();
$c2 = $div.find('#widget-filter-c').sortedList();
$containers = ? // as $c1 + $c2 + $c3
$c1.doSomethingForC1(); // only for c1
$containers.doSomethingForC1C2C3(); // for all three
</code></pre>
<p>How it's possible to do this ?</p>
|
javascript jquery
|
[3, 5]
|
3,255,490 | 3,255,491 |
Getting the next element with the same class during the page scroll with jQuery
|
<p>On a page I have 10 elements with the same class name:</p>
<pre><code><span class="simpleclass">text</span>
</code></pre>
<p>What I'm trying to do is - go to the next element with class "simpleclass" when the page is scrolled. That means that for the first time when I scroll the page I need to get a reference to the second span with class "simpleclass" on the page, etc. Could anybody help me to figure out how this can be achieved? </p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,002,057 | 1,002,058 |
javascript code to hide
|
<p>I'm trying to write javascript code where there is an object called "costCenter" which the visibility should be false. but when i click on the "computer" item on my dropdownlist it will set the "costcenter" visibility to true.</p>
<p>so far this is what i have. is this the proper use of syntax for javascript?</p>
<pre><code>function hideMe()
{
var g = document.getElementById('costcenterid');
var e = document.getElementById('dg_form_ctl02_DropDownList1');
if(e == 'computer')
{
g.style.display = 'block';
else
g.style.display = 'none';
}
}
</code></pre>
<p>C# code behind</p>
<pre><code>ClientScript.RegisterStartupScript(GetType(),"hwa","hideMe();",true);
</code></pre>
<p>i found this code from somewhere, but i'm not sure what goes in the "hwa"</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
2,319,816 | 2,319,817 |
Javascript ContextMenu in IE7
|
<p>We are using div tag in aspx and javascript functions to show context menu in our web application. In IE6 the sub menus in the context menu are getting displayed at the correct x and y coordinates what we have hard-coded in our application. But in IE7 and IE8, the sub menus are getting overlapped and in some machines the menus are going behind the window. Can any one please tell what is wrong or any other alternatives to display conext menu and submenu?</p>
<pre><code><HTML>
<HEAD>
<TITLE>Nested popup windows</TITLE>
<script>
var firstPopupDiv = null;
var popup = null;
var vpopup = null;
function tag_onclick()
{
var popup = window.createPopup();
var div = popup.document.createElement("DIV");
div.style.backgroundColor = "green";
div.style.width = 200;
div.style.height = 200;
div.onclick = div_onclick;
popup.document.body.appendChild(div);
firstPopupDiv = div;
vpopup = popup.document.parentWindow;
popup.show(30, 30, 200, 200, maindiv);
}
function div_onclick()
{
var fpopup = vpopup.createPopup();
fpopup.document.body.innerHTML = "<div id=\"MarkupSubMenu\" style=\"position:relative\">&nbsp;&nbsp;Markups</div>";
fpopup.document.body.style.backgroundColor = "red";
fpopup.show(230, 30, 200, 200, firstPopupDiv); // Not shown at 230!
}
</script>
</HEAD>
<BODY>
<div id="maindiv" onclick="tag_onclick()">Click me</div>
</BODY>
</HTML>
</code></pre>
|
asp.net javascript
|
[9, 3]
|
4,003,627 | 4,003,628 |
Collect tr ids using jquery
|
<p>Here I have a table structure </p>
<pre><code><table>
<tr>
<th>F name<th>
<th>L name<th>
<th>Add<th>
</tr>
<tr id="test3">
<td>ssss</td>
<td>sss</td>
<td>sss</td>
</tr>
<tr id="test2">
<td>ssss</td>
<td>sss</td>
<td>sss</td>
</tr>
<tr id="test1">
<td>ssss</td>
<td>sss</td>
<td>sss</td>
</tr>
</table>
</code></pre>
<p>And I want to collect the id's such as </p>
<pre><code>test1 test2 test3
</code></pre>
<p>using jQuery or using JavaScript also</p>
|
php jquery
|
[2, 5]
|
5,198,555 | 5,198,556 |
How to print a page content (div, form, jqgrid) using a single button click?
|
<p>i.e. When I click the button from my page, the desired page content should get printed in a sheet. The main goal over here is, it should not show me with the print dialog box/print preview of the page asking for OK or CANCEL button where we can also choose for multiple prints of a particular page. Thanks in advance.</p>
|
java javascript jquery
|
[1, 3, 5]
|
1,752,458 | 1,752,459 |
Save data to SQL 2000 from asp.net page using jquery (C#)
|
<p>I am currently looking for a good solution that implements this. I have a comments section and I want the comments posted to my database using jquery and then the section gets refreshed without having to reload the page. How feasible is this and does it have any security or performance issues?</p>
<p>Thanx</p>
|
c# asp.net
|
[0, 9]
|
4,615,399 | 4,615,400 |
jQuery iframe file upload
|
<p>Im building a file upload with jQuery, but Im getting a jQuery error trying to set the attributes of the form:</p>
<pre><code>$(document).ready(function () {
$("#formsubmit").click(function () {
var iframe = $('<iframe name="postframe" id="postframe" class="hidden" src="about:none" />');
$('div#iframe').append(iframe);
$('#theuploadform').attr("action", "/ajax/user.asmx/Upload")
$('#theuploadform').attr("method", "post")
$('#theuploadform').attr("userfile", $('#userfile').val())
$('#theuploadform').attr("enctype", "multipart/form-data")
$('#theuploadform').attr("encoding", "multipart/form-data")
$('#theuploadform').attr("target", "postframe")
$('#theuploadform').submit();
//need to get contents of the iframe
$("#postframe").load(
function () {
iframeContents = $("iframe")[0].contentDocument.body.innerHTML;
$("div#textarea").html(iframeContents);
}
);
<div id="uploadform">
<form id="theuploadform" action="">
<input id="userfile" name="userfile" size="50" type="file" />
<input id="formsubmit" type="submit" value="Send File" />
</form>
</div>
<div id="iframe" style="width: 0px; height: 0px; display: none;">
</div>
<div id="textarea">
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,159,870 | 3,159,871 |
textarea auto expand
|
<p>Hi I have this auto expand textarea jquery code and currently, it is working somehow there except for Google Chrome. </p>
<p>The issue is when I added the style padding:3px to the textarea, whenever I type something in the box, it will expand the height. If I remove the style padding, it will work nicely. </p>
<p>The test is here: <a href="http://jsfiddle.net/JkxgB/" rel="nofollow">http://jsfiddle.net/JkxgB/</a> (Use Google Chrome to test)</p>
<p>I have been trying to figure out why, would appreciate if anyone could shed some light here. Thanks in advanced.</p>
|
javascript jquery
|
[3, 5]
|
4,137,244 | 4,137,245 |
let user scrolling stop jquery animation of scrolltop?
|
<p>I want to make it so that a webpage automatically scrolls to a certain element, however I don't want the scrolling to fight user input-- If it begins to scroll and then the user scrolls, I want the automated scrolling to stop and let the user have full control.</p>
<p>So I originally thought I could do something like this:</p>
<pre><code>var animatable = $('body, html');
animatable.animate({scrollTop: $('#foo').offset()}, 1000);
$(window).scroll(function() { animatable.stop(); });
</code></pre>
<p>however, the problem is-- the animation of the scrollTop triggers the scroll event handler for window! So, the animation begins and then stops immediately.</p>
<p>I am looking for a way that I can make my window scroll event handler only stop if it's triggered by user input... Is this possible?</p>
|
javascript jquery
|
[3, 5]
|
3,688,441 | 3,688,442 |
Remove item after max reached w/jQuery
|
<p>OK, I am trying to clone table with 3 elements in it. After I make 3 clones I need to continue cloning but remove item <strong>.val3</strong>.</p>
<pre><code>$('a').click(function(e) {
var $table = $(this).prev();
$table.after($table.clone());
e.preventDefault();
var n = $(".val3").length;
if (n > 3) {
if (!$(".val3").hasClass("max3")) {
$(".val3").remove();
}
} else {
$(".val3").addClass("max3");
}
});
<table border="1">
<tr>
<td>
<div class="val1">val 1</div>
<div class="val2">val 2</div>
<div class="val3">val 3</div>
</td>
</tr>
</table>
<a href="#">copy</a>
</code></pre>
<p>I decided that I'll add a class to the first 3 and then check if the class does not exist, remove the div. I think i got lost in my own logic... </p>
<p>Here's <a href="http://jsfiddle.net/uR7Aw/" rel="nofollow">jfiddle I put as a demo</a>.</p>
|
javascript jquery
|
[3, 5]
|
4,908,353 | 4,908,354 |
Saving a variable in the closure scope
|
<p>I have the following:</p>
<pre><code>var Save = $('th:first')[0];
$('th').click(function() {
if (Save !== this) {
Save = this;
...
}
});
</code></pre>
<p>How do I put "Save" into a closure scope?</p>
|
javascript jquery
|
[3, 5]
|
2,011,255 | 2,011,256 |
PHP/Jquery: Using value of clicked element in a function
|
<p>I have an element of label class</p>
<pre><code><li><a><span class='label'>$element</span></a></li>
</code></pre>
<p>and I want to be able to run <code>loadStuff</code> onclick. How do I get the value of the clicked element to pass in like:</p>
<pre><code>$(".label").click(loadStuff(valueOfClickedElement));
</code></pre>
|
php jquery
|
[2, 5]
|
3,343,582 | 3,343,583 |
Setting default values in spinner in android
|
<p>I am using a spinner using following code</p>
<pre><code> private String `DEFAULT_CURRENCY_TYPE`;
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(this, android.R.layout.simple_spinner_item, currenciesDataSource.keys);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
paidIn.setAdapter(adapter);
</code></pre>
<p>I want to do something like that <code>paidIn.setDefault(DEFAULT_CURRENCY_TYPE)</code></p>
<p>Meaning whenever i create spinner it compare its values with my default values and then set it as first element. How can i do that? </p>
<p>Best Regards</p>
|
java android
|
[1, 4]
|
5,519,450 | 5,519,451 |
Select text from a specific table cell on another page?
|
<p>I have a weird question. I want to create script in javascript (or PHP if I have to, I'm just more comfortable in javascript) that reads through a table until it finds specific text (know how to do that) and then returns the text three cells to the right. </p>
<p>To be specific, I want a script that finds a row for a specific printer on <a href="http://clusters.andrew.cmu.edu/printerstats/" rel="nofollow">this site</a> and returns the printer's status. I know how to select unique text, but not so much about nonunique text. </p>
|
php javascript jquery
|
[2, 3, 5]
|
2,193,157 | 2,193,158 |
SQL user authentication web service
|
<p>Is it possible to authenticate user using a SQL database, containing users
and passwords?</p>
<p>What I want to achive is:
I have as SQL database containig data for my app. This database also
contains usernames, passwords and rights which are specific for my app.
Also I have a middle tier WebService, which contains the business logic of
my app, and is responsible for connecting to SQL database.
The connection between SQL server and the WebService as made with hardcoded
user. I don't need to authenticate the Users with SQL server.
As a frontend I have a Windows Froms and ASP .NET applications.
The users should fill username/password boxes, then this information is to
be passed to the WebService, which checks the username and password in the
SQL database.
I want the WebService methods to be available only to users, which have
authenticated to the user database in SQL server.</p>
<p>For example: The following operations are supported URL: <a href="https://www.example.com/AuthenticationService.asmx" rel="nofollow">https://www.example.com/AuthenticationService.asmx</a></p>
<p>inside this service description will contains 2 methods such as</p>
<p>CheckUserAuthentication
UserEndSession</p>
<p>Any ideas, sample code and documents of how to implement this would be
greatly appreciated.</p>
<p>I use C# ASP.NET</p>
<p>Thank you in advance!</p>
|
c# asp.net
|
[0, 9]
|
506,707 | 506,708 |
View.getId and R.id.viewLabel return different values
|
<p>Let's say I have a method like this into my activity, and set it as <code>onClick</code> field of different buttons into xml:</p>
<pre><code>public void onButtonPressedFromView(View button) {
switch(button.getId()) {
case (R.id.button1) :
//do something
break;
case (R.id.button2) :
//do something different
break;
default :
//default action
break;
}
}
</code></pre>
<p>It comes out that, if I press for instance button1, the id obtained with <code>button.getId()</code> is always bigger of 1 than the id obtained with <code>R.id.button1</code>. It's quite easy to solve, I just changed my code into</p>
<p><code>switch(button.getId() - 1)</code></p>
<p>but I don't like it, and would like to understand the difference between these two ways of obtaining the id of a view.</p>
|
java android
|
[1, 4]
|
1,443,678 | 1,443,679 |
How to schedule downloading of files on server using ASP.NET web page
|
<p>How to download a file from a web server to another iis server</p>
<p>e.g. I have lot of movie files which i want to host on my website</p>
<p>the movies are uploaded on other site and I want to grab them on my own site.</p>
<p>Is it possible to schedule asynchronously downloading of files on server using ASP.NET web page?
I have only FTP access to the web sever as I'm using shared hosting.</p>
|
c# asp.net
|
[0, 9]
|
5,419,129 | 5,419,130 |
Modify what the user typed on a text box onsubmit and select?
|
<p>I'm using a script to return what the user types on an inputbox without www.</p>
<p>I want the modification to work in the inputbox itself. Is this possible?</p>
<p>Like for example the user types: www.example.com and when he presses GO www. disappears from what he typed and then the text is highlighted (selected).</p>
<pre><code><input type="text" id="url" />
<input type="button" id="submit" value="Go!" />
<div id="output"></div>
<script>
$("#submit").click(
function() {
var url = $("#url").val();
if(url.match(/^www\./))
{
url = url.substring(4);
}
$("#output").html(url);
}
);
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,716,233 | 3,716,234 |
Selecting specific range of columns with jquery
|
<p>I'm looking to select columns 2-4 on the 2nd row in a table. Does jquery have any sort of "and" function in their selectors? Or would I have to do something like this?</p>
<pre><code>$('#id tr:eq(1)').find('td:lt(5)').find('td:gt(1)')
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,167,934 | 1,167,935 |
Delete Gallery Folder on Android
|
<p>I would like to delete all images within a gallery folder (album). Given the URI of one image in the gallery, how can I obtain the other URIs so I can call getContentResolver.delete() on each.</p>
|
java android
|
[1, 4]
|
1,891,378 | 1,891,379 |
How do I allow the user to move an absolutely positioned div?
|
<p>I am using jQuery to create a "dialog" that should show up in the center of the page on top of everything and should remain centered at all times unless the user moves it. It has a header area (like a title bar) and I would like the user to be able to click there and drag the dialog "window" around. It is an absolutely positioned div. What is the best way to do this?</p>
<p>EDIT: I failed to mention that I would like to do it without jQuery UI if it's not terribly difficult. But I will look into how jQuery UI does it though. I may end up using it.</p>
|
javascript jquery
|
[3, 5]
|
2,432,205 | 2,432,206 |
.trigger() a .on()
|
<pre><code>var $forms = $('form.vote');
$forms.submit(function(){
return false;
});
$('.votebtn').on('click',function(){
$this.closest('form').trigger('vote_now', [$(this).val()]);
});
$forms.on('vote_now',function(value){
alert(value);
});
</code></pre>
<p><code>vote_now</code> should be triggered and popup the value but something's wrong. What is it?</p>
<p><a href="http://jsfiddle.net/6ZHy4/" rel="nofollow">http://jsfiddle.net/6ZHy4/</a></p>
|
javascript jquery
|
[3, 5]
|
4,605,279 | 4,605,280 |
populating dropdownlist with hours in c#
|
<p>I have to 2 dropdownlists and I want to populate them with hours from 1 to 24. Then I want to make the difference between them.If i choose in the first dropdown let's say the hour 12 AND in the second 16 then the difference will be 4. How can I achieve that in c#? I'm developing a asp.net web application with c#.This is how I populate my dropdownlist:</p>
<pre><code> DateTime Date = DateTime.Today;
DateTime Time = DateTime.Now;
ListItem item1 = new ListItem(Time.ToShortTimeString(),
Time.ToShortTimeString());
for (int i = 0; i <= 48; i++)
{
ListItem item2 = new ListItem(Date.ToShortTimeString(),
Date.ToShortTimeString());
droplist.Items.Add(item2);
if (Date.CompareTo(Time) < 0 && Date.AddMinutes(30).CompareTo(Time) > 0)
droplist.Items.Add(item1);
Date = Date.AddMinutes(60);
}
</code></pre>
<p>How can I assign values to my dropdown, values being the hours??</p>
|
c# asp.net
|
[0, 9]
|
2,126,612 | 2,126,613 |
getting value first offset name after click?
|
<p>How can get value <code>2011</code> in <code>input:name</code> with jquery?</p>
<pre><code><input type="text" name="hi[2011][]">
</code></pre>
<p><strong><a href="http://jsfiddle.net/QRkjs/" rel="nofollow">Example:</a></strong></p>
<pre><code><button>Click me</button>
<input type="text" name="hi[2011][]">
$('button').click(function() {
var f_offset = $('input').prop('name');
alert(f_offset);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
332,521 | 332,522 |
Gridview using hyperlink field for javascript
|
<p>I have a grid view and i am using an hyperlinkfield. Now i need to call another web page using this hyperlink field. This page should be a pop up. </p>
<p>It has to be a javascript function. Dynamically i need to pass group_id value as a query string.</p>
<p>Can you please let me know how to do this.</p>
<p>Right now i am doing this</p>
<p></p>
<p>It works but i need to do with javascript</p>
|
c# javascript
|
[0, 3]
|
1,579,823 | 1,579,824 |
Proper way to decode SecurityElement.Escape using Javascript
|
<p>I've tried several methods to decode encoded xml using javascript. For some reason all of them ignore ' which causes it to fail. I can do a string.replace to fix the issue, but wondering why this happens or if there is some other method I should be using.</p>
<p>I've tried decodeURIComponent as well as another method I found on SO that puts the content in a div and then pulls it back out. Both ignore the '. I also tried unescape which curiously did nothing whatsoever. It is an xml block I am decoding.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,869,804 | 2,869,805 |
how to add object to array
|
<h1>how to add object to array</h1>
<p>how can add <strong>a object into a array</strong> (code in javascript or jquery)
for example
what is the problem this code?<br>
</p>
<pre><code> function(){
var a = new array();
var b = new obejct();
a[0]=b;
}
</code></pre>
<p>for example use this code for save many object in array into function1 and call in function2 and use the object in array.</p>
<ol>
<li>how can save object in array</li>
<li>how can get object in array and save it to a variable</li>
</ol>
|
javascript jquery
|
[3, 5]
|
2,545,616 | 2,545,617 |
C++ abstract classes
|
<p>I am new to C++, I coded in Java for an year. The equivalent in C++ for interfaces and abstract classes alike is only abstract classes. Is that supposed to be a handicap while doing factory design? There are many times I want to leave out the defining the methods to the inheriting classes and I want to enforce that.</p>
|
java c++
|
[1, 6]
|
624,351 | 624,352 |
Header changes while the browser scroll down action
|
<p>I have a Header with fixed position. I need to change that header while the browser scrolls actions. See below my code. It is not working. Pls help me</p>
<pre><code><style>
body {
height: 900px;
}
#header {
height: 40px;
width: 100%;
position: fixed;
top: 0px;
border: 3px solid green;
}
</style>
<body>
<div id="header"> Changing Header</div>
<script>
$("body").scroll( function() {
var value = $(this).scrollTop();
if ( value > 1 )
$("#header").css({"border" : "3px solid red", "background" : "yellow"});
else
$("#header").css({"border" : "3px solid green", "background" : "white"});
});
</script>
</body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,122,094 | 3,122,095 |
Internet task which modifies the view - CalledFromWrongThreadException
|
<p>I want to modify the TextViews of a tabbed Activity view using a TimerTask.<br>
Here's the code of the task class: </p>
<pre><code> public class QueryServer extends TimerTask {
public void run(){
MCQuery mcQuery = new MCQuery(serverAddrress,25565);
QueryResponse response = mcQuery.basicStat();
int Onlineplayers = response.getOnlinePlayers();
int MaxPlayers = response.getMaxPlayers();
Log.d("MCQuery", "" + Onlineplayers + " OnlinePlayers");
TextView serverStatus = (TextView) findViewById(R.id.server_status);
TextView onlinePlayersView = (TextView) findViewById(R.id.online_players);
serverStatus.setText("Online");
onlinePlayersView.setText("" + Onlineplayers + "/" + MaxPlayers);
Log.d("QueryServer", "Querying the server...");
}
}
</code></pre>
<p>This is the class calling the task: </p>
<pre><code> public class FirstTab extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.first_tab, null);
//check Internet connection
if (isOnline() == true) {
Log.d("CheckConnection", "The device is connected to the network");
} else {
Log.d("CheckConnection", "The device is NOT connected to the network");
}
Timer timer = new Timer();
TimerTask task = new QueryServer();
//run the QueryServer task every 3 seconds
timer.schedule(task, 3000, 3000);
return v;
}
}
</code></pre>
<p>This is the error:</p>
<blockquote>
<p>08-01 20:43:16.759: E/AndroidRuntime(1030): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.</p>
</blockquote>
<p>Thank you.</p>
|
java android
|
[1, 4]
|
3,749,522 | 3,749,523 |
How to add time to my date object?
|
<p><strong>How to add time to my date object which i select using DatePicker.</strong> The date picker by default set's the time to <code>00:00:00</code> to my date object, i need to add the current system time to my date object.</p>
<pre><code>Calendar now = Calendar.getInstance();
int hours = now.get(Calendar.HOUR_OF_DAY);
int minutes = now.get(Calendar.MINUTE);
int seconds = now.get(Calendar.SECOND);
//int hours = new Time(System.currentTimeMillis()).getHours();
//int minutes = new Time(System.currentTimeMillis()).getMinutes();
//int seconds = new Time(System.currentTimeMillis()).getSeconds();
now.set(year, month, day, hours, minutes, seconds);
textDateField.setText(getDateAsString(now.getTime()));
</code></pre>
<p>I am using Date Picker and the click of the set button, i get the date displayed in the field, but the date object is without time. How can i append the time with my date object. </p>
<pre><code>public static String getDateAsString(Date date) {
SimpleDateFormat format = new SimpleDateFormat("dd MMM yyyy");
return format.format(date);
}
</code></pre>
<p>The above is what i tried, but it did not work.</p>
|
java android
|
[1, 4]
|
4,533,174 | 4,533,175 |
How do I assign click handlers to each child with jquery?
|
<pre><code><div id="menu">
<div class="menuitem-on" id="home">Home</div>
<div class="menuitem-off" id="mycart">My Cart</div>
<div class="menuitem-off" id="shop">Shop</div>
</div>
</code></pre>
<p>how do I assign click handlers to each of the children of menu with jquery?</p>
|
javascript jquery
|
[3, 5]
|
5,029,778 | 5,029,779 |
Android Drag, Pinch Scale, and Rotate Objects
|
<p>Does anyone have a resource or suggestion on how to learn how to do pinch scale, drag/pan, and rotation of objects on Android. I have completed an app for iOS and all of these features were seamless integrated, but I'm not sure where to start with Android.</p>
<p>The purpose of the app is to simply drag images from a menu onto a "canvas" and rotate/scale those images.</p>
<p>Do I use a surface view and simply drag on ImageViews? Does Android have pre built gestures (like pinch)? How do I work with the point coordinate system to have objects move where the finger is touching? </p>
<p>Could someone point me in the right direction so I can learn how to do this?</p>
|
java android
|
[1, 4]
|
745,902 | 745,903 |
How to get the first name of each list?
|
<p>Sorry if the title isn't clear enough, I have five <code><li>'s</code> in each <code><li></code> I have <code><a></code> and a <code><div></code> and in each <code><div></code> I have a <code><ul></code>with a class of "config". Then in that I have two <code><li></code>.</p>
<p>I use jQuery to hide the <code><ul></code> with the class of config and then use slideToggle to show/hide them. The problem is, It shows all of them. I want to just click one link and the appropriate <code><div></code> or <code><ul></code> should appear, not all of them. How can I do this? </p>
<p>So far I have:</p>
<pre><code>$(document).ready(function(){
$("ul.config").hide();
$("li:nth-child(1) a").click(function(){
$("li ul.config:first").slideToggle(300);
});
});
</code></pre>
<p>But that only shows the very first list. How can I show each one when it's clicked?</p>
|
javascript jquery
|
[3, 5]
|
3,594,719 | 3,594,720 |
jQuery: Global Variable Namespace Problem
|
<p>Is there a way to declare a global variable in jQuery in its own namespace?</p>
<p>Sure, I can declare global variables with plain old JavaScript, but they will fall in the <code>window</code>'s namespace. For example, if I had a variable named <code>document</code>, it would surely overwrite the <code>document</code> object of the <code>window</code>.</p>
<p>Does jQuery have a hash table that lets you store any object by their name?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,641,278 | 1,641,279 |
Link button control using asp.net
|
<p>I have one link button in master page and one dropdown list in content page .
Can any one tell How to change the visibility of the dropdown list.</p>
|
c# asp.net
|
[0, 9]
|
5,208,808 | 5,208,809 |
jQuery filter selector, is this right?
|
<p>It seems to work ok but I don't know if this can be impoved on or not.</p>
<p>I want to select any HTML tag that has a class of edit-text-NUM or edit-html-NUM and change the color of it. Here is what I am using...</p>
<pre><code>jQuery(document).ready(function(){
jQuery('*')
.filter(function() {
return this.className.match(/edit-(text|html)-\d/);
})
.css({
'color': '#ff0000'
});
});
</code></pre>
<p>Does that look ok and is the regex ok?</p>
<p>*edit: Also is this efficient? I am aware that using <code>jQuery('*')</code> might be a bit of a hog if it's a large page. It only has to work from <code><body></code> down so maybe it could be changed?</p>
|
javascript jquery
|
[3, 5]
|
2,386,689 | 2,386,690 |
Grid view SelectedRowStyle does not apply to Template Fields
|
<p>Markup</p>
<pre><code><asp:GridView ID="gridView_Config" runat="server" AutoGenerateColumns="False"
CssClass="gridViewStyle" OnRowDataBound="gridView_Config_RowDataBound" OnSelectedIndexChanged="gridView_Config_SelectedIndexChanged">
<Columns>
<asp:TemplateField ControlStyle-CssClass="ConfigProfileColumn ProfileTextBoxWidth">
<ItemTemplate>
<div>
<asp:TextBox Text='<%# Bind("Type") %>' ID="type" runat="server" ReadOnly="true" CssClass="FieldLabel " ></asp:TextBox>
</div> </ItemTemplate>
</asp:TemplateField> </Columns>
<SelectedRowStyle CssClass="gridViewSelectedRow" />
<HeaderStyle CssClass="gridHeader" />
</asp:GridView>
</code></pre>
<p>Code-Behind</p>
<pre><code>protected void gridView_PrintConfig_RowDataBound(object sender, GridViewRowEventArgs e)
{
//check the item being bound is actually a DataRow, if it is,
//wire up the required html events and attach the relevant JavaScripts
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.gridView_PrintConfig, "Select$" + e.Row.RowIndex);
}
}
</code></pre>
<p>The gridViewSelectedRow css class has background color blue and color as white. but when a row is selected the text color of the template field still remains black instead of white. how do i solve this?</p>
|
c# asp.net
|
[0, 9]
|
1,886,011 | 1,886,012 |
Android java NullPointerException
|
<pre><code>public class Database extends Activity {
private TextView tvInfo = (TextView)findViewById(R.id.tvInfo);
private Button btnInfo = (Button)findViewById(R.id.btnInfo);
</code></pre>
<p>Hello guys, probably this is just an newbie error in java, but why is this throwing me a NPE? I'm just declaring those variables and it gives me an NPE.</p>
|
java android
|
[1, 4]
|
3,181,646 | 3,181,647 |
what's the jquery plugin that inserts text in a textbox, and it disappears upon focus?
|
<p>what's the jquery plugin that inserts text in a textbox, and it disappears upon focus?</p>
|
javascript jquery
|
[3, 5]
|
5,973,466 | 5,973,467 |
No focus in settings menu on D-PAD use
|
<p>I am working on an Android handset that has a D-PAD.</p>
<p>Here is the scenario:
1) Open settings menu
2) Scroll to the bottom of the list using touch
3) Use D-PAD to scroll the list.</p>
<p>Problem: No focus/marker is shown when D-PAD is used to scroll the list items</p>
<p>I have tried to figure this out, but not able to find out the root cause. All suggestions/opinions/comments are welcome.</p>
|
java android
|
[1, 4]
|
3,337,965 | 3,337,966 |
JQuery shaking effect with some tilt/rotation
|
<p>I am trying to create an effect where on button click, the div would shake left and right and tilt about 10deg each way so it looks like a natural motion when shaking an object with two hands. I am able to create the left and right shaking effect but can't seem to tie it in with rotation. I also need this to work in IE8, so css3 is not an option. I am using JQuery UI and .rotate() but if there is a better way please let me know. I need this to shake about 3-4 times on button click.</p>
<pre><code> <div class="container">
<div class="globe-main" id="globe">
<div class="content"></div><!-- end .content -->
</div><!-- end .globe-main -->
</div><!-- end .container -->
<script>
var times = 4;
var loop = setInterval(rota, 300);
function rota() {
times--;
if(times === 0){clearInterval(loop);}
$(".globe-main").rotate({animateTo:10, duration: 500, });
//$(".globe-main").effect("shake", { times:3, distance:30 }, 800);
}
rota();
</script>
</code></pre>
<p>Here is what I have so far <a href="http://jsfiddle.net/J2ySt/" rel="nofollow">FIDDLE</a> </p>
<p>Thank you</p>
<p>UPDATE</p>
<p>Here is the updated <a href="http://jsfiddle.net/J2ySt/2/" rel="nofollow">FIDDLE</a></p>
|
javascript jquery
|
[3, 5]
|
103,133 | 103,134 |
Resizing Images with jquery ( nivo plugin )
|
<p><a href="http://nivo.dev7studios.com/demos/" rel="nofollow">http://nivo.dev7studios.com/demos/</a></p>
<p>I am not a JS dev, I would like to know how to reduce the image in the the slider.</p>
<p>The js file that handlle this feature is jquery.nivo.slider.pack.js</p>
<p>Can some one help ?</p>
|
javascript jquery
|
[3, 5]
|
3,896,558 | 3,896,559 |
sending mail along with embedded image using asp.net
|
<p>sending mail along with embedded image using asp.net </p>
<p>I have already used following but it can't work</p>
<pre><code>Dim EM As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage(txtFrom.Text, txtTo.Text)
Dim A As System.Net.Mail.Attachment = New System.Net.Mail.Attachment(txtImagePath.Text)
Dim RGen As Random = New Random()
A.ContentId = RGen.Next(100000, 9999999).ToString()
EM.Attachments.Add(A)
EM.Subject = txtSubject.Text
EM.Body = "<body>" + txtBody.Text + "<br><img src='cid:" + A.ContentId +"'></body>"
EM.IsBodyHtml = True
Dim SC As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient(txtSMTPServer.Text)
SC.Send(EM)
</code></pre>
|
c# asp.net
|
[0, 9]
|
11,708 | 11,709 |
Any PHP -> jQuery libraries out there?
|
<p>Have any bridge libraries been developed for PHP that provide access to the jQuery framework? Ideally it would be nice to have something fairly extensible so that creating jQuery-based content using PHP code would be fairly easy and customizeable. Does such a thing exist yet?</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,327,271 | 2,327,272 |
How to convert jquery code into javascript
|
<p>Yesterday I have put the question which was answered correctly but now I want to convert that same code into javascript. I have made some changes but its not work</p>
<p>working code- <a href="http://jsfiddle.net/SXzyR/8/" rel="nofollow">http://jsfiddle.net/SXzyR/8/</a></p>
<p>mycode- <a href="http://jsfiddle.net/SXzyR/11/" rel="nofollow">http://jsfiddle.net/SXzyR/11/</a></p>
|
javascript jquery
|
[3, 5]
|
681,907 | 681,908 |
how to copy checkboxlist item's value to listbox using jquery
|
<p>I have a checkboxlist in my page having item text as some languages (ex: c, c++, java, c#sharp.net etc.). I have an empty listbox called desired skills. HR recruiter will select some of the languages (items of checkboxlist) and click a button called desire to copy the selected ckeckboxes and that need to be populated in list box. I wanted to know that how can i achieve this using jquery. here are my controls :</p>
<pre><code><asp:CheckBoxList ID="cbxlang" runat="server">
<asp:ListItem Text="C" Value="C"></asp:ListItem>
<asp:ListItem Text="C++" Value="C++"></asp:ListItem>
<asp:ListItem Text="Java" Value="Java"></asp:ListItem>
<asp:ListItem Text="csharp" Value="csharp"></asp:ListItem>
</asp:CheckBoxList>
</code></pre>
<p>here the button : </p>
<blockquote>
<pre><code><asp:Button ID="btnCheck" runat="server" Text="DesiredSkills" />
</code></pre>
</blockquote>
<p>and the listbox is like this</p>
<pre><code> <asp:ListBox ID="lstDesired" runat="server"></asp:ListBox>
</code></pre>
<p>I want to populate the selected checkbox items as my listbox items. I have done this in code behind page, but that need page to be sent back and then load it again. Please help. I am very new to jquery.</p>
|
jquery asp.net
|
[5, 9]
|
3,938,613 | 3,938,614 |
How to use device default theme for app?
|
<p>I have an app that I want to develop for Android 2.1, 2.2, 2.3.3, 3.0/3.1 and 4.0.x. Between those API levels, there are about 3 different types of Themes. The latest 4.0.x theme is Holo. </p>
<p>Anyways, I want my app to use the default Android theme for whatever device it's on. If it's on a 4.0.x device, I want it to use Holo. If it's on 2.3.3 I want it to use the theme from that version of Android. etc...</p>
<p>Is there a simple way to approach this? I noticed that with 4.0, they added a <code>Theme.DeviceDefault</code> theme that you can use, but this doesn't help me for older API levels. What is the best approach to this?</p>
|
java android
|
[1, 4]
|
1,841,599 | 1,841,600 |
Expanding the dimension of an element
|
<p>I have a thumbnail. When i click on it, how can i enlarge it. I know there are many plugins that do this, but is there simple code that serve the purpose. </p>
|
javascript jquery
|
[3, 5]
|
286,749 | 286,750 |
jQuery: Store additional/extra data/info inside a jQuery object?
|
<p>Is it possible and smart to store extra data inside a jQuery object?</p>
<p>Right now I have objects that contain some data but these objects also have a visual representation of that data. This works but I have a lot of code to keep them both in sync. </p>
<p>For example if you delete an object from the dom I also have to delete the related object from the object array. Deleting is fairly simple but it gets a little more complicated if I start sorting/moving the objects around.</p>
|
javascript jquery
|
[3, 5]
|
3,067,941 | 3,067,942 |
How to remove javascript code as gmail does?
|
<p>I am currently working on securing my javascript code. I am using Asp.net 4.0 When i was checking my mail on gmail I just right clicked & selected view source & It just showed me <code><html><body></body></html></code> . Can i implement this type of security in my application or any other best security feature that will hide/encrypt my javascript code </p>
|
javascript asp.net
|
[3, 9]
|
5,358,042 | 5,358,043 |
dynamically add clickable row to table
|
<p>I'm trying to add rows to a table in HTML using JavaScript that are clickable. </p>
<p>Here is my codes:</p>
<p>HTML:</p>
<pre><code><table border="1" id="example" style="cursor: pointer;">
<tr>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
</table>
</code></pre>
<p>JavaScript:</p>
<pre><code>//clicked function
$('#example').find('tr').click( function(){
alert('You clicked row '+ ($(this).index()) );
});
//add new row
var x=document.getElementById('example');
var new_row = x.rows[0].cloneNode(true);
new_row.cells[0].innerHTML = "hello";
x.appendChild( new_row );
</code></pre>
<p>The problem is that the newly added rows are clickable but won't go through the clicked function to get the alert. </p>
<p>Anyone know why? </p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.