Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
5,120,486 | 5,120,487 |
substitute for php rawurlencode in asp.net?
|
<p>I have a php running code to send mms but when i converted whole code into asp.net i didnt get any substitute for rawurlencode in asp.net. i m searching this fromlast two days for nothing is working plz help me out from this problem.
Thanks in advance.</p>
|
php asp.net
|
[2, 9]
|
2,129,601 | 2,129,602 |
Select all text on focus using jQuery
|
<p>I have a little jQuery function that is meant to automatically select text in an asp.net text box when it gets focus. However, the text in the text box gets selected, but immediately then deselects.</p>
<p>The code works if i bind to the focus event with .focus(function()) but I am adding the text boxes to the page dynamically which is why I think I need to use the live event.</p>
<p>Can anyone see a problem? The text boxes in question are in Item templates of two gridviews inside a multiview if that makes a difference?</p>
<p>Code:</p>
<pre><code><script type="text/javascript">
//Select all text in Cost Rate Text Boxes when they have focus
$(document).ready(function () {
$(".CostRateTextBox").live('focus', function () {
$(this).select();
});
});
</script>
</code></pre>
<p><img src="http://i.stack.imgur.com/gzDiz.png" alt="enter image description here"></p>
<p>Edit:</p>
<pre><code><script type="text/javascript">
//Select all text in Cost Rate Text Boxes when they have focus
$(document).ready(function () {
$(".CostRateTextBox").live('focus', function () {
$(this).select();
preventDefault();
});
});
</script>
</code></pre>
|
jquery asp.net
|
[5, 9]
|
4,976,213 | 4,976,214 |
ASP.NET/Javascript: Loading huge data in browser
|
<p>I have this GUI that shows, let's say Customer Orders. When my client nailed down the requirements, he asked me to keep pagination like this,</p>
<blockquote>
<p><strong>Show Items Per Page : 10/50/150</strong></p>
</blockquote>
<p>For each customer there could be thousands of orders and each order will have atleast 50 attributes to show up in the screen. So, assume a 50 column html table with 2000 or 3000 records associated with it spanning across multiple database tables (anyway, this is a different story)</p>
<p>Things were breeze until yesterday, now my client has come up with new change requests, in that he specified Show Items like this,</p>
<blockquote>
<p><strong>Show Items Per Page : 10/50/150/<em>All</em></strong></p>
</blockquote>
<p>Yes, he wanted to see 2000 or 3000 records by just select "All" option. Internally, this is not a big change, I would go back and remove the filters I apply on rowcount etc., but when it is loaded in GUI it really sucks ... view state was huge etc., etc.,</p>
<p>I know, this is a standard problem. How you guys deal with it? I cannot convince my client to remove this "All" option, he got stick to it. (the reason is simple, he got a big 42" screen where he can easily see 1000 items in one page)</p>
<p>I also tried to use javacript to prepare DOM in a ajax call .. but still, inserting 2000 TDs is really slow.</p>
<p>Any help is greatly appreciated.</p>
<p><strong>Some Extra Info</strong></p>
<ol>
<li>This application is a intranet application or else accessed through VPN connection</li>
</ol>
|
asp.net javascript
|
[9, 3]
|
5,962,919 | 5,962,920 |
Adding items to select (list box) of html/php through jQuery or javascript
|
<p>Is it possible to add items to a select (list box) of html/php through jQuery or javascript when a specific action is triggered by another control in jQuery/javascript? <em>(edited by <a href="http://stackoverflow.com/users/611306/alex-thomas">Alex Thomas</a>)</em></p>
|
php javascript jquery
|
[2, 3, 5]
|
4,173,568 | 4,173,569 |
How to stop SharePoint from writing JavaScript code over and over?
|
<p>I'm using PIE.js to force IE7 to use CSS3 styles. However, whenever an element on my SharePoint page contains the class that PIE is supposed to style, it actually inserts the code into the html when rendered. Then upon editing the page, the code is added again on top of the old code. So at first I start with a simple tag with a class, then I end up with 200+ lines of code. </p>
<p>The question: How can I prevent SharePoint from literally writing the rendered code from the javascript?</p>
<p>I know this is a larger issue than just PIE.js...any javascript append or prepend actually prints the code in SharePoint. </p>
|
javascript jquery
|
[3, 5]
|
1,227,485 | 1,227,486 |
Validate form using Javascript
|
<p>I am trying to validate my form using javascript. If a radio button is not selected, onsubmit the text "You did not select a filling" should appear below the filling section. The rest of the code works fine. cslab.bc.edu/~thomasfd/hw8/hw8.php to see it live.</p>
<pre><code> <script>
function validateform(){
var namevalid = validatename();
var entreevalid = validateentree();
var fillingvalid = validatefilling();
return false;
}
function displayfilling(){
var fillingselected =document.forms["mytestform"].filling.value;
var resultloc=document.getElementById("fillingerror");
resultloc.innerHTML = "You have selected " + fillingselected + ".";
}
function validatefilling(){
var a=document.getElementById("myfilling");
if (a.selectedIndex == 0){
var resultloc=document.getElementById("fillingerror");
resultloc.innerHTML = "<span style='color:red;'>Please select a filling!<span>";
return false;
}
var resultloc=document.getElementById("fillingerror");
resultloc.innerHTML = "";
return true;
}
</script>
</code></pre>
|
php javascript
|
[2, 3]
|
4,177,598 | 4,177,599 |
jquery greybox pass query string
|
<pre><code> <a href="../../AddLesson.aspx?id=<%# Request.QueryString["id"] %>" rel="gb_page_center[340, 380]"><img src="../../images/add_lesson_icon.png" width="17" height="18" alt="Add Lesson" /></a>
</code></pre>
<p>Here is my code to open a greybox popup by clicking on anchor tag and i also want to send data through querystring. i have done like above. but it is not working.
Any help</p>
|
jquery asp.net
|
[5, 9]
|
5,586,555 | 5,586,556 |
cannot implicitly convert decimal to Datamanager.report[]
|
<pre><code>a = Sesion.Usuario.USE_CLI_ID;
</code></pre>
<p>I get an error at this statement as <em>"cannot implicitly convert decimal to Datamanager.report[]"</em>.a is a object of <code>Datamanager.report[]</code><br>
here <code>sesion</code> and <code>usuario</code> are the table name and <code>USE_CLI_ID</code> is the field.</p>
|
c# asp.net
|
[0, 9]
|
4,646,759 | 4,646,760 |
split the message into array
|
<pre><code>RadikalGenc.aspx?phonenumber=5552451245&message=ISTAN-ALL-123;Emly,Foz,Praia,Sol,Luna,Trabalha
string number = Request.QueryString["phonenumber"].ToString();
string textMessage = Request.QueryString["message"].ToString();
</code></pre>
<p>I need the textMessage splitted int array Like this:</p>
<p>ISTAN-ALL-123 -> <em>Presents Form name</em>
<strong>The list below, presents the fiels name</strong></p>
<ol>
<li>Emly </li>
<li>Foz </li>
<li>Praia </li>
<li>Sol </li>
<li>Luna </li>
<li>Trabalha</li>
</ol>
<p>how can do that?</p>
|
c# asp.net
|
[0, 9]
|
5,743,398 | 5,743,399 |
how to select a select box which is not having any class
|
<p>I need to select a select box which is not having any class name </p>
<pre><code> Minute : <select name="dob_minute'+$i+'[]" class="" style="width: 56px">
<option value="">--------</option></select>
</code></pre>
<p>I can not select it by using name. I am having some other issues in it. That is the reason that I am not selecting by name</p>
|
javascript jquery
|
[3, 5]
|
2,530,494 | 2,530,495 |
C# equivalent of Java instance initializer
|
<p>In <code>Java</code> instance variables can be initialized by an initialization block as shown below:</p>
<pre><code>class Example {
private int varOne;
private int varTwo;
{
// Instance Initializer
varOne = 42;
varTwo = 256;
}
}
</code></pre>
<p>Is there an equivalent construct in <code>C#</code>?</p>
<p><strong>[Edit]</strong> I know that this can be inline with the instance variable declaration. However, I am looking for is something similar to the static constructor in <code>C#</code> but for instance variables.</p>
|
c# java
|
[0, 1]
|
5,060,050 | 5,060,051 |
Image change on hover
|
<p>Hi, I have a HTML image that is setup like this:</p>
<pre><code><input id="img" type="image" src="">
</code></pre>
<p>How can I change <code>src</code> on hover?</p>
<p>.</p>
|
javascript jquery
|
[3, 5]
|
3,483,388 | 3,483,389 |
This simple comparison of jQuery objects does not compare
|
<p>Curious what I'm doing wrong here :</p>
<pre><code>employee_ids = $('[data-employee_id="'+employee+'"]');
timestamp_ids = $('[data-scheduled_on="'+timestamp+'"]');
var common = $.grep(timestamp_ids, function(element) {
$.each(employee_ids, function(idx, item) {
if ( item === element ) { console.log ("omg!") };
});
});
</code></pre>
<p>This returns just the list of <code>timestamp_ids</code> and not that array compared against <code>employee_ids</code> looking for a single match.</p>
|
javascript jquery
|
[3, 5]
|
4,488,131 | 4,488,132 |
modify class in stylesheet in codebehind
|
<p>I am Working in asp.net and c#.</p>
<p>I have a css stylesheet named STYLE.css in my application,and i have a some classes in that stylesheet.I want to change the style in that classes in my codebehind.How to do that.Give ur suggessions.</p>
<p><strong>Style.CSS</strong>:</p>
<pre><code> .someclass
{
//some attributes
}
</code></pre>
<p>I Want to change the attributes of <strong>someclass</strong> Class in codebehind.</p>
|
c# asp.net
|
[0, 9]
|
4,939,833 | 4,939,834 |
Passing a function in Jquery / Javascript
|
<p>Good afternoon people's</p>
<p>I have built a jquery plugin that I use on my site. The plugin is for suggestive input boxes and works fine.</p>
<p>One thing I need to add to it is the ability to pass a function in it's config to apply to the response of the ajax call that is made for the suggestive. I can't find anything on trusty old google about how to pass functions and have them applied in the scope of the plugin..</p>
<p>I need this because some responses update one field and some update 2 or more fields with different text held in the reponse and I dont want to keep duplicating the plugin allowing for this to happen. I am assuming that the javascript method "apply" is what I need to look at but I am totally confused</p>
<p>Does this even make sense on what I am trying to do ? and if so can anyone help or point me in the right direction.</p>
<p>Thanks in advance</p>
<p>Alex</p>
|
javascript jquery
|
[3, 5]
|
1,845,001 | 1,845,002 |
Showing a modal dialog box or form when the application is not running in UserInteractive mode
|
<p>Hi all I am getting this error when my site was in live when trying to show print preview dialog</p>
<pre><code>PrintPreviewDialog ppdlg = new PrintPreviewDialog();
ppdlg.ShowDialog();
</code></pre>
<p>How can I resolve this error</p>
<p>Complete error</p>
<p><code>Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.</code></p>
|
c# asp.net
|
[0, 9]
|
2,115,747 | 2,115,748 |
Check ASP.NET checkbox with jQuery
|
<p>I have following ASP.NET server control checkboxes.</p>
<pre><code><asp:checkbox id="chkMonS1" runat="server" />
<asp:checkbox id="chkMonS2" runat="server" />
<asp:checkbox id="chkAllMon" runat="server" />
</code></pre>
<p>And also other check boxes.</p>
<pre><code><asp:checkbox id="chkTueS1" runat="server" />
<asp:checkbox id="chkTueS2" runat="server" />
<asp:checkbox id="chkAllTue" runat="server" />
</code></pre>
<p>So I tried to use jQuery to select all check boxes like so..</p>
<pre><code><script type="text/javascript">
$('chkAllMon').click(
function () {
$('chkMonS1').attr('checked', true)
$('chkMonS2').attr('checked', true)
}
)
</script>
</code></pre>
<p>However, it doesn't work. Where did it go wrong?</p>
|
jquery asp.net
|
[5, 9]
|
5,627,870 | 5,627,871 |
Change CSS with jQuery Sortable
|
<p>How can I change CSS property once sorted. Something likes this:</p>
<pre><code> $( "#sort" ).sortable({
$(#div1).css("background-color","yellow");
});
</code></pre>
<p>Thanks alot</p>
|
javascript jquery
|
[3, 5]
|
3,325,709 | 3,325,710 |
Show all currently running setIntervals
|
<p>Is there anyway to see all ongoing <code>setIntervals</code></p>
<p>If I make intervals global</p>
<pre><code>b = setInterval(function(){
$("body").append("B <br>");
},500);
</code></pre>
<p>I can see them when I, but I can't really see that they are intervals. </p>
<pre><code>console.dir(Object.keys( window ));
Array[15]
0: "top"
1: "window"
2: "location"
3: "external"
4: "chrome"
5: "v8Intl"
6: "v8Locale"
7: "document"
8: "jQuery171033813792187720537"
9: "resizeJSBin"
10: "$"
11: "jQuery"
12: "a" <--this is an interval!
13: "local"
14: "b" <--this is an interval!
length: 15
__proto__: Array[0]
</code></pre>
<p>Is there anyway to get information about all the intervals being run at a particular time. Like, see at what interval they are running, what code is being executed at that interval?</p>
<p><a href="http://jsbin.com/omupax/1/edit">JSBIN</a></p>
|
javascript jquery
|
[3, 5]
|
2,838,112 | 2,838,113 |
Display second dropdown list if a value is selected in the first dropdown (using variables)?
|
<p>Is there any way I can select a certain value in a dropdown list and according to that selection display a second dropdown list?
I know how to do it with just normal words, but what if I use variable names?</p>
<pre><code>University Name: <select name="university" id="university">
<?php
while($row = mysql_fetch_array($uniName)) {
echo "<option>" . $row['uni_name'] . "</option>";
}
?>
</select>
<br/>
Course Name: <select name='course' id='course'>
<?php
while($row = mysql_fetch_array($courseNames)) {
echo "<option>" . $row['course_name'] . "</option>";
}
?>
</select>
</code></pre>
<p>So as you can see, in the first dropdown list I've added all the retrieved university names from my database. I did the same for the courses as well.</p>
<p>Now how can I modify the code below:</p>
<pre><code>$(document).ready(function() {
$('#course').hide();
$('#university').change(function () {
if ($('#university option:selected').text() == "Harvard University"){
$('#course').fadeIn('slow');
}
else {
$('#course').fadeOut('slow');
}
});
});
</code></pre>
<p>Instead of "Harvard University", I want to put a variable there according to what the user has selected. Something like $university_name and then I'll create a new query and display only the courses belong to a certain $university_name.</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,071,418 | 5,071,419 |
JS & PHP - Change dropdown value if other fields are filled
|
<p>I have a PHP application form for medical health plans where the user fills in his details and selects some options from various controls, one of which is the plan type (private of family plan). Sometimes, although the user fills in his siblings/spouse details, they forget to also select the 'family' option and leave the drop down at it's default value which is the 'private' plan. </p>
<p>How can I make sure that if the user fills in his sibling's details, that the 'plan' dropdown will change to the proper option? I know this can be done easily with js but I'm not sure what event I should call it on, <code>onFocus</code> and <code>onClick</code> won't work because the user might simply click on the <code>Sibling Name</code> field but not enter a value, fill in something but later on clear it out etc.</p>
<p>I think that a script that counts the length of the 4 available siblings fields and if one of them is not empty, then change the 'plan' select value from 'private' to 'family'.</p>
<p>Any ideas would be great, thanks.</p>
|
php javascript
|
[2, 3]
|
4,448,611 | 4,448,612 |
Why can I not set my data attribute with jQuery?
|
<p>I have the following:</p>
<pre><code>editCity: "/Admin/Citys/Edit?pk=0001I&rk=5505005Z"
$('#editCity')
.attr('title', "Edit City " + rk)
.data('disabled', 'no')
.data('href', editCity)
.removeClass('disabled');
</code></pre>
<p>When I check the HTML with developer tools I see this:</p>
<pre><code><div class="button dialogLink" id="editCity"
data-action="EditCity" data-disabled="yes"
data-entity="City" title="Edit City 5505005Z" ></div>
</code></pre>
<p>Everything is updated except the href. Anyone have an ideas what I am doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
2,828,577 | 2,828,578 |
is it legal to store jquery reference?
|
<pre><code>var global_ref = null;
function a(){
function some_click_handler {
global_ref = $(this);
}
}
// later in
function b()
{
$(global_ref).css(...) // or global_ref.css(...) ???
}
</code></pre>
<p>Is above concept right? and the syntax right?</p>
|
javascript jquery
|
[3, 5]
|
1,498,156 | 1,498,157 |
How can we use two queries in same click event?
|
<p>I used the code:</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
SqlConnection con = new SqlConnection("server=kiran-b946c0f6d;
uid=sa;
pwd=123;
database=employe");
SqlCommand com=new SqlCommand("INSERT INTO Emplo VALUES('"+TextBox2.Text+"'",con);
com.Parameters.Add("Email_ID", SqlDbType.VarChar);
com.Parameters["Email_ID"].Value = TextBox2.Text;
con.Open();
Label3.Text = "successfully added";
SqlDataReader reader = null;
com = new SqlCommand("SELECT Email_ID FROM Emplo WHERE Email_ID='"
+ TextBox2.Text + "'",
con);
reader = com.ExecuteReader();
if (reader != null && reader.HasRows)
{
Label3.Text = "Emailid alraedy exist";
}
reader.Dispose();
SqlDataAdapter da = new SqlDataAdapter(com);
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
con.Close();
}
</code></pre>
<p>I intended to use Insert values in the database and if there is any duplicity,it will show the error.The duplicity is working properly.But insertion is not properly working.It will show inserted successfully.But the values are not doing insertion.</p>
|
c# asp.net
|
[0, 9]
|
5,461,984 | 5,461,985 |
Javascript toFixed() function
|
<p>I'm trying to format the user input values using following technique, but I get the following error on Fire Bug console </p>
<p>$(this).val().toFixed is not a function</p>
<pre><code>$(".amount-text").bind('change',function () {
$(this).val(($(this).val()).toFixed(2));
});
</code></pre>
<p>Can some one help me on this?</p>
|
javascript jquery
|
[3, 5]
|
5,537,529 | 5,537,530 |
loading DXT texture files in android using Java
|
<p>I am looking to load compressed jpg and png files in android. Loading the raw files is just too slow. The plan is to compress the files ahead of time into DXT files. I tried to use DXTViewer to compress some images and attempt to load them as textures.</p>
<p>Currently I am getting a GL_INVALID_ENUM from gl.glCompressedTexImage2D(...).</p>
<p>Here is the code.</p>
<p><i></p>
<pre><code> InputStream is = ESGLTextureUtility.loadFile(iFile, assetManager);
ByteBuffer bb = this.readToByteBuffer(is);
textureInfo.source = iFile;
is.close();
this.checkError(gl);
gl.glGenTextures(1, textureInfo.textures, 0);
gl.glBindTexture(GL10.GL_TEXTURE_2D, textureInfo.textures[0]);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE);
gl.glCompressedTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, 512, 512, 0, (int) this.total, bb);
</code></pre>
<p></i></p>
<p>Like I said, this triggers a GL_INVALID_ENUM.</p>
<p>There seems to be very little documentation or examples on this topic. </p>
<p>Thanks in advance.</p>
|
java android
|
[1, 4]
|
5,377,938 | 5,377,939 |
jQuery click.modalEvent
|
<p>Revising code of jQuery.reveal plugin (http://www.zurb.com/playground/reveal-modal-plugin) and trying to understand how it handles the modal behaviour, I see that it binds the closeModal function (that closes the popup) to the event <code>'click.modalEvent'</code>.</p>
<p>But I can't find any information about this event, I don't know if it belongs to javascript itself or if it's part of jQuery</p>
|
javascript jquery
|
[3, 5]
|
1,512,621 | 1,512,622 |
is it posible to move from asp.net validators to jQuery validators
|
<p>is it possible to move from asp.net validations to j Query validations without much effort .I also need a validation summary like control.</p>
|
c# asp.net jquery
|
[0, 9, 5]
|
115,398 | 115,399 |
functionality required only to show certificate(image) for registered members
|
<p>I want to junrate a certificate(image) general code from my site registers members certificate will only show on his sites.for exmple abc.com is my registerd member and he placed that code on his site like bellow</p>
<pre><code>img src="mysite.com?member=abc.com"
</code></pre>
<p>or any code (like facebook social plugin or like plugin of facebook etc)
when its calling from abc.com the code will display the certificate(image) but when same code applies to another location like www.def.com the certificate(image) should not to display.</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,887,560 | 1,887,561 |
What are the risks of described approach to developing web application?
|
<p>We want to write a UI that consists of HTML, Javascript (JQuery) and CSS. Although the initial starting point will be served up by a web server, there won't be any sever side templating. The browser will interact with the server via a restful interface and render its UI.</p>
<p>What are the risks of this approach? </p>
<p>Ideally I'd like a nice, straightforward javascript OO api which underneath makes http calls to the server to get JSON representations of resources. Any suggestions as to how this could be structured?</p>
<p>Anyone have experience with browser side templating? </p>
<p>Is there a framework to make this style of development easier? </p>
<p>We will also be defining the server side resources and my thoughts are to follow ruby on rails conventions. For example, if you define a Users resource in routes.rb, you have 7 uri templates. Any thoughts?</p>
<p>By the way, the server side functionality will be developed in java.</p>
|
java javascript jquery
|
[1, 3, 5]
|
5,430,110 | 5,430,111 |
HTML-Javascript - Filechooser showing only server-side files
|
<p>I hope the following isn't too tricky. </p>
<p>I have a simple html button. Now I want to open a filechooser as soon as a user clicks on this button.</p>
<p>I do this like the following:</p>
<pre><code>$('.button').click(function()
{
$('<input type="file"/>').attr('value');
});
</code></pre>
<p>This opens a filechooser, but I want this file-chooser to only show files on the server, not on the client. I've searched the net but couldn't find an adequate solution so far.</p>
<p>Any proposals are welcome :)</p>
|
javascript jquery
|
[3, 5]
|
562,906 | 562,907 |
Pythonic way to rewrite the following C++ string processing code
|
<p>Previous, I am having a C++ string processing code which is able to do this.</p>
<pre><code>input -> Hello 12
output-> Hello
input -> Hello 12 World
output-> Hello World
input -> Hello12 World
output-> Hello World
input -> Hello12World
output-> HelloWorld
</code></pre>
<p>The following is the C++ code.</p>
<pre><code>std::string Utils::toStringWithoutNumerical(const std::string& str) {
std::string result;
bool alreadyAppendSpace = false;
for (int i = 0, length = str.length(); i < length; i++) {
const char c = str.at(i);
if (isdigit(c)) {
continue;
}
if (isspace(c)) {
if (false == alreadyAppendSpace) {
result.append(1, c);
alreadyAppendSpace = true;
}
continue;
}
result.append(1, c);
alreadyAppendSpace = false;
}
return trim(result);
}
</code></pre>
<p>May I know in Python, what is the Pythonic way for implementing such functionality? Is regular expression able to achieve so?</p>
<p>Thanks.</p>
|
c++ python
|
[6, 7]
|
2,452,915 | 2,452,916 |
load another php page dynamically in jquery ui on click of a button
|
<pre><code>jQuery(function ($) {
// Load dialog on page load
// Load dialog on click
$('#basic-modal .basic').click({
modal:true,
open: function ()
{
var id = $('#id').attr('value');
$(this).load('edit.php?id='+id);
},
height: 400,
width: 400,
title: 'Dynamically Loaded Page'
});
});
</code></pre>
<p>This is not opening the dialog on the click of the button. what is it that i am doing wrong here?</p>
|
php jquery
|
[2, 5]
|
33,729 | 33,730 |
Chained select boxes not working
|
<p>I have three select boxes state,city and locality with the id's same as name</p>
<pre><code>$(document).ready(function() {
$("#state").on('change',function(){
var state = $("#state").attr('value');
$("#city").load('http://localhost/trial/index.php/new/view_cities/'+state).change();
}).change();
$("#city").on('change',function(){
var city = $("#city").attr('value');
$("#locality").load('http://localhost/trial/index.php/new/view_localities/'+city);
}).change();
});
</code></pre>
<p>On page load state gets correctly shown because it's directly from database, and city options gets automatically updated, but localities do not. And when i change city the localities can change.</p>
|
javascript jquery
|
[3, 5]
|
657,414 | 657,415 |
What does const denote here?
|
<p>What does const denote in the following C++ code? What is the equivalent of this in C#? I code in C# and I am trying to learn C++.</p>
<pre><code>template <class T> class MaximumPQ {
public:
virtual ~MaximumPQ () {}
virtual bool IsEmpty () const = 0;
virtual void Push(const T&) = 0;
virtual void Pop () = 0;
};
</code></pre>
|
c# c++
|
[0, 6]
|
630,411 | 630,412 |
dropdown value changed by javascript is not coming in codebehind
|
<p>I have a dropdown list whose value is changed based on other controls in the UI using javascript.</p>
<p>I used the following code to change the dropdown list,
<code>document.getElementById("ddlchkStsID").options[2].selected = true;
document.getElementById("ddlchkStsID").value = "3";</code></p>
<p>But in the code-behind, the <code>ddlchkStsID.SelectedValue</code> is still coming as first option's value.</p>
<p>This the control in aspx page.</p>
<pre><code><asp:DropDownList ID="ddlchkStsID" runat="server" TabIndex="10" CssClass="meta">
<asp:ListItem Text="TBD" Value="1" />
<asp:ListItem Text="Yes" Value="2" />
<asp:ListItem Text="No" Value="3" />
</asp:DropDownList>
</code></pre>
<p>Could someone help me how to get the changed value in the code-behind.</p>
<p>thanks in advance :)</p>
|
javascript asp.net
|
[3, 9]
|
1,371,748 | 1,371,749 |
Compulsory option of jQuery plugin
|
<p>I am making my custom jQuery plugin whose code is this:</p>
<pre><code>(function($) {
$.fn.foo = function(options) {
var opt = $.extend({}, $.fn.foo.defaults, options);
return this.each(function() {
//do operation with opt
});
});
$.foo.defaults = {
item1:'value1',
item2:'value2',
item3:'value3',
};
})(jQuery);
</code></pre>
<p>It will be implemented like this:</p>
<pre><code> //Implementation
$(...).foo({
item1:'value1',
item2:'value2',
item3:'value3',
item4:'value4',
});
</code></pre>
<p>My question is that how can I make <em>item4</em> value to be compulsory? I want that user must enter value for <em>Item4</em> . In my plugin I need to do some operations with item4 so how can it be made compulsory. I will be having one or more items too which should be compulsory. Is there any way by which I can warn user if the that value is not passed by the user ? </p>
|
c# php asp.net jquery
|
[0, 2, 9, 5]
|
256,562 | 256,563 |
How to extend the asp.net User.Identity Property?
|
<p>I'm <strong><em>not</em></strong> talking about asp.net membership.</p>
<p>For each logged user I want to cache some properties like status or the number of friend requests, from the db.</p>
<p>I can create custom class which would do it but I thought it will be better to extend the existing User.Identity property.<br>
Something like this:</p>
<pre><code>Label1.Text = User.Identity.Status;
</code></pre>
<p>It is possible?</p>
|
c# asp.net
|
[0, 9]
|
1,866,772 | 1,866,773 |
Adding Multiple inline javascript in single line
|
<p>I have 2 different links with inline js added.</p>
<p>I would like to add both to a single inline onclick.</p>
<p>Here are the two separate one:</p>
<pre><code><a href="#" onclick=\'$("#id").toggle();\'>
<a href="#" onclick="myvar = '1';">
</code></pre>
<p>And this is what I would like to do:</p>
<pre><code><a href="#" onclick="$("#id").toggle();myvar = '1';">
</code></pre>
<p>How could I do this?</p>
|
javascript jquery
|
[3, 5]
|
2,349,887 | 2,349,888 |
Pass DIV offset during form submission JAVA / JAVASCRIPT
|
<p>Ok I have a filter box where I do a submit on some form variable and also some hidden variables in Java.</p>
<p>For the purpose of this question im not gonna type out all the form variables.</p>
<p>What I need to do is pass the the DIV offset also to the form as variable's <code>top</code> and <code>left</code></p>
<p>I know I can get the offset with javascript:</p>
<pre><code>var offset = $("#filterPanel").offset();
//alert( $("#filterPanel").offset() );
var top = offset.top;
var left = offset.left;
alert( "top = " + top);
alert( "left = " + left)
</code></pre>
<p>what I need to do is pass those two variable also with my form when I press my "apply" button:</p>
<pre><code><div class="sideMenuPanel" style="display: none; width: 290px; top: ${panelTop}px;" id="filterPanel">
<form name="filterForm" action="process.mgmtview_update_filters" method="get">
<input type="hidden" name="metricGroup" value="${filterForm.metricGroup}" />
<input type="hidden" name="referrer" value="${referrer}" />
<tr>
<td colspan="2" class="filter_section_header" style="text-align: center;">
<input style="font-size: 8pt;" name="actionButton" value="Apply" type="submit" />
</td>
</tr>
</table>
</form>
</code></pre>
<p></p>
|
javascript jquery
|
[3, 5]
|
1,255,671 | 1,255,672 |
Toggle between two tabs with different dynatrees using jquery or javascript
|
<p>I have two divs with tabs, I need to write a javascript or jquery script that will allow for the content to be switched back and forth onclick of the appropriate tab name.</p>
<p>I created a fiddle <a href="http://jsfiddle.net/sgnZS/3/" rel="nofollow">HERE</a>. Although I haven't even begun to write the javascript yet. Can someone take a look at it for me? It seems like it should be pretty straight forward:</p>
<p>(ID's updated) </p>
<ul>
<li><p>show div1 on ready,</p></li>
<li><p>Hide div1, show div2 onclick link1,</p></li>
<li><p>hide div2, show div1 onclick link2</p></li>
</ul>
<p>I first tried using </p>
<pre><code>$('#showTree').click(function() {
$('#div1').hide();
$('#div2').show();
}),
$('#showTree2').click(function() {
$('#div1').show();
$('#div2').hide();
});
</code></pre>
<p>but this did not work. Would someone mind taking a look at the fiddle and giving me some advice? Much thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
1,436,072 | 1,436,073 |
jquery or javascript: Truncate text in table cell
|
<p>I need to truncate the text in the first column of a table using javascript or jQuery. Here's where I'm at:</p>
<p>The table:</p>
<pre><code><table id="bigTable">
<tr><td>Text is tooooo looong</td><td>Just Right</td></tr>
<tr><td>Text is tooooo looong</td><td>Just Right</td></tr>
<tr><td>Text is tooooo looong</td><td>Just Right</td></tr>
</table>
</code></pre>
<p>Trying stuff like the following without success ( compiled from other similar posts ):</p>
<pre><code>var lbl = $("#bigTable tbody");
var newLbl = $(lbl[0].outerHTML);
$('td:eq(0)', newLbl).slice(5);
</code></pre>
<p>It does not seem to be getting the contents, or text from the cells. Has no effect whatsoever. Tried also -</p>
<pre><code>$('td:eq(0)', newLbl)contents().slice(5);
$('td:eq(0)', newLbl).text().slice(5);
</code></pre>
<p>What am I doing wrong?</p>
<p><strong>EDIT</strong></p>
<p>Before more down-voting and general grumpy-ness occurs ...
I have to have the text from a div copied to a variable for manipulation and later display in a different window/div.
This happens in response to a button click. </p>
<p>...but applying the css rules sounds promising. Will try that instead.</p>
<p>Please see this fiddle to understand what I need to do:</p>
<p><a href="http://jsfiddle.net/Vsse3/2/" rel="nofollow">http://jsfiddle.net/Vsse3/2/</a></p>
<p>I have to be able to wrap column cells with a div before using the css idea. </p>
|
javascript jquery
|
[3, 5]
|
5,720,605 | 5,720,606 |
show stored value in jquery
|
<p>I want to temporarily save form values in jquery (not in a database) and then echo the value on the same page.</p>
<p>I have a page where there is a button called "add items", when a user clicks on the "add items" button a form appears in a popup modal. When the save the button is selected on the popup modal values from the popup modal will stored in jquery variables. The values of those variable will then be displayed on a div which I hid at the start.</p>
<p>I don't know how to show the value in a div, this is what i am doing: </p>
<pre><code><div id="items">
</div>
$('#items').hide();
$('#popupmodal').click(function(){
$('#savebutton').click(function() {
var price = $('#price').val();
alert(price);
</code></pre>
<p>I want to show the price from the pop modal in the div "items". </p>
|
javascript jquery
|
[3, 5]
|
5,834,329 | 5,834,330 |
How to wake up device using Alarm clock?
|
<p>I use the following code for setting repeating events in <code>AlarmManager</code>:</p>
<pre><code>mAlarmManager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(),
PERIOD, getPendingIntent(time));
</code></pre>
<p>Code for receiver:</p>
<pre><code>public class NotificationsReceiver extends BroadcastReceiver {
public static final String NOTIFICATION_INFO="notification_info";
@Override
public void onReceive(Context context, Intent intent) {
playSound(context);
Intent i=new Intent(context, MainActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
private void playSound(Context context) {
Uri notification=RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
RingtoneManager.getRingtone(context, notification).play();
}
}
</code></pre>
<p>There is some problem - I need to play music when the event happens, but if my device is in sleeping I don't hear any signal! But when I wake up device I hear music. How can I fix it? </p>
|
java android
|
[1, 4]
|
3,192,839 | 3,192,840 |
populate another drop down on selection of first
|
<p>I am going to populate a another drop down on selection of first drop down. Implementing this with intermediate php file. I am showing second drop down on basis of Jquery.</p>
<p>Jquery code.</p>
<pre><code>$("<select/>", {
class: "selectdoctor",
name: "selectdoctor" + i,
id: "selectdoctor" + i
}).appendTo("#prescriptiondiv").after("<br/>");
</code></pre>
<p>This dropdown will be shown number of times using for loop. So I can populate value in this on basis of class only.
Second jquery that will send value to phpfile and fetch result using ajax has code.</p>
<pre><code>$.post("getdoctorlist.php", {
childid: childid
}, function(data) {
//alert(data);
$('.selectdoctor').html(data);
});
</code></pre>
<p>My phpcode for <code>getdoctor.php</code> list has code,</p>
<pre><code>if(mysql_num_rows($query)!=0);
{
while($result=mysql_fetch_assoc($query))
{
echo '<option value="'.$result["pcpkey"].' ">'.$result["pcpfname"].'</option>';
}
}
</code></pre>
<p><strong>How can I fetch this response(data) in <code>drop down with classname='selectdoctor'</code> ?</strong></p>
|
php jquery
|
[2, 5]
|
1,217,194 | 1,217,195 |
C++ code communication with Java
|
<p>I have a Java based desktop application. Now also along there is a camera sdk, through which one can control the camera (i.e. get the latest picture from camera, generate thumbnail's, camera clock etc). This code to handle all this is written in C++.</p>
<p>What is the best provision to interact both the above parts. What I want is:</p>
<ol>
<li>2-way communication.</li>
<li>C++ code should communicate with the Java process about any error in process or Image received successfully etc. This can be pure text or an Integer.</li>
<li>If possible, the C++ code should be able to give the Image object. Or at worse, it can give the temporary file path to the Image which Java can load it.</li>
</ol>
<p>My options:</p>
<ol>
<li>Have the C++ code run as a separate process and let both of them communicate through some sort of message passing. For ex through db/file. Suggestions needed here.</li>
<li>Have a Java wrapper. i.e. by using jni or jna. I have never worked on this so do not have much idea about the feasibility</li>
</ol>
<p>Anyother efficient and better way?</p>
|
java c++
|
[1, 6]
|
4,170,962 | 4,170,963 |
Can't find the bug in this jQuery code
|
<p>I have the following code, which, upon the press of a certain button, should validate for an email address (this functionality works already), and then should try to post my form, and if it gets back "Error", it should show an error. I think I'm mixing up PHP and JS somewhere.</p>
<pre><code>$('#recoverSub').live('click',function() {
$("#recoverPost").validate({
rules: {
recoverField: {
email: true
}
},
messages:{
recoverField: {
email: "Not a valid email."
}
}
});
if($("#recoverPost").valid())
{
$.post('php/recoverPost.php', $('#recoverPost').serialize(), function(){
function(data) {
if(data != "Error")
{
$('#recoverPost').hide();
$('#success').show();
}
else
{
echo "This email is not in our records.";
}
}
});
}
});
</code></pre>
|
php jquery
|
[2, 5]
|
3,386,169 | 3,386,170 |
How do you cycle through and display parameters in jQuery
|
<p>Suppose you have a URL like <code>http://www.somesite.com/somepage.html?id=1&page=2&field=3</code></p>
<p>Now with jQuery I would like to display all of the GET variables passed to the page. How do I dodo this. Its fine (perhaps even better) if its done as part of some Debug function.</p>
|
javascript jquery
|
[3, 5]
|
1,270,451 | 1,270,452 |
No space left on device - Android emulator
|
<p>I've got an error and i don't know why, i googled it many time but nothing appeared.</p>
<p>com.android.ddmlib.SyncException: No space left on device</p>
<p>I clean and build the project... Nothing. I don't know what to do next.
I'm talking about the emulator.</p>
|
java android
|
[1, 4]
|
2,305,993 | 2,305,994 |
need help converting c++ definitions to c# equivalent
|
<p>I'm using an API (written in c++) to connect to a DVR machine, actually I only have the .dll and the .lib files, and I want to do the job in .NET (C#).
So, the API doc contains definitions to all functions inside the dll, and I'm having a hard time trying to figure out how to translate those functions to equivalente C# definitions. Some of them are straightforward, but some I cannot make it work.</p>
<p>For example, there is this function: </p>
<pre><code>bool searchEvent(int channel, const LONG* condition, bool next)
</code></pre>
<p>In my c# class I put the following: </p>
<pre><code>[DllImport("search.dll")]
protected static extern bool searchEvent(int channel,
[MarshalAs(UnmanagedType.I8)]long condition, bool next);
</code></pre>
<p>but when I call the searchEvent function, it raises an error (memory error), I guess because of that long var. So my question is how can I translate "const LONG* condition" to c#?
Also, that searchEvent function triggers a callback that returns a struct. I am unable to translate some vars of that struct, like: </p>
<pre><code>char _version[2]
time_t _time
BYTE* _minute
unsigned short int _dwell[MAX]
</code></pre>
<p>Can someone help me with this, please? I´m no expert in c++, so any tips are greatly appreciated. Thanks!</p>
|
c# c++
|
[0, 6]
|
4,934,052 | 4,934,053 |
jQuery - Do UI change after other UI change is finished
|
<p>How would I execute <code>$("#login").toggle("drop", {direction: "left"});</code> then after THAT is completely finished... do <code>$("#register").toggle("drop", {direction: "right"});</code>. Because the <code>DIVS</code> are not floated and at the same time they stack up against each other when they <code>drop</code>.</p>
|
javascript jquery
|
[3, 5]
|
5,756,835 | 5,756,836 |
Javascript/JQuery arguments by type
|
<p>I'm not quite sure if the title is correct because I'm not sure how to describe my question, but basically I'm wondering how jQuery can handle functions that take things like <code>("Some String", true, function(){})</code> and <code>("Some String", function() {})</code>. IE, it seems like it's an overloaded function, I'd expect the function to be something like</p>
<pre><code>function DoSomething(theStr, theBool, theFunc) {
//...
}
</code></pre>
<p>but that doesn't explain how it can handle the 2 argument call, at least to me. Anyone able to explain, or is it just a lot of if/else.</p>
|
javascript jquery
|
[3, 5]
|
5,242,692 | 5,242,693 |
Checklist Box (C#)
|
<p>My query is quite simple yet complex for me!!</p>
<p>The scenario is that I have a checklist box whose checked items are to be added in a listbox for further processing. All I need to know is how to uncheck an item in a checklist box if an item is removed from the listbox. There are two buttons named <code>Remove All</code> and <code>Remove Selected Item</code> (from the items selected in the Listbox).</p>
<p>Please help me with the functioning of the second button, i.e. if a user removes a particular item from the listbox, the corresponding chechklist item also should get unchecked.</p>
<p>Guide me as to how to uncheck a particular item in the checklist I removed from listbox.</p>
|
c# asp.net
|
[0, 9]
|
1,264,785 | 1,264,786 |
How to use front camera in Xing QR Code scanner libary on android
|
<p>I wish to know how can I use front camera with Xing library on android to scan 2D Qr code . I mean what what code is required ? </p>
<p>Thanks a lot
Vishal</p>
|
java android
|
[1, 4]
|
4,457,175 | 4,457,176 |
Accessing method in main activity from another class
|
<p>How do I access the method myMethod from another class?</p>
<pre><code>public class controller extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
int myMethod() {int id = 0; return id;} //arbitrary example, may also be static?
}
</code></pre>
|
java android
|
[1, 4]
|
558,904 | 558,905 |
Pulling HTML value through jQuery
|
<p>I have these data-attributes</p>
<pre><code><li data-audio="" data-pic="images/one.png" data-word="one" data-hint="What?"></li>
</code></pre>
<p>I pull them through using this function</p>
<pre><code>$(wordsData).each(function () {
var elm = $(this);
listOfWords.push({
"name": elm.data("word"),
"pic": elm.data("pic"),
"hint": elm.data("hint"),
"audio": elm.data("audio")
});
});
</code></pre>
<p>My problem is that when I pull the picture through I would like to display the hint in the same div. But for some reason when I check in the console it says value="", when it should say "What?"</p>
<pre><code><div class="hint-img-wrapper">
<img src="" value="" id="hintPic" class="pic-hint" alt="Hint" />
</code></pre>
<p>I display it it like this</p>
<pre><code> $("#hintPic").attr('src', listOfWords[rndWord].pic).attr('value', listOfWords[rndWord].hint);
$(hintPic).show();
</code></pre>
<p>Can someone tell me what I am doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
2,509,898 | 2,509,899 |
Getting Value Of a Particular Row On Clicking On the LinkButton Inside GridView
|
<p>I have a Gridview As Follows :</p>
<pre><code><asp:GridView ID="PartnerView" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" CssClass="GridViewStyle"
GridLines="None" DataKeyNames="Partnerid" Width="900px">
<Columns>
<asp:BoundField DataField="Partnername" HeaderText="Partner Name" />
<asp:BoundField DataField="partnertype" HeaderText="Type"/>
<asp:BoundField DataField="Contact" HeaderText="Contact" />
<asp:BoundField DataField="City" HeaderText="City"/>
<asp:BoundField DataField="State" HeaderText="State"/>
<asp:BoundField DataField="Country" HeaderText="Country" />
<asp:BoundField DataField="email" HeaderText="Email ID" />
<asp:TemplateField HeaderText="Details">
<ItemTemplate>
<asp:LinkButton ID="Show_Button" Text="Show" runat="server" OnClick="Show_Button_click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</code></pre>
<p>And i have the LinkBUtton inside the gridview....Now i want that when i click on the LinkBUtton inside the gridview i want to get the data only of that particular row.....in the next page..</p>
|
c# asp.net
|
[0, 9]
|
3,326,060 | 3,326,061 |
How to make /#!/ in our URL?
|
<p>Everyone!</p>
<p>Almost 3 hours im stack in this problem! iv'e copy the concept in twitter like this if twitter.com/#!/username then the page/profile is username, </p>
<p><a href="http://twitter.com/#!/mardagz" rel="nofollow">http://twitter.com/#!/mardagz</a> as you can see it redirected to my account, so now im trying to make my own by getting the current url.. then i trim to string and split it by (/#!/) and when i try to apply nothing works...</p>
<p>assuming that the current url is <a href="http://www.domain.com/#!/about" rel="nofollow">http://www.domain.com/#!/about</a></p>
<p>the Code:</p>
<pre><code>$(window).load(function () {
var getUrl = top.location;
var trimUrl = jQuery.trim(getUrl);
var splitUrl = trimUrl.split('/#!/')
//alert(splitUrl[1]);
switch(splitUrl[1])
{
case 'home':
//Do Something
break;
case 'skill':
//Do Something
break;
case 'about':
//Do Something go to About Us Page!
break;
}
});
</code></pre>
<p>owhh it's not working... whew anyone has a solution for this? :) thank you in advance.. :)</p>
|
javascript jquery
|
[3, 5]
|
2,707,701 | 2,707,702 |
What is JSON.parse written in / Is it open source?
|
<p>PHP funcitons are written in C and you can look at the source code if you like. For example here -
<a href="http://lxr.php.net/opengrok/xref/PHP_5_3/ext/session/session.c#1361" rel="nofollow">session_start source</a></p>
<p>What about with Javascript? How are functions like JSON.parse implemented? Where can I go to view the source?</p>
<p>Thanks!</p>
|
php javascript
|
[2, 3]
|
3,490,969 | 3,490,970 |
file sending using php
|
<p>can we use php to send a file to another like in MSN Messenger? I am working on a chat script and was wondering if its possible or not to send a file to the other person during chat?</p>
<p>i am using jquery/mysql/textfiles/php for this script</p>
|
php jquery
|
[2, 5]
|
5,982,702 | 5,982,703 |
jQuery issue with .net
|
<p>I'm working on a website built with .net and im having a strange problem. </p>
<p>I have a jQuery call that changes all my 'select' tags from the default browser style to a custom style. When my page loads the javascripit is read and so this works, my only problem being that when you select an option the dropdown, when the page reloads it seems to lose the styling and reset back to the browser style, as though the page is reloading without the jQuery. </p>
<p>Does this make sense? if so is there anyway to combat this? </p>
<p>Thanks </p>
|
jquery asp.net
|
[5, 9]
|
1,232,452 | 1,232,453 |
Select a random string from an array
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4550505/javascript-getting-random-value-from-an-array">JavaScript: Getting random value from an array</a> </p>
</blockquote>
<p>Could someone help me on this topic? I've got this code.</p>
<pre><code>var textArray = [
'song1.ogg',
'song2.ogg'
]
audioElement.setAttribute('src', textArray);
</code></pre>
<p>How can I randomly get one of those strings into my audio element?</p>
<p>Would be glad if someone can help....</p>
|
javascript jquery
|
[3, 5]
|
1,177,176 | 1,177,177 |
User controls (listview, gridview etc) or Use custom made tables or lists
|
<p>I'm starting a project in ASP.net, but since I first started with asp.net mvc. It's a bit weird with all the user controls you can just drag on the page and bind it with a datasource.</p>
<p>Is it bad practice to simply make a public variable on the code behind file and loop through it with a for-each like in asp.net mvc with the razor engine and making a table that way?</p>
|
c# asp.net
|
[0, 9]
|
314,909 | 314,910 |
Onclick button language change in java android
|
<p>I'm looking for a way to implement change of language triggered by button onclick. I have created proper strings.xml in proper folders (for example res/values-en/) Here is my code of the button:</p>
<pre><code>Button setEN_bt = (Button) findViewById(R.id.setEN);
setEN_bt.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Locale locale_en = new Locale("en");
Locale.setDefault(locale_en);
Configuration config_en = new Configuration();
config_en.locale = locale_en;
getBaseContext().getResources().updateConfiguration(config_en, getBaseContext().getResources().getDisplayMetrics());
}
});
</code></pre>
<p>So basicly I change the locale with the onclick but the page doesn't refresh afterwards (why should it...:) ). Could somebody tell me how to refresh/reload the activity?</p>
<p>Thanx for help in advance.</p>
|
java android
|
[1, 4]
|
3,936,260 | 3,936,261 |
Execute java code though javascript w/o ajax
|
<p>I am trying to implement java code on a web based application to reduce redundancy and increase OOP principles</p>
<p>I have a phone validation regular expression on server side java code. I have a requirement to perform the same validation on the browser as people are adding information, without communicating with the server. I understand I can place the same code into the javascript but then I have two locations to maintain the same code. I am looking for a simple way to send the regular expression function with the http response.</p>
<pre><code>//java code
Class myVerf
{
bool verPhone(input) {return //comepare verPhone to regEx}
}
//html
input type = "text" id = "1" onkeypress = "verPhoneFunc()"
//javascript
function verPhoneFunc()
{
//get value from id 1
//execute verPhone java code
}
</code></pre>
<p>Are there any downfalls to doing this? EX: what happens if there is no JVM on the machine the browser is running in? How does the java code execute on the browser?</p>
<p>I want to emphasise again... I cannot use AJAX because I can not communicate with the server.</p>
|
java javascript
|
[1, 3]
|
2,919,248 | 2,919,249 |
javascript: pass function as a parameter to another function, the code gets called in another order then i expect
|
<p>i want to pass a function to another function as a parameter.</p>
<p>I want to do that because the latter function calls an async Jquery method and AFTER that gives a result back, i want some javascript code executed.</p>
<p>And because this function is called from multiple places, i want the code to execute (after the async Jquery code gets executed) to be passed in the function.
Makes sense? i hope :)</p>
<p>Now what is see is that the order in which the code is executed is noth what i want.
I've simplified the code to this code:</p>
<pre><code>$('#AddThirdParty').click(function() {
var func = new function() {
alert('1');
alert('2');
alert('3');
}
alert('4');
LoadHtml(func);
alert('5');
});
function LoadHtml(funcToExecute) {
//load some async content
funcToExecute;
}
</code></pre>
<p>Now what i wanted to achieve (or at least what i thought would happen) was that alert4 would fire, then the loadhtml would fire alert1, alert2 and alert3, and then the code would return to alert5.</p>
<p>But what happens is this: alert1, alert2, alert3, alert4, alert5.</p>
<p>Does anyone know what i'm doing wrong and why this is the order in which the code is executed?</p>
<p>It looks like the alert1..alert3 gets executed when i define the <code>new function()</code>, but why doesn't it ALSO get executed when i call it from the <code>LoadHtml</code> function?</p>
|
javascript jquery
|
[3, 5]
|
4,472,439 | 4,472,440 |
find() function not working on page load in jquery
|
<p>I have the following jquery code to remove the style attribute of all <code>table</code>, <code>tr</code> and <code>td</code> elements located inside a <code>div</code> with <code>id="testdiv"</code>. </p>
<pre><code>$(document).ready(function(){
$("#testdiv").find("table, tr, td").removeAttr("style");
});
</code></pre>
<p>If i run the <code>$("#testdiv").find("table, tr, td").removeAttr("style");</code> line in the firebug console directly it works,but its not working automatically when the page loads.
How can this problem be fixed?</p>
|
javascript jquery
|
[3, 5]
|
5,255,238 | 5,255,239 |
Is there a way to get a list of all the users on a domain using ASP.NET with C# as the backend?
|
<p>The question basically says it all. I want to be able to get a list of all the users on the windows domain (i.e. in the active directory) using c#.</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
4,820,204 | 4,820,205 |
Javascript .indexOf says 2 equal elements are not equal
|
<pre><code>$.makeArray($('ul#NavAContent li')).indexOf($('ul#NavAContent li#A1'))
</code></pre>
<p>The li element with id A1 is in the ul#NavAContent, but the indexOf function returns <strong>-1</strong>, what am i doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
5,802,748 | 5,802,749 |
Is there a js function that scrolls a site left right up and down?
|
<p>I was wondering if anyone knows if there was a javascript or something that scrolls a site left right up and down on a click.</p>
<p>For example I want to create a site with multiple divs. Look at photo below.</p>
<p><img src="http://i.stack.imgur.com/ygCBW.jpg" alt="enter image description here"></p>
<p>I want each div to fit to screen and div 1 being the main div, the starting point. Say that I had a link in the menu for biography and the content for biography was in div 4 and someone click biography, I want the site to move down to div 3 and then right to div 4 and the same thing goes for div 4 and all the divs. When someone clicks a link in the divs I want the site to scroll in a direction I specify, is this possible.</p>
<p>Left Right Up Down</p>
|
javascript jquery
|
[3, 5]
|
4,537,547 | 4,537,548 |
dropdown list value from sql in php
|
<p>I want to do this function in php. i have two fields, one is text box and an
other one is drop down list. Drop down list contains values from sql. When one of the value is selected from the drop down list i want the text box to be filled according to the option which is selected.</p>
<p>Following is the drop down list code,</p>
<pre><code><td>Test Group ID</td>
<td><select id="testgroupid" name="testgroupid" style="column-width:35">
<option value="<?php echo $testgroupid;?>"><?php echo $testgroupid;?></option>
<?php
$x=new con();
$x->connect();
$retval = "select distinct(Id) from testgroupmaster";
$sql1 = mysql_query($retval) or die (mysql_error());
while($res=mysql_fetch_array($sql1, MYSQL_BOTH)){
?>
<option value="<?=$res['Id'];?>"><?=$res['Id'];?></option>
<?
}
?>
</select></td>
</code></pre>
<p>According to the id,I want textbox to be filled, How can i do this ? Pls help friends.</p>
<pre><code><tr>
<td>Test Group Name</td>
<td><input type="text" name="testgroupname" id="zipsearch" value="<?php echo $testgroupname; ?> "></td>
</tr>
</code></pre>
|
php javascript
|
[2, 3]
|
1,998,075 | 1,998,076 |
Creating User Control works with AJAX
|
<p>I need to create a user control with 3 images: like, dislike and comment buttons. I want to like and dislike button to save some info to the database (liked user and liked object). But i want to work them without reloading the page. </p>
<p>Example scenario: </p>
<ul>
<li>Like button shows like count if the post has any</li>
<li>User likes a blog post.</li>
<li>Save like process to the DB</li>
<li>Disable like button.</li>
</ul>
<p>I want to implement this operation via AJAX call to the page in which the control is used, inside of the control. I don't want to implement them separately. When another developer wanted to use this, he/she must use the control just by instantiating. Also, it must be used more than once in a page.</p>
<p>Regards.</p>
|
c# asp.net
|
[0, 9]
|
4,072,958 | 4,072,959 |
using javascript function to be called from code behind under specific condition
|
<pre><code><asp:Button ID="btn_create" runat="server"
Text="Create Weekly Report"
OnClick="btn_create_Click" />
</code></pre>
<p>This is a user button and code behind is</p>
<pre><code>con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (!(dr.HasRows))
{
Page.ClientScript.RegisterStartupScript(
this.GetType(),
"alert",
"openWinContentTemplate();",
true);
}
else
{
Response.Redirect("entry.aspx");
}
con.Close();
</code></pre>
<p>I want to call the javascript functionif the first condition is true.
but it is not working.<br>
My javascript function is</p>
<pre><code>function openWinContentTemplate() {
$find("RadWindow_ContentTemplate").show();
}
</code></pre>
<p>This opens a radwindow if the condition is satisfied.<br>
Its not working could anyone plz help me out.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,440,007 | 2,440,008 |
Android PorterDuff.Mode error: PorterDuff cannot be resolved to a variable
|
<p>I've got a class which extends LinearLayout, can't figure out how to get PorterDuff.Mode working with this piece of code:</p>
<pre><code>this.getBackground().setColorFilter(Color.parseColor("#a7d2e3"), PorterDuff.Mode.DARKEN);
</code></pre>
<p>"PorterDuff cannot be resolved to a variable"</p>
<p>I've imported porterduff and from what I can see PorterDuff is a static class. Any ideas?</p>
|
java android
|
[1, 4]
|
5,636,506 | 5,636,507 |
how to namespace many capture events in a Javascript object literal
|
<p>I am using jQuery events to capture events across a rails app. Basically, there are a set of event captures' on DOM elements that then call other functions. What I'd like to do is provide some namespacing to these event captures and an looking for the best way:</p>
<p>I currently have (but like 60 of them):</p>
<pre><code>$(document).ready(function(){
$('.edit-item').on('click', arc.event_handler.edit_item);
});
</code></pre>
<p>and would like something like the following - basically provide the edit_item so we know where to look:</p>
<pre><code>$(document).ready(function(){
var events.edit_item= {
$('.edit-item').on('click', arc.event_handler.edit_item);
};
});
</code></pre>
<p>But this is giving me an error. I am familiar with basic object literal syntax like:</p>
<pre><code>var my = {
say_my_name: function(){
alert('my name');
}
}
</code></pre>
<p>but not sure how to apply it with jQuery functions. How would I do this?</p>
<p>I am aware that there are anonymous functions for namespacing this more agressively but, honestly, just want this one change right now</p>
<p>thx in advance</p>
|
javascript jquery
|
[3, 5]
|
3,878,979 | 3,878,980 |
How to implement internet radio using java
|
<p>How to implement internet radio using java?
Is there any Java APIs for this?</p>
<p>I want to make a internet radio using Android / java. But I am not getting any APIs how to connect or how to receive the channel information for streaming the audio.</p>
<p>Please help me how to create that same and provide some code/API for that.</p>
|
java android
|
[1, 4]
|
2,939,083 | 2,939,084 |
Jquery/JavaScript Time Calculation
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7641791/javascript-library-for-human-friendly-relative-date-formatting">Javascript library for human-friendly relative date formatting</a> </p>
</blockquote>
<p>How to show 2days ago, 3 months ago instead of time and date in Jquery?</p>
|
javascript jquery
|
[3, 5]
|
385,453 | 385,454 |
.text() function does not show HTML tags like I want. How do I fix this?
|
<p>I am trying to limit 300 charecters to show in a container and using this</p>
<pre><code><script>
$(function () {
$('.shippingMessage').append($('#forQuickViewOnly'));
var myDiv = $('#firstPara');
myDiv.text(myDiv.text().substring(0, 300));
$('.productdetailtopquickview .productdetailshopnowform').appendTo($('.infoHolder'));
});
</script>
</code></pre>
<p><strong>I am trying to show <code><ul><li><li></ul></code> structure but i am getting a paragraph.</strong> In other words, the list formatting is getting stripped. Any idea how to prevent that? </p>
|
javascript jquery
|
[3, 5]
|
4,528,910 | 4,528,911 |
altering onload event after body tag is printed, using jQuery .ready() in body of document
|
<p>I have a tabbed page I inherited that works through a number of queries and the results determine what tabs are printed.</p>
<p>I want to implement some logic in PHP that will cause one tab or another to be the tab with focus when page load is completed.</p>
<p>Is it good practice to add a call to jQuery's <code>.ready()</code> at the closing body tag of the document?</p>
<p>Any advice most welcome.</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
957,261 | 957,262 |
separate string with html into two strings
|
<p>I'm trying to separate a string with html and non-html in it into two strings.</p>
<p>My javascript string is:</p>
<pre><code><span>1x</span> Front-line zero tolerance productivity
</code></pre>
<p>I want this to be separated into two variables</p>
<pre><code>var quantity = "1x";
var name = "Front-line zero tolerance productivity";
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,606,421 | 2,606,422 |
Overriding $.connection.hub.id in signalr for my own Id's
|
<p>can i override this functionality to give my connected client my own Id's not the id generated by the Hub i looked for it through the internet i fount that you have to do a class that override IClientfactory or IConnectionIdGenerator class but i also found that those classes have been deleted and in my signalr Dll's i couldn't find them so is their any other way to do so ? </p>
|
c# javascript
|
[0, 3]
|
2,627,622 | 2,627,623 |
ASP.NET - Are there any advantages or differences in using (Type)Container.DataItem and Eval() within Server tags?
|
<p>Are there any advantages or differences between using the following?</p>
<pre><code><%# Eval("Item.Details")%>
</code></pre>
<p>and <code><%# ((ItemDetails)Container.DataItem).Item.Details%></code></p>
|
c# asp.net
|
[0, 9]
|
2,533,199 | 2,533,200 |
Time Line graph is not showing date exactly
|
<p>I am working on time line graph i am getting From date and To date from date base. I am binding that values to time line graph through javascript. But Graph is displaying one month ahead.</p>
<p>Ex: My date is 12-jun-2011, but in graph I am getting near 12-july-2011.</p>
<p>How can I solve this ?</p>
|
javascript asp.net
|
[3, 9]
|
4,257,634 | 4,257,635 |
How can I extract table data from an aspx file?
|
<p>I work in a call center and have an aspx page that generates a html table of the current stats of all the other call centers in the company.</p>
<p>I have put an example of what is generated on a <a href="http://jsfiddle.net/UqZjt/" rel="nofollow">JSFiddle here</a>. I'm afraid I'm only an enthusiastic beginner so apologies if I'm not asking this correctly etc.</p>
<p>I am looking to extract just the data I need which includes all Rows and the Columns labeled:</p>
<pre><code> --- C6 C7 C13 C14
</code></pre>
<p>So all I need to see is the above columns.</p>
<p>This needs to be client side, so I assume JS, as we cannot access or edit on-server so we could not have our own aspx file for example.</p>
<p>I'm happy to use jQuery, I understand that one can extract data using jQuery but I can't seem to get my head around it :(</p>
<p>If anyone would be kind enough to put together a JSFiddle using <a href="http://fiddle.jshell.net/UqZjt/show/" rel="nofollow">http://fiddle.jshell.net/UqZjt/show/</a> as the source file, that would be much appreciated.</p>
<p>Thanks in advance.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
382,450 | 382,451 |
How to stop cursor from jumping to beginning/end of textbox on up/down key?
|
<p>How can I prevent the cursor from jumping to the beginning or end of a textbox when up or down arrow key is pressed, using JavaScript and jQuery?</p>
|
javascript jquery
|
[3, 5]
|
1,792,251 | 1,792,252 |
javascript repeat action
|
<p>how to do a same loop action? thank you.</p>
<pre><code>$('a.level').click(function() {
var level = $(this).parent('li').attr("class");
var nxvl = parseInt(level)+1;
var dir = $(this).html();
var curr = $(this);
var data = new Object();
data.n = new Date().getTime();
data.act = "getdirectory";
data.level = level;
data.direct = dir;
var str = $.toJSON(data);
$.post('ajax.php', { str: str }, function(result){
var data = eval('('+obj.data+')');
var html = [];
$.each(data, function(key, value) {
html[key] = "<li class='"+nxvl+"'><a href='javascript:void(0);' title='' class='level'>"+eval(value)+"</a><ul></ul></li>";
});
$(curr).next('ul').html(html.join(""));
$('a.level').click(function() {
// do the same action
}
});
return(false);
</code></pre>
<p>});</p>
|
javascript jquery
|
[3, 5]
|
1,468,888 | 1,468,889 |
ashx file for download from Master page menu item?
|
<p>Right now I wrote download code in Masterpage code behind for Menu item click. Now I want change this. When user click menu item in master page I want to call .ashx file and execute download logic. But stay in the same page where the request has made. </p>
<p>Please point me to right direction to implement this.</p>
|
c# asp.net
|
[0, 9]
|
3,165,661 | 3,165,662 |
Jquery photography slider (window resize and image increase in size)
|
<p>Here is the jsfiddle: <a href="http://jsfiddle.net/d5yBg/" rel="nofollow">http://jsfiddle.net/d5yBg/</a></p>
<p>My 1 problem is with commented out parts of the code, near the bottom. I'd like to increase size of .focus image. Problem is total width of the slide is not re-calculated correctly so I've image falling out of the slider.</p>
<pre><code>//$(".focus").animate({"height":300}, "fast");
//$(".focus").animate({"height":350}, "slow");
//set_slide_width();
</code></pre>
<p><strike>2 is how do I get image be centered even if user resizes the window? My move_slide() function can be used with something that listens to browser size?</strike> this problem solved.</p>
<p>Jquery:</p>
<pre><code>//
function set_slide_width() {
var slide_width = 0;
$("#barely_slide article img").each(function(){
slide_width += $(this).outerWidth();
});
$("#barely_slide article").css("width",slide_width);
}
//
set_slide_width();
//
function move_slide() {
var focus_margin = 0;
$("#barely_slide article img").each(function(){
if ($(this).attr("class") == "focus") {
focus_margin += $(".focus").outerWidth() / 2;
return false;
}
focus_margin += $(this).outerWidth();
});
//
var container_center = $("#barely_slide").outerWidth() / 2;
var offset = - (focus_margin - container_center);
$("#barely_slide article").animate({"margin-left": offset }, "slow");
}
//
move_slide();
//
$("#barely_slide article img").on("click", function(){
//$(".focus").animate({"height":300}, "fast");
$("#barely_slide article img").removeAttr("class");
$(this).addClass("focus");
move_slide();
//$(".focus").animate({"height":350}, "slow");
//set_slide_width();
return false;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
419,289 | 419,290 |
Generate PDF file in asp.net
|
<blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="http://stackoverflow.com/questions/575584/how-to-make-pdf">How to make pdf ?</a><br>
<a href="http://stackoverflow.com/questions/3252872/create-pdf-file-in-asp-net">Create pdf file in Asp.net</a> </p>
</blockquote>
<p>What is the best way to generate pdf files in asp.net using C#? Any help would be greatly appreciated.</p>
|
c# asp.net
|
[0, 9]
|
2,879,542 | 2,879,543 |
PHP ↔ JavaScript communication : constants VS strings
|
<p>I am developping a web-application which makes a heavy use of AJAX. The server often answer by an array in order to <em>concatenate</em> different parts of the response.</p>
<p>I wonder what is the best solution to handle the keys in those arrays among the following two (the JSON encoding and decoding aren't shown):</p>
<h3>Strings</h3>
<p>This solution is easy to read, especially in JavaScript, but is really brittle and hard to maintain.</p>
<p><em>PHP</em> :
</p>
<pre><code><?php
return array(
'key_name_1' => 'foo',
'key_name_2' => 'bar'
);
?>
</code></pre>
<p><em>JavaScript</em> :
</p>
<pre><code>var result = ajax(...);
alert(result.key_name_1);
</code></pre>
<h3>Constants</h3>
<p>This is a solid solution, which allow for short and numeric keys, but it's heavy and hard to read (use Reflection to automatize the generation of JavaScript constants is not an acceptable solution in my case, and doesn't solve all the drawbacks anyway).</p>
<p><em>PHP</em> :
</p>
<pre><code><?php
class Answer
{
const CONSTANT_1 = 1;
const CONSTANT_2 = 2;
}
return array(
Answer::CONSTANT_1 => 'foo',
Answer::CONSTANT_2 => 'bar'
);
?>
</code></pre>
<p><em>JavaScript</em> :
</p>
<pre><code>Answer.CONSTANT_1 = <?php echo Answer::CONSTANT_1; ?>
Answer.CONSTANT_2 = <?php echo Answer::CONSTANT_2; ?>
var result = ajax(...);
alert(result[Answer.CONSTANT_1]);
</code></pre>
<hr>
<p>According to you, what is the best choice?</p>
|
php javascript
|
[2, 3]
|
315,212 | 315,213 |
Where I can see the Log, If I have installed application on Phone?
|
<p>Where I can see the Log, If I have installed application on Phone?
Example like </p>
<p><code>Log.v(TAG, "Current State is - "+state);</code></p>
<p>My application is crashing when incoming call comes. So how can I trace the Log or Error?</p>
|
java android
|
[1, 4]
|
4,302,488 | 4,302,489 |
Scroll to bottom of page, only if the user already was at the bottom before DOM manipulation
|
<p>I'd like to learn how to use <code>window.scrollTo</code>.</p>
<p>Here's is the desired behavior:</p>
<ol>
<li>Determine if the user is scrolled to the bottom of the page, or no scroll bar is visible</li>
<li>Then I want to grow a DIV, this is working</li>
<li>If #1 was true, use <code>window.scrollTo</code> to scroll to the bottom of the page after the DIV has grown which changed the window height.</li>
</ol>
<p>Ideas?</p>
|
javascript jquery
|
[3, 5]
|
2,547,571 | 2,547,572 |
How to change the weight size of a fragment in android?
|
<p>Here is the xml-Layout of my fragment view</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:weightSum="100"
>
<fragment
android:id="@+id/menuFragment"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="70"
class="com.pack.Menufragment" >
</fragment>
<fragment
android:id="@+id/bodyFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="30"
class="com.pack.BodyFragment" >
</fragment>
</LinearLayout>
</code></pre>
<p>Now I want to change the fragment weight size from the java not from XML, is there anyway to do this?</p>
|
java android
|
[1, 4]
|
2,711,606 | 2,711,607 |
pass the e.target to a function thats called when element is clicked
|
<p>I am trying to pass the clicked event (event.target) to a function inside a function that is being called when clicked how would i do this?</p>
<pre><code>function showGrid(){
updateTag()
}
function updateTag(){
/*how do i get the event.target passed here? */
alert(e.target)
}
$(".gridViewIcon").click(function(e) {
showGrid();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,758,034 | 3,758,035 |
Jquery and retrieving object via .find()
|
<p>Via ajax method, I need to fetch an html which is a real mess, half of the elemnts are opened but not closed.</p>
<p>Now I need to find elements which contains time string as in such format: "19:00-20:00" which means it should have something such as "HH:MM-HH:MM".</p>
<p>How can I fetch these rows that contains such time-time elements ?</p>
<p>an example for ajax call source can be found here: <a href="http://www.tatlisestv.com/YayinAkisi.asp?Day=3" rel="nofollow">http://www.tatlisestv.com/YayinAkisi.asp?Day=3</a>
I am interested with start-end time and the nearest right element that holds the program name for that hour interval.</p>
<p>Regards</p>
|
javascript jquery
|
[3, 5]
|
4,369,596 | 4,369,597 |
Playing a video in android
|
<p>Im implementing a video playback in android im completely new to android, and this is the bit of code i have gathered so far.</p>
<p>according to the logic it should play a video. don't know where im doing wrong.</p>
<pre><code>package com.themetanoia.readfilefromsdc;
import java.io.File;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.VideoView;
import android.widget.AdapterView.OnItemClickListener;
public class ReadFileFromSDCActivity extends ListActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Get the file path for external storage
String a = Environment.getExternalStorageDirectory().getAbsolutePath();
final String finalPath = a+"/Videos";
//Define new file funtion
File f=new File(finalPath);
if(f.isDirectory()){
//Define arrayadapter
setListAdapter(new ArrayAdapter<String>(this, R.layout.listview,files));
//Define listview
ListView listview = getListView();
listview.setTextFilterEnabled(true);
//Onclick list item event
listview.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
//get selected items
String selectedValue = (String) getListAdapter().getItem(position);
Uri uri = Uri.parse(finalPath);
MediaController mediaController = new MediaController(getBaseContext());
mediaController.setAnchorView(mVideoView);
Uri video = Uri.parse(finalPath+"/"+selectedValue);
mVideoView.setMediaController(mediaController);
mVideoView.setVideoURI(video);
mVideoView.start();
}
});
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
1,691,164 | 1,691,165 |
Password strength script failed
|
<p>I'm using a little script to check the password strength in an inscription form, here is a relevant part of the script:</p>
<pre><code> $('#password').keyup(function(){
var password = $(this).val();
password = $.trim(password);
var lettre_min = /[a-z]/;
var lettre_maj =/[A-Z]/;
var nombre = /[0-9]/;
var symbole = /[\`\!\"\?\$\%\^\&\*\(\)\_\-\+\=\{\[\}\]\:\;\@\'\~\#\|\\\<\,\>\.\/]/;
if(password.length != 0)
{
//password moin de 8 caractères
if(password.length <8)
{
$('.bar').animate({width:'50px',height:'5px'},200).show();
$('.bar').css('background-color','red');
$('.error').text('Too short').show();
}else
//password faible
if((password.match(lettre_min)) && password.length <12)
{
$('.bar').animate({width:'75px',height:'5px'},200).show();
$('.bar').css('background-color','red');
$('.error').text('Weak').show();
}else
//password moyen
//1 type
if((password.match(lettre_min)) && (password.match(nombre)) && password.length <12)
{
$('.bar').animate({width:'100px',height:'5px'},200).show();
$('.bar').css('background-color','orange');
$('.error').text('Average').show();
}else ...
</code></pre>
<p>The problem is: if I put letters (lettre_min) AND numbers (nombre) on the form input, he tells me the password is weak when he should tell me that it is average. He totally ignores the second condition.</p>
<p>I have no clue what's going on =/</p>
<p>PS: I'm sorry if there is already an answer for this in an other question but I don't even know what the problem is, so I don't know what to search for =/</p>
|
javascript jquery
|
[3, 5]
|
2,473,706 | 2,473,707 |
How i can create json on javascript(jquery)
|
<p>I have json: </p>
<pre><code>{
"sEcho": 1,
"iTotalRecords": 3,
"iTotalDisplayRecords": 3,
"aaData": [
["http://google.com", "0", "0", "2013-02-20 18:31:02"],
["http://ya.ru", "0", "0", "2013-02-22 18:45:43"],
["http://yandex.ru", "0", "0", "2013-02-22 18:45:43"]
]
}
</code></pre>
<p>How i can create same JSON on JavaScript(jQuery)? </p>
<p>ADD</p>
<p>Initially, I have only </p>
<pre><code>{
"sEcho": 1,
"iTotalRecords": 3,
"iTotalDisplayRecords": 3,
"aaData": []
}
</code></pre>
<p>In the future i want add data to <strong>"aaData"</strong>... </p>
<p>Sorry, that poorly written question ..</p>
|
javascript jquery
|
[3, 5]
|
5,797,381 | 5,797,382 |
Where can i get offline jQuery 1.7 API dump
|
<p>Hi i am tired googling for jQuery 1.7 API documentation file. Someone please provide me a link, where i can get offline jQuery 1.7 api dump.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,071,329 | 2,071,330 |
Can't get focus on editText when children are added in layout
|
<p>i am adding a spinner, an image and an editText in a linearLayout everytime i click a button.</p>
<p>Now whenever i add this layout , editText shows blinking, means it has focus but the keyboard won't show up. Even i click on it, the keyboard won't show up. What most i can do is to click somewhere else and then back at the editText to make it show keyboard and proper focus.</p>
<p>I am using following code, how can i fix this bug.</p>
<pre><code> viewHolder.title = (EditText) view.findViewById(R.id.AddNewDetail);
view.setTag(viewHolder);
layout.addView(view);
</code></pre>
|
java android
|
[1, 4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.