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 |
|---|---|---|---|---|---|
2,389,168
| 2,389,169
|
"This" outside of each scope (JQuery)
|
<p><strong>I'm trying to get rid of that nasty variable declaration of ref in this instance</strong>, I'm sure there is a way to get out of the each scope to get the "this" of the on-call. I just have no idea how to.</p>
<pre><code>$(document).on('click', '.item', function(){
var ref = $(this).attr('data-id');
$.each(t, function(){
if(this.id == ref){
//action
return false;
}
});
}
</code></pre>
<p>This isn't really life or death, I just am trying to clean up code.</p>
|
javascript jquery
|
[3, 5]
|
4,342,412
| 4,342,413
|
a place for network connection checking
|
<p>I've got a simple hiearachy of activities where: A is abstract and B,C, etc inherit from A.
I need a place to handle network connection and it would be good to place it in the parent activity(A). However, I don't see how I can stop code in my child activities(B,C) from executing. Additionally, in each of the onResume methods of the child activities(B,C) I have extra network code which shouldn't be executed as well.</p>
<p>So, is there any way apart from "if" in parent onCreate + "if" in child onCreate + "if" in child onResume ? This approach should be more concise.</p>
|
java android
|
[1, 4]
|
4,566,746
| 4,566,747
|
DB Operations in asp.net with c#
|
<p>I have a question from an interviewer:</p>
<p>If two users open the same page, one person adding 105 record and another person deleting the same record, what happens in this scenario?</p>
<p>How do I answer this?</p>
|
c# asp.net
|
[0, 9]
|
3,734,918
| 3,734,919
|
On Selected, take a value from G.V and redirect user on another page and get the value .Execute code only if is redirected from page1
|
<p>I have a simple gridview and sqldatasource to bind data to gridview.</p>
<ul>
<li>My goal is to make in the gridview when the user is selecting a row ,
to take a value from a column for the current editing row , then
redirect him to the other page and there to work with the value taken
from the main page.</li>
</ul>
<p>In the example below I've just used a static string, not value taken from gridview.</p>
<p>On WebForm1.aspx:</p>
<pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
string selectedvalue = "test";
Response.Redirect("http://localhost:53253/WebForm2.aspx?selectedValue=" + selectedvalue);
}
</code></pre>
<p>on WebForm2.aspx:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
string take = Request.QueryString["selectedValue"];
Label1.Text = take.ToString();
}
</code></pre>
<p>The problem is in WebForm2.aspx I want the code to work only if it's called from the main page with the GridView1_SelectedIndexChanged code.</p>
<p>Because I also want to access the WebForm2 page without getting the code if I'm redirected from webform1.</p>
|
c# asp.net
|
[0, 9]
|
4,106,898
| 4,106,899
|
Using Java in Android app to copy code, update name and create new class
|
<p>I have a java class with a specific function. It allows the user to save a cars setup. I need to create a button that allows them to create as many of these using the existing code and layout over and over and over and be able to separate them by which track they are on, which type of race they are participating in and so on...so every time they hit CREATE NEW TUNE it needs to save it to a different shared prefs name as well or store some other way that i dont know how to implement yet</p>
<p>I am very new to this. </p>
<p>I have no idea how to do this so i havent tried anything. I do know how to use shared preferences to complete this task but with 82 Tracks and Shared Preferences thats at least 4290 java pages to create. </p>
<p>Any help appreciated. </p>
|
java android
|
[1, 4]
|
3,040,696
| 3,040,697
|
jQuery events not firing
|
<p>I'm creating a simple jQuery editor, nothing complicated, and just can't seem to find out why the events do not work. See code below.</p>
<pre><code>var $editor = $('<div>').addClass('editor')
.insertBefore(this.$element)
.append(this.$element);
var $b = $('<div>').addClass('button-wrapper')
.appendTo($editor);
this.$element.css({height:this.opts.height,width:this.opts.width});
//Load up each button.
$.each(this.opts.buttons.split(' '), function(i, button)
{
//If its an empty string keep going.
if(button == '')return true;
//Generate a button.
$('<div>').data('buttonName', button)
.addClass(button.toLowerCase())
.click(clicked)
.hover(hover, hover)
.appendTo($b);
});
</code></pre>
<p>To go over it, simply, $element represents the textarea that I am using as the base element, $b represents the button wrapper, and $editor is the div to wrap around all of these things. When I append the buttons to $editor none of the events fire, however, when I append to document.body it works perfectly fine. For the record, the event clicked and hover are nothing special, just testers to see if the events are working.</p>
|
javascript jquery
|
[3, 5]
|
3,306,355
| 3,306,356
|
getting intellisense to show properties in markup for a custom server control
|
<p>I have a custom control that inherits from <strong>UserControl</strong>, and I can't get it's properties to show in intellisense. For example, I have a property:</p>
<pre><code>public string Title;
</code></pre>
<p>but if I start typing:</p>
<pre><code>ff:myControl Tit...
</code></pre>
<p>Nothing shows up (like I think it should). I have tried adding attributes like <strong>Browsable</strong>, <strong>EditorBrowsable</strong>, etc, but nothing is seeming to work - what am I forgetting?</p>
|
c# asp.net
|
[0, 9]
|
3,428,174
| 3,428,175
|
Adding event clicks to POIs in Android Augmented Reality framework?
|
<p>I'm developing an application based on Android AR framework : <a href="http://code.google.com/p/android-augment-reality-framework" rel="nofollow">http://code.google.com/p/android-augment-reality-framework</a></p>
<p>Can anyone please suggest how to add click to the POIs or icons in camera view to view address of the POIs? </p>
|
java android
|
[1, 4]
|
1,169,435
| 1,169,436
|
looking for tool to convert unescape string to escapted string
|
<p>Hello
i just wander where can i find a tool that takes in my case java script string that is<br>
unescape and converting it to escaped string so i could use it as string value in c++ </p>
<p>for example characters like " i need to convert it to \"<br>
i need something smart and not just replace all function . </p>
|
javascript c++
|
[3, 6]
|
772,362
| 772,363
|
Pass list of strings from Javascript to asp.net code-behind
|
<p>I have problems with javascript in ASP.NET.<br>
I modify a listBox, with add and remove command using javascript.<br>
Now I have to use the data of the list in the code behind. How can I pass this data to the server? Can I use json?</p>
<p>Here is the code. I can't use hiddenField because of the remove.</p>
<pre><code><asp:listbox ID="SubCat" runat="server" ></asp:listbox>
<input type=button onClick="addOption(SubCat)"; value='Add'>
<input type=button onClick="removeOptions(SubCat)"; value='Remove Selected'>
<input type=button onClick="removeAllOptions(SubCat)"; value='Remove All'>
<script type="text/javascript">
function removeAllOptions(selectbox) {
var i;
for (i = selectbox.options.length - 1; i >= 0; i--) {
selectbox.remove(i);
}
}
function removeOptions(selectbox) {
var i;
for (i = selectbox.options.length - 1; i >= 0; i--) {
if (selectbox.options[i].selected)
selectbox.remove(i);
}
}
function addOption(selectbox) {
var txtBox1 = document.getElementById('txForn')
var optn = document.createElement("OPTION");
var t = txtBox1.value;
optn.text = t;
optn.value = t;
selectbox.options.add(optn);
}
</ script>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
4,642,387
| 4,642,388
|
Problem in calling the mask function on jquery?
|
<p>My Question is how I'll be to call the jquery function.. Please Check my codes if there's some adjustment..</p>
<p>jquery</p>
<pre><code>jQuery(function($){
$("txtPhone").mask("(999) 999-9999");
});
</code></pre>
<p>asp.net</p>
<pre><code><script src="insurance.js" type="text/javascript"> </script>
<script src="jquery.maskedinput.js" type="text/javascript"></script>
&nbsp;<asp:TextBox ID="txtPhone" runat="server"></asp:TextBox>
</code></pre>
|
jquery asp.net
|
[5, 9]
|
4,679,883
| 4,679,884
|
call an external javascript function from python
|
<p>I have a javascript function that I can call with input and that returns a result.
I can integrate this javascript function into an html-document (of course).</p>
<p>Now I would like to call exactly this javascript function from python. I have a python programm and want to call the javascript function with input parameters passed to the JS function by the calling python function. And the JS function shall return some result to python.</p>
<p>This JS function has quite complex functionality and is used in a web project also. I would like to use same functionality in Python.</p>
<p>Does anyone know how to solve this? Python is quite huge so I think I only did not find the required python module up until know. I spent 2 days in searching a possibility.</p>
<p>Thanks!</p>
|
javascript python
|
[3, 7]
|
4,319,019
| 4,319,020
|
Javascript ' on.("load", ' not working
|
<pre><code>jQuery(document).ready(function() {
jQuery('#submit').click(function() { jQuery("#LoadingImage").show();
jQuery('#imgRESULT').html('<img id="image1" src="http://johndoe.com/foo.php?username1=' + jQuery('input[name=username1]').val() + '&amp;username2='+ jQuery('input[name=username2]').val() + '" >');
});
$('#image1').on("load", function() {
$("#LoadingImage").hide();
});});
</code></pre>
<p>The thing is the loading image div, does not hide when the generated image is generated.</p>
<p>Any ideas on how to get this to work?</p>
|
javascript jquery
|
[3, 5]
|
690,197
| 690,198
|
javascript setInterval function not working
|
<p>I want to call a function for every half minute. i am using the following code. The function is not getting triggered.</p>
<p>Code:</p>
<pre><code>window.setInterval('progress()', 10000);
</code></pre>
<p>Geetha.</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
993,960
| 993,961
|
why jquery detach element will cause a form to submit?
|
<p>i wonder why in the following example, trying to <code>detach</code> an element (<code>li</code>) causes the <code>form</code> containing it to <code>submit</code></p>
<p><strong>html</strong></p>
<pre><code><form id="frmToDo" name="frmToDo">
<p id="lineInput">
...
<input type="submit" id="btnSubmit" value="Add" />
</p>
<ul id="todolist">
<!-- added in ajax -->
</ul>
</form>
</code></pre>
<p><strong>JS</strong></p>
<pre><code>$("#frmToDo").submit(function() {
// this runs after: $("#todolist").detach(...)
});
$("#todolist").delegate("li[id^=task-] button", "click", function() {
$("#todolist").detach($($(this).parent()).id());
return false;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,713,447
| 3,713,448
|
How do i get these values to save?
|
<p>I need the inserted values in this edittext to show up after i quit the application. I currently have it set up so it'll set new default values if this is the first time for a user to set up the settings page but i can't get the set values to save and load the same values. Here is my code.</p>
<pre><code> if (res.equals("555")) {
//post the saved text
} else if (res.equals("510")) {
editTextname.setText("Firstname Lastname", TextView.BufferType.EDITABLE);
editTextphone.setText("XXX-XXX-XXXX", TextView.BufferType.EDITABLE);
editTextemail.setText("name@yourdomain.com", TextView.BufferType.EDITABLE);
editTextaddress.setText("Street, City, State, Zip", TextView.BufferType.EDITABLE);
//save the entered text above and show it
}
</code></pre>
|
java android
|
[1, 4]
|
4,727,340
| 4,727,341
|
asp:ImageButton is not firing in an asp.net UpdatePanel?
|
<p>I have an asp:ImageButton that is supposed to popup a save dialog when clicked. When I put it outside the UpdatePanel, it works fine, but when I put it inside the UpdatePanel, the dialog does not popup.</p>
|
c# asp.net
|
[0, 9]
|
4,109,623
| 4,109,624
|
basic jquery looping question around 'click'
|
<p>Basic question, but I have been pounding my head for a bit so thought id bring it here. </p>
<p>html looks like this (edit, fixed the closing quotes) </p>
<pre><code><span class='deleteimage-119'>delete</span>
<span class='deleteimage-120'>delete</span>
<span class='deleteimage-121'>delete</span>
<span class='deleteimage-122'>delete</span>
<span class='deleteimage-123'>delete</span>
</code></pre>
<p>javascript/jquery looks like this</p>
<pre><code>iids = ['119','120','121','122','123'];
for (i=0; i<iids.length; i++) {
place = iids[i];
$(".deleteimage-" + place).click(function () {
alert(place);
});
}
</code></pre>
<p>The click functionality gets attached to each individual span, but the alert after clicking just shows the last item in the array. </p>
|
javascript jquery
|
[3, 5]
|
4,580,893
| 4,580,894
|
download file to a specific location with Response.BinaryWrite and Server.Mappath possible?
|
<p>I have varbinary data associated with a file in the DB. This is the code I'm using to download this file on clicking a link -</p>
<pre><code>//a is my attachment object
var r = context.Response;
r.AddHeader("Content-Disposition", "attachment; filename=" + a.FileName);
r.Charset = "";
r.ContentType = a.MIME;
r.BinaryWrite(a.Content.ToArray());
</code></pre>
<p>Currently, this file gets downloaded to the Downloads folder. Is there any way to create a new folder in the users system and have this file download there? I read that <b>server.mappath</b> can be used with r.WriteFile, but I'm not quite sure. Can this be done?</p>
|
c# asp.net
|
[0, 9]
|
290,089
| 290,090
|
Autopostback in c# code while keeping several textboxes and dropdownlists values
|
<p>I have several <code>textboxes</code>and <code>dropdownlists</code> on my form. When a user submits the form, I want to keep several of these values on the form but I also want to make them invisible for several seconds after the form submits, so the user knows the form has been submitted. I am pretty sure you need to do an <code>autopostback</code>in order to change the visibility of <code>textboxes</code>and <code>dropdownlists</code> but I do not want to do an <code>autopostback</code> because I will lose the fields I want to keep. Any alternatives?</p>
|
c# asp.net
|
[0, 9]
|
4,101,806
| 4,101,807
|
selecting div that contains div with a certain value
|
<p>I have several outer divs, all of them contain 3 inner divs <code>class1</code> <code>class2</code> <code>class3</code>. I want to select the outer div based on the value attribute of its inner div that has <code>class1</code>. For example, I want to select the first div because its <code>class1</code> div has value <code>x</code>. How do I do this with jquery?</p>
<pre><code><div> <-----this is the div I want to select
<div class="class1" value="x"></div>
<div class="class2" value="y"></div>
<div class="class3" value="z"></div>
</div>
<div>
<div class="class1" value="a"></div>
<div class="class2" value="b"></div>
<div class="class3" value="c"></div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,130,300
| 3,130,301
|
How can I get the difference between 2 dates in days, hours and minutes
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1968167/difference-between-dates-in-javascript">Difference between dates in JavaScript</a> </p>
</blockquote>
<p>How can I get the difference between 2 dates in hours, minutes and seconds? This is my code which isn't working:</p>
<pre><code>var date = new Date(2012, 0, 21, 0, 0, 0, 0);
window.setTimeout(function () {
var now = new Date();
console.log(now);
console.log(date.getTime() - now.getTime());
console.log(new Date(date - now));
}, 1000);
</code></pre>
<p>None of the console.log show proper difference between 2 dates.</p>
|
javascript jquery
|
[3, 5]
|
4,728,809
| 4,728,810
|
selecting classes using wildcard not exact class name
|
<p>I have several classes that I want to select .group1-1 .group1-2 .group1-3, each one of these has 50 elements under it. </p>
<p>Is there a way to select all classes that start with group1 (so I end up selecting group1-1, group1-2, group1-3), something like <code>$(".group1"+*)</code></p>
|
javascript jquery
|
[3, 5]
|
2,327,480
| 2,327,481
|
Access a javascript function value within PHP?
|
<p>Can I access the value of a javascript function from outside the function
like if I had a function</p>
<pre><code><script>
function test_tree(opt)
{
val = opt;
}
</script>
</code></pre>
<p>Can I access the <code>val</code> value from outside the <code>test_tree</code> function or is there a way to access it from PHP code?</p>
<p>I need to be able to access a value from the javascript code in PHP code.</p>
|
php javascript
|
[2, 3]
|
3,849,200
| 3,849,201
|
converting function to jquery click() call
|
<p>Here is the code that I'm trying to convert:</p>
<pre><code><script>
function fsomething(rowid) {
window.location = "/somewhere/" + rowid;
}
</script>
<tr>
<td>
<button onClick="fsomething('{{rowid}}')">row 1L</button>
</td>
<td>
<button onClick="fsomething('{{rowid}}')">row 2L</button>
</td>
</tr>
</code></pre>
<p>How can I convert this to:</p>
<pre><code>$('button').click(function() { .... } );
</code></pre>
<p>where <code>{{rowid}}</code> is dynamically generated, and unique to each row?</p>
|
javascript jquery
|
[3, 5]
|
2,869,369
| 2,869,370
|
how to make a string keep straight?
|
<pre><code> Button hoursButton = (Button) findViewById(R.id.hours);
final AlertDialog.Builder openinghours = new AlertDialog.Builder(this);
hoursButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openinghours.setTitle("Opening Hours");
openinghours.setMessage(
"\nMonday: CLOSED"
+ "\nTuesday: CLOSED"
+ "\nWednesday: 22:00 - 3:00"
+ "\nThursday: CLOSED"
+ "\nFriday: 22:00 - 3:00"
+ "\nSaturday: 22:00 - 3:00"
+ "\nSunday: CLOSED");
openinghours.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
</code></pre>
<p>The opening hours are displayed. I want the actual opening hours to be displayed in a neat straight line, this is how it displays:</p>
<p><img src="http://i.stack.imgur.com/NvddI.png" alt="enter image description here"></p>
<p>i'm trying to space the string out so that it looks all in straight, formed line.</p>
<p>There must be a better way of doing this?</p>
|
java android
|
[1, 4]
|
2,039,616
| 2,039,617
|
How to open pop up window from a model popup?
|
<pre><code>window.open
</code></pre>
<p>above method doesn't work when i call it from model pop up.Is there any alternate to open a popup window over model pop up? Thanks in advace.</p>
|
javascript jquery
|
[3, 5]
|
3,765,347
| 3,765,348
|
jQuery textarea word count on form submit
|
<p>I have been looking around for a function that counts the number of words in a textarea when I click the form submit button.</p>
<p>I am trying to display a message to the user that if they click submit and have only entered 50 or less words. This will be a confirm message basically saying "You have entered less than 50 words, are you sure you would like to continue?"...or something.</p>
<p>Cheers</p>
|
javascript jquery
|
[3, 5]
|
5,171,409
| 5,171,410
|
How to build jQuery remove
|
<p>I have some like that.</p>
<pre><code><script src="http://code.jquery.com/jquery-latest.js"></script>
<table>
<tr title="test" id="ex1">
<td><div class="move">Hello</div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr id="ex2">
<td><div class="move">Hello</div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<button>Move</button>
<script>
$("button").click(function () {
$(".move").remove();
});
</script>
</code></pre>
<p>If I press button, the both div's will moved. But I need to move only one, according to id of tr it laid.</p>
<p>I have only wrong ideas:</p>
<pre><code>$(".move").parent.parent.attr('id', 'ex2').remove();
</code></pre>
<p>Thank you so much!</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,989,077
| 1,989,078
|
Generic Type Detection
|
<p>What's the equivalent of the following in C#?</p>
<pre><code>template<class T>
struct S
{
typedef T MyType;
};
</code></pre>
|
c# c++
|
[0, 6]
|
985,081
| 985,082
|
Modalpopupextender gets hide for some time once checkchanged event fires?
|
<p>I have used ModalpopupExtender control in my web page. I have checkbox for selectall option with checkchanged event with checkboxlist control(With list of options). Whenever i check selectall option then all rest of the options gets selected & modalpopup window gets invisible for little time & again it comes visible as i used code in checkchanged event of selectall checkbox as follows:</p>
<pre><code>ModalPopupExtender1.Show();
</code></pre>
<p>But i want to keep modalpopup window as it is once checkbox for selectall is checked, dont want to disappears popup window & display again.
I used C# & asp.net.
Please help me to solve this problem.</p>
|
c# asp.net
|
[0, 9]
|
2,644,308
| 2,644,309
|
trailing comma problem, javascript
|
<p>I'm currently trying hard to get my jQuery to work in IE7, when I Lint the following:</p>
<pre><code>$(".regflow").validate({
errorLabelContainer: $("#error-message"),
rules: {
txtTextOnly: {required: true,textOnly: true},
txtNumbersOnly: {required: true,numbersOnly: true},
txtPhoneOnly: {required: true,phoneOnly: true},
txtAreaCodeOnly: {required: true,numbersOnly: true},
txtSimCodeOnly: {required: true,simCodeOnly: true},
txtCprOnly1: {required: true,numbersOnly: true},
txtCprOnly2: {required: true,cprOnly1: true},
txtMailOnly: {required: true,mailOnly: true}
},
messages: {
txtTextOnly: {required: "Dette felt skal udfyldes"},
txtNumbersOnly: {required: "Dette felt skal udfyldes"},
txtPhoneOnly: {required: "Dette felt skal udfyldes"},
txtAreaCodeOnly: {required: "Dette felt skal udfyldes"},
txtSimCodeOnly: {required: "Dette felt skal udfyldes"},
txtCprOnly1: {required: "Dette felt skal udfyldes"},
txtCprOnly2: {required: "Dette felt skal udfyldes"},
txtMailOnly: {required: "Dette felt skal udfyldes"}
},
});
</code></pre>
<p>... I get this error from Lint: <em>"warning: trailing comma is not legal in ECMA-262 object initializers"</em></p>
<p>Does anyone know what this means, and how do I fix it?</p>
|
javascript jquery
|
[3, 5]
|
3,049,587
| 3,049,588
|
Postback problem on a submit button !
|
<p>I have a page that has 4 tables. Initially when the page is loaded, it shows 1 & 2. Thats working fine. On Post back(When Submit is clicked), it should show 3 &4. Even thats working fine(code shown here). When the submit is clicked again, it has to call updatePaymentInfo() and redirect.. Is there something to write as a condition to call UpdatepaymentInfo() because when submit is clicked, it is taking as an other postback and showing me 3 &4 again. </p>
<pre><code>protected void imgbtnSubmit_Click(object sender, ImageClickEventArgs e)
{
try
{
if (Page.IsPostBack)
{
trtest.Visible = false;
trCCandBilling.Visible = true;
trtest2.Visible = true;
}
else
{
UpdatePaymentInfo();
Response.Redirect(ApplicationData.URL_MERCHANT_ACCOUNT_HOME, true);
}
}
}
</code></pre>
<p>Thanks guys!!</p>
|
c# asp.net
|
[0, 9]
|
1,046,307
| 1,046,308
|
0 is null or not an object error
|
<p>Am using the following javascript programm for convert pdf file to binary file .It will work properly in FireFox.but in IE it will display the "0 is null or not an object javascript" .how to solve this? </p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script>
$(document).ready(function(){
$('#document_upload').change(function()
{
var fileList = this.files;
var file = fileList[0];
create_blob(file,function(blob_string)
{
replace_binary_data=blob_string;
$("#document_binary").val(replace_binary_data);
});
});
function create_blob(file, callback)
{
var reader = new FileReader();
reader.onload = function()
{
callback(reader.result)
};
reader.readAsDataURL(file);
}
});
</script>
<body>
<input type="text" id="document_binary" value=""/>
<div id="upload_document">
<input type="file" name="document" id="document_upload"/>
</div>
</body>
</html>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
248,608
| 248,609
|
Delete cache for a single tooltip on click event
|
<p>I am using the <a href="http://www.lullabot.com/files/bt/bt-latest/DEMO/index.html" rel="nofollow">BeautyTips plugin</a> for tooltips on my website.</p>
<p>I am caching all ajax content that goes into my tooltips. What I want to do is delete a cache for a single element after a click action.</p>
<p>So:</p>
<pre><code>$("#SomeId").click(function(){
/// now clear a tooltip cache but of only single tooltipped element. how to do it?
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,768,154
| 5,768,155
|
Setting a jQuery slider maximum value to unlimited?
|
<p>Can you set a jQuery slider to have a maximum value of 10,000 - but then if moved at all to the left it scales as though it was a slider of between 1-50 (if they move it to the right it returns to the very high value).</p>
<p>So it would be something like:</p>
<p>min: 0,
max: 50,
secondmax: 10000, (<- this is what I need to figure out).
values: [0, 50, 10000], </p>
<p>We have a filter by distance slider on our job board and want it, by default to be unlimited - and then if the user moves the slider left it should scale between reasonable values (1-50).</p>
|
javascript jquery
|
[3, 5]
|
3,299,665
| 3,299,666
|
Passing get parameter from javascript to php destroys formatting
|
<p>I format text with javascript asigning <code>+</code> to every emtpy space like this</p>
<pre><code>var ft = text.replace(/ /g,"+");
</code></pre>
<p>Then I pass <code>ft</code> to a php script via jquery ajax as an get argument.</p>
<p>But</p>
<pre><code>print $_GET['text'];
</code></pre>
<p>gives me the text with empty spaces instead +.</p>
<p>Any ideas?</p>
|
php javascript
|
[2, 3]
|
2,925,826
| 2,925,827
|
PHP/JavaScript How to combine 2 page in one
|
<p>I need a reference on how to make 2 pages become one.</p>
<p>Originally i have 2 php pages. View.php and comment.php</p>
<p>The view.php will have a link to call comment.php. When click the 'comment' link, it will open comment.php like pop up. After fill in the comment, and click send, it will closed and return the view.php. </p>
<p>The problem is, Instead of popup i want it hide until i click it. I dont know what is the exact term to call this process. I know it got something to do with javascript, using id, onclick function and similar to frame function. Because i dont know what it call, it hard for me to research. So anyone please tell me what it called or gimme any references or example solution on how to do it.</p>
<p>thank you very much</p>
<p>UPDATED:</p>
<p>dear all..</p>
<p>found this code in internet. Like RageZ said..it uses css and javascript to show and hide img. how to use for others? </p>
<p>do i need to convert my comment.php into a function and put in view.php n use the id for that function. is it possible?</p>
<pre><code><html>
<head>
<script>
function changeme(id, action) {
if (action=="hide") {
document.getElementById(id).style.display = "none";
} else {
document.getElementById(id).style.display = "block";
}
}
</script>
</head>
<body>
<img id="myIMG" style="display: none;" src="question.php.html"width="100" height="100" />
<span onclick="changeme('myIMG', 'show');" style="color: blue; text-decoration: underline; cursor: pointer;">Show the image</span>
<span onclick="changeme('myIMG', 'hide');" style="color: blue; text-decoration: underline; cursor: pointer;">Hide the image</span>
</body>
</html>
</code></pre>
|
php javascript
|
[2, 3]
|
619,237
| 619,238
|
bx slider vertical scroll jumping and other issues
|
<p>I am using bx slider to create an auto, vertical scrolling slideshow. I am currrently having two issues:</p>
<ol>
<li>It jumps quite a bit when it gets back to the first slide.</li>
<li>After three or four cycles, the last slide rolls out of the div and then the screen is white for a good three or four seconds and the scroll begins at the bottom again. So a giant blank space in the scroll basically after about three or four passes.</li>
</ol>
<p>What kind of things do I need to look for here to diagnose and solve this problem? Pseudo code of what I am using:</p>
<pre><code>$('#example_container').bxSlider({
mode: 'vertical',
ticker: true,
tickerHover: true,
tickerSpeed: 1500,
displaySlideQty: 3
});
<div id ="example_container">
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
<div class ="example_slide">
//contents
</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,268,868
| 3,268,869
|
How can I check if a background image is loaded?
|
<p>I want to set a background image on the body tag, then run some code - like this:</p>
<pre><code>$('body').css('background-image','http://picture.de/image.png').load(function() {
alert('Background image done loading');
// This doesn't work
});
</code></pre>
<p>How can I make sure the background image is fully loaded?</p>
|
javascript jquery
|
[3, 5]
|
5,900,298
| 5,900,299
|
Ajax message
|
<p>Want to display a "confirm" message in my asp.net appl, when the window closes, but when the Cancel button is pressed, the page closes, the event is not Canceled.
I tried a different approach: I use; event.returnValue = "Message";
This approach works (when cancel is pressed, page does not close), but I get the "Message" that I specify plus some other message; "Click Acept or Cancel to calcel" or something similar.</p>
<p>How can I create a message on the client side that only displays the text that I specify</p>
<p>Many thanks in advanced guys!!! </p>
|
asp.net javascript
|
[9, 3]
|
4,859,251
| 4,859,252
|
Javascript progress animation
|
<p>I am trying to build a progress bar using jQuery and javascript.</p>
<p>It is basically a bar</p>
<pre><code><div id="progressbar"><div id="progress"></div>
<div id="number">0%</div>
</code></pre>
<p>when you click on the next button (which isnt here) it changes the width of the progress div and using css3 it animates it nicely, but my problem here is the number. I have 5 screens so they are all 20% each and I would like to animate the numbers so while the bar is getting wider the number flicks through all numbers from 0% to 20% in the same time as the bar animation (0.5s)</p>
<p>I know with JQuery you could just use the innerHTML command and change it from 0% to 20% but I wanted to animate it.</p>
<p>Any idea how to do that?</p>
|
javascript jquery
|
[3, 5]
|
1,142,253
| 1,142,254
|
JQuery Modal Box On PHP else die
|
<p>Just wondering if there is a way to include a JQuery modal box/popup in the event of a PHP else die statement, e.g: <code>else die("Invalid");</code>.</p>
<p>So rather than the output <code>Invalid</code> displaying on the page, the else die triggers a JQuery modal popup box that contains the output <code>Invalid</code>.</p>
|
php jquery
|
[2, 5]
|
1,115,693
| 1,115,694
|
How do I re-create "this" inside an event handler?
|
<p>I've got an event handler that was pre-bound to a specific variable (via <code>$.proxy</code>). As a result, when the handler is triggered, <code>this</code> isn't the normal value, it's my pre-bound value.</p>
<p>I'd like to recover <code>this</code> using the handler's <code>event</code> argument, but <code>this</code> doesn't seem to map directly to <code>event.currentTarget</code>, <code>event.target</code>, or any other event property.</p>
<p>So, I've tried digging through the jQuery source, but the event callback stuff is very convoluted, and I can't figure out exactly what <code>this</code> is getting set to. Does anyone know how simulate a jQuery event handler <code>this</code> using only the event argument?</p>
<p><strong>* * Edit * *</strong></p>
<p>Just to clarify, here's an example:</p>
<pre><code>var boundThis = {foo: 'bar'}
var handler = $.proxy(function(event) {
// Because of the $.proxy, this === boundThis
// (NOT the normal "this" that jQuery would set)
// In theory event has everything I need to re-create this,
// but I'm having trouble figuring out exactly how
// Here's a naive/non-functional example of what I'm trying to do
jQueryThis = event.target; // If only this worked ...
}, boundThis);
$(someElement).click(handler);
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,207,798
| 4,207,799
|
Move Android Status Bar in Ice Cream Sandwich
|
<p>I'm working on a project to modify some of the UI elements on Android 4.0 (Ice Cream Sandwich.) Specifically, I'm trying to reposition the status bar to the bottom of the screen.</p>
<p>I have found a post for doing something very similar <a href="http://stackoverflow.com/questions/5971585/move-the-android-status-bar">here</a>; however, the information is for Froyo and the source tree, not surprisingly, had diverged enough since then to render the information outdated (the referenced source files no longer appear to exist in the 4.0.3 AOSP.) </p>
<p>Does anyone have any information as to where the relevant source files to modify the status bar position now exist in the ICS AOSP and what changes are required to modify the status bar position?</p>
<p>Thanks!</p>
|
java android
|
[1, 4]
|
3,066,868
| 3,066,869
|
Creating a jQuery plugin to cause individual elements to react when the window is resized. How do I handle the listeners?
|
<p>I'm working on a plugin that causes something to happen in selected elements when the window is resized. The logic on what happens is perfectly fine, but I'm running into a conundrum when it comes to where to hook on the event listeners.</p>
<p>Basically, the code looks something like this:</p>
<pre><code>$.fn.beAwesome = function() {
return this.each(function(){
// ???
});
}
</code></pre>
<p>While I've completed the rest of the plugin (and have it working just fine on, say, a click even on <code>this</code>), I can't put it "all together" without solving this central issue.</p>
<p>I considered just adding an extra bind <code>resize</code> to <code>$(window)</code> for each awesome element, but there'd be no way to access the element from within the closure:</p>
<pre><code>$.fn.beAwesome = function() {
$window = $(window);
return this.each(function(){
$window.resize(function(){
// can't access initial awesome element
});
});
}
</code></pre>
<p>The other solution that sprung to mind was to instantiate a global data store (probably in <code>$(document).data('beAwesome')</code> or something like that. This, however, doesn't seem Javascript-like, blocking off access once the function runs its course, so I'd have to come up with some roundabout ways to do things like removing the hook. I've definitely seen approaches like these in Javascript libraries I've used in the past, but I don't know whether that's due to necessity or laziness on the authors' parts.</p>
<p>So is there an effective way to accomplish what I'm looking for?</p>
|
javascript jquery
|
[3, 5]
|
1,152,135
| 1,152,136
|
how to make a single jar file of multiple classes that can be used in other projects
|
<p>I have some classes say I have 20 classes with different objectives. Now what I want to do is that I want to make a single jar file of all of them. I want to do this because I want to use these classes as a single Jar in other projects. How can I do this?</p>
|
java android
|
[1, 4]
|
6,020,539
| 6,020,540
|
jQuery Ajax call not working in Chrome Browser
|
<p>jQuery Ajax call not working in Chrome Browser.</p>
<p>my code :-</p>
<pre><code>function memories(pageName)
{
$.ajax({
type: "POST",
url: pageName,
success: function(html){
$("#page").load(pageName);
}
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
129,446
| 129,447
|
How to load file from URL on every 2s (over and over )?
|
<p>How to load file from URL on every 2s (over and over )? Do I need to close connection or to stay connected ( I load one time with this code ) ? Do I need to use synchronized somewhere ?</p>
<pre><code>public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView txt=(TextView)this.findViewById(R.id.lbl);
try {
URL url = new URL("http://10.0.2.2/test/dynamic/test.json");
URLConnection urlconnection = url.openConnection();
long l = urlconnection.getContentLength();
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
StringBuffer buffer=new StringBuffer();
while ((line = in.readLine()) != null)
{
buffer.append(line);
}
in.close();
System.out.println("bufer="+buffer.toString());
txt.setText(buffer.toString());
Object obj = JSONValue.parse(buffer.toString());
JSONArray array = (JSONArray) obj;
for(Object o:array){
JSONObject element_json = (JSONObject)o;
int id=Integer.parseInt(""+element_json.get("id"));
int type=Integer.parseInt(""+element_json.get("type"));
int device_type=Integer.parseInt(""+element_json.get("device_type"));
}
} catch (Exception exc) {
exc.printStackTrace();
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,016,613
| 5,016,614
|
iframe video in automatic fullscreen on a webview android
|
<p>This is the code I'm using to play a video inside a webview, however I want that the video to fill the fullscreen when I start the app. This way the user doesn't need to tap the fullscreen button. I already tried some ways but till now, no success. </p>
<p>If someone can help me, thanks.
;)</p>
<pre><code>webView = (WebView) findViewById(R.id.webView);
webView.getSettings().setJavaScriptEnabled(true);
WebSettings webViewSettings = webView.getSettings();
webViewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setPluginState(PluginState.ON);
webView.setInitialScale(100);
webViewSettings.setBuiltInZoomControls(true);
webViewSettings.setPluginState(PluginState.ON);
webView.loadData("<iframe src=\"http://antena24.com/sic.php\" ></iframe>", "text/html","utf-8");
</code></pre>
|
java android
|
[1, 4]
|
2,611,282
| 2,611,283
|
Use Javascript Object in PHP without POST or AJAX
|
<p>Is there a way to pass a JSON object directly into PHP and work with it?</p>
<p>Something like this:</p>
<pre><code><script>
var gridData = {"id":100,"level":"B","Zone":"Entry"};
</script>
<?php
echo "Your grid Information is:". [**How to get the gridData displayed here**]
?>
</code></pre>
<p>I know I can pass to backend using AJAX, get the result and show it up in a div, but is there an easier way since I am already in this page and I already have the data in Javascript?</p>
<p>Also please note: I am working off some really old legacy code I inherited with lot of business logic calculations in a custom javascript platform, so please bear with me that the whole architecture is a bit odd :) </p>
|
php javascript
|
[2, 3]
|
944,708
| 944,709
|
How to open a user control as popup using jQuery dialog
|
<p>I have Parts.aspx page,<br>
UserControl1.ascx,[ it contains a textbox and one button1 ]<br>
Add.ascx Controls [ it contains a textbox, button2, button 3 ]<br>
I have added UserControl1.ascx in parts.aspx page.</p>
<p>Now when I click button1 [usercontrol1.ascx] it should open like a popup Add.ascx on top of the page using JQuery Dialog.<br>
In Add.ascx user enters comments in the textbox and clicks Submit, after this it should close Add.ascx and the comments entered in Add.ascx page should appear in UserControl1.ascx textbox for <em>readonly</em>.</p>
|
jquery asp.net
|
[5, 9]
|
5,628,889
| 5,628,890
|
Ques regarding sending email to a specific user
|
<p>So I just googled n found out this code:-</p>
<pre><code>MailMessage message = new MailMessage ("abc@somedomain.com","administrator@anotherdomain.com","Testing","This is a test mail");
</code></pre>
<p>Now my ques:-
How do I send a nicely formatted Email with links and all instead of simple text "This is a test mail" ??
I don't wanna attach no file</p>
|
c# asp.net
|
[0, 9]
|
2,813,969
| 2,813,970
|
ie8 split function issue in javascript
|
<p>I want to split the string with <code>'</span>'</code>. I used the following code</p>
<pre><code>var select_value = td_value.split('</span>');
</code></pre>
<p>It works in fine in FF, chrome. But IE not support this. So i tried the following. But it is not working.</p>
<pre><code>var select_value = td_value.split(/</span.*?>/gi);
</code></pre>
<p>What is the issue with this? please help. Thanks</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,450,828
| 4,450,829
|
ASP.net Data GridView
|
<p>I need to generate Data gridview just like below. All the P Cells should be textboxes and editable. I have no clue how to do it .please let me know how I can do it in C#. Thanks in advance </p>
<p><img src="http://i.stack.imgur.com/Wcz3s.png" alt="enter image description here"></p>
|
c# asp.net
|
[0, 9]
|
3,274,877
| 3,274,878
|
Yes No Cancel buttons for AJAX Modalpopupextender
|
<p>Does Ajax ModalPopupExtender has an option to create 3 buttons?? Yes, No and Cancel? for Asp.net, c# </p>
<p>I have been trying since few days. But i could not come up with a solution. I can just find OKControlID and CancelControlID. </p>
<p>
</p>
<pre><code><table id="pnlPopupMerchantUpdate" runat="server" style="display:none">
<tr>
<td>
<asp:Panel runat="server" CssClass="modalPopup">
<table width="350" height="80" class="warningPopup">
<tr>
<td>
<!-- <img src="images/warning_blue.gif" alt="Warning" /> -->
</td>
<td colspan="2" align="left" style="padding-left: 75px; padding-top: 10px;">
Do you wish to update the Location Information as well.
</td>
</tr>
<tr>
<td align="center" colspan="4">
<input id="btnYesMerchant" type="button" value="Yes" class="popupButton" causesvalidation="true" onclick="btnYessave_Click"/>
<input id="btnNoMerchant" type="button" value="No" class="popupButton" causesvalidation="true" onclick="btnNosave_Click" />
<input id="btnCancel" type="button" value="Cancel" class="popupButton"/>
</tr>
</table>
</asp:Panel>
</td>
</tr>
</code></pre>
<p>Here,i do want to call different functions for Yes and No. Can somone help me. Thanks!!</p>
|
c# asp.net
|
[0, 9]
|
3,761,811
| 3,761,812
|
JS syntax breaks the page
|
<p>I have the following code in my external JS file:</p>
<pre><code>var myDiv = $(".myDiv");
if (myDiv.css('left') == 'auto') {
var pos = myDiv.position();
myDiv.css({ "left:" + pos.left + "px", "top:" + pos.top + "px" });
}
</code></pre>
<p>It appears that the following line breaks my page:</p>
<pre><code>myDiv.css({ "left:" + pos.left + "px", "top:" + pos.top + "px" });
</code></pre>
<p>If I comment it out everything works fine, except this functionality, obviously. </p>
<p>And if I put the values in alert I get them correctly as well.</p>
<pre><code>alert(pos.left + ' ' + pos.top)
</code></pre>
<p>What am I missing?</p>
|
javascript jquery
|
[3, 5]
|
2,446,207
| 2,446,208
|
ASP.NET Windows Role Provider (AspNetWindowsTokenRoleProvider) not noticing a user being added to a new group
|
<p>I am trying to create an application that uses <strong><authorization></strong> rules to limit the groups that are authorized to access the application. I am using Windows authentication and the Windows Role provider for ASP.NET (AspNetWindowsTokenRoleProvider). I am using local groups to define the roles, as the domain that I am developing on, and the domain that the app will eventually be deployed to will be different.</p>
<p>When I initially setup deployed my application to an IIS7 server, and I setup the site to use basic authentication, with the proper default domain, everything worked fine for the users that were already assigned to the authorized groups. However, when I attempted to add a new user to any of the authorized groups, this user was never authorized to access the application. I have done everything save for rebooting the machine. I restarted IIS as well as deleted all temporary files and cookies on the client side, to no avail.</p>
<p>It should be stated that this is an ASP.Net MVC app, though I didn't think that would really make any difference. Here are the pertinent entries from my web.config:</p>
<pre><code><!-- use windows authentication -->
<authentication mode="Windows" />
<!-- use the Windows role provider -->
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" />
<!-- global authorization rules -->
<authorization>
<allow roles="admins,contractors"/>
<deny users="*" />
</authorization>
</code></pre>
<p>For instance, let's say we have a user, "Domain\joe", that is not currently a member of the local "admins" group, but we want to add him. We go add him, and then when Joe attempts to login, he sees an error that he is not authroized (after several failed login attempts). No amount of IIS restarts or having Joe delete his cookies and other temporary files will solve this issue.</p>
<p>Is ASP.Net keeping some kind of secret role/group cache? How do you go about adding a new user to a group and then ensuring that the role provider will see that the user was added to a group?</p>
|
c# asp.net
|
[0, 9]
|
2,926,575
| 2,926,576
|
Find Out Dynamic IP address of Computer using c#
|
<p>I've to check that system has static or dynamic IP Address & then display ITs Dynamic address.I know how to find out static address.I want to know how to find out Dynamic IP address.....</p>
|
c# asp.net
|
[0, 9]
|
6,023,465
| 6,023,466
|
Finding which elements in the page share the left and the right edges with any component
|
<p>How to find which elements share their right edge with the left edge of an component and which components share their left edge with the right edge of the component? So my function takes a single id say X and returns me a Java script object like </p>
<pre><code>{
leftElements = [leftElement1,leftElement2,...],
rightElements = [rightElement1,rightElement2,...],
}
</code></pre>
<p>So leftElements will contain an array of ids of components that share their right edge with the left edge of the argument to the function and rightElements will contain their left edges aligned with the right edge of the argument . The argument will be a string id.</p>
<p>So when I do elements('x') , i get an object like the above .</p>
|
javascript jquery
|
[3, 5]
|
3,306,438
| 3,306,439
|
Any solution to use non-guessable links in a program?
|
<p>I've been looking for a file hosting site to host my files and my friend offered me a premium account on Box.net.</p>
<p>The problem in this host site (and on many others) is that the links arent guessable, they cant be predicted. That means: If you upload 2 images called "1.jpg" and "2.jpg", the links aren't like </p>
<blockquote>
<p>"www.host.com/omar/1.jpg , www.host.com/omar/2.jpg" ,</p>
</blockquote>
<p>instead, they are like </p>
<blockquote>
<p>"www.host.com/qweqwasd , www.host.com/123lqqwje" .. </p>
</blockquote>
<p>So I cant use them on my application since I upload a lot of small site and I cant copy each link manually, it will take days.</p>
<p>Is there a way to override this problem in a program? maybe run a script to get all the links on the site? </p>
|
c# java javascript
|
[0, 1, 3]
|
4,723,658
| 4,723,659
|
Using class as object property name
|
<p>For the below code Aptana is giving me "Missing name after. operator" but the code is working.</p>
<p>Can I use class as an object variable name. Also what are the reserved keyword for variable name.</p>
<pre><code>response = JSON.parse(data);
alert(response.class);
</code></pre>
|
javascript jquery
|
[3, 5]
|
963,562
| 963,563
|
adding thumbnail to gridview
|
<p>I have been struggling for a while to add a thumbnail of an image to a gridview so that the image can be displayed as a smaller version of the original.</p>
<p>I am still in the process of learning C# coding and was hoping I could receive some help. I managed to upload the picture and even to display the picture but getting it to thumnail size is problematic.</p>
<p>I will insert some code as one of numerous attempts(all of which returns errors)</p>
<p>kind regards</p>
<pre><code>if (upImage.HasFile)
{
try
{
string filename = Path.GetFileName(upImage.FileName);
//****************************************************
System.Drawing.Image sourceImage = System.Drawing.Image.FromFile(Server.MapPath("~/") + filename);
System.Drawing.Image thumbNail = sourceImage.GetThumbnailImage(70, 70, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
thumbNail.Save(Path.ChangeExtension(filename, "thumb"));
upImage.SaveAs(Server.MapPath("~/") + filename);
//upImage.SaveAs(Server.MapPath("~/") + filename);
lblUpload.Text = "Upload status: File uploaded!";
}
catch (Exception ex)
{
lblUpload.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
}
}
public bool ThumbnailCallback()
{
return true;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,412,191
| 1,412,192
|
Jquery / Javascript get params from window localtion
|
<p>My URL is:</p>
<pre><code>http://localhost:3000/?sort=rating
</code></pre>
<p>The parameter <code>sort</code> is dynamic, and I would like to add it to another URL.</p>
<p>In my javascript I have:</p>
<pre><code>window.location.pathname + '.js?page=' + currentPage
</code></pre>
<p>How do I add the <code>sort</code> parameter at the end? </p>
<p>Example:</p>
<pre><code>window.location.pathname + '.js?page=' + currentPage + &sortparam
</code></pre>
<p>In this case it would be:</p>
<pre><code>window.location.pathname + '.js?page=' + currentPage + '&sort=rating'
</code></pre>
|
javascript jquery
|
[3, 5]
|
325,571
| 325,572
|
Visual C# : how to login to a website(that is built via asp.net classic) and keep the user logged in ..
|
<p>Step 1 : Log into a website
Step 2 : navigate a a particular page
Step 3 : download a file (I suppose webclient would be ideal here) </p>
<p>would like all this to be happening silently without the user knowing it .
I do not want to use the webbrowser object for the same reason</p>
<p>Note : The Website is built by someone else
disconnects if the user is idle for a certain period of time. </p>
<p>Problem is , I have no idea reagarding how to go about keeping the user logged in that website using c# . I do not have a concrete idea of it yet . i just wanted someone to point me in the right direction . </p>
<p>Thanks </p>
|
c# asp.net
|
[0, 9]
|
4,020,445
| 4,020,446
|
OO design: Using Linq2Sql in Front-end pages
|
<p>Would it be a terrible if I were to use Linq2Sql in my front end pages (ie: aspx and ascx pages). It would save me huge amounts of time.</p>
|
c# asp.net
|
[0, 9]
|
2,861,737
| 2,861,738
|
JavaScript Function Return Scope
|
<p>A function triggers a database call which returns some Json. This CID is then used to stamp the newly added DOM element.</p>
<p>I need to retrieve / return the value of "cid" which exists within ajax success block, it will be used to update attribute.</p>
<p>Error
<strong>cid is not defined</strong></p>
<pre><code>//Save New Task
$("body").on('click','.icon-facetime-video',function(event){
var new_entry = $(this).prev().val();
var thebid = $(this).parents('tbody').prev().find('th').attr('id').split('_')[1];
$(this).parent().addClass('tk').html('<i class="icon-eye-open"></i> '+new_entry);
//CALL FUNCTION
var cid = update_entry('new_tk',new_entry,thebid); //value of cid from update_entry
$(this).parent().attr('id','cid_'+cid);
});
function update_entry(typeofupdate,new_entry,thebid){
switch(typeofupdate){
case 'new_tk': var action = 'new_tk';
break;
}
$.ajax({
type:'post',
url: 'posts_in.php',
dataType: "json",
data: {cid : thebid, action: action, content: new_entry},
success: function(data){
var action = data[0],cid= data[1];
console.dir(data);
}
});
return cid;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,149,744
| 4,149,745
|
SimpleCursorAdapter is undefined?
|
<p>Below is the sample of code giving me grief. The simpleCursorAdapter works if I put it outside of the textchangedlistener but not in I keep getting the message</p>
<blockquote>
<p>The constructor SimpleCursorAdapter(new TextWatcher(){}, int, Cursor, String, int, null) is undefined</p>
</blockquote>
<pre><code>txt.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
//onTextChanged
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
//beforeTextChanged
}
public void afterTextChanged(Editable s) {
//afterTextChanged
typedText = s.toString();
Cursor cur = db.rawQuery("SELECT * FROM " +
DB_TABLE +" where field LIKE '%" + typedText + "%'" , null);
String displayFields = "field";
int displayViews = R.id.bmark_visits;
setListAdapter(new SimpleCursorAdapter(this,
R.layout.testlist, cur,
displayFields, displayViews, null
));
}
});
</code></pre>
|
java android
|
[1, 4]
|
5,240,951
| 5,240,952
|
Get Parameters used by ObjectDataSource in ASP.NET
|
<p>How can I access the values passed after an update using the following asp.net controls:</p>
<ul>
<li>details view</li>
<li>objectdatasource</li>
</ul>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
2,137,460
| 2,137,461
|
Custom Query Dynamic Data Application
|
<p>I am trying to use a Dynamic Data Application and having issues with customizing a query. Everything scaffolds wonderfully, however, I want to be able color code the main Parent table when a Child Objects Property is a certain value. Normally I would just iterate over the data using LINQ however, all the information I've researched always filters and color codes items in the grid based on the Parent level data. Any ideas on how to do this on Child Data?</p>
|
c# asp.net
|
[0, 9]
|
3,273,433
| 3,273,434
|
Synonym for ApprovalWorkflow
|
<p>We have an abstract workflow class that is called <strong>ApprovalWorkflow</strong> the thing is it can hold both an approve, reject and input state. Its slightly misleading to call it ApprovalWorkflow but I cant be sure of what the right term is. </p>
<p>Does anyone know of a better term to call ApprovalWorkflow as it can Authorize and Reject?</p>
|
c# java c++
|
[0, 1, 6]
|
2,730,357
| 2,730,358
|
adding an "active" class to parent and child element
|
<p>Need to add an active class to both parent and child element if a user clicks on the child element in a list. My html is as follows:-</p>
<pre><code><ul class="tabs">
<li class="accordion"><a href="#tab1">Bar</a>
<ul class="sub">
<li>lorem/li>
<li>ipsum</li>
<li>Lorem Ipsum</li>
<li>Dolor Sit Amet</li>
</ul>
</li>
</code></pre>
<p>and I'm using the jquery code below to add an active class to both the parent and child element yet I'm having errors:-</p>
<pre><code>$("ul.tabs li").click(function() {
$("ul.tabs li").removeClass("active").find(".sub li").removeClass("active");
$(this).addClass("active").find(".sub li").addClass("active");
});
</code></pre>
<p>Then styled my active class in CSS. say example</p>
<pre><code>.active {background:#EFEFEF;}
</code></pre>
<p>only the clicked (this) child element should have the active class applied to it and not the whole li child elements. Now together with the child li (say lorem) the parent li (bar) should also be highlighted. Think of it like a tree accordion menu where both the selected child element and it's parent li have the active class with different css styling.</p>
|
javascript jquery
|
[3, 5]
|
2,035,959
| 2,035,960
|
The import javazoom cannot be resolved
|
<p>hi all
i use the javazoom.jl.player.Player package but it is says The import javazoom cannot be resolved. i am using eclipse and doing Android project. i clean the project still the same error is shown. please correct me.</p>
|
java android
|
[1, 4]
|
3,204,755
| 3,204,756
|
jquery 1.9.1 on event not working
|
<p>With Jquery v1.5.2 following function works, I have upgraded jquery to 1.9.1 live has been replaced to <strong>on</strong> function. if I change live to on. its not working.</p>
<p>I changed on to live and included the migration plugin its working. how can I use this with <strong>on</strong> function </p>
<pre><code>$( ".pop-up" ).live(
"click",
function( event ){
// get the id of the item clicked on
var id = $(this).attr('id');
alert(id)
// block the href actually working
return( false );
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,813,221
| 5,813,222
|
Field of view type effect?
|
<p>I've been playing around with blocking out other divs on button press, and Block UI is a very nice tool, however it creates rectangular blocks around divs which doesn't really look good, so I was wonering if it was possible to do a "field of view" type block with jquery like the one in the image below.</p>
<p><img src="http://i.stack.imgur.com/tI5Lu.jpg" alt="enter image description here"></p>
<p>Thanks so much :)</p>
|
javascript jquery
|
[3, 5]
|
1,733,796
| 1,733,797
|
Does div with certain content exist
|
<p>If I have a container div called <code>#container</code> which has a bunch of <code>.inside</code> divs in it, how would I go about checking whether a certain <code>.inside</code> div with a specified content (just a string of English text) exists or not? I'm doing this to prevent duplicates in a notification system I'm setting up for a website. I don't need the actual text - just whether it exists. Also, being able to modify the content of the <code>.inside</code> div if it's found would be good, so I can increment and show the number of times that message has occurred (grouping, if you like).</p>
<p>Thanks,</p>
<p>James</p>
|
javascript jquery
|
[3, 5]
|
3,842,851
| 3,842,852
|
Query-able Client-Side Storage for GridView and DetailsView
|
<p>My concern is that using a DetailsView with a Selectable GridView requires two queries to the SQL server. One to populate the GridView with data and a second each time an item is selected from the GridView to display the pertinent information in the DetailsView. Is there not a way to just make the first query which gathers all necessary data, store it somewhere client-side to populate the DetailsView on SelectedIndexChange? Is there not some kind of query-able, static, client-side object that I can store this in and bind to the DetailsView as a datasource?</p>
|
javascript asp.net
|
[3, 9]
|
1,305,047
| 1,305,048
|
IEnumerable.except error
|
<p>I have two <code>IEnumerable<dynamic></code> of data retrieved from database tables, called <code>FullSet</code> and <code>InScopeSubSet</code> . </p>
<p>The second <code>IEnumerable<dynamic></code> is a subset of the first set (both sets have <code>ChildID</code> as their unique ID)</p>
<p>I would like to create a new <code>IEnumerable<dynamic></code> that contains only items from x that do not occur in y</p>
<p>I have tried the following but it will not compile. It says:
<em>"extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax"</em></p>
<pre><code> var sql = "SELECT ChildID, FirstName, Surname FROM Child ORDER BY ChildID ASC";
var FullSet = DB.Query(sql);
sql = "
SELECT UserScope.ChildID, Child.FirstName, Child.Surname
FROM UserScope
INNER JOIN Child ON UserScope.ChildID=Child.ChildID
WHERE UserAccountID = @0 ORDER BY ChildID ASC
";
var InScopeSubSet = DB.Query(sql, UserAccount.UserAccountID);
var OutScopeSubSet = FullSet .Except(InScopeSubSet );
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,917,819
| 2,917,820
|
Retrieving and displaying dynamic content from SQL database into ASP.NET pages
|
<p>I am currently working on the development of news portal website in asp.net. I have created a table in sql server 2008 with parameters (NewsId, NewsTitle, NewsDetails, NewsCategory). I am now able to dynamically retrieve the NewsTitle from the database and displaying it in my aspx page.
Now I want to pass the NewsId for that particular NewsTitle and then retrieve the NewsDetails in a separate aspx page. What is the best thing to do this in ASP.NET? I don't want to create new aspx pages every time a link to the NewsTitle is clicked, rather I am interested to use the same Details page and pass different ID parameters?</p>
<p>regards,</p>
|
c# asp.net
|
[0, 9]
|
3,895,133
| 3,895,134
|
accessing an object literal defined with jQuery onready from without
|
<p>I have adopted a project that has several object literals defined - mostly for just structuring the code. Btw, not a full-time front-end developer. The problem is that some of them are defined with the jQuery onready event and some are outside. This seems really problematic to say the least. Would this be considered bad design? I'm assuming so. I have included a snippet of code that shows some of the problems, specifically the the from_inside function within obj2:</p>
<pre><code><script>
$(document).ready(function(){
alert('here i am' + obj2.handlers2.background2); // can access the obj2 value as expected
alert('make this up: ' + obj2.handlers2.tell_me2());
var obj={};
obj.handlers={
background: 'blue',
foreground: 'green'
}
});
var obj2={};
obj2.handlers2={
background2: 'here i am jt',
foreground2: 'there you are',
tell_me2: function(){
return "these are things";
}
,
from_inside: function(){
alert('color from inside jQuery: ' + obj.handlers.background); // problem here! could I get a reference to obj here?
}
};
obj2.handlers2.from_inside();
</script>
</code></pre>
<p>Given how we currently have it, what would be a preferable workaround? It would seem like I could pass a reference of the jQuery object to obj2 in the above but perhaps it might just be simpler to pull all the objects outside of the jQuery on ready even if at all possible. </p>
<p>thx in advance for any advice</p>
<p><strong>edit #1</strong></p>
<pre><code>$(document).ready(function(){
$(document).on('click','#pairing-comment-submit', function(){
arc.event_handler.submit_pairing_comment.call(this);
});
... about 50 more of these
});
arc={};
arc.event_handler={
submit_pairing_comment: function(){
var id=$(this).data('the-id');
....
},
....
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,618,100
| 4,618,101
|
Detect if any input box on a panel changed
|
<p>How do I detect if any control on a panel has value changed? Is there any event gets fired on a panel if control value changes?</p>
<p>I am having some issues with query printElement() plug in. For that I have to detect changes on panel without a postback.</p>
<p>Thanks,</p>
|
c# asp.net
|
[0, 9]
|
451,146
| 451,147
|
is there a way to use multiple strings in the jquery :contains() selector?
|
<p>hi i was wondering if there is a way to use multiple strings in the <a href="http://http://api.jquery.com" rel="nofollow">jquery</a> selector <code>:contains()</code>. for example I would liek to do something like this:</p>
<pre><code> $("#"+idArray[i]).find("th:Contains(" + query && query2 + ")").closest($(".instTable, .break")).show();
</code></pre>
<p>similar to an if statement's sysntax. is this possible?</p>
<p>thanks</p>
|
javascript jquery
|
[3, 5]
|
978,564
| 978,565
|
Include PHP inside javascript (.js) file
|
<p>I have a javascript file (.js file, not HTML file) containing several js functions. I want to call one of the PHP functions in a PHP file containing only several PHP function from within one of the js functions. Is that possible? Would I need to "include" the .php file containing the php function in the .js file? How would I do that? For example, say I had a file called myLib.php containing a function called "myFunc" that takes two parameters (param1 and param2). Then I have a .js file containing a function called "myJsFunc". How would a call the myFunc (PHP) from within the myJsFunc (javascript function)? Wouldn't I need to include the PHP file somehow in the javascript/.js file?</p>
|
php javascript
|
[2, 3]
|
2,253,793
| 2,253,794
|
How do I create a javascript control in jquery?
|
<p>I am using jquery library.
I have to let users create their own Cars on the browsers. For example:
Let's say that the object model is such that a Car has a collection of wheels and a name. Each wheel has a colour.</p>
<pre><code>var Car = new Car();
Car.Name = "BMW";
Car.Wheels = [];
var WheelR = new Wheel();
WheelR.Colour = "Blue";
var wheelL = new Wheel();
WheelL.Colour = "Green";
Car.Wheels.push(WheelR);
Car.Wheels.push(WheelL);
</code></pre>
<p>What I want to do is user to click on the button 'Create Car'</p>
<p>This will then append a div element within the body of the html form.
Within a div, there will be a textarea where user will enter the name.</p>
<p>User will then click on 'Add Wheel' button.
This will then append a div element within the car's div element.
This div will contain a combo box and user will select a colour and click on Add.</p>
<p>User can add wheels to a car at max 4 times.</p>
<p>User can then add another car on the screen.</p>
<p>I want to create a Car control and a Wheel control and have it mapped to the object model I have created above. </p>
<p>Can someone please give me some ideas and guidance?</p>
<p></p>
|
javascript jquery
|
[3, 5]
|
5,447,603
| 5,447,604
|
Android - getTabHost() is undefined
|
<p>I started learning Java and how to program for Android last night :)</p>
<p>So far I'm on this tutorial: developer.android.com/resources/tutorials/views/hello-tabwidget.html</p>
<p>Clearly these tutorials have been designed for people that already have experience with Java. </p>
<p>Despite the tutorial lacking all the required steps (for an absolute beginner with Java) and even having a typo, it seems I've figured everything out (which I'm really proud of :p). Except I cannot figure out how to fix <code>TabHost tabHost = getTabHost();</code> which apparently is undefined.</p>
<p>I have one other error shown in the linked image below, but I don't see why.</p>
<p>Here is the <a href="http://imgur.com/Ifw6w.png" rel="nofollow">linked image</a>.</p>
<p>Thanks, Gareth</p>
|
java android
|
[1, 4]
|
3,526,302
| 3,526,303
|
Find control of child gridview in a dropdown selected index change event
|
<p>i have a two gridview Gv1 which is parent and gv2 which is nested inside Gv1
and i want to find the control of child gridview as well as the label which is placed inside the itemtemplate of childgridview in the selectedindexchange of dropdownlist which is placed outside the both grids</p>
<p>i have used this code inside the dropdown selected index change</p>
<pre><code> GridView grid_child = grv_parent.FindControl("grv") as GridView;
if (grid_child != null)
{
Label lbl_asset_type = (Label)grid_child.FindControl("lbl_asset_type");
</code></pre>
|
c# asp.net
|
[0, 9]
|
992,311
| 992,312
|
jquery check previous check-box before a tag to be checked
|
<p>I have a code like</p>
<pre><code><input type="checkbox" name="abc" value="A" class="chbx">
<a href="#" class="checkbox-selector">href1</a>
<input type="checkbox" name="abc" value="b" class="chbx">
<a href="#" class="checkbox-selector">href2</a>
<input type="checkbox" name="abc" value="c" class="chbx">
<a href="#" class="checkbox-selector">href3</a>
</code></pre>
<p>What I desired is when I click on <code>href1</code> checkbox 1st should be selected and when I click on <code>href2</code>, the 2nd checkbox should be selected.</p>
<p>How can this be done in jQuery ?</p>
|
javascript jquery
|
[3, 5]
|
5,653,074
| 5,653,075
|
why jquery.load function not working?
|
<p>in <code>dbload.php</code> i wrote:</p>
<pre><code> <?php
class grid
{
function show()
{
echo"<div id = 'show'>";
if(isset( $_GET["Name"] ))
echo "done";
else
echo "Not done";
echo "</div>";
}
}
?>
</code></pre>
<p>and in <code>load.php</code> i wrote:</p>
<pre><code><!DOCTYPE html>
<?php
include "dbload.php";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function () {
$("a").click(function () {
$("div").load(this, function(){
alert("shod");
});
return false;
});
});
</script>
</head>
<body>
<a href="load.php?Name=mehdi"> click for load ajax</a>
<?php
$db = new grid();
$db->show();
?>
</body>
</html>
</code></pre>
<p>but my load function not working. any idea?</p>
|
php jquery
|
[2, 5]
|
2,807,989
| 2,807,990
|
how to change object embed source via jquery
|
<p>I have the following scenario..</p>
<p>When the user visit my website I show the user some audio files from the server. When the user clicks on one link, then the jquery function is eventually executed and change the source of the embedded object to selected file.</p>
<p>my script is :</p>
<pre><code> <script type="text/javascript">
$("#song").click(function(){
var src=$(this).attr("href");
var plyr=document.getElementById("mplayer");
var clone=plyr.cloneNode(true);
clone.setAttribute('src',src);
plyr.parentNode.replaceChild(clone,plyr)
});
</script>
</code></pre>
<p>Link to select audio file.</p>
<pre><code> <a href="resources/songs/xx21.mp3" id="song">
</code></pre>
<p>xx21</p>
<p>And the object is</p>
<pre><code> <div id="music">
<embed type="audio/mpeg" src="#" name="plugin" height="100%" width="100%" id="mplayer">
</div>
</code></pre>
<p>What happening for me is, When I click on the link. The song plays in new page. I need to play the song with embedded object inside the <code>div</code> <code>music</code>.</p>
|
javascript jquery
|
[3, 5]
|
115,882
| 115,883
|
Android Java - How to make my program loop
|
<p>How can I loop a program? Do I add code to OnActivity after existing code to make it restart to a certain place in the code?</p>
<p>I have an IF THEN statement, which at the end I want it to goto a portion of the code where it activates the TTS not from very begining where I have a button to start....</p>
<p>Thank you.
Flinx</p>
|
java android
|
[1, 4]
|
4,319,249
| 4,319,250
|
Changing DIV color without giving an ID?
|
<p>I have the following code : </p>
<pre><code><div id="wrapper">
<div style="width:500px;background-color:yellow;"> // this is a parent div
<div style="width:260px;">
<a href="javascript:XXXXX">Click me to color only the FIRST yellow div</a>
</div>
</div>
<div style="width:500px;background-color:yellow;"> // this is a parent div
<div style="width:260px;">
<a href="javascript:XXXXX">Click me to color only the SECOND yellow div</a>
</div>
</div>
</div>
</code></pre>
<p>Can I use jQuery to change the parent div's color without giving its ID or name?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
5,088,425
| 5,088,426
|
.Net how should i share session objects between different layers of asp.net project
|
<p>I have created a List objects when application starts and saved them as a session variable.</p>
<p>I then use this session variable throughout life of the application.</p>
<p>At times I update to this List in other layers of the application so I want to pass this session variable to other layers.</p>
<p>Should I be passing List object from asp.net to other layers in the methods? should i create a property of List in all layers which are going to use this object and set the property from the presentation layer? if i create a static list then all users see same list. i want the list to be session specific.</p>
|
c# asp.net
|
[0, 9]
|
1,553,378
| 1,553,379
|
What does ver=3.1.2 at the end of ajax.js or filename.js?ver=3.1.2 mean?
|
<p>I am having some conflicting jquery issues on a website and as I was trying to figure it out, I have noticed the following suffixes in my head files:</p>
<pre><code>ajax.js?ver=3.1.2'></script>
jquery.prettyPhoto.js?ver=3.1.2'></script>
jquery.cycle.all.2.72.js?ver=3.1.2'></script>
jcarousellite_1.0.1.min.js?ver=3.1.2'></script>
jquery.kwicks-1.5.1.pack.js?ver=3.1.2'></script>
ddsmoothmenu.js?ver=3.1.2'></script>
js.js?ver=3.1.2'></script>
</code></pre>
<p>obviously the 3.1.2 is probably some type of "latest update" or something. How does it work? How do you synch theme or balance them out?</p>
<p>Would these other files be failing because of mixed versions? Here the rest of it:</p>
<pre><code>.css?ver=20110325' type='text/css' media='all' />
.css?ver=3.1.2' type='text/css' media='all' />
l10n.js?ver=20101110'></script>
jquery.js?ver=1.4.2'></script>
all.js?ver=3.1.2#xfbml=1'></script>
comment-reply.js?ver=20090102'></script>
</code></pre>
<p>Not sure if this is the way I should post on Stackoverflow so feel free to edit as it should.</p>
|
javascript jquery
|
[3, 5]
|
4,704,340
| 4,704,341
|
Incrase / decrase div size with 1 px on click button
|
<p>I've made a website with windows PVC and doors PVC products.
I want to make order page with a calculator. it's working but I need now to animate the configuration of the window.( example: <a href="http://orasvirtual.ro/images/a.JPG" rel="nofollow">http://orasvirtual.ro/images/a.JPG</a>)
so, the default window size is 250px height and 350px width. I made 4 buttons:
(example: <a href="http://orasvirtual.ro/images/b.JPG" rel="nofollow">http://orasvirtual.ro/images/b.JPG</a>)
increase height, decrease height, increase width and decrease width.
I've made this until now, but how to make to increase/decrease holding the click for x seconds.</p>
<p>thanks for all</p>
<p>ok, until now I've made this, thanks to NullPointer: </p>
<p>html:</p>
<pre><code><div id='divid'>div</div>
<button id="inch" >+ h</button>
<button id="dech" >- h</button>
<button id="incw" >+ w</button>
<button id="decw" >- w</button>
</code></pre>
<p>jquery:</p>
<pre><code>$("#inch").click(function(){
var height = $("#divid").height()+1; //to decrease just -1 instead of 1
$("#divid").height( height );
})
$("#dech").click(function(){
var height = $("#divid").height()-1; //to decrease just -1 instead of 1
$("#divid").height( height );
})
$("#incw").click(function(){
var width= $("#divid").width()+1; //to decrease just -1 instead of 1
$("#divid").width( width );
})
$("#decw").click(function(){
var width= $("#divid").width()-1; //to decrease just -1 instead of 1
$("#divid").width( width );
})
</code></pre>
|
php jquery
|
[2, 5]
|
1,982,194
| 1,982,195
|
How to format date
|
<p>I have a date as "Thursday, 4 Aug 2011". How do I format it to "yyyy/MM/dd"? I have tried the codes: </p>
<pre><code>var myDate = dateText.toString("yyyy/MM/dd");
myDate = Date.parseExact(myDate, "yyyy/MM/dd")
</code></pre>
<p>but none seem to work. Help please. </p>
|
javascript jquery
|
[3, 5]
|
3,389,221
| 3,389,222
|
jQuery append an element more than once
|
<p>I'm currently trying to add n number of divs to the bottom of the body, however using this code: </p>
<pre><code>star = $('<div class="star" />');
for(i=0; i<12; i++) {
$('body').append(star);
}
</code></pre>
<p>results in just one div being appended to the bottom of the body. I'm guessing this is because the content of the body is not being refreshed between each iteration of the for loop, but can't figure out how to best to solve it.</p>
|
javascript jquery
|
[3, 5]
|
3,290,398
| 3,290,399
|
asp.net include page like php
|
<p>im starting to learn asp.net :P, and in php i should use include(); to show something like a menu. but how can i do this in asp.net?</p>
<p>i dont mean a simple include, but a page where i can query a database to make the page dynamicly for example.</p>
<p>i hope you understand my problem.</p>
|
php asp.net
|
[2, 9]
|
213,138
| 213,139
|
Automatically sets second select field value
|
<p>So basically I need to make feature that if you select something from first select box, it will be automatically selected in second select box too, and if you will change anything in second select box, it will be changed automatically in first select box too. Here is how far I'm currently am, I have fixed, if someoen changes the first select box value, but I'm not sure how to make the second select box value the same as first, and vice versa. - <a href="http://jsfiddle.net/3Tt7N/5/" rel="nofollow">http://jsfiddle.net/3Tt7N/5/</a></p>
<p>Hope you can help me with this ;)!</p>
|
javascript jquery
|
[3, 5]
|
642,108
| 642,109
|
Determine if key pressed is in provided array
|
<p>I have code similar to this:</p>
<pre><code>$("#some-input").keyup(function (event) {
var availableKeys = [".", ",", ";"];
var key = String.fromCharCode(event.which);
if (availableKeys.indexOf(key) != -1) {
alert("Derp");
}
});
</code></pre>
<p>However it does not work as I expected. The <code>event.which</code>/<code>fromCharCode</code> combination works like this properly on digits or letters (capital ones) and this is the correct behaviour since (I presume) event keycodes are different than charset entries.</p>
<p>Is there a workaround other than directly specifying keycodes for comparison (keeping the array of characters is a priority)?</p>
|
javascript jquery
|
[3, 5]
|
3,020,739
| 3,020,740
|
what is this window.top check performing? is this checking for an iframe?
|
<pre><code>if(window.top!==window.self){document.write="";
window.top.location=window.self.location;
setTimeout(function(){document.body.innerHTML=""},1);
window.self.onload=function(){document.body.innerHTML=""}};
</code></pre>
<p>Is this making sure the page isn't rendering inside of a iframe?</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.