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 |
---|---|---|---|---|---|
1,147,321 | 1,147,322 |
Wait before showing a loading spinner?
|
<p>I want to use loading spinners in my single-page web application, which are easy enough to do if you want to show a spinner as soon as the request is fired and hide it as soon as the request is finished.</p>
<p>Since requests often only take a few hundred milliseconds or less to complete, I'd rather not show a spinner right away, but rather wait <em>X</em> milliseconds first so that, on those requests that take less than X milliseconds to complete, the spinner doesn't flash on the screen and disappear, which could be jarring, especially in times when multiple panels are loading data at once.</p>
<p>My first instinct is to use setTimeout, but I'm having trouble figuring out how to cancel one of multiple timers.</p>
<p>Would I have to create a Timer class so that I could stop and start different instances of a setTimeout-like object? Am I thinking about this from the wrong angle?</p>
|
javascript jquery
|
[3, 5]
|
1,707,630 | 1,707,631 |
Why return will not work but echo does in this jquery with php script
|
<p>In this script, using php's return will not work, whereas echo will. Thing is, if I use echo, and someone where to access the page directly, they would be able to see the output without the formatting.</p>
<pre><code><script type="text/javascript">
$(function() {
$('.callAppend').click(function() {
$.ajax({
type: 'GET',
url: 'recent.php',
dataType:'HTML',
cache:false,
success: function(data){
console.log(data);
//}
},
});
return false;
});
});
</script>
</code></pre>
<p>This the php script</p>
<pre><code><?php
$feedback = 'Hello this is the php page';
return $feedback; //Use echo, and all works fine.
?>
</code></pre>
|
php jquery
|
[2, 5]
|
2,989,707 | 2,989,708 |
How do I write a JavaScript file that uses jQuery?
|
<p>I'm new to JavaScript and JQuery. I know basic C++ and I like including header files and run functions from the header file to keep the code neat.</p>
<p>If I create a new JavaScript file how can I be sure that I can use jQuery in those external JavaScript files?</p>
<p><strong>Edit:</strong> I have the <code>jquery.js</code> file on my computer. </p>
|
javascript jquery
|
[3, 5]
|
2,921,672 | 2,921,673 |
How to select the text of a span on click?
|
<p>I am looking for a way to select the text inside a span using jquery when the text is clicked on.</p>
<p>For example in the html snippet below, I want the text "\apples\oranges\pears" to become selected when it is clicked on.</p>
<pre><code><p>Fruit <span class="unc_path">\\apples\oranges\pears</span></p>
</code></pre>
<p>I've tried implementing this myself to no avail.</p>
|
javascript jquery
|
[3, 5]
|
5,192,974 | 5,192,975 |
How do I set up a timer to prevent overlapping ajax calls?
|
<p>I have a page where search resuts are shown both in a grid and on a map (using KML generated on the fly, overlaid on an embedded Google map). I've wired this up to work as the user types; here's the skeleton of my code, which works:</p>
<pre><code>$(function() {
// Wire up search textbox
$('input.Search').bind("keyup", update);
});
update = function(e) {
// Get text from search box
// Pass to web method and bind to concessions grid
$.ajax({
...
success: function(msg) {
displayResults(msg, filterParams);
},
});
}
displayResults = function(msg, filterParams) {
// Databind results grid using jTemplates
// Show results on map: Pass parameters to KML generator and overlay on map
}
</code></pre>
<p>Depending on the search, there may be hundreds of results; and so the work that happens in <code>displayResults</code> is processor-intensive both on the server (querying the database, building and simplifying the KML on the fly) and on the client (databinding the results grid, overlaying big KML files on the map). </p>
<p>I like the immediacy of getting progressively narrower results as I type, but I'd like to minimize the number of times this refreshes. What's the simplest way to introduce an N-second delay after the user stops typing, before running the <code>update</code> function?</p>
|
javascript jquery
|
[3, 5]
|
5,031,540 | 5,031,541 |
How to change the URl Link in my Javascript
|
<p>I am new to javascript can any body help me out</p>
<pre><code> urls = urls + "stm_aix(\"p3i0\", \"p1i0\", [0, \"" + item.helpLinkDescription + "\", \"\", \"\", -1, -1, 0, \"" + item.helpLink1 + "\", \"_self\", \"\", \"Help Topics\", \"060508icon4.gif\", \"060508icon5.gif\"], 526, 0);";
</code></pre>
<p>in the place of item.helpLink1 I have to show something like this</p>
<pre><code>ShowURL(item.helpLink1);
</code></pre>
<p>that is I am dynamically generating this helplinks in ShowURL method.</p>
<p>so that I can use this ShowURL method to pass this helpLink.</p>
<p>Can any body help me out how to update my code.</p>
|
javascript jquery
|
[3, 5]
|
4,721,006 | 4,721,007 |
Jquery Validation?
|
<p>Hi there i am looping some fields with php. </p>
<pre><code>$number = 5;
for ($i = 1; $i <= $number ; $i++) {
name : <input name="name[]" type="text" class="required" title="Name Surname Please"/>
}
</code></pre>
<p>Am using jquery validation to control the fields,</p>
<pre><code>$("#form").validate({
errorLabelContainer: $("#form div.error")
});
</code></pre>
<p>but it is only validating the first field of the loop. only after clicking on the other fields the plugin works.</p>
<p>Can someone help or explain that</p>
<p>the script:</p>
<pre><code><form action="" method="post" id="form" name="form">
<table width="100%" border="0" cellspacing="5" cellpadding="0">
<?php for ($i = 1; $i <= 5; $i++) {?>
<tr>
<td>name :
<input name="name[]" type="text" class="required" title="Name Surname Please"/></td>
</tr>
<?php }?>
</table>
<input name="submit-form" type="submit" value="submit"/>
</form>
<script src="/jquery.validate.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$().ready(function() {
$("#form").validate({
errorLabelContainer: $("#form div.error")
});
});
</script>
</code></pre>
|
php jquery
|
[2, 5]
|
3,621,089 | 3,621,090 |
Applying a class from an array to a repeated item with JQuery
|
<p>I know I'm close here but it only adds a class from the colors array to the 1st 3 postbox divs:</p>
<pre><code>$(document).ready(function($) {
var toCopy = $('.postbox');
var colors = ['box1','box2','box3'];
for (var i = 1;i < 7;i++) {
$('.rightCol').append(toCopy.clone());
}
$('.postbox').each(function(i, val) {
$(this).addClass(colors[i]);
});
});
</code></pre>
<p>Here's the end result using the above:</p>
<pre><code><div class="rightCol">
<div class="postbox box1"></div>
<div class="postbox box2"></div>
<div class="postbox box3"></div>
<div class="postbox"></div>
<div class="postbox"></div>
<div class="postbox"></div>
<div class="postbox"></div>
</div>
</code></pre>
<p>How do I get it to keep repeating? </p>
|
javascript jquery
|
[3, 5]
|
4,158,552 | 4,158,553 |
set/change value to drop down using jquery
|
<p>how to set or change value to drop down.</p>
<p>I'm having a drop down list which is initially not selected a value.</p>
<p>How can i select a value using jquery</p>
|
javascript jquery
|
[3, 5]
|
5,378,391 | 5,378,392 |
What can I use to let users build their own avatar character?
|
<p>How would you go about providing users with the ability to build a custom avatar character, something like <a href="http://messenger.yahoo.com/features/avatars/" rel="nofollow">Yahoo! Avatars</a>?</p>
<p><strong>EDIT</strong> - Let me be more specific about what Yahoo! Avatars does:<br>
It lets you <em>create</em> an avatar by selecting a face, hair style, eyes, etc.<br>
This is what I'm looking for.</p>
<p>I am interested in: </p>
<ul>
<li>Libraries, free or paid</li>
<li>Outsourcing to an external website, provided this can be well integrated into our website</li>
<li>Any other suggestions</li>
</ul>
|
c# asp.net
|
[0, 9]
|
4,793,023 | 4,793,024 |
C# Error: The name 'RegisterHyperLink' does not exist in the current context
|
<p>I've been working on a group project with this code that another group member wrote and I'm getting the following error:</p>
<p>The name 'RegisterHyperLink' does not exist in the current context</p>
<p>Here's the chunk of code:</p>
<pre><code> protected void Page_Load(object sender, EventArgs e)
{
RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
}
</code></pre>
<p>Anyone have any ideas as to why I'm encountering this error?
Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
2,649,303 | 2,649,304 |
Difference between this.href and $(this).attr("href")
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6977049/this-href-vs-this-attrhref">this.href vs $(this).attr('href')</a> </p>
</blockquote>
<p>Here is my code:</p>
<pre><code> $(function () {
$("a.Delete").click(function () {
console.log(this.href);
console.log($(this).attr("href"));
return false;
});
</code></pre>
<p>and here is my link</p>
<pre><code><a class="Delete" href="/Contact/Delete/10402">Delete</a>
</code></pre>
<p>Here is my output:</p>
<pre><code>http://localhost:59485/Contact/Delete/10402
/Contact/Delete/10402
</code></pre>
<p>Why the difference doesn't the attr method just get the attribute. Isn't that what this.href does? Is the href property special in some way that it actually gives you the absolute url?</p>
|
javascript jquery
|
[3, 5]
|
2,515,804 | 2,515,805 |
Removing a table row using jquery, fading and changing color slightly
|
<p>I have a button that when clicked, gets the row in the table that was clicked on.</p>
<p>So I have:</p>
<pre><code>$("#someId").remove();
</code></pre>
<p>I want to highlight the row that is being deleted, and fade it out (it is being deleted).</p>
<p>Is there a way to do this with jQuery? I tried: $("#someId").fadeOut("slow").remove() but tat didn't seem to show anything.</p>
|
javascript jquery
|
[3, 5]
|
2,909,564 | 2,909,565 |
What is the working of web Crawler?
|
<p>Will web crawler crawl the web and create a database of the web or it will just create a searchable index of web? If suppose it creates an index, who will exactly will gather the data of web pages and store it in database?</p>
|
php python
|
[2, 7]
|
2,312,799 | 2,312,800 |
jQuery get html of container including the container itself
|
<p>How do i get the html on '#container' including '#container' and not just what's inside it. </p>
<pre><code><div id="container">
<div id="one">test 1 </div>
<div id="two">test 2 </div>
<div id="three">test 3 </div>
<div id="four">test 4 </div>
</div>
</code></pre>
<p>I have this which gets the html inside #container. it does not include the #container element itself. That's what i'm looking to do</p>
<pre><code>var x = $('#container').html();
$('#save').val(x);
</code></pre>
<p>Check <a href="http://jsfiddle.net/rzfPP/58/" rel="nofollow">http://jsfiddle.net/rzfPP/58/</a></p>
|
javascript jquery
|
[3, 5]
|
2,176,489 | 2,176,490 |
php help - need to echo php using strings
|
<p>I am trying to add a few things mentioned below on my php code, but its throwing a parse error, when i try to open with firefox or any other browser for thar matter...hence would like some expertize on this one...</p>
<pre><code><?php
$var1 = array();
//These are two of my website abc.com & abcdef.info...
$var1[] = "http://abc.com";
$var1[] = "http://abcdef.info";
$var2 = $var1[array_rand($var1)];
?>
//Now i need to echo $var2 on all 3 strings below, but as you see sometimes the echo needs to be executed not only by the end of the string but between the links of the below mentioned strings, so that i would be able to echo the final result from $test onto $var3.
<?php
$tests = array();
//three strings
$tests[] = "http://www.123.com/folder/subfolder.php?u="<?php echo "$var2";?>"";
$tests[] = "http://www.456.com?u="<?php echo "$var2";?>"&myimagelink&mydescription";
$tests[] = "http://www.some-other-site.com/okay/?u="<?php echo "$var2";?>"&myimagelink&mydescription";
$test = $tests[array_rand($tests)];
?>
//an example of what needs to be printed according to a browser point of view is $var3 = http://www.456.com?u=http://abcdef.info&myimagelink&mydescription";
$var3 = "<?php echo "$var2";?>"
</code></pre>
|
php javascript
|
[2, 3]
|
4,086,458 | 4,086,459 |
Mac: Apple dock bouncing effect
|
<p>I am looking for a bouncing effect of a bar.
If you have noticed in mac, the dock where all the applications are lined up. The minute you click on any of the application, the icon starts bouncing. I am looking for similar effect.
The bar needs to bounce 3 times and then stop for a second or two and again bounce 3 times.</p>
<p>Here is what I am doing currently which didn't help</p>
<pre><code>$(function () {
function bounceDiv(){
$("#six").effect("bounce", { times:3, distance:20 }, 400);
}
setInterval(bounceDiv,1000);
});
</code></pre>
<p>Thanx in Advance.</p>
|
javascript jquery
|
[3, 5]
|
2,501,363 | 2,501,364 |
JavaScript error in IE8
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/886668/window-onload-is-not-firing-with-ie-8-in-first-shot">window.onload() is not firing with IE 8 in first shot</a> </p>
</blockquote>
<p>I am getting a error while running the code in JavaScript on line 20. The line 20 code is just here:</p>
<pre><code>window.onload = setTimeout( function(){
$('#notification_div').slideUp(2000);
} , 6000);
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,824,324 | 5,824,325 |
Combining 2 arrays in javascript
|
<p>I have 2 arrays in javascript. </p>
<pre><code> var A = ['c++', 'java', 'c', 'c#', ...];
var B = [12, 3, 4, 25, ...];
</code></pre>
<p>Now from these 2 arrays i want to create another array like :</p>
<pre><code> [['c++',12], ['java',3], ['c',4], ['c#', 25] ...];
</code></pre>
<p>Both <code>A</code> and <code>B</code> arrays are variable length in my case so how can i do this?</p>
|
javascript jquery
|
[3, 5]
|
4,469,054 | 4,469,055 |
Navigating through text input fields using arrow keys and return
|
<p>I'm trying to build a simple navigation mechanism between multiple input fields using jQuery. The first part of the code, skipping down by using the down arrow or return key work fine, but when I added the second block to go backwards by looking for the up arrow and then reversing the order, typing in the first text field jumps right away to the second. Any thoughts?</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
// get only input tags with class data-entry
textboxes = $("input.data-entry");
// now we check to see which browser is being used
if ($.browser.mozilla) {
$(textboxes).keypress (checkForAction);
} else {
$(textboxes).keydown (checkForAction);
}
});
function checkForAction (event) {
if (event.keyCode == 13 || 40) {
currentBoxNumber = textboxes.index(this);
if (textboxes[currentBoxNumber + 1] != null) {
nextBox = textboxes[currentBoxNumber + 1]
nextBox.focus();
nextBox.select();
event.preventDefault();
return false;
}
}
if (event.keyCode == 38) {
currentBoxNumber = textboxes.index(this);
if (textboxes[currentBoxNumber - 1] != null) {
prevBox = textboxes[currentBoxNumber - 1]
prevBox.focus();
prevBox.select();
event.preventDefault();
return false;
}
}
}
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,407,116 | 5,407,117 |
Null Value in Label object
|
<p>I have created on GridView with Label. I have written store procedure to get StatusCode</p>
<pre><code>SELECT StatusCode
From TableName
</code></pre>
<p>This line in GridView</p>
<p>< asp:Label ID="lblStatusCode" runat="server" Visible="false" </p>
<p>Text='<%#DataBinder.Eval(Container.DataItem, "StatusCode")%>' /></p>
<p>These lines in .cs file</p>
<pre><code>Label lblStatusCode = (Label)row.FindControl("lblStatusCode");
objJV.Status = Convert.ToInt32(lblStatusCode.Text);
</code></pre>
<p>but in <code>lblStatusCode.Text</code> it is showing <em>NULL</em> even though there is value in Table.</p>
<p>When I execute stored procedure independently it is giving values. </p>
<p>// bind function</p>
<p>protected void Page_Load(object sender, EventArgs e)
{</p>
<pre><code> if (!IsPostBack)
{
BindJVJobValidationDetails();
}
}
</code></pre>
<p>protected void BindJVJobValidationDetails()
{</p>
<pre><code> JVSummary objJV = new JVSummary();
DataSet dataJobValidation = new DataSet();
if (SessionVariables.PERID != null)
{
dataJobValidation = objJV.GetjvTransaction(SessionVariables.PERID);
gvEmployee.DataSource = dataJobValidation;
gvEmployee.DataBind();
}
}
</code></pre>
<p>What might be the problem...?</p>
|
c# asp.net
|
[0, 9]
|
5,951,914 | 5,951,915 |
how to disable default selection in dropdownlist in asp.net
|
<p>i want the code to disable default selection in dropdownlist in asp.net and also on selection of a particular data field the values are displayed in the txtbox below.the dropdown should be filled with system related data like eg c:drive, d ... etc dynamically at run time.</p>
|
c# asp.net
|
[0, 9]
|
2,581,686 | 2,581,687 |
Creating interface with the software without API-Possibilities
|
<p>I have one proprietary software my office uses for database access and reporting which nobody likes in my office. I am thinking of building a python/Java application with a simple interface which does the task of communicating with the propriety software. My problem is: Since the software is proprietary, there is no known API of any sort I am aware of such that I can interface. Is there a way around to get through this or is it mandatory to have API to access the software? I am doing this in windows XP platform.</p>
|
java python
|
[1, 7]
|
5,841,547 | 5,841,548 |
how to decode something that is encoded with encodeUri()
|
<p>If you encode something using javascript's <code>encodeURI()</code> method, how do yo get the decoded string in PHP?</p>
<p>I have string <code>name= "salman mahmood"</code> which I'm sending via POST message to my server. When I <code>alert()</code> the string at client side it gives me "salman%20mahmood" after encoding.
At server side I'm decoding it using <code>urldecode()</code> but the result I'm getting is "salman". Do I need a different method to decode? the <code>rawurldecode</code> isnt working either; I just need the value with the space restored back.</p>
<p>Edit: thanks every one for the suggestions but im writing the code as follows and it still doesnt work!!</p>
<pre><code><input type="text" id="chapterNumber" value=<?php echo rawurldecode("chapter%20Two"); ?> disabled="disabled">
</code></pre>
<p>it only prints "chapter"</p>
|
php javascript
|
[2, 3]
|
2,880,700 | 2,880,701 |
Calling JavaScript Functions
|
<p>I am trying to call some javascript functions which I ahve written in some file. Eg.</p>
<pre><code>function OpenPopup() {
alert("OpenPopUp");
return false;
}
</code></pre>
<p>when I call this from button from OnClientClick = "OpenPopup()" it is not called but when I put this function on MasterPage it is able to call the function.</p>
<p>I added this is the MasterPages's Head</p>
<pre><code> <script src="Scripts/something.js" type="text/javascript"></script>
</code></pre>
<p>Please let me know what can be the possiblities why it is not called.</p>
|
javascript asp.net
|
[3, 9]
|
5,560,397 | 5,560,398 |
jquery attribute indexOf
|
<p>When I am getting at an attribute <code>onclick</code> of custom(Reporting Services) checkbox it gives me correct result. However when I am trying to use <code>indexOf</code> on that result it says "Object doesn't support this property or method", i.e. this is fine, gives me a long string</p>
<pre><code>$('input[id*=CustomCheckBox]').click(function()
{
alert( $(this).attr("onclick") );
});
</code></pre>
<p>But this gives an error(object doesn't support this property or method):</p>
<pre><code>$('input[id*=CustomCheckBox]').click(function()
{
if ($(this).attr("onclick").indexOf("SomeString") > -1 )
{
//do some processing here
}
}
</code></pre>
<p>What would I need to modify so that <code>indexOf</code> is working properly?</p>
|
asp.net jquery
|
[9, 5]
|
4,871,489 | 4,871,490 |
dynamic textbox in c#
|
<p>I have the following code:</p>
<pre><code> string str = string.Empty;
foreach (ListItem item in this.CheckBoxList1.Items)
{
if (item.Selected)
{
str += item.Value + "<br><br>";
TextBox txt1 = new TextBox();
}
}
lbl1.Text = str;
</code></pre>
<p>What I want is for each data checked I want to have a textbox. When I loop through the checkbox List the label takes my values and display them but the textbox not. How can I do it?</p>
|
c# asp.net
|
[0, 9]
|
3,149,091 | 3,149,092 |
Can you explain this jQuery method?
|
<p>Trying to understand how jquery works under the covers, what's the difference between:</p>
<p>jQuery.fn and jQuery.prototype</p>
<pre><code>jQuery = window.jQuery = window.$ = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context );
},
</code></pre>
<p>and then:</p>
<pre><code>jQuery.fn = jQuery.prototype = {
init: function( selector, context ) {
</code></pre>
|
javascript jquery
|
[3, 5]
|
941,640 | 941,641 |
find all div's with contenteditable attribute in iframe and remove said attribute with jQuery?
|
<p>I have an ifram on a page with class ms-dlgFrame and in this iframe I want to remove contenteditable="true" on elements since it's not supported by Safari on iPad (I am checking the user agent first).</p>
<p>I have some issues with combining <code>.find(), .each(), .attr()</code>, and <code>.removeAttr()</code></p>
<p>I tried something like:</p>
<pre><code>console.log("iPad");
$('.ms-dlgFrame').contents().find("div").attr("contenteditable").each(function() {
$(this).removeAttr("contenteditable");
});
</code></pre>
<p>Any ideas?</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
3,008,742 | 3,008,743 |
Adding a counter to a slideshow
|
<p>Hi
Does anyone know how I would go about adding a counter (i.e. 1/12, 2/12, 3/12 etc.) to this slideshow?</p>
<p><a href="http://www.switchonthecode.com/tutorials/jquery-creating-a-slideshow" rel="nofollow">http://www.switchonthecode.com/tutorials/jquery-creating-a-slideshow</a></p>
<p>Also, I would like the option to have another button that takes the user back to the first image at any given point during the slideshow. </p>
<p>Any help on this would be really appreciated.</p>
<p>Thanks!!</p>
|
javascript jquery
|
[3, 5]
|
2,168,759 | 2,168,760 |
can't see my picture on the form - asp.net
|
<p>i add Image control to my WebForm.</p>
<p>i insert picture to App_Data.</p>
<p>i connect the picture to my Image control in the ImageUrl</p>
<p>it seen like this: </p>
<pre><code><asp:Image ID="Image1" runat="server" Height="94px"
ImageUrl="~/App_Data/Tulips.jpg" Width="209px" />
</code></pre>
<p>in the design i see this picture, but when i run the project i dont see the picture.</p>
<p>what can be the problem ?</p>
|
c# asp.net
|
[0, 9]
|
203,749 | 203,750 |
I need ($("#flip").click slideToggle ) to perform several times on the same page with same <div> ID
|
<p>I have a FAQs page that reads from XML using XSl code, The div for the question and answer will be repeated as much as the number of records in the XML.</p>
<p>This is the XSL code:</p>
<pre><code><xsl:for-each select ="TSPRoot/FAQS/FAQ">
<div id="flip">
<xsl:value-of select ="Question"/>
</div>
<div id="panel">
<xsl:value-of select ="Answer" disable-output-escaping ="yes"/>
</div>
</xsl:for-each >
</code></pre>
<p>And in the head I have this JQuery code:</p>
<pre><code><script>
$(document).ready(function(){
$("#flip").click(function(event){
event.preventDefault();
$("#panel").slideToggle("slow");
});
});
</script>
</code></pre>
<p>The slideToggle works only for the first div, then it do not work.</p>
<p>I can't figure out any ideas.</p>
|
javascript jquery
|
[3, 5]
|
2,842,007 | 2,842,008 |
How can I do to fix the jquery portfolio error?
|
<p>I have a problem with the implementation of a portfolio in a single page.
The portfolio that I enter this code has</p>
<pre><code>$(window).load(function() {
$('#work').flexslider({
animation: "slide",
controlsContainer: '.flex-container'
});
//Add one flexslider for project
$('#proj_slider01').flexslider();
$('#proj_slider02').flexslider();
$('#proj_slider03').flexslider();
$('#proj_slider04').flexslider();
$('#proj_slider05').flexslider();
$('#proj_slider06').flexslider();
$('#proj_slider07').flexslider();
$('#proj_slider08').flexslider();
$('#proj_slider09').flexslider();
});
</code></pre>
<p>Unfortunately I can not publish all the code of a website done in a single page. So if you want to see the site the link is <a href="http://goo.gl/W2Xq7" rel="nofollow">http://goo.gl/W2Xq7</a> and can find the real portfolio in this link <a href="http://goo.gl/jgD3o" rel="nofollow">http://goo.gl/jgD3o</a>. If you don't understand where il the problem, you can ask me the link for the source code.
Where is the problem in my site and how can I do to fix it?</p>
|
javascript jquery
|
[3, 5]
|
2,987,878 | 2,987,879 |
AsyncTask from Activity Class
|
<p>I am using this class to download txt file</p>
<pre><code>class RetreiveFeedTask extends AsyncTask<String, Void,String> {
@Override
protected ArrayList<Item> doInBackground(String... params) {
try{
URL url = new URL("myurl");
InputStream is = url.openStream();
BufferedReader in = new BufferedReader(new InputStreamReader(is));
String str;
while ((str = in.readLine()) != null){
}
in.close();
return str;
}
catch (MalformedURLException e){}
catch (IOException e){}
return null;
}
protected void onPostExecute(Strin str) {
}
</code></pre>
<p>this is how i call this class from my activity:</p>
<pre><code>new RetreiveFeedTask().execute();
</code></pre>
<p>And i want to know if there is a way to pass out this result to the activity that make the call.</p>
|
java android
|
[1, 4]
|
1,206,158 | 1,206,159 |
How to pass Querystring from source code?
|
<p>I am trying to pass querystring from html source code, the link is within the ItemTemplate of a ListView</p>
<pre><code><a href='<%# "Photos.aspx?AlbumID="+Eval("AlbumID") "&address=" + Request.QueryString["Id"].ToString() %>'>
</code></pre>
<p>i tried this code but it did not work. There are multiple errors.</p>
|
c# asp.net
|
[0, 9]
|
579,734 | 579,735 |
Javascript stopped working
|
<p>For some reason, the scripts that I have set up on my wordpress install stopped working yesterday afternoon. I had been editing things, but I'm not sure what I could have done that caused it to stop.</p>
<p>Is there any way that I can error check why it's not working, or any common reasons why it might not be?</p>
<p>The site is up at</p>
<p><a href="http://www.delsilencio.net/staging/wordpress/" rel="nofollow">http://www.delsilencio.net/staging/wordpress/</a></p>
|
jquery javascript
|
[5, 3]
|
2,812,055 | 2,812,056 |
jquery validationengine not working on aspx page with master page
|
<p>jquery validationengine not working on aspx page inheriting master page as it says it works only on form .
So i referred the formid from the master page form and it works. Thats good..but my question is is it the right way to do?
here is the aspx cod:</p>
<pre><code><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
<link href="Styles/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
<link href="Styles/template.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-1.6.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="Scripts/jquery.validationEngine.js" type="text/javascript"></script>
<script type="text/jscript">
jQuery(document).ready(function () {
$("#btnSubmit").click(function () {
$("#Form1").validationEngine();
})
});
</script>
</asp:Content>
</code></pre>
<p>Master pagew code:</p>
<pre><code><form id="Form1" runat="server">
<asp:HiddenField runat="server" ID="hfSearchString" />
<div class="page">
<div style="float: right; display: table-cell; margin-bottom: 5px; margin-right: 2px">
<asp:Label runat="server" ID="lblWelcome" Text="Welcome, QUTI User" />
</div>
</code></pre>
<p>Any suggestion will be helpful.
Thanks in advance</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,230,376 | 4,230,377 |
disable tabbing on document but enable input tabbing?
|
<p>I have added the following code to my site to prevent tabbing, this applies to the whole document. Problem is that this obviously disables all tabbing throughout the site, how can I add a rule in to allow inputs to be tabbed? I tried adding .not('input') but this doesnt seem to work.</p>
<pre><code>$(document).keydown(function(objEvent) {
if (objEvent.keyCode == 9) {
objEvent.preventDefault();
}
});
</code></pre>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,324,852 | 4,324,853 |
If page is not postback
|
<p>I know this:</p>
<pre><code>if (!IsPostBack)
{
do something
}
</code></pre>
<p>But what if I need to do something if page is NOT postback?
Do I use else or there is other/better way??</p>
|
c# asp.net
|
[0, 9]
|
525,866 | 525,867 |
Combining two event handlers, jQuery
|
<p>I have two events that I want to observe on an object, </p>
<pre><code>input.blur(function(event) {
ajaxSubmit(this);
event.preventDefault();
});
form.submit(function(event) {
ajaxSubmit(this);
event.preventDefault();
});
</code></pre>
<p>But I feel like this isn't dry enough, can I bind two events to my object <code>input</code> and execute my function <code>ajaxSubmit()</code> if either fire?</p>
<p><hr></p>
<p>What would be super cool is if you could do:</p>
<pre><code>input.bind("blur", "submit", function(event) {
ajaxSubmit(this);
event.preventDefault();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,733,293 | 4,733,294 |
How to create mentions for names like "@myname" using javascript?
|
<p>I'm planning to build web app and i heve question how to create mentions for name "@myname" like facebook or twitter</p>
|
php javascript
|
[2, 3]
|
2,720,341 | 2,720,342 |
Ensuring Process.Start() runs under the logged in user
|
<p>I'm running a batch file from some ASP.NET/C# code on a web server. Basically the batch file performs some test automation tasks on a VM using tools like psloggedon and pexec.</p>
<p>If I run the batch file manually when I'm logged into the server under an administrative account, it works fine.</p>
<p>My problem comes when I run it from my code (below), it seems to run under the 'SYSTEM' account, and psloggedon etc. don't seem to work correctly.</p>
<p><strong>Code</strong></p>
<pre><code> Process p = new Process();
p.StartInfo.FileName = "C:\SetupVM.bat";
p.Start();
p.WaitForExit();
</code></pre>
<p>I've got this in my web.config, it doesn't seem to make any differance?</p>
<pre><code><identity impersonate="true" userName="Administrator" password="myadminpassword"/>
</code></pre>
<p>Is there anyway I can ensure the batch file runs under the 'Administrator' account?</p>
<p><strong>UPDATED CODE</strong></p>
<pre><code> Process p = new Process();
p.StartInfo.FileName = "C:\\SetupVM.bat";
p.StartInfo.UserName = "Administrator";
p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = "C:\\";
string prePassword = "myadminpassword";
SecureString passwordSecure = new SecureString();
char[] passwordChars = prePassword.ToCharArray();
foreach (char c in passwordChars)
{
passwordSecure.AppendChar(c);
}
p.StartInfo.Password = passwordSecure;
p.Start();
p.WaitForExit();
</code></pre>
<p>From MSDN:</p>
<p><em>When UseShellExecute is false, you can start only executables with the Process component.</em></p>
<p>Maybe this is the issue as I'm trying to run a .bat file?</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
1,864,381 | 1,864,382 |
call .cs class file(c#) function from javascript
|
<p>I have doubt regarding call .cs class file(C#) function from javascript
My Code:
I have class file(.cs) like call_cs_function_from_js</p>
<pre><code>------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace call_cs_function_from_js
{
public class cal_lcs_function_from_js
{
public void getdata()
{
}
}
}
</code></pre>
<h2>This is javascript code File:</h2>
<pre><code><script type="text/javascript">
function call(){
cal_lcs_function_from_js.getdata(); //This way is not working
alert('called');
}
</script>
</code></pre>
<p>Here I want call getdata of cal_lcs_function_from_js from call()(means .js). call() invoked when button click.</p>
<p>Please Show me what are the other ways.</p>
|
c# javascript
|
[0, 3]
|
5,591,826 | 5,591,827 |
Deferred object confusion
|
<p>The following snippet works as expected:</p>
<pre><code>function boxAnimation() {
var dfd = $.Deferred();
$('div').fadeIn('slow', dfd.resolve);
return dfd.promise();
}
$(function () {
boxAnimation().done(
function () { $(this).animate({ 'margin-top': 50 }); },
function () { $(this).animate({ 'margin-left': 150 }); },
function () { $(this).animate({ 'margin-top': 250 }); },
function () { $(this).animate({ 'margin-left': 350 }); }
).fail(function () { alert('failed'); });
});
</code></pre>
<p>However in this one <strong>the differed object is neither rejected or resolved</strong>.</p>
<p>Please tell me where am I going wrong.</p>
<pre><code>function boxAnimation() {
var dfd = $.Deferred();
var randomNum = Math.floor(Math.random() * 5);
$('div').fadeIn('slow', function () {
if (randomNum == 1) {
dfd.reject;
}
else {
dfd.resolve;
}
});
return dfd.promise();
}
$(function () {
boxAnimation().done(
function () { $(this).animate({ 'margin-top': 50 }); },
function () { $(this).animate({ 'margin-left': 150 }); },
function () { $(this).animate({ 'margin-top': 250 }); },
function () { $(this).animate({ 'margin-left': 350 }); }
).fail(function () { alert('failed'); });
});
</code></pre>
<p>my body is:</p>
<pre><code><div id='box' style='width:200px; height:200px; border:solid 1px #222222; display:none; background:#cccccc'></div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,129,444 | 5,129,445 |
How to get the selected-row count from a list box in asp.net
|
<pre><code>int countSelected = ListBoxMembers.Items.Cast<ListItem>().Where(i => i.Selected).Count();
string groupName = txt_GroupName.Text;
for (int counter = 0; counter < ListBoxMembers.Items.Count; counter++)
</code></pre>
<p>I have 20 items in the list, when I select only 2 ListBoxMembers.Items.Count shouws 20 and Countselected is 0</p>
<p>i tried this int count = ListBoxMembers.GetSelectedIndices().length;
system.web.ui.controls.listbox does not contain a definition for selected items and no extension method selevted items acceptin first argument error</p>
<pre><code> <asp:ListBox ID="ListBoxMembers" runat="server" SelectionMode="Multiple" CssClass="style102"
ToolTip="Press ctrl to select multiple users" DataValueField="FirstName"></asp:ListBox>
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,062,433 | 1,062,434 |
How to call this javascript function from code behind
|
<p>I'm putting javascript created controls (http://www.dariancabot.com/projects/jgauge_wip/) on my page.</p>
<pre><code><div class="jgauge" ></div>
$(document).ready(function () {
var ctl;
ctl = new jGauge();
ctl.init();
)}
</code></pre>
<p>Let's say I need to pass few parameters to <code>init</code>. like... <code>ctl.init(a, b);</code> from code behind, how can I achieve that? I tried something like this...</p>
<pre><code>string script2 = String.Format("init('{0}','{1}')", param1, param2);
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "initialize control", script2, true);
</code></pre>
<p>But it's not working. I got:</p>
<pre><code>ReferenceError: init is not defined
</code></pre>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
3,011,130 | 3,011,131 |
The local variable xxx is never read
|
<p>This is my code:</p>
<pre><code>boolean startGameBoolean;
Bundle extras = getIntent().getExtras();
extras.getInt("startGameBoolean");
if (startGameBoolean = true){
counter.start();
}
</code></pre>
<p>Eclipse gives a warning that "The local variable startGameBoolean is never read"; but it is.
I get the boolean from an another intent.</p>
<p><strong>I edited my code, I missed some of it, sorry!</strong></p>
|
java android
|
[1, 4]
|
2,205,218 | 2,205,219 |
Geting XML form website?
|
<p>I'm new in Android development but I like it so far.
I want to make app to get xml from website and put it into the listview.
I want that user is able to use search to filter xml from website, and application should put that filtered data into the listview?
Can anyone give me a hint how to do that.
Thank you in advance, Wolf.</p>
|
java android
|
[1, 4]
|
1,596,956 | 1,596,957 |
PhoneGap + JQueryMobile - Option field text size
|
<p>I am developing a cross-platform application using phonegap and jquery. In my HTML document I have a select element with several options. On Android, when the user taps on the select element, an overview of all options opens using the standard Android dropdown (something like an overlay with all options). So far so nice, but unfortunately my options have too much text that eventually gets cut off at the end. How can I adjust the size of the text here? Any hints? Adjusting the text size via CSS is simply ignored. I am thinking of using radio buttons instead, but that is just a workaround for me.</p>
|
android jquery
|
[4, 5]
|
4,802,241 | 4,802,242 |
How to do undetectable redirect
|
<p>I want to be able to go from one site to another but not as a redirection. In other words I want to fake that I inserted a particular link directly to my browser input field instead of clicking the link on my page.</p>
<p>So I've tried "HTML meta refresh", JavaScript redirection and PHP header() redirection. I was doing redirection from www.mysite1.com to www.mysite2.com, and in all those cases I could see in Google Analytics (of mysite2.com), that visitor came from www.mysite1.com. And my goal is to hide the redirection source which is www.mysite1.com in this case.</p>
<p>I'm sure it is possible but, don't really know where to start.</p>
|
php javascript
|
[2, 3]
|
664,138 | 664,139 |
Android: Referring to a string resource when defining a log name
|
<p>In my Android app, I want to use a single variable for the log name in multiple files. At the moment, I'm specifying it separately in each file, e.g.</p>
<pre><code>public final String LOG_NAME = "LogName";
Log.d(LOG_NAME, "Logged output);
</code></pre>
<p>I've tried this:</p>
<pre><code>public final String LOG_NAME = (String) getText(R.string.app_name_nospaces);
</code></pre>
<p>And while this works in generally most of my files, Eclipse complains about one of them:</p>
<blockquote>
<p>The method getText(int) is undefined
for the type DatabaseManager</p>
</blockquote>
<p>I've made sure I'm definitely importing android.content.Context in that file. If I tell it exactly where to find getText:</p>
<blockquote>
<p>Multiple markers at this line<br>
- Cannot make a static reference to the non-static method getText(int)
from the type Context<br>
- The method getText(int) is undefined for the type DatabaseManager</p>
</blockquote>
<p>I'm sure I've committed a glaringly obvious n00b error, but I just can't see it! Thanks for all help: if any other code snippets would help, let me know.</p>
|
java android
|
[1, 4]
|
2,579,143 | 2,579,144 |
Why is first sound slow to play with soundmanager2?
|
<p>I've just finished this jquery plugin to display musical scales:</p>
<p><a href="http://www.daveconservatoire.org/tools/scales" rel="nofollow">www.daveconservatoire.org/tools/scales</a></p>
<p>The piano keys are clickable and play the relevant notes. I'm using the Soundmanager2 package. </p>
<p>I'm loading all the sounds when the page loads, but even when loaded I notice that the first note I click takes a while to playback the note - but then when I click on either that note or any other note the playback is quick and crisp. </p>
<p>Why does it take a second or so to "wake up" soundmanager?</p>
|
javascript jquery
|
[3, 5]
|
1,065,000 | 1,065,001 |
Dragging, dropping and horizontal scrolling
|
<p>I am developing an jQuery browser based game where I use jQuery drag and drop (UL list).
How can I also let the user horizontally scroll this list with swipe of the mouse?</p>
<p><strong>UPDATE</strong></p>
<p>I am using this code. I do not want to show all cards in the first row at once. The user should be able to horizontally scroll among them. <a href="http://www.elated.com/res/File/articles/development/javascript/jquery/drag-and-drop-with-jquery-your-essential-guide/card-game.html" rel="nofollow">http://www.elated.com/res/File/articles/development/javascript/jquery/drag-and-drop-with-jquery-your-essential-guide/card-game.html</a></p>
<p>Thankful for all input!</p>
|
javascript jquery
|
[3, 5]
|
891,501 | 891,502 |
JavaScript or jQuery string ends with utility function
|
<p>what is the easiest way to figure out if a string ends with a certain value?</p>
|
javascript jquery
|
[3, 5]
|
5,618,889 | 5,618,890 |
Undefined error getting parents childs input value
|
<p>I have a table that looks like this:</p>
<pre><code><table>
<tr>
<td class="packing-vol">0.19</td>
<td class="qty-cell"><input type="text" name="qty[]" class="qty" value="2" /></td>
</tr>
<tr>
<td class="packing_total">0.70</td>
<td class="qty-cell"><input type="text" name="qty[]" class="qty" value="1" /></td>
</tr>
</table>
</code></pre>
<p>I'm looping through each occurence of .packing-vol getting it's text, then I want to get the qty from the same row so I go up to it's parent then drill into the .qty class. But when I alert(qty) i get 'undefined' message.</p>
<pre><code>var total = 0;
jQuery('.packing-vol').each(function(i) {
var qty = jQuery(this).parent("td.qty-cell .qty").val();
alert(qty);
var cur = parseFloat(jQuery(this).text());
if(!isNaN(cur)){
total = total + cur;
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
606,770 | 606,771 |
JavaScript for loop goes too many times.
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example">Javascript closure inside loops - simple practical example</a> </p>
</blockquote>
<p>Can someone tell me why the value of 'i' in this code prints out the number 4? the loop only goes to 3, however it will print 'i = 4' inside of the menu_feedback div.</p>
<pre><code>for(i=1; i<=3; i++){
$('#file_button'+i).hover(function (){
$('#menu_feedback').html('i = '+i+'<br/>');
}, function(){
$('#menu_feedback').html('');
});
}
</code></pre>
<p>.</p>
<pre><code><button type="button" id="file_button1">Door 1</button>
<button type="button" id="file_button2">Door 2</button>
<button type="button" id="file_button3">Door 3</button>
<div id="menu_feedback"></div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,507,628 | 5,507,629 |
Webview - spaces in IMG SRC
|
<p>I have a ton of HTML files that have roughly 1000 images combined. Most have spaces in their names.</p>
<p>I am loading these HTML files with </p>
<pre><code>webView.loadDataWithBaseURL(url, data, "text/html", "UTF-8", null);
</code></pre>
<p>Also, the "Src" attribute is prepended with</p>
<pre><code>file:///android_asset/images/
</code></pre>
<p>Image files without spaces in their name work ie: </p>
<pre><code>src="file:///android_asset/images/my_test_image.jpg"
</code></pre>
<p>However, images with spaces do not load the image ie:</p>
<pre><code>src="file:///android_asset/images/my test image.jpg"
</code></pre>
<p>Is there any way to get the web view to load these images? Or, do some type of regex to replace spaces inside all "SRC" items with %20 (if that would even work)?</p>
<p>My background in java is pretty limited, I am a C#/Obj-C programmer. So please help!!</p>
<p>Thanks!</p>
<p>ps: Most common answer will probably be "rename the images without spaces, and fix all the src tags", but obviously, 200 or so HTML files, and 1000's of images might take awhile.</p>
<p>edit:</p>
<p>I wrote this, but still doesnt work. I guess java/android doesnt handle %20?</p>
<pre><code>Pattern p=null;
Matcher m= null;
String word0= null;
p= Pattern.compile(".*<img[^>]*src=\"([^\"]*)",Pattern.CASE_INSENSITIVE);
m= p.matcher(data);
while (m.find()){
word0=m.group(1);
String originalString = word0.toString();
data = data.replaceAll(originalString, originalString.replaceAll(" ", "%20"));
}
</code></pre>
|
java android
|
[1, 4]
|
3,004,325 | 3,004,326 |
Can't seem to get sample code to replace check boxes working
|
<p>I used code from the following:</p>
<p><a href="http://www.htmldrive.net/items/show/311/Fancy-checkboxes-and-radio-buttons-with-jquery" rel="nofollow">Fancy checkboxes</a></p>
<p>The demo appears to work but it seems that it does not really change the status of the checkbox. Rather it just makes it looked checked or not checked.</p>
<p>Here's the HTML:</p>
<pre><code><fieldset class="checkboxes">
<label for="checkbox-01" class="label_check c_on"><input type="checkbox" checked="" value="1" id="checkbox-01" name="sample-checkbox-01"> I agree to the terms &amp; conditions.</label>
<label for="checkbox-02" class="label_check"><input type="checkbox" value="1" id="checkbox-02" name="sample-checkbox-02"> Please send me regular updates.</label>
</fieldset>
</code></pre>
<p>Here's the javascript that is used:</p>
<pre><code><script type="text/javascript">
function setupLabel() {
if ($('.label_check input').length) {
$('.label_check').each(function () {
$(this).removeClass('c_on');
});
$('.label_check input:checked').each(function () {
$(this).parent('label').addClass('c_on');
});
};
};
var linkObj;
$(document).ready(function () {
$('.label_check, .label_radio').click(function () {
setupLabel();
});
setupLabel();
</code></pre>
<p>Can someone please confirm if there's a problem with the code. Seems to me that the author has missed making the code change the checkbox checked state. </p>
<p>Here's the code I use to check the status of the checkbox:</p>
<pre><code>var action = $('#htmlEdit').is(":checked") ? "Editing HTML" : "Editing";
</code></pre>
<p>Am I doing the check wrongly or is the author's code just not changing the input element?</p>
|
javascript jquery
|
[3, 5]
|
1,371,876 | 1,371,877 |
selectors via jquery
|
<p>Is there any way to write the following code working with innerHTML in the compact platform-independent way (probably using jquery)?</p>
<p>The point is that IE names tags in different case in innerHTML, so I need two if clauses to handle that. toLowerCase does not help when it comes to quotes.</p>
<pre><code>var flagpos = html.indexOf('</a>')
if (flagpos == -1) flagpos = html.indexOf('</A>')
html = (flagpos >= 0) ?
'<span class="' + html.substr(flagpos + 4).
replace(/^\s*|\s*$/, '').
replace(/ /g, '"></span><span class="') +
'"></span>' + res + ' ' + html.substr(0, flagpos + 4) : res + ' ' + html
</code></pre>
<p>-- or --</p>
<pre><code>if (!toggleFlags[j] ||
child.innerHTML.indexOf('<span class="' + j + '">') >= 0 ||
child.innerHTML.indexOf('<SPAN class=' + j + '>') >= 0) continue
</code></pre>
|
javascript jquery
|
[3, 5]
|
31,409 | 31,410 |
is there any way to get the index of an Item from a DataTable inside of a Repeater?
|
<p>I am trying to get the index of the DataItem from the DataTable and insert that into the repeater. I tried this solution: <a href="http://stackoverflow.com/questions/1722486/inject-index-of-current-item-when-binding-to-a-repeater">http://stackoverflow.com/questions/1722486/inject-index-of-current-item-when-binding-to-a-repeater</a></p>
<p>but that does not give me what I want. that solution only gives me the location of the item within the Repeater, but I want the location of the item within its source DataTable. </p>
<p>The reason for this is because I want to number my search results, and if I use the above solution then the numbers reset on pagination.</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
2,443,247 | 2,443,248 |
Ennui Content Slider Display two images at once
|
<p>Hello I am trying to use the Ennui Content slider to display two images per sequence of images. </p>
<p><a href="http://ennuidesign.com/demo/contentslider/" rel="nofollow">http://ennuidesign.com/demo/contentslider/</a> this is the slider</p>
<p>I am not sure what I need to change or do to get it to do this</p>
<p>Any ideas</p>
<p>*cheers</p>
|
javascript jquery
|
[3, 5]
|
3,168,038 | 3,168,039 |
Swtich between text with each click
|
<pre><code>$("#mute").click(function(){
$("#audioplayer")[0].muted = $("#audioplayer")[0].muted;
$("#message").text("Volume muted");
})
</code></pre>
<p>What I need to achieve is when the users clicks again the button "mute", they will receive another message with "Volume UnMuted", instead of muted, if he clicks it again, switch back to mute, and so on.</p>
|
javascript jquery
|
[3, 5]
|
972,164 | 972,165 |
jQuery AJAX URL path issue
|
<p>In jQuery AJAX url place, if I give <code>http://172.121.0.1/filename.php</code>, it's working. If I give <code>http://localhost/filename.php</code> then it's working. Please help me.</p>
<pre><code>$.ajax({
url: "http://172.22.0.155/login/login_check",
type: "POST",
data:$("#logins").serialize(),
beforeSend: function(){
$("#err").html("");
},
success: function($msg){
if($msg=="yes"){
document.location.href=urls+"main/";
}else{
$("#err").html("Please enter correct username and password");
return false;
}
},error:function (msg){
alert(msg);
}
});
</code></pre>
|
php jquery
|
[2, 5]
|
1,364,465 | 1,364,466 |
Background Process without UI - android
|
<p>I have an application Android and I need update the data without UI (Background Process)
I haven't idea about it</p>
<p>Help me</p>
|
java android
|
[1, 4]
|
5,854,697 | 5,854,698 |
Android - to listen the phone state
|
<p>In my application, I need to set a phoneStateListener so that when the connectivity is off,I am able to cache the required updations in a hashtable.I know how to do that using phoneStateListener in a single activity.But can you suggest how can I do it an efficient way other than repeating the same in all activities?. I am a novice in both Java and android.I thought about doing inheritance,But all my classes are already inheriting another class.So how can I implement this without using inheritance?</p>
|
java android
|
[1, 4]
|
2,270,547 | 2,270,548 |
Append css to specific div
|
<p>Can below jQuery be amended so that instead of appending to the generic .myCss style I can append to the css within the specific div 'myDiv' ?</p>
<pre><code>var myDiv= $("#myDiv");
$('<a class=\".newCss\" href=\"#\"></a>').appendTo('.myCss');
</code></pre>
<p>By append to css I mean the div gets converted from this : </p>
<pre><code><div id="myId" class="myCss">
</div>
</code></pre>
<p>to this : </p>
<pre><code><div id="myId" class="test">
<a class="myCss"></a>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,301,224 | 4,301,225 |
Absolute path reference problem on virtual directory
|
<p>My image path references (src='/images/image.jpg') inside my .js files are failing when there is a virtual directory as the virtual directory gets included to the path hierarchy</p>
<p>I can deal with this on other areas of my application where I have server methods to give me the correct path info.</p>
<p>What is a good way to deal with this for .js files?</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
1,510,703 | 1,510,704 |
JS: + variable is this right?
|
<pre><code>$.ajax({
type: "POST",
url: "misc/AddFriend.php",
data: {
mode: 'ajax',
friend: c,
uID: $('#uID').val(),
fID: $('#fID').val(),
bID: $('#bID').val()
},
success: function (msg) {
alert('OK');
$('#friend' + fID).slideUp('slow');
}
});
</code></pre>
<p>IS this right? It wont slide up right now</p>
|
javascript jquery
|
[3, 5]
|
4,187,251 | 4,187,252 |
if not salary in one gridview row than give error on checkbox click event in asp.net
|
<p>I take one gridview in which basicsalary pf, total employeepf,than if not value of basicsalary
in one gridview row than if click check box than show error message that please enter basic salary and i used Asp.net With C# so please help me</p>
|
c# asp.net
|
[0, 9]
|
2,529,458 | 2,529,459 |
Hide / show on condition in javascript
|
<p>I want to hide and show a button on a particular condition in JavaScript.</p>
<p>Code:</p>
<pre><code>$(function(){
// hide the div initially
$("#a").hide();
// Check to see if there is 250 in the url
var bal_amount = document.getElementById('balance_amount');
if (bal_amount.value > 0) {
$("#a").show();
}
});
</code></pre>
<p>HTML</p>
<pre><code><form>
<input type="text" id="balance_amount">
</form>
<image src="image.jpg" id="a">
</code></pre>
<p>But it doesn't work.</p>
|
javascript jquery
|
[3, 5]
|
5,327,385 | 5,327,386 |
How to get the current text color of a button?
|
<p>I want to check in a button click event if the current text color of that button is red or not?</p>
<p>I have done this so far:</p>
<pre><code>ColorStateList mList = gridcell.getTextColors();
int col=mList.getDefaultColor();
switch(col)
{
case Color.RED:
Toast.makeText(getApplicationContext(), "RED",
Toast.LENGTH_SHORT).show();
break;
}
</code></pre>
<p>But when I click on the button which's text color is red it doest toast any thing, The defaut color is white and its getting white in all te buttons. What can I do now?</p>
|
java android
|
[1, 4]
|
5,533,037 | 5,533,038 |
Stop window scroll with keycode (arrows), event.preventDefault() not working?
|
<p>I built an autosuggest, and keycode works to navigate up and down through the list, but it scrolls the window. I have tried event.preventDefault() but it is not stopping it. Any ideas? This is what I have tried:</p>
<pre><code>$(document).keyup(function(e) {
e.returnValue=false;
e.preventDefault();
switch(e.keyCode) {
case 40:
suggestionLine++;
$('#suggestionLine_'+suggestionLine).focus();
break;
// etc...
</code></pre>
<p>Thank you!</p>
|
javascript jquery
|
[3, 5]
|
4,183,497 | 4,183,498 |
What jquery experssion would give me ['a','b'] for the doc <tag att1='a' /><tag att1='b'/>
|
<p>What jquery experssion would give me <code>['a','b']</code> for the doc <code><tag att1='a' /><tag att1='b' /></code>.</p>
<p>Even though the question seems straight forward enough, I've added more info here to pass the automated quality standards on the question submission form.</p>
<p>The actual case I'm working on is to list an array of all the images used in an html doc (not the tags, but the actual locations of the images). So the desired result will be something like <code>["http://mywebsite.com/path_to_image_1.jpg", ...]</code> for a document that contains snippets like:</p>
<pre><code><img src="http://mywebsite.com/path_to_image_1.jpg" />
<img src="http://mywebsite.com/path_to_image_2.jpg" />
</code></pre>
<p>I really don't want to have to list all the tags, then iterate manually to get the src attribute.</p>
|
javascript jquery
|
[3, 5]
|
2,799,693 | 2,799,694 |
Cross Domain javascript call using porthole not working in firefox
|
<p>I have a website(<strong>abc.com</strong>) in which a iframe(<strong>efg.com</strong>) is opened in a facebox.i have used porthole to do a java-script cross domain scripting, but this is working fine in chrome but not in firefox and internet explorer.</p>
<p>is there any other way to send a message in a cross domain environment using javascript?</p>
|
php javascript
|
[2, 3]
|
5,337,157 | 5,337,158 |
Setting values to usercontrol & reloading it
|
<p>i have a usercontrol with two public properties </p>
<pre><code>public DateTime fromdate
{
get;
set;
}
public DateTime toDate
{
get;
set;
}
</code></pre>
<p>I am setting this values in my code behind. After setting the values i want to reload the usercontrol so that it fires a get method which will use these dates ...how will i reload the usercontrol </p>
|
c# asp.net
|
[0, 9]
|
1,129,912 | 1,129,913 |
Monitor services in android
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/600207/android-check-if-a-service-is-running">android: check if a service is running</a> </p>
</blockquote>
<p>I have one services to perform my action, it will run on background indefinite time. I want to monitor the service whether its is running or not. So, I want to create another service to monitor first one. </p>
<p>Is There any other action interfilter to broadcast, service running or not?</p>
|
java android
|
[1, 4]
|
4,445,525 | 4,445,526 |
selectmenu plugin on selectlist
|
<p>I am using <code>selectmenu() plugin</code> on the select list </p>
<pre><code> <select id="main" size="1"><option ..</select>
$("#main").selectmenu();
</code></pre>
<p>Now after applying this plugin, select list event 'onchange<code>is not working on the</code>select#main`.Can anybody please help me out?</p>
|
javascript jquery
|
[3, 5]
|
4,173,202 | 4,173,203 |
How do I change an attribute of an element when someone scroll pass the element (Sticky Element)
|
<p>For example <a href="http://twitter.github.com/bootstrap/base-css.html" rel="nofollow">http://twitter.github.com/bootstrap/base-css.html</a> try to scroll up. You will see the bar with </p>
<blockquote>
<p>"Typography Code Tables Forms Buttons Icons by Glyphicons"</p>
</blockquote>
<p>when you scroll pass the element it will add a class to make the element change. While you are scrolling back up it will remove the attribute to change the element again.</p>
<p>Edit: I found out this is call Sticky Element.</p>
|
javascript jquery
|
[3, 5]
|
322,720 | 322,721 |
Javascript event when changing/focusing tab/window
|
<p>Is there an event handler for focusing or blurring a tab or window in jQuery?
blur() and focus() don't seem to work on window.</p>
|
javascript jquery
|
[3, 5]
|
2,104,289 | 2,104,290 |
How can I call a specific page everytime than a event occurs?
|
<p>I have this follow code in my javascript.</p>
<p>I call this function when the user click in a specific checkbox and then I just change the image of this checkbox.</p>
<p>the problem is that my ExportaZap are accessed just one time, for example, if a click now in my checkbox, I call ExportaZap.ashx and then change the image of this checkbox. If a click again, he don't pass through my ExportaZap.ashx. </p>
<p>How can I do to call ExportaZap ever than my user click on my checkbox using the function below ?</p>
<pre><code> function Visibilidade(id, imagemBaixa, credenciada) {
$.get("../Action/ExportaZap.ashx", { id: id, imagemBaixa: imagemBaixa, credenciada: credenciada }, function (data) {
if (data != "limite") {
if ($("#" + imagemBaixa).attr("src") == "../tema/default/images/CheckVerde.png") {
$("#" + imagemBaixa).attr("src", "../tema/default/images/CheckCinza.jpg");
}
else if ($("#" + imagemBaixa).attr("src") == "../tema/default/images/CheckCinza.jpg") {
$("#" + imagemBaixa).attr("src", "../tema/default/images/CheckVerde.png");
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,721,346 | 2,721,347 |
Images will not upload on web server but ok on local
|
<p>I have some images on server i want to upload it on another server i make code to upload all images on server but it is OK to upload on local but i didn't know what is wrong in that it can't be upload on server </p>
<pre><code> try
{
byte[] content;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
using (BinaryReader br = new BinaryReader(stream))
{
content = br.ReadBytes(500000);
br.Close();
}
response.Close();
string CompleteDPath = "ftp path";
string UName = "abc";
string PWD = "123";
WebRequest reqObj = WebRequest.Create(CompleteDPath + file_name);
reqObj.Method = WebRequestMethods.Ftp.UploadFile;
reqObj.Credentials = new NetworkCredential(UName, PWD);
reqObj.GetRequestStream().Write(content, 0, content.Length);
reqObj = null;
//FileStream fs = new FileStream(file_name, FileMode.Create);
//BinaryWriter bw = new BinaryWriter(fs);
//bw.Write(content);
//fs.Close();
//bw.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,932,889 | 5,932,890 |
Jquery increment numbers with a limit of 5
|
<p>I'm adding text fields with a onclick. What I'm trying to do is limit the amount of boxes to about 5.</p>
<p>I also need to increment the number to use as an ID.</p>
<p>my code: </p>
<pre><code>jQuery('#add_slider_image').click(function() {
var i = 0
var plus = ++i;
jQuery('.form-table').append("<tr><td><input type'text' value='' name='slider[]' /><input type='button' name='sliderbut' value='Upload' id='button' rel='"+ plus +"' /></td><tr>");
var count = jQuery.('#button').attr('rel');
if(count=5){
alert('Limit reached');
}
})
</code></pre>
<p>THanks</p>
|
javascript jquery
|
[3, 5]
|
1,552,077 | 1,552,078 |
JQuery change the value of an <img src="" by ID
|
<p>I need some simple JQuery code so I can change the src value of a specific img.</p>
<p>It's currently:</p>
<pre><code><img id="myImage" src="image1.gif" />
</code></pre>
<p>and I need to change it to:</p>
<pre><code><img id="myImage" src="image2.gif" />
</code></pre>
<p>using JQuery.</p>
|
javascript jquery
|
[3, 5]
|
3,073,328 | 3,073,329 |
prevent jQuery append from appending to iframe
|
<p>I am trying to append to $('body'), but some sites use full html pages inside iframes, that means it -the page- has two -or more- body tags, i tried to use $('body').first(), but with no luck, any thoughts? same goes for html tag.</p>
<p><strong>EDIT 1</strong>: as per request to show some code, i'll explain further, i am creating a chrome extension that appends a fixed div to the current page, everything works fine when there is only one html/body tag, other than that the div is appended to all of the html/body tags in the page, as someone said "give it an ID", i can't, this is not my page i have no real control over the server generated DOM, i only can inject into it, anyways here is the code that deals with appending the div.</p>
<pre><code>formDiv = jQuery('<div/>', {
id : 'fform',
class :'_fform',
html : fhtml,
style : 'left:' + document.body.scrollLeft + ';top:' + document.body.scrollTop
})
$('html').first().append(formDiv);
</code></pre>
<p><strong>EDIT 2</strong>: i suspect it has something to do with "all_frames" in chrome extension manifest now.</p>
|
javascript jquery
|
[3, 5]
|
2,342,365 | 2,342,366 |
Vertical scrollbar of JQueryMobile Autocomplete is not working on Android
|
<p>I am using jQuery Autocomplete on my jQUeryMobile application. It works perfect. Now I am trying to show vertical scrollbar to scroll through the list of looked up items. The scrollbar shows up on desktop browsers, but not on Android devices. my css looks like this:</p>
<p>
.ui-autocomplete
{
max-height: 100px;
overflow-y: auto;
/* prevent horizontal scrollbar */
overflow-x: hidden;
}
</p>
<p>Can someone help, thanks!</p>
|
android jquery
|
[4, 5]
|
220,289 | 220,290 |
How do I validate a number in the box if the number should be greater than 60 (using javascript)?
|
<pre><code><html>
<head>
<title>Mobile number validation using regex</title>
<body>
<script type="text/javascript">
function regIsDigit(fData)
{
var reg = new RegExp(”^[6-9][0-9]$”);
return (reg.test(fData));
}
</script>
<form >
name: <input type="text" name="fData" >
<input type="submit" value="Check" onclick="regIsDigit();" >
</form>
</body>
</html>
</code></pre>
|
java javascript
|
[1, 3]
|
5,389,402 | 5,389,403 |
jquery ajax call fails
|
<pre><code>$('.deleteBtn').click(function(){
$('#videofrm').load('edit.php?url='+encodeURI($(this).siblings('a').attr('href'))+'&action=delete');
})
</code></pre>
<p>edit php code is:</p>
<pre><code>if($_GET['action']=='delete'){
echo "<p>daniel</p>";
}
</code></pre>
<p>why is this not working???</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,669,266 | 2,669,267 |
checking out the login result
|
<p>i am trying to integrate cpanel to my cms...
i have this code to remote logins:</p>
<pre><code><form action=’http://www.yourdomain.com:2082/login/’ method=’post’>
<table border=’1′ width=’250′ cellpadding=’2′ cellspacing=’0′>
<tr>
<td align=’right’>Username:</td>
<td><input type=’text’ name=’user’></td>
</tr>
<tr>
<td align=’right’>Password:</td>
<td><input type=’password’ name=’pass’></td>
</tr>
<tr>
<td colspan=’2′ align=’center’><input type=’reset’ name=’r1′ value=’Reset’><input type=’submit’ name=’s1′ value=’Login’></td>
</tr>
</table>
</form>
</code></pre>
<p>this form loads cpanel after successful login. i dont want this form to loads cpanel after successful login. i want to load another page of my cms after successful login. so, i would like to check if login is successful or not. i tried to do it with jquery however jquery did not work on cross domain. does anyone got any suggestion for this situation?</p>
|
php jquery
|
[2, 5]
|
3,765,770 | 3,765,771 |
searching number in body using jquery
|
<p>i am trying to search all numbers (of digits 8) in body using jQuery, its only returning first no. in body?</p>
<pre><code>var myRe = /[0-9]{8}/;
var myArray = myRe.exec($('body').html());
alert(myArray);
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,541,513 | 2,541,514 |
Convert objects to a string value
|
<pre><code>jQuery.each(input, function(key, value){
jQuery('<div/>', {
class: 'info',
id: value.id,
text: jQuery('<div/>', {class: 'image', text: '<img src="'+value.image+'">'})+jQuery('<div/>', {class: 'text_data', text: value.name})
}).appendTo('#list');
});
</code></pre>
<p>Is it possible somehow to convert objects to string in <code>text</code> attribute (should to be no cycles). If needed can be wrapped by a function.</p>
<p><strong>UPDATE:</strong></p>
<pre><code><div class="info" id="29">[object Object][object Object]</div>
<div class="info" id="30">[object Object][object Object]</div>
<div class="info" id="31">[object Object][object Object]</div>
</code></pre>
<p>So i need to update this line <code>jQuery('<div/>', {class: 'image', text: '<img src="'+value.image+'">'})+jQuery('<div/>', {class: 'text_data', text: value.name})</code> that there would be a string.</p>
|
javascript jquery
|
[3, 5]
|
1,271,217 | 1,271,218 |
ASP.NET Webforms and Jquery - strategy for dealing with ID mangling
|
<p>I like jQuery and am using ASP.NET. I know you can get round ID mashing a bit using the ClientID but this dosn't work well when are farming you script out to sepearte js files.</p>
<p>The only way I have used round this is to store the ClientID in a javascript variable on the page then use this id in the seperate js file. But this is less than ideal.</p>
<p>Does anyone have any better ways of dealing with this (other than wait for ASP.NET 4.0!)</p>
<p><strong>EDIT: Duplicate Question:</strong></p>
<p><a href="http://stackoverflow.com/questions/497802/how-to-stop-asp-net-from-changing-ids-in-order-to-use-jquery/498972#498972">How to stop ASP.NET from changing IDs in order to use jQuery</a></p>
|
asp.net jquery
|
[9, 5]
|
3,133,697 | 3,133,698 |
Unable to load image in img control in asp.net
|
<p>I have image control.I want to load image from my specific path.
i have a code in page behind</p>
<pre><code>string imagePath ="E:/DotNetProjects/Templates/Default/icons/Computer.png";
imgEditor.ImageUrl = imagePath;
imgEditor.AlternateText = "Unable To Find Image";
</code></pre>
<p>path is exist and image is also available but always load alternate text.
<code>imgEditor</code> is my image control ID.
Plz help to catch my mistake.Thanks. </p>
|
c# asp.net
|
[0, 9]
|
5,418,701 | 5,418,702 |
having trouble making a menu slide down on click and then reverse this animation using jquery
|
<p>I am trying to create a sliding menu effect when a link is clicked, basically on click I want to prepend a background that fades in with 0.6 opacity and then slide my menu into place and then on a further click I want to reverse this animation. I have create a click event with a callback function but I think this callback is cancelling out my first click so nothing seems to be happening, can anyone advise me on how I can create this effect?</p>
<p>I have created a fiddle here: <a href="http://jsfiddle.net/AHj4Y/3/" rel="nofollow">http://jsfiddle.net/AHj4Y/3/</a></p>
<p>Thanks
Kyle</p>
|
javascript jquery
|
[3, 5]
|
594,563 | 594,564 |
jquery datepicker not focussed after date is chosen, after postback datepicker doesn't work
|
<p>everytime the user selects a date from my datepicker the for some reason instead of staying focused on the are the date picker is in it scrolls to the top of the page.</p>
<p>Heres the function located at the bottom of my asp.net page under the </p>
<pre><code> <script>
$(function() {
$( "#<%= pissued1.ClientID %>" ).datepicker();
});
</script>
</code></pre>
<p>This is the code.</p>
<pre><code><td align="left" colspan="2">
<strong>
<asp:Label ID="labdi1" runat="server" Text="*Date Issued:"></asp:Label>
<asp:RequiredFieldValidator ID="p1divalidate" runat="server" ControlToValidate="pissued1"
ErrorMessage="You Forgot The">*</asp:RequiredFieldValidator><br />
</strong>
<asp:TextBox ID="pissued1" runat="server" Width="45%"></asp:TextBox>
</td>
</code></pre>
<p>and also on postback my datepickers stop working. For example i have a dropdownlist that causes postback and if the user uses the drop downlist then the datepickers stop working</p>
|
asp.net jquery
|
[9, 5]
|
3,510,747 | 3,510,748 |
How to show the first n number of elements in jQuery?
|
<p>I have a page that has 50 elements with the same class "fields" which are all display none at the moment</p>
<pre><code><div class="fields" style="display:none;">
...
</div>
<div class="fields" style="display:none;">
...
</div>
<div class="fields" style="display:none;">
...
</div>
<div class="fields" style="display:none;">
...
</div>
...
</code></pre>
<p>How to I only show the first 3 or whatever number. Plus count them with a count on top like the following example below.</p>
<p>So for example if I needed the first 3 this is what i need the divs to look like</p>
<pre><code><div class="fields">
<h1>Station 1</h1>
</div>
<div class="fields">
<h1>Station 2</h1>
</div>
<div class="fields">
<h1>Station 3</h1>
</div>
<div class="fields" style="display:none;">
...
</div>
...
</code></pre>
<p>So basically only some the number of divs that I need...I already have the number of elements I need to show in this blur statement in the station_count variable. Also notice i need a span tag with the count..any ideas on how to do this</p>
<pre><code> $("#number_station").blur(function(){
var station_count = $(this).val();
//code goes there
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,391,898 | 4,391,899 |
How to show/hide webforms ins aspnet?
|
<p>Hide/Close Loginform.aspx if userid/password is correct then show newform.aspx and how to create message box on asp?That will pop up Message: Login Successfull.</p>
<p>Help please..I am exploring ASP net as a Beginner. </p>
<p>Thanks..</p>
<p>How can i get the username value from loginform.aspx to newforms.aspx so thati can also get its value for my sql queries insert/update.</p>
|
c# asp.net
|
[0, 9]
|
1,379,243 | 1,379,244 |
asp.net textbox.text and jquery.val()
|
<p>I'm reading the contents of a an asp.net TextBox on a button click event in the codebehind of a webpage.</p>
<p>This works fine if I type something into the box I can read whats in there via TextBox.Text.</p>
<p>However, if I copy into the input textbox using jquery, setting the contents using val(), I can see the text appear in the box but when the click event fires and I try to read the contents of the textbox it is always blank. There's only every anything in there if I type it in myself.</p>
<p>The relevant bits of code are: -
The input box</p>
<pre><code><asp:TextBox runat="server" ID="deliveryAddress3" CssClass="required radius disabled sugestedAddressTargetCity bcity2" />
</code></pre>
<p>Javascript</p>
<pre><code>var bfields = ['.baddress', '.bcity', '.bcountry', '.bpostcode'];
var dfields = ['.baddress2', '.bcity2', '.bcountry2', '.bpostcode2'];
for (var i in dfields) {
$(dfields[i]).prev('label').hide();
$(dfields[i]).val($(bfields[i]).val());
$(dfields[i]).attr('disabled', 'disabled');
$(dfields[i]).addClass('disabled');
$(dfields[i]).attr('disabled', 'disabled');
</code></pre>
<p>Code in button click method of codebehind: -</p>
<pre><code>customer.DelTown = deliveryAddress3.Text;
</code></pre>
<p>Whats going on here is that the customer can copy their address from one set of boxes to another. If they do this (by clicking a button) the ext shows up in the boxes but in the code behind is blank. However, if I type something in to those boxes it is available in the code behind.</p>
|
jquery asp.net
|
[5, 9]
|
1,214,495 | 1,214,496 |
PHP/JS: Disable form´s action if enter
|
<p>Hey, so my form is where you register you as a user. You type in 2 fields <strong>then press next</strong> and then 3 new fields come and then it runs the action="index.php?register=yes". </p>
<p>Now as you can see i highlighted "then press next" thats because, maybe some users just press enter after typing in the last field, and then it runs the action. But if you click Next, it shows you the 3 new fields(fading them in with javascript) and i added a return false; so it doesnt run the action="" in the form until the last button(on "page 2(with the 3 new fields") </p>
<p>Is there any way to do so you can "return false" if you just press enter(on your keyboard), like you can return false when you click on the button so it dont run the action="" ?</p>
|
php javascript
|
[2, 3]
|
5,933,264 | 5,933,265 |
Using android.jar in Java project - RuntimeException Stub?
|
<p>I tried to <strong>include android.jar</strong> into Java project, <strong>remove JRE from Build Path</strong> and run this code. It throws Runtime exception. Why?</p>
<pre><code>Exception in thread "main" java.lang.RuntimeException: Stub!
at android.content.ContentValues.<init>(ContentValues.java:5)
at JarTest.main(JarTest.java:5)
public class JarTest {
public static void main(final String[] args) {
final ContentValues values = new ContentValues();
values.put("test", "test");
System.out.println(values);
}
}
</code></pre>
<p>Why is ContentValues used only in Android environment?</p>
|
java android
|
[1, 4]
|
4,721,010 | 4,721,011 |
Setting cursor position on textbox after postback
|
<p>I am able to focus on the textbox after postback using this code:</p>
<pre><code>ScriptManager.RegisterStartupScript(textBox, textBox.GetType(), "selectAndFocus", "$get('" + textBox.ClientID + "').focus();", true);
</code></pre>
<p>But this sets the cursor position to the beginning of the textbox, not after the last typed character. I try to solve this by using this code:</p>
<pre><code>textBox.Attributes.Add("onfocus", "$get('" + textBox.ClientID + "').value = $get('" + textBox.ClientID + "').value;");
</code></pre>
<p>But that doesn't work. Same result as before.
How can I solve this? </p>
<p>I have read a ton of links, <a href="http://parentnode.org/javascript/working-with-the-cursor-position/" rel="nofollow">this</a> seeming like the best solution, but I haven't been able to get it to work. </p>
<p>UPDATE: Forgot to mention that the textbox resides inside an updatepanel.</p>
<p>UPDATE2, attempted solution:</p>
<pre><code>string setCaretTo = @"function setCaretTo(obj, pos) {
if(obj.createTextRange) {
/* Create a TextRange, set the internal pointer to
a specified position and show the cursor at this
position
*/
var range = obj.createTextRange();
range.move('character', pos);
range.select();
} else if(obj.selectionStart) {
/* Gecko is a little bit shorter on that. Simply
focus the element and set the selection to a
specified position
*/
obj.focus();
obj.setSelectionRange(pos, pos);
}
}";
ScriptManager.RegisterClientScriptBlock(//anotherunrelated script);
ScriptManager.RegisterClientScriptBlock(textBox, textBox.GetType(), "MyScript", setCaretTo, true);
ScriptManager.RegisterStartupScript(textBox, textBox.GetType(), "MyStartupScript", "window.onload = function() {obj = window.document.getElementById('"+textBox.ClientID+"');setCaretTo(obj, obj.getAttribute('value').length);}", true);`
</code></pre>
|
javascript asp.net
|
[3, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.