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,858,924
| 5,858,925
|
compare values of cells in different rows in table using jquery
|
<p>I have a dynamically generated table with php that has same rows. Need to get value from cell 1 in row 1 and value from cell 1 in row 2 and compare them. If they are the same remove entire row or hide... Do that for the whole table... Any help is appreciated.. Thanks!!</p>
<p>Haave this so far:</p>
<pre><code>var numRows = $('table#changeSubjectKatedra tr').lenght;
var i = 0;
do {
var cur = $('input#'+i).val();
var next = $('input#'+(i+1)).val();
if(cur == next){
$('tr#'+i).remove();
}
i++;
} while(i<numRows);
</code></pre>
<p>The row in table looks like this:</p>
<pre><code><tr id='idNum'><td>someText<input type='hidden' value='someData' id='idNum'>
</td><td>someText</td></tr>
</code></pre>
|
php jquery
|
[2, 5]
|
400,400
| 400,401
|
Javascript iframe loading time function for many urls
|
<p>Got a very simple function that checks the loading time of an iframe:</p>
<pre><code>function loadTime() {
var beforeLoad = (new Date()).getTime();
$('#loading_iframe').one('load', function () {
var afterLoad = (new Date()).getTime();
var result = (afterLoad - beforeLoad) / 1000;
$("#loadingtime").html(result + " sec");
});
}
</code></pre>
<p>I load my frame like so (where $url = some link)):</p>
<pre><code><iframe style="visibility:hidden;display:none" id="loading_iframe" src="<?php echo $url;?>"></iframe>
</code></pre>
<p>After that i put my result into a div:</p>
<pre><code><div id="loadingtime"></div>
</code></pre>
<p>This works very well for one single url, i want it to work for an array of urls. Heres the structure i would like to have(is this possible?):</p>
<pre><code>foreach ($url_array as $i)
iframe gets loaded with url
javascript that gets the loadtime of the url
passint the javascript value to php varriable
write the php varriable to a database
close foreach and begin the next loop
</code></pre>
|
php javascript
|
[2, 3]
|
5,038,743
| 5,038,744
|
The remote server returned an error: 227 Entering Passive Mode (89,202,213,212,6,32)
|
<p>Briefly,<br>
I'm trying to read 5000 xml files from ftp but it throws
The remote server returned an error: 227 Entering Passive Mode (89,202,213,212,6,32) on reading 1500th xml file. what shall i do somebody help me. </p>
<pre><code>string[] files;
files = GetFileList();
foreach (string file in files)
{
xmlDoc.Load("ftp.Test.com/stats/" + file);
XmlNodeList itemNodes = xmlDoc.SelectNodes("//Sport");
}
</code></pre>
<p>on reading 1600th xml file i get the Exception like
<strong>The remote server returned an error: 227 Entering Passive Mode (89,202,213,212,6,32)</strong> </p>
|
c# asp.net
|
[0, 9]
|
2,631,397
| 2,631,398
|
If it is final then why put static?
|
<p>Sometimes I see something like :</p>
<pre><code>public class MainActivity extends Activity
{
public static final String url_google = "http://www.google.com";
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
</code></pre>
<p>What I actually don't get, is why using <code>public static final</code> , and not <code>public final</code> or <code>final</code>
<br></p>
|
java android
|
[1, 4]
|
5,564,736
| 5,564,737
|
jquery get last each if value
|
<p>I have this code, </p>
<pre><code>$(function () {
$.post("fetch_data.php?url="+$('#url').val(), { }, function(response){
var arrValues = [ <?php echo $js_img_arr; ?> ]; //output from php
$.each(arrValues, function( intIndex, objValue ) {
var img = new Image(); //creating four Image Elements
img.src = objValue;
img.onload = function() {
if(img.height > 100 && img.width > 200) {
alert('height: ' + img.height + ' width: ' + img.width);
//here
}
}
});
});
});
</code></pre>
<p>I am new to jquery/javascript.</p>
<p>Is it possible to get value of how many images loaded at last, let say 10 img have loaded and met the height/width criteria, i want the value of 10 images loaded.</p>
<p>Thank you.</p>
|
javascript jquery
|
[3, 5]
|
4,757,930
| 4,757,931
|
Repeater DataBind error
|
<p>Half a day spent on this one...</p>
<p>On a page, I have two repeaters like so:</p>
<pre><code><% if (String.IsNullOrEmpty(Request.QueryString["id"])) { %>
<asp:Repeater ID="auth_items" runat="server">
<ItemTemplate>
<a href="/admin/auth.aspx?action=view&amp;id=<%# Eval("id") %>"><%# Security.script(Eval("name").ToString()) %></a><br />
</ItemTemplate>
</asp:Repeater>
<% } else { %>
<asp:Repeater ID="auth_item" runat="server">
<ItemTemplate>
<%# Security.script(Eval("name").ToString()) %>
</ItemTemplate>
</asp:Repeater>
<% } %>
</code></pre>
<p>and in code behind:</p>
<pre><code>if (String.IsNullOrEmpty(Request.QueryString["id"]))
sql = "SELECT * FROM table1 ORDER BY attr1 DESC";
else
{
id = Security.sql(Request.QueryString["id"]);
sql = "SELECT * FROM table2 WHERE attr2=" + id;
}
s.OpenConn(sql);
if (String.IsNullOrEmpty(Request.QueryString["id"]))
{
auth_items.DataSource = s.GetRead();
auth_items.DataBind();
}
else
{
auth_item.DataSource = s.GetRead();
auth_item.DataBind();
}
</code></pre>
<p>The problem is that I get 'object reference not set to an instance of an object' on auth_item.DataBind().
First repeater works fine and displays the data, but the second one won't work and instead, throws me an error.
I debugged it and DataSource for the second repeater is not null, and sql returns a value.</p>
<p>What seems to be the problem?</p>
<p>Thank you!</p>
|
c# asp.net
|
[0, 9]
|
2,010,417
| 2,010,418
|
Jquery - techniques for extending 'perimeter' for mouseout?
|
<p>I would like to implement behaviour such that a mouseover/hover event is triggered when the mouse pointer hovers over a certain div, but such that the mouseout event tiggers not when the pointer leaves the div, but when it leaves the area 10px ourside the div.</p>
<p>Is there any way of achieving this that doesn't involve creating a larger parent div to bind the mouseout event to?</p>
|
javascript jquery
|
[3, 5]
|
2,201,285
| 2,201,286
|
want to show / hide only the specified elements in jQuery iteration
|
<p>I have the following code where I want to show / hide different text based upon a mouseover. I am using a data-global-id value and want to iterate through the children of the item-list and hide all but specified value (item-1 for data-global-id=1 for example): </p>
<pre><code><script>
$(document).ready(function() {
$('.item-list').hide();
$('.h').mouseover(function() {
// need to hide everything but the 1 or 2
var id = $(this).data('global-id');
var chil=$('.item-list').children();
$.each(chil, function(i,v){
alert(i);
console.log(v);
});
});
});
</script>
<style>
.h{
width: 200px;
border: 1px solid red;
}
</style>
<ul>
<li><div class='h' data-global-id="1">Client 1</div></li>
<li><div class='h' data-global-id="2">Client 2</div></li>
</ul>
<ul class="item-list">
<li class="item-1">
Lorem ipsum jtjtjt, etc...
</li>
<li class="item-2">
Lorem ipsum, etc...
</li>
</ul>
</code></pre>
<p>How would I specify in the each loop to hide everything and just show the item+data-global-id value? Is there a better / easier way to do this?</p>
<p>thx</p>
|
javascript jquery
|
[3, 5]
|
5,299,844
| 5,299,845
|
how to register user clicked on link ads
|
<p>I want to register user clicked on ads and save users info to database without change ads operation.</p>
<pre><code><div>
<a>ads link</a> // without modify ads
<a>ads link</a>
<a>ads link</a>
<a>ads link</a>
</div>
</code></pre>
<p>how to update user info to database before load link ads.</p>
<p>Please help.</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,558,209
| 4,558,210
|
Iterate through and delete empty HTML table rows with jQuery
|
<p>I am attempting to iterate through a HTML table using jQuery and delete empty rows. The page is driven by ASP.NET and with certain permission, items in the table will be hidden. Therefore, I wanted to create this script to remove the empty rows and get rid of the space between the other items that are still displayed. I cannot seem to get what I currently have to run and I am unsure as to why. Here is the code:</p>
<pre><code><script src="http://code.jquery.com/jquery-1.5.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('tr').each(function () {
$(this).find('td').each(function () {
if ($(this).text().trim() == "") {
$(this).closest("tr").remove();
};
});
});
});
</script>
</code></pre>
<p>Any guidance would be greatly appreciated. Thanks!</p>
|
javascript jquery
|
[3, 5]
|
1,283,964
| 1,283,965
|
How to properly get String from resources?
|
<p>Hey, I have a lot of Strings so I put them on a .xml, And I also have an ExpandableListView, and each child refers to a String.<br>
I have named each String in the xml like: "String3_1" .. which means this String is for Group 3 Child 1 in the the ExpandableListView..<br>
When switching activity after clicking in one of the childs, I send the GroupNum and ChildNum and I form the a new String: </p>
<pre><code> Intent myIntent=getIntent();
child = myIntent.getStringExtra("GroupNum");
group=myIntent.getStringExtra("ChildNum");
String finalstring="String"+child+"_"+group;
</code></pre>
<p>Now how I call the String in the resources?<br>
getString(resId) gets the String itself not the title of it so I cant compare it with the finalstring</p>
<p>Thanks. </p>
|
java android
|
[1, 4]
|
5,949,893
| 5,949,894
|
jquery how to get Name of parent
|
<p>im searching for the Element whicht Provides the Name of a Parent. This:</p>
<pre><code> $('.Item').click(function(){
var a = $(this).parent();
alert(a[0].tagName);
});
</code></pre>
<p>just says "DIV", but I need the real name of a Element. Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,956,879
| 1,956,880
|
What should I focus my attention on? PHP or Java
|
<p>For the long run (next decade) : Which is better to learn?</p>
<ol>
<li><p>Php</p></li>
<li><p>Java</p></li>
</ol>
<p>I already have a bit of a background in php, but no background in java.</p>
<p>What would you say is more "marketable" and "futureproof" in the next 10 years?</p>
|
java php
|
[1, 2]
|
2,323,085
| 2,323,086
|
Countdown timer get time from client's machine, need server time
|
<p>I'm using this javascript code in order to calculate the difference between the current time and targeted time.</p>
<p>the counter is working fine, but according to client time, not Server side time.</p>
<p>Here is the code I'm using:</p>
<pre><code> function StartCountDown(myDiv,myTargetDate)
{
var dthen = new Date(myTargetDate);
var dnow = new Date();
ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
CountBack(myDiv,gsecs);
}
</code></pre>
<p>how to get the server time, not client local machine time?</p>
|
php javascript
|
[2, 3]
|
4,895,226
| 4,895,227
|
How to get size of an image that is held in a byte array in KB
|
<p>I want to find out the size of an image that is held in a byte array in KB </p>
<pre><code>Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.mPicture);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); //bm is the bitmap object
byte[] b = baos.toByteArray();
</code></pre>
<p>The following logs display two different results for an image that is <b>11.7KB</b>:</p>
<pre><code>Log.d(TAG, "bm size: "+bm.getByteCount()/1024); // 942
Log.d(TAG, "baos size: "+baos.size()/1024); // 81
Log.d(TAG, "byte size: "+b.length/1024); // 81
</code></pre>
<p>Which is the correct result or how do I get the correct result?? Any help is appreciated.</p>
|
java android
|
[1, 4]
|
5,175,550
| 5,175,551
|
Prevent scroll to top --Issue
|
<p>Ok, I am trying to prevent the page from scrolling to the top of the page when I click on an anchor. </p>
<p>I have done this many times before, but I am not understanding what I am missing this time. </p>
<p>Please have a look at this code:</p>
<pre><code>$('#regionMapNav a').click(function(event){
event.preventDefault();
var i = $(this).attr("class");
var name = $(this).attr("id");
name = name.replace(/\s+/g, '');
if(i != 'active'){
$('.active').removeClass('active');
$(this).addClass('active');
$('.map').hide();
$('#' + name + 'Map').fadeIn(3000);
return false;
}
});
</code></pre>
<p>thanks for any help. </p>
<p><strong>EDIT</strong>
I went ahead and create a hack to just scroll to bottom since nothing that should work is working....I know it is not the best, but it works...Here is the code just in case someone ever has the same issue. Keep in mind that this item I am creating is at the bottom of the page. Also, that there is a dynamically loaded large header on this page. I think my issue has something to do with that, but I just don't have the energy today to trace back my mistake. </p>
<pre><code>$('#regionMapNav a').click(function(event){
event.preventDefault();
var i = $(this).attr("class");
var name = $(this).attr("id");
name = name.replace(/\s+/g, '');
if(i != 'active'){
$('.active').removeClass('active');
$(this).addClass('active');
$('.map').hide();
$('#' + name + 'Map').fadeIn(3000);
window.scrollTo(0, document.body.scrollHeight);
return false;
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,805,119
| 5,805,120
|
What is the best way to create a wizard for web?
|
<p>I want to create a wizard that includes a few steps, that in the final steps
we need to include all the steps and save to the data base.
What is the best design to do this ?</p>
<p>Is there an implementation for jquery ?
Do I need to save the steps in session till the final save ?</p>
|
c# jquery
|
[0, 5]
|
1,086,917
| 1,086,918
|
How to assign ID to the dynamically created rows
|
<p>I am creating rows dynamically in javascript.As the controls in all rows have same id, i need to assign an id to that control when it is creating.can anyone help me how to assign ID to that control
this is my code</p>
<pre><code>function AddNewRow(tblrowdetails) {
var table = $("tblrowdetails"); //getting the table id
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var colCount = table.rows[0].cells.length;
for(var i=0; i<colCount; i++) {
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[0].cells[i].innerHTML;
switch(newcell.childNodes[0].type) {
case "text":
newcell.childNodes[0].value = "";
break;
case "checkbox":
newcell.childNodes[0].checked = false;
break;
case "select-one":
newcell.childNodes[0].selectedIndex = 0;
break;
}
}
}
}
</code></pre>
<p>Where i need to assign id to the control and how to assign pls help me </p>
|
c# javascript
|
[0, 3]
|
5,155,249
| 5,155,250
|
Need some suggestion to buys books of javascript and jquery
|
<p>May be this question duplicate or redundant but i want to elaborate my question so:</p>
<p><strong>i have tried looking to google and flipkar,amazon that ...but by just looking at the book you can't really judge how it will be...and it's always good ask someone who has experience...because i can't keep on buying to find good book</strong></p>
<p>I want to buy books on jquery and javascript,and please consider that i am not a experienced in javascript and jquery neither a beginner ...so i want buy a book that has a very high level ....so that all goes above my head...</p>
<p>if some <strong>experienced</strong> one can reply to this it will be helpfull...and all others(less experienced) are also welcome.....</p>
<p>Hoping i will get good answer :)</p>
|
javascript jquery
|
[3, 5]
|
3,639,515
| 3,639,516
|
Easiest way to get element parent
|
<p>Suppose i have this structure of elements:</p>
<pre><code><div class="parent">
<div class="something1">
<div class="something2">
<div class="something3">
<div class="something4"></div>
</div>
</div>
</div>
</div>
</code></pre>
<p>And code like this:</p>
<pre><code>$(".something4").click(function(){
//i could do it like this...
$(this).parent().parent().parent().parent().parent();
});
</code></pre>
<p>But that seems to be stupid, is there a better way to do this?</p>
<p>also i can't just say <code>$(.parent)</code> because there are many divs like this with class <code>parent</code> in my page.</p>
|
javascript jquery
|
[3, 5]
|
4,708,324
| 4,708,325
|
Using jQuery .change() to change values in a <p> element
|
<p>I have a select element with a few options for currencies, and then a <code><p></code> element at the bottom that currently prints the current exchange rate for USD to another currency. What I'm trying to do, is upon <code>.change()</code> of the select element value, I want to insert the value of the select element into a PHP script, and then re-<code>.load()</code> the <code><p></code> element.</p>
<p>How can I pass a value from jQuery .val() to a PHP script?</p>
|
php jquery
|
[2, 5]
|
3,072,462
| 3,072,463
|
google map api v2
|
<p>I've problem calling gdrirection.load(),if I specified the values it'll work ,but if I pass them through text boxes it doesn't work.
here's my code </p>
<pre><code>var map;
var directionsPanel;
var directions;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(24.7116667, 46.7241667), 12);
map.setUIToDefault();
var txtAddress = document.getElementById('txtAddress').value;
var TextBox1 = document.getElementById('TextBox1').value;
directions = new GDirections(map, directionsPanel);
directions.load("from: 'TextBox1' to: 'txtAddress'");
}
}
<body onload=initialize()>
<asp:TextBox ID="txtAddress" runat="server" Visible="true" />
<input type="button" value="direction" onclick="initialize();" title="direction" />
<asp:TextBox ID="TextBox1" runat="server" Visible="true"></asp:TextBox>`
</code></pre>
<p>Thanks</p>
|
javascript asp.net
|
[3, 9]
|
49,303
| 49,304
|
Converting a C# snippit to Java
|
<p>The Java code should have the same functionality as the C# code. Is this code the same?</p>
<p>This is the code in C# code:</p>
<pre><code>byte[] hashBytes;
UnicodeEncoding encoding = new UnicodeEncoding();
hashBytes = encoding.GetBytes(inputstr.Text.ToUpper().Trim());
SHA1 sha1 = new SHA1CryptoServiceProvider();
byte[] cryptPassword = sha1.ComputeHash(hashBytes);
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
SHA1.Text = enc.GetString(cryptPassword);
outputstr.Text = Convert.ToBase64String(cryptPassword);
</code></pre>
<p>Here is the Java ported code, but I'm getting different output:</p>
<pre><code>byte[] pwBytes = new String("password".toUpperCase().getBytes(), "UTF-16").getBytes();
MessageDigest md = null;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1pw = md.digest(pwBytes);
final BASE64Encoder encoder = new BASE64Encoder();
String encodedPw = encoder.encode(sha1pw);
</code></pre>
<p>The Java code should calculate encodedPw the same way that the C# code calculates outputstr.Text.</p>
<p>I'm sorry, I can not run the C# code to provide an example. The Java code hashes "password" as <code>oghZbO1T3U/eu3POLIIQweZ/gvQ=</code>.</p>
|
c# java
|
[0, 1]
|
2,737,763
| 2,737,764
|
My asmx webservice works locally but not when deployed on remote IIS 7
|
<p>I have developped an asmx webservice with visual studio and I deploy on IIS 7 which has 3.5 Framework by copying all the files.</p>
<p>When testing it says</p>
<blockquote>
<p>Could not load file or assembly
'System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system
cannot find the file specified.</p>
</blockquote>
<p>I don't use [System.Web.Script.Services.ScriptService] so I don't understand why it tries to load System.Web.Extensions. </p>
<p>So I change in Visual Studio from .NET 2 to 3.5 but got another error:</p>
<blockquote>
<p>Could not load file or assembly
'WebServiceTest' or one of its
dependencies. An attempt was made to
load a program with an incorrect
format.</p>
</blockquote>
<p>How to fix this ?</p>
<p>Note: I'm not using any other assembly/lib I'm just learning webservice so it's very simple: I create a webservice Test.asmx with one method which uses one class Test.cs within same namespace WebServiceTest. This works locally.</p>
<p>Finally I have started from scratch again now it works, I think I have mismatched by renaming namespace, class etc.</p>
|
c# asp.net
|
[0, 9]
|
882,571
| 882,572
|
Form validation is not working
|
<p>Please see my demo <a href="http://neginph.com/mysite/test" rel="nofollow">here</a>. <code>required_valid()</code> doesn't work after I click on the "Click Me" button. There are two <code><form></code> elements after I click on "Click Me", I use of two form, how can I fix this problem?</p>
<pre><code>....
$('.submit').live('submit', function() {
var passed = true;
passed = autocomplet_valid() && passed;
passed = ticket_check() && passed;
passed = required_selectbox() && passed;
passed = required_valid() && passed;
if (!passed) {
$('#loadingDiv, #overlay').hide();
return false;
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
874,434
| 874,435
|
confirm box using javascript
|
<p>how to get confirmation before a export button is cliked.if yes then then export function has to be done if no it should not be done</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,684,278
| 1,684,279
|
jquery: post input values to PHP without serializing
|
<p>Trying to do very simple thing.</p>
<p>Have too many of these fields:</p>
<pre><code><input name="itempriceqty0" /><input name="itemprice0" /><br />
<input name="itempriceqty1" /><input name="itemprice1" /><br />
<input name="itempriceqty2" /><input name="itemprice2" /><br />
</code></pre>
<p>etc...</p>
<p>Goal is to get their values in one PHP string of this format: itempriceqty0=itemprice0, itempriceqty1=itemprice1,itempriceqty2=itemprice3,etc...</p>
<p>Serializing with jquery gives a url formatted string, which I need to split many times with PHP to get rid of input names and other &= chars.</p>
<pre><code>$.post('test.php', {
itemprice: $('#itempricefieldswrapper :input').serialize() }, ...
);
</code></pre>
<p>What is the easiest way to handle it with jquery?</p>
<p>P.S. Googled everywhere. Need help. Thanks.</p>
|
php jquery
|
[2, 5]
|
3,000,158
| 3,000,159
|
my jQuery script is not working with images, but working with all other elements
|
<p>I have created a jQuery script to drag elements over the document. I done the script and is working perfectly. but when I add an image the script fails. Why I cant drag an image over my document, I can drag other elements such as div, span etc . I am not interested to use jQuery UI for this purpose</p>
<p>my code follows</p>
<pre><code><script language="javascript" src="jquery-1.4.2.min.js"></script>
<script language="javascript">
var x1 = y1 = 0;
var drag = false;
$(document).ready(function(e){
$('#dv').mousedown(function(e){
x1 = e.pageX - parseInt($('#dv').css('left'));
y1 = e.pageY - parseInt($('#dv').css('top'));
drag = true;
})
$(document).mouseup(function(e){ drag = false; })
$(document).mousemove(function(e){
if(!drag) return
$('#dv').css('left',eval(e.pageX - x1)+'px')
$('#dv').css('top',eval(e.pageY - y1)+'px')
})
});
</script>
</code></pre>
<p>please check this <a href="http://olario.com/jquery/first.php" rel="nofollow">olario.com/jquery/first.php</a> ( a normal div with text) working perfectly </p>
<p>second <a href="http://olario.com/jquery/second.php" rel="nofollow">olario.com/jquery/second.php</a>, that doesn't work with image </p>
<p>I spent two weeks to fix this issue, hope this forum will help me</p>
<p>Thanks a lot in advance</p>
|
javascript jquery
|
[3, 5]
|
201,439
| 201,440
|
Preventing overlapping elements during animation
|
<p>I am creating an addition and subtraction game where a sum is randomly generated and displayed at the top of the container. Numbers then animate from bottom to top and the idea is to click on the correct one.</p>
<p>Numbers are given a random "x" position at the start and then animate to the top at the same speed.</p>
<p>The problem I am having is that when the program is running the elements can sometimes overlap because they are given a similar "x" position at the start.</p>
<p>I need to tell the program not to give the same "x" position until the element using it is far enough up the screen for them to not overlap.</p>
<p>The problem is at it's worst when the game first starts.</p>
<p>Here is the relevant code...</p>
<pre><code>var currentMoving = [];
function moveRandom(id) {
// Mark this one as animating
currentMoving.push(id);
var cPos = $('#container').offset();
var cHeight = $('#container').height();
var cWidth = $('#container').width();
var bWidth = $('#' + id).width();
var bHeight = $('#' + id).css('top', '395px').fadeIn(100).animate({
'top': '-55px'
}, AnimationSpeed,'linear').fadeOut();
maxWidth = cPos.left + cWidth - bWidth;
minWidth = cPos.left;
newWidth = randomFromTo(minWidth, maxWidth);
$('#' + id).css({
left: newWidth
}).fadeIn(100, function () {
setTimeout(function () {
$('#' + id).fadeOut(10);
// Mark this as no longer animating
var ix = $.inArray(id, currentMoving);
if (ix !== -1) {
currentMoving.splice(ix, 1);
}
window.cont++;
}, 100);
});
}
</code></pre>
<p>Here is a fiddle - <a href="http://jsfiddle.net/pUwKb/68/">http://jsfiddle.net/pUwKb/68/</a></p>
|
javascript jquery
|
[3, 5]
|
3,272,596
| 3,272,597
|
jquery function doesn't work after typing in textbox
|
<pre><code> $('.quote').live('click', function() {
var quote = "test";
$("#msg").append(quote).scrollTop($('#msg')[0].scrollHeight).focus();
});
</code></pre>
<p>This function just copies "test" to the textbox. Since it will be a multi-quote function I used the append() function. It works fine. Even when I focus on the textbox.</p>
<p>BUT when I type any characters in the textbox or break the line it no longer works. Any ideas?</p>
<p>msg - textbox</p>
<p>focus(); isn't also working for some reason.</p>
|
javascript jquery
|
[3, 5]
|
2,689,460
| 2,689,461
|
JQuery frontend with Java and C# backends: design choices
|
<p>I have to build a multibrowser web app which should be able to be installed in both Windows and Linux servers.</p>
<p>I've thought of using a single client-side frontend built with JQuery, and two different backends, built with java and c# respectively. The client then would use ajax calls with json to communicate with MVC frameworks on the server (ASP.net MVC for the C# version and Struts for the java one).</p>
<p>Is it wise? Is it viable? What other choices do I have?</p>
|
c# java jquery
|
[0, 1, 5]
|
1,835,588
| 1,835,589
|
How to get the values from a text box
|
<p>My web page looks like this</p>
<pre><code>name(textbox1)
email(textbox2)
age(textbox3)
phoneno(textbox4)
submit(button) showfile(hyperlink)
</code></pre>
<p>How can I get the values of textboxes saved in "showfile" web page after <code>onclick</code> in the submit button? Can anyone help me?</p>
|
c# asp.net
|
[0, 9]
|
1,051,954
| 1,051,955
|
how can i Pass element values 'val[]' from parent window to child layer window element 'sel_value' for each corresponding click?
|
<p>her this DIV is the new layer window with one form.
showModal('modal') is a simple java script to hide/show new layer window</p>
<pre><code><div id="modal" style="border:3px solid black; background-color:#9999ff; padding:25px; font-size:150%; text-align:center; display:none;">
This is a hidden layer(only show after click)
<form name="frm" method=post action="">
Your name<input type="text" id="sel_value" name="sel_value" size=12 value=test>
<input type=submit value='Submit' >
</form>
</div>
</code></pre>
<p>this is the parent window</p>
<pre><code><input type="text" name="va[]" id="va[]" size=12 value="2"><a href="#" onClick="Popup.showModal('modal');return false;">link</a>
<input type="text" name="va[]" id="va[]" size=12 value="3"><a href="#" onClick="Popup.showModal('modal');return false;">link</a>
<input type="text" name="va[]" id="va[]" size=12 value="4"><a href="#" onClick="Popup.showModal('modal');return false;">link</a>
<input type="text" name="va[]" id="va[]" size=12 value="5"><a href="#" onClick="Popup.showModal('modal');return false;">link</a>
<input type="text" name="va[]" id="va[]" size=12 value="6"><a href="#" onClick="Popup.showModal('modal');return false;">link</a>
</code></pre>
<p>.
.
.</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,896,589
| 4,896,590
|
Is there a way to check how many screens are plugged into one computer (JS/PHP)?
|
<p>I don't have code for this question. However I've been searching around trying to find a way to detect how many screens a visitor currently has. What I am trying to achieve is a JS or jQuery slideshow between 2 monitors. I am thinking the best way to go about doing this is to first find out how many screens, and the screens size.</p>
<p>I also thought of making a huge div that would spread across 2 screens but that won't work, I think.</p>
<p>Sorry I am not providing any code, but I was looking around and couldn't find anything on that on the net.</p>
<p>Thanks in advance.</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,473,442
| 3,473,443
|
jquery redirect issues
|
<p>I am having problems in redirecting page with jquery. I have a variable <code>url</code> which contains <code>localhost/abc#123</code>. When i write <code>document.location.href = url;</code>, the page redirects to <code>localhost/abc</code> leaving <code>#123</code>. How to resolve this issue</p>
|
javascript jquery
|
[3, 5]
|
5,723,320
| 5,723,321
|
jQuery extension: why does it not work on all matching elements?
|
<p>I have an extension going like:</p>
<pre><code>$.fn.crazything = function() {
var self = $(this);
// do some crazy stuff
return self;
}
</code></pre>
<p>And when I call it like:</p>
<pre><code>$("div.crazydiv").crazything();
</code></pre>
<p>It works, but only on the first matching div. If I have more than one div on the page, I need to do:</p>
<pre><code>$("div.crazydiv").each(function(i) { $(this).crazything (); });
</code></pre>
<p>Why is this, and how can I rewrite my extension to work on multiple divs?</p>
|
javascript jquery
|
[3, 5]
|
3,063,978
| 3,063,979
|
$(this) in plugin options
|
<p>I'm new to writing jQuery plugins, and I'm confused as to how to let users use $(this) in their options. As a simple (and redundant) example, say I wanted to let a user append their selection's text to an element they supply in their options, like so:</p>
<pre><code>$(function() {
$('#stuff').appender({ 'placement' : this });
});
</code></pre>
<p>And the plugin code is:</p>
<pre><code>(function($) {
$.fn.appender = function(options) {
var opts = $.extend({}, $.fn.appender.defaults, options);
return this.each( function() {
var $el = $(this);
$(opts.placement).append( $el.text() );
});
};
$.fn.appender.defaults = {
'placement' : 'body',
}
})(jQuery);
</code></pre>
<p>If the user supplies 'body' or $('#wrapper') for 'placement' in the plugin options, of course it works as expected. But when using 'this' or '$(this)', it refers to the document itself rather than the element in the selection.</p>
<p>This is a pretty crappy example of a plugin, but the thing I would like to learn is how to allow plugin users to use $(this) or its attributes as values for options.</p>
<p>Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
5,127,461
| 5,127,462
|
Changing color of TextView
|
<p>I want to change the color of a <code>TextView</code> inside my <code>Activity</code>s <code>ListView</code> by java code. <code>ListView</code> contains multiple rows which are fed by a <code>MatrixCursor</code> and an <code>ArrayAdapter</code>. The color of the <code>TextView</code> should be green or white which should be determined by an <code>if</code> clause. How can I accomplish this?</p>
<pre><code> citem = NameManager.getciList();
NameManager.WriteName(citem);
MatrixCursor cursor;
cursor = NameManager.getnameList();
startManagingCursor(cursor);
if (cursor.getString(9).equals("yes")){
//TODO set color of R.id.name color here
}
String[] from = { "name", "info", "status", "path", "folder", BaseColumns._ID };
int[] to = { R.id.name, R.id.info, R.id.status, R.id.path };
final SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.row, cursor, from, to);
setListAdapter(adapter);
</code></pre>
|
java android
|
[1, 4]
|
4,900,852
| 4,900,853
|
How to dynamically load jQuery in a javascript function, call another function, and return that function's return value?
|
<p>I have a function which uses jQuery. I need to dynamically inject jQuery with JavaScript and have that function return that function’s return value. I would like to do something like</p>
<pre><code>(function(){
var jQueryLoaded = false;
var returnValue;
if (!window.jQuery) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'http://code.jquery.com/jquery-1.7.1.min.js';
script.onreadystatechange= function () {
if (this.readyState == 'loaded' || this.readyState == 'complete')
onJQueryLoaded();
};
script.onload = onJQueryLoaded;
document.getElementsByTagName('head')[0].appendChild(script);
}
else {
returnValue = myJQueryFunction();
if (typeof(returnValue) == 'undefined')
returnValue = true;
return returnValue;
}
function myJQueryFunction() {
// do something
}
function onJQueryLoaded() {
if (jQueryLoaded)
return;
jQueryLoaded = true;
var $ = jQuery;
returnValue = myJQueryFunction();
if (typeof(returnValue) == 'undefined')
returnValue = true;
}
while (typeof(returnValue) == 'undefined'); // wait until onJQueryLoaded returns
return returnValue;
})();
</code></pre>
<p>but <code>onJQueryLoaded</code> does not get called during the <code>while</code> loop.</p>
<p>Is there any way to have my base function wait until <code>onJQueryLoaded</code> gets called before returning?</p>
|
javascript jquery
|
[3, 5]
|
1,067,573
| 1,067,574
|
Open PDF in new browser full window
|
<p>How to open PDF document in new browser window? Window should be full and withouth menu.
Just pdf dicument in clean full window with native js or jQuery.</p>
<p>Thank You</p>
|
javascript jquery
|
[3, 5]
|
221,599
| 221,600
|
Reload div on parent page from iframe
|
<p>So, I'm making a small application, but I ran into a problem. Basically, I have a page which consists of header and an iframe. Application itself runs in the iframe, while header stays the same, but here's the thing. Header displays some data from database which is updated from the application. In order for data in the header to stay up to date, I need to refresh it on button click from iframe. So my question is - is it possible? Is it possible to reload a div element in parent page from iframe?
All I have fro now is this jQuery:</p>
<pre><code>var auto_refresh = setInterval(function()
$('#stats').load('reload.php');
}, 5000);
</code></pre>
<p>Which reloads my div every 5 seconds, but I don't know if it's a good idea to reload a div automatically after a period of time. Well, I hope you guys understand my problem. :)</p>
|
javascript jquery
|
[3, 5]
|
3,037,704
| 3,037,705
|
java script, jquery
|
<pre><code> <body>
<button> Change </button>
<div id="mydiv" style="margin:25% 0% 0% 37%">
<a href="#" onclick="alert('buhaha');" style="width:50px; height:50px; background-color:#99CC99; padding:10px; margin:5px">One</a>
<a href="#" onclick="alert('buhaha');" style="width:50px; height:50px; background-color: #FF9900;padding:10px; margin:5px"> Two</a>
<a href="#" onclick="alert('buhaha');" style="width:50px; height:50px; background-color: #FFCC00;padding:10px; margin:5px"> Three</a>
</div></body>
</code></pre>
<p>when i click my " change" button, onclick event must disable. after i click again my button onclick click must enable . how to do this two actions from one button .. if u can help me pls send jquery code ... </p>
<p>after disable onclick="alert()", i need to show this list USING Body Right Click
(when enable onclick="alert()" list should hide)</p>
<pre><code><ul id="companySelect" style="display:none">
<li> <a href="#"> DEN </a> </li>
<li> <a href="#"> SouthDelhi </a> </li>
<li> <a href="#"> Cham</a> </li>
<li> <a href="#"> GKS</a> </li>
</ul>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,265,303
| 4,265,304
|
Checking if array contains a number (Issue with 0)
|
<p>I have an array of numbers. The array may contain a zero.</p>
<p>How can I check if the array contains a number or not? I am currently doing that:</p>
<p><code>if (Number(arr. value(pos)) != false)</code></p>
<p>This however, considers <code>0</code> as false too. So if a 0 is in the array, it will consider it as if the array was empty.</p>
<p>How can I overcome this?</p>
|
javascript jquery
|
[3, 5]
|
493,594
| 493,595
|
How do I focus on a javascript radio button or any other items on specific jquery tabs?
|
<p>I have javascript validation that validates items such as textboxes, radio buttons etc. How do I use focus() on the text box or other item located in a specific tab governed by tags? </p>
<p>Sample of the javascript code:</p>
<pre><code>if (theForm.radbtnProg.checked && theForm.ddlProg.selectedIndex == 0) {
alert("Please select Institution Name from the list.");
theForm.ddlProg.focus();
}
</code></pre>
<p>Above example theForm.radbtnProg.checked and theForm.ddlProg.selectedIndex are the radio button and drop down list that I want to validate. How do I refer to them according to specific tabs? </p>
<pre><code>$('#tabs').tabs(theForm.radbtnProg.checked)?
</code></pre>
<p><strong>Edited:</strong>
Answered by @nnnnnn and I modified the code:</p>
<pre><code>if (theForm.radProg.checked && theForm.ddlProg.selectedIndex == 0) {
alert("Please select Program Name from the list.");
$('#tabs').tabs("select", 0);
$("#ddlProg").focus();
return false;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,807,811
| 3,807,812
|
Can we have the OR operator in the string variable in asp.net?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2912476/using-c-sharp-to-check-if-string-contains-a-string-in-string-array">Using C# to check if string contains a string in string array</a> </p>
</blockquote>
<p>Can we have the multiple strings in a single string variable using logical OR operator(|) in asp.net ?</p>
<pre><code>string _Text = "";
string _str = "abc" | "xyz" | "123";
if(_Text.Contains(_str))
{
foo("_str");
}
</code></pre>
<p>Thanks,</p>
|
c# asp.net
|
[0, 9]
|
4,561,550
| 4,561,551
|
With jQuery, can I make it so the submit button won't "work" unless the required fields are filled out
|
<p>I want the user to be able to click submit, but if the correct fields aren't filled out it will not go through and errors will appear. Is this possible? I know how to do the errors part, but the blocking submit part is annoying.</p>
|
php jquery
|
[2, 5]
|
3,023,331
| 3,023,332
|
auto-refreshing div with jquery
|
<p>how exactly do you make an auto-refreshing div with javascript (specifically, jQuery) ?
I knew about the setTimeout method, but is it really a good practice ? Is there a better method ?</p>
<pre><code>function update() {
$.get("response.php", function(data) {
$("#some_div").html(data);
});
window.setTimeout("update();", 10000);
}
</code></pre>
<p>Thanks before.</p>
|
javascript jquery
|
[3, 5]
|
739,110
| 739,111
|
Changing parent page's title from user control
|
<p>Am a newbie to asp.net
I've an asp.net page which uses a user control.
On Page_Load event of this control,I want to change the title of parent aspx page.
Need help on this please.</p>
|
c# asp.net
|
[0, 9]
|
5,959,447
| 5,959,448
|
trigger jquery with php?
|
<p>my php code will check after a condition. if the condition is true i want it to trigger a jquery code that displays a box.</p>
<p>i wonder how i can trigger a jquery code with php?</p>
|
php jquery
|
[2, 5]
|
3,496,822
| 3,496,823
|
"click" event handler not firing
|
<p>I have a php page that prints out a div having multiple anchor tags with different IDs. Here is a sample code:</p>
<pre><code>echo "<div id=\"pageLinks\">";
echo " <a href=\"javascript:;\" id=\"1\"><<</a> ";
echo "another link...."
echo "</div">;
</code></pre>
<p>The javascript code that should listen for the <code>click</code> event is the following:</p>
<pre><code>$(document).ready(function(){
$("div#pageLinks a").click(function(){
alert("clicked");
});
});
</code></pre>
<p>but it's apparently not working (I cannot see the "clicked" alert).
Can someone help me?</p>
|
javascript jquery
|
[3, 5]
|
5,864,153
| 5,864,154
|
Get a process response
|
<p>I am looking for a way to get a response in a form of a javascript alert after a form has been submitted using a php script. I guess ajax should do this but Im not an Ajax guy yet. A simple sample code would help a lot. Thanks for reading</p>
|
php javascript
|
[2, 3]
|
4,613,567
| 4,613,568
|
problem in showing listview in horizontal layout?
|
<p>I am trying to show a list view with calendar view in a linear layout. when i am using vertical layout then list view appears but in horizontal layout the same listview disaappears. I solved the problem using relative layout, but can i do this using linear layout.here is my xml...</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.exina.android.calendar.CalendarView
android:layout_height="wrap_content"
android:id="@+id/calendar" android:layout_width="wrap_content">
</com.exina.android.calendar.CalendarView>
<ListView android:layout_height="fill_parent" android:id="@+id/android:list"
android:layout_weight="1" android:scrollingCache="false"
android:layout_width="fill_parent" android:drawSelectorOnTop="false"
android:dividerHeight="4.0sp"></ListView>
</LinearLayout>
</ScrollView>
</code></pre>
|
java android
|
[1, 4]
|
4,561,411
| 4,561,412
|
No data retrieved while calling a stored procedure
|
<p>I am trying to call a stored procedure from VC++.</p>
<p>Here is what the stored procedure looks like:</p>
<pre><code>public static void SqlStoredProcedure2(string name, out byte[] backup)
{
using (SqlConnection conn = new SqlConnection("context connection=true"))
{
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
conn.Open();
cmd.CommandText = "SELECT EmployeePhoto FROM [dbo].[DimEmployee] where FirstName like '%@name%'";
SqlDataReader reader = null;
reader = cmd.ExecuteReader();
backup = null;
while (reader.Read())
{
backup = (byte[])reader["EmployeePhoto"];
}
conn.Close();
}
}
</code></pre>
<p>And the c++ code looks like:</p>
<pre><code>RETCODE retcode = SQLAllocHandle(SQL_HANDLE_STMT,hdbc,&hstmt);
retcode = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 5, 0, "Alan", 0, &cbParm1);
unsigned char ptr[8000] = "";
cbParm2 = 8000;
retcode = SQLBindParameter(hstmt, 2, SQL_PARAM_OUTPUT, SQL_C_BINARY, SQL_VARBINARY, 0, 0, ptr, 0, &cbParm2);
retcode = SQLExecDirectA(hstmt, (UCHAR*)"{call SqlStoredProcedure2(?, ?)}", SQL_NTS);
</code></pre>
<p>There is no error when I check returned code but nothing comes in <code>ptr</code>? What is wrong here?</p>
|
c# c++
|
[0, 6]
|
5,951,251
| 5,951,252
|
How to remove div element with jQuery
|
<p>when I want to remove div element, I have the following code:</p>
<pre><code><div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
<div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
<div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
<div class='text-field'>
<input type='text' />
<input type='button' class='remove-btn' />
</div>
</code></pre>
<p>when i click remove-btn, its parent div text-field should be removed. i have this code but it doesnt work.</p>
<pre><code>$(".remove-btn").click(function(){
$(this).parent().remove();
});
</code></pre>
<p>thanks for any help. :)</p>
|
javascript jquery
|
[3, 5]
|
4,899,206
| 4,899,207
|
how to retain a button1 clicks action with a sleep against another button2 click action without sleep
|
<p>My problem is I have two labels and two buttons in two different update panel in ASP.Net. The update panels contains two buttons. When buttons are clicked it will update the corresponding label text. The issue is, suppose I gave a delay of 5 seconds in my button1_click() method, when I click button1 and button2 immediately, label2 is gettin updated, whereas label1 is not getting updated.</p>
<p>Can you suggest where I'm going wrong?</p>
<pre><code>protected void Button1_Click2(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(5000);
Label1.Text = "Hello";
}
protected void Button2_Click1(object sender, EventArgs e)
{
Label2.Text = "World";
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,305,828
| 2,305,829
|
How to set popup on page load first time only?
|
<p>How to set a popup window that open when first time the page load? i m using this code for my popup how to set session for this popup? is there any way to use ip as session?</p>
<pre><code> <script>
!window.jQuery && document.write('<script src="fancybox/jquery-1.4.3.min.js"><\/script>');
</script>
<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("a#example1").fancybox();
$("a#example1").trigger('click');
});
</script>
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
</head>
<body>
<a id="example1" href="images/pic.jpg"></a>
</body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,649,079
| 2,649,080
|
Message Alert Tone
|
<p>I am working on an App that gets sms alerts and would like to control volume of alert tone based on device volume. How do I adjust alert notification sound in alignment with device master volume. Following code doesn't change volume of alert in my app based on device volume. Thank you.</p>
<pre><code> volume = audioMan.getStreamVolume(AudioManager.STREAM_RING);
mPlayer.setVolume(volume, volume);
</code></pre>
|
java android
|
[1, 4]
|
1,475,354
| 1,475,355
|
How to remove invalid characters from a string?
|
<p>I have no idea how to remove invalid characters from a string in Java. I'm trying to remove all the characters that are not numbers, letters, or ( ) [ ] . How can I do this?</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
5,155,961
| 5,155,962
|
How do I get the first child of each of these rows?
|
<p>I have 2 rows, each with 2 text inputs. How do I go through each row w/ class "myRow" and, within each row, get the first child that has class "This"? I can get the first "This" class of row 1 but can't seem to get row 2.</p>
<p><a href="http://jsfiddle.net/qkPZm/" rel="nofollow">My fiddle</a></p>
<pre><code><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="http://code.jquery.com/jquery-1.8.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#btn').click(function(){
$(".myRow").each(function(){
var r = $(".This").eq(0).val();
alert(r);
});
});
});
</script>
</head>
<body>
<div class="myRow">
<input type="text" class="notThis" value="wrong!"/>
<input type="text" class="This" value="first one!"/>
<input type="text" class="This" value="almost!"/>
</div>
<br>
<br>
<div class="myRow">
<input type="text" class="notThis" value="wrong!"/>
<input type="text" class="This" value="second one"/>
<input type="text" class="This" value="almost!"/>
</div>
<button id="btn">Submit</button>
</body>
</html>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,184,833
| 3,184,834
|
Overriding instantiateItem(...) won't compile
|
<p>I am trying to use a PageAdapter. I found out that <code>public Object instantiateItem( View pager, int position )</code> has been deprecated. So I am trying up update but ran into a problem. The new definition changes the deceration to <code>public Object instantiateItem( ViewPager pager, int position )</code>, when I do this and push it to my device the app crashed. </p>
<p>Here is my logcat output.</p>
<blockquote>
<p>12-26 19:24:30.701: ERROR/AndroidRuntime(25431): FATAL EXCEPTION: main
java.lang.UnsupportedOperationException: Required method instantiateItem was not overridden
at android.support.v4.view.PagerAdapter.instantiateItem(PagerAdapter.java:175)
at android.support.v4.view.PagerAdapter.instantiateItem(PagerAdapter.java:110)
at android.support.v4.view.ViewPager.addNewItem(ViewPager.java:649)
at android.support.v4.view.ViewPager.populate(ViewPager.java:783)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1016)</p>
</blockquote>
<p>So I added <code>@Override</code> to the method call, but when I compile it ,using maven, I get the following output that corresponds to my method.</p>
<blockquote>
<p>Chronos/ChronosApp/src/com/kopysoft/chronos/view/ClockViewer.java:[67,4] error: method does not override or implement a method from a supertype</p>
</blockquote>
<p>I am at a lose as what to do. Any advice would be greatly appreciated!</p>
<p>The entire code can be found here: <a href="http://pastebin.com/da5Kqcmg" rel="nofollow">http://pastebin.com/da5Kqcmg</a></p>
|
java android
|
[1, 4]
|
3,571,121
| 3,571,122
|
How do I format a timestamp in Javascript to display it in graphs? UTC is fine
|
<p>Basically, I receive raw timestamps and I need to format them into HH:MM:SS format.</p>
|
javascript jquery
|
[3, 5]
|
3,326,140
| 3,326,141
|
Jquery parsing JSON response
|
<p>I have a jQuery function - this is the response that is it is getting</p>
<pre><code> {"d":"{\"res\":\"\\u003cdiv class=\\\"accordian_head\\\"\\u003e\\u003cdiv class=\\\"plus\\\"\\u003e\\u003c/div\\u00..........."NewTags\":\"\\........
</code></pre>
<p>when the response is just {"d":" response..." } I have no trouble reading it in jQuery with just msg.d - but here I have "res" : "text" nested in "d" , so how to I read res out of this response ? I tried </p>
<pre><code> success: function (msg) {
var obj = unescape(msg.d);
var res = unescape(obj.res);
var newtags = unescape(obj.NewTags);
</code></pre>
<p>Where the sample JSON I pasted is msg</p>
|
jquery asp.net
|
[5, 9]
|
4,099,227
| 4,099,228
|
Android Hashmap Failed in showing up inside the listView
|
<p>I am stuck in this hashmap problem when copying the key. (Android)</p>
<p>Initially I had a xml file similar to this</p>
<pre><code><many_people>
<people>
<id>1</id>
<name>Johnson</name>
<tel_num>12345678</tel_num>
</people>
.
.
.
</many_people>
</code></pre>
<p>so i created arraylist with hashmap to store the whole xml</p>
<pre><code>for (int i = 0; i < nl.getLength(); i++) {
map = new HashMap<String, String>();
Element e = (Element) nl.item(i);
map.put(KEY_ID, parser.getValue(e, KEY_ID));
map.put(KEY_NAME, parser.getValue(e, KEY_NAME));
map.put(KEY_TELNUM, parser.getValue(e, KEY_TELNUM));
// adding HashList to ArrayList
peopleList.add(map);
}
</code></pre>
<p>I used onItemClickListener to capture the input from AutoCompleteTextView so that I can compare the input with the xml. The peopleList will later be used in listView.</p>
<p>For example:
input - Johnson
Compare with , if found then my list view will show Johnson's name with contact together. The problem is here, if I have 2 Johnson, the listView only read my first johnson in the xml.
I do not know how to compare the input to the xml.
Below is my code:</p>
<pre><code>for (HashMap<String, String> map : peopleList) {
if (input.equals(map.get(KEY_NAME))) {
// At here I created another hashmap with copying the value
map2.put(KEY_ID, map.get(KEY_ID));
map2.put(KEY_NAME, map.get(KEY_NAME));
map2.put(KEY_NAME, map.get(KEY_TELNUM));
peopleList2.add(map2);
}
}
</code></pre>
<p>I successfully to show the first data in my listView but second and third data (same name as Johnson) failed. I not sure this is the way to do or not.</p>
|
java android
|
[1, 4]
|
232,821
| 232,822
|
scraping website with javascript cookie with c#
|
<p>I want to scrape some things from the following site: <a href="http://www.conrad.nl/modelspoor" rel="nofollow">http://www.conrad.nl/modelspoor</a>.</p>
<p>This is my function:</p>
<pre><code>public string SreenScrape(string urlBase, string urlPath)
{
CookieContainer cookieContainer = new CookieContainer();
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(urlBase + urlPath);
httpWebRequest.CookieContainer = cookieContainer;
httpWebRequest.UserAgent = "Mozilla/6.0 (Windows; U; Windows NT 7.0; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.9 (.NET CLR 3.5.30729)";
WebResponse webResponse = httpWebRequest.GetResponse();
string result = new System.IO.StreamReader(webResponse.GetResponseStream(), Encoding.Default).ReadToEnd();
webResponse.Close();
if (result.Contains("<frame src="))
{
Regex metaregex = new Regex("http:[a-z:/._0-9!?=A-Z&]*",RegexOptions.Multiline);
result = result.Replace("\r\n", "");
Match m = metaregex.Match(result);
string key = m.Groups[0].Value;
foreach (Match match in metaregex.Matches(result))
{
HttpWebRequest redirectHttpWebRequest = (HttpWebRequest)WebRequest.Create(key);
redirectHttpWebRequest.CookieContainer = cookieContainer;
webResponse = redirectHttpWebRequest.GetResponse();
string redirectResponse = new System.IO.StreamReader(webResponse.GetResponseStream(), Encoding.Default).ReadToEnd();
webResponse.Close();
return redirectResponse;
}
}
return result;
}
</code></pre>
<p>But when i do this i get a string with an error from the website that it use javascript.</p>
<p>Does anybody know how to fix this?</p>
|
c# javascript
|
[0, 3]
|
4,587,990
| 4,587,991
|
jQuery: On document load check if checkbox is selected and do function
|
<p>I have few <code><li></code>'s with a checkbox on each <code><li></code> which the value of it is saved into a database. On document load, the <code><li></code>'s that have the checkbox selected, I want to add a class <strong>'.done'</strong>.</p>
<p>I tried this:</p>
<pre><code>if (currentTODO.find('.status').is(":checked")) {
currentTODO.find('.text').addClass("done");
alert('Test.');
}
</code></pre>
<p>but it works only if it used under click function, mousemove etc but not on document load. Also, If I have that piece of code under on Document load, nothing else works. </p>
<p>I hope someone can help me out.</p>
<p>Thanks alot</p>
|
javascript jquery
|
[3, 5]
|
6,010,345
| 6,010,346
|
How do I slide down one tab and close any others that are open (JQuery/JavaScript)
|
<p>Here is my code:</p>
<pre><code><script>
$(document).ready(function () {
$('#t1').click(function() {
$('#p1').slideToggle('slow');
$("#pm1, #pm1h").toggle(0);
removeContainer();
$("#load1").load('file', showPlayer);
});
$('#t2').click(function() {
$('#p2').slideToggle('slow');
$("#pm2, #pm2h").toggle(0); removeContainer();
$("#load2").load('file', showPlayer);
});
$('#t3').click(function() {
$('#p3').slideToggle('slow');
$("#pm3, #pm3h").toggle(0); removeContainer();
$("#load3").load('file', showPlayer);
});
$('#t4').click(function() {
$('#p4').slideToggle('slow');
$("#pm4, #pm4h").toggle(0); removeContainer();
$("#load4").load('file', showPlayer);
});
});
</script>
</code></pre>
<p>Alright so what I want to do is when someone clicks on t1,t2,t3 or t4, all the other tabs that are in the slide down position will slide up (For example if t3 and t4 are down, once I click on t1 the t3 and t4 will slide up and then the t1 will slide down). This will make it so that only one tab can be open at a time.</p>
<p>I also need the proper toggle to correspond with the position of the tab. By default all tabs are hidden and all have a plus sign but when you click on any tab it will expand and have a negative sign. I this to stay true.</p>
<p>Can anyone help or need more clarification?</p>
|
javascript jquery
|
[3, 5]
|
5,572,831
| 5,572,832
|
Carousel Jquery/Javascript
|
<p>I have been using <a href="http://www.bkosborne.com/jquery-waterwheel-carousel/options" rel="nofollow">this</a> carousel to load images dynamically in my homework project of ASP .NET.
In the documentation of this carousel , there is an option called "activeClassName" which is used to get the center item (if I have interpreted it correctly) but still I am unable to get this class in my ASPX file where I have written my javascript code since I am new to Jquery as well as javascript. I have searched through net and still I could get as far as making an object of a class like this:</p>
<pre><code>a = new classA;
</code></pre>
<p>Can somebody give me any example of how to use this option please?</p>
|
javascript jquery
|
[3, 5]
|
5,770,298
| 5,770,299
|
Screen scape altered info from another website
|
<p>I'm trying if it is possible to get the result of another site after clicking some items and altering some data on that site.</p>
<p>For example, you have a site which asks you first for some input and then gives a result. This result i want to have and save it to a database and display it on my own site. Is there any possibility for this?</p>
<p>I searched for hours and i can only find static examples.</p>
<p>Any help or link would be much appriciated.</p>
|
c# asp.net
|
[0, 9]
|
846,059
| 846,060
|
Why jquery trigger doesn't work?
|
<p>This part should trigger click on image when #X is present in browser url... but it never happens....</p>
<pre><code>//
var hash = window.location.hash.slice(1);
if (hash) {
$("#barely_slide img[data-imgnum='"+ hash +"']").trigger("click");
} else {
move_slide();
}
</code></pre>
<p>Actuall part that needs to be triggered:</p>
<pre><code>//
$("#barely_slide article img").on("click", function(){
if ($(this).attr("class") == "focus") {return false;}
//
$("#barely_slide article img").removeClass("previous");
$("#barely_slide article .focus").addClass("previous");
var image = $(this);
$(".previous").animate({"height":300,"margin-top":0}, "fast");
$("#barely_slide article .focus").removeClass("focus");
image.addClass("focus");
//
window.location.hash = image.attr("data-imgnum");
//
move_slide();
return false;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,642,649
| 3,642,650
|
Different uses of $(document).ready
|
<p>What is the difference/advantages of using the $(docu...) with your variables and functions defined inside, from using it with a function and then calling it inside the $(docu...)</p>
<pre><code>$(document).ready(function (){
initialize();
});
function initialize(){
hello
}
</code></pre>
<p>over using this:</p>
<pre><code>$(document).ready(function (){
hello
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,238,114
| 5,238,115
|
How might you grab information from a page that only populates AFTER that page executes javascript? (C#)
|
<p>Hey there. I have a CE program which needs to get information from a website. I can't simply grab the source code, because the information is only displayed after the page's javascript is executed. Is there a way to view a page's information/source/links after javascript has fully load the information? Thanks! :)</p>
|
c# javascript
|
[0, 3]
|
2,728,239
| 2,728,240
|
hard to read javascript code - single line logic to "demystify"
|
<p>Can someone demystify this line for me? <br />
It's javascript and it works fine, I just don't understand the exact logic behind the code. Maybe it would help to split the code into several lines or write it in c# or delphi for "comparison".<br /><br />
(I got it from here: <a href="http://www.learningjquery.com/2009/02/slide-elements-in-different-directions" rel="nofollow">http://www.learningjquery.com/2009/02/slide-elements-in-different-directions</a>)
<br /><br />
many thanks!</p>
<pre><code>$('#inlay-container').animate(
{
left: parseInt($('#container').css('left'),10) == 0 ? +$('#container').outerWidth() : 0
}...
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,346,669
| 4,346,670
|
Value of this.id for same element is different between browsers
|
<p>I'm using Raphael.js to handle an SVG map. It does great in all desktop browsers. I have a click function to fire off a few things when a given area on the map is clicked. It relies on grabbing the (this.id) of the clicked object and spitting back some results. </p>
<p>Problem is that it works on desktop browsers Safari, Opera, IE9, and Chrome. I tried opening same thing on a mobile android (4.0.3) browser and the value for (this.id) is not the same so the region I clicked on is not the one I get results for. The this.id of the object on the desktop is NOT equal to the this.id of the same object on the mobile browser.</p>
<p>I've verified the values by using alerts. What gives? How can I work around this or find the id of the clicked item in a more foolproof way?</p>
<p>Here's the snipped of code that matters:</p>
<pre><code>drawnl[i].click(function(){//click function
if(dcount == mcount){
idx = (highestid-1-this.id); // this takes the total number of markets generated up to this point, subtracts the # of markets for this current map
}else if(gens > 2){
idx = (mcount-1)-((dcount + (gens-2))-(this.id)); // this takes the total number of markets generated up to this point, subtracts the # of markets for this current
}else{
idx = mcount-1-(dcount-this.id);
}
}
</code></pre>
<p>I've confirmed that all other values are consistent except for when I grab this.id. I'm using the built-in handler from Raphael.js (<a href="http://raphaeljs.com/reference.html#Element.click" rel="nofollow">http://raphaeljs.com/reference.html#Element.click</a>)</p>
|
javascript jquery
|
[3, 5]
|
549,314
| 549,315
|
query a database on onblur textbox event asp.net C#
|
<p>I want to query database on onblur event of a textbox.
Simple I want is that when I enter the ID in first textbox and after onblur event occurs, the name of the respective ID from database is shown in another textbox or label.</p>
|
c# asp.net
|
[0, 9]
|
4,219,345
| 4,219,346
|
Javascript: Interpolating variables inside strings
|
<p>I have the following jquery code which loads the <code>#content</code> div from <em>another</em> page, into the <code>#result</code> div on the <em>current</em> page:</p>
<pre><code>$('a').click(function(event){
$('#result').load('abother_page.html #content');
});
</code></pre>
<p>As you can see, I'm hard-coding the name of the requested file, along with the specific div I want to display, into the string that is sent with the load method.</p>
<p>I'm trying to make this dynamic, but my code is missing something:</p>
<pre><code>// get the href of the link that was clicked
var href=$(this).attr('href');
// pass the href with the load method
$('#result').load('href #content');
</code></pre>
<p>Obviously this doesn't work because the href variable that i've created is not interpolated in the string. How can I do that? </p>
<p>I tried the following, all without success:</p>
<pre><code>// Ruby-style:
$('#result').load('#{href} #content');
// Concatenating-style
$('#result').load(href + '#content');
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,015,750
| 2,015,751
|
How do I add an element to an existing property map in JavaScript?
|
<p>I'm using this piece of code to create a property map that I will pass to jQuery:</p>
<pre><code>var myMap = {"one": 1, "two": 2, "three": 3};
</code></pre>
<p>However, this isn't complete. I want to iterate through a <code>for</code> loop and create a complex property map, that looks like this:</p>
<pre><code>[...
{
sleep: 2,
fade: 1
}, [
{ src: 'sand-castle.jpeg' },
{ src: 'sunflower.jpeg' },
{ src: 'flip-flops.jpeg' },
{ src: 'rubber-ring.jpeg' }
]
</code></pre>
<p>I'm iterating through the list of files in the directory. How do I do this?</p>
|
javascript jquery
|
[3, 5]
|
4,957,716
| 4,957,717
|
Media player not playing any sound
|
<p>I am developing a simple calculator for a device, there I am using mediaplayer to play some sound when a button is pressed using</p>
<pre><code>media=MediaPlayer.create(this, R.raw.wipe);
media.start();
</code></pre>
<p>and in a reset button i am releasing it with</p>
<pre><code>media.release();
</code></pre>
<p>but after some button clicks it stops playing any sound. How can I fix this problem?</p>
|
java android
|
[1, 4]
|
1,341,270
| 1,341,271
|
how to call a variable in code behind to aspx page
|
<p>i know i have seen this but cant recall the correct way of doing it... basically i have a string variable called "string clients" in my .cs file.. but i wasn't to be able to pass it to my aspx page something like</p>
<pre><code><%=clients%>
</code></pre>
<p>please correct me, i do not recall or not sure how to do this. (new to c#) and when i googled it.. it was not clear.. or not many of these out there.. searched as</p>
<p>"asp.net c# <code><%= %></code> not consistent results.. maybe because i do not know how to call these..</p>
|
c# asp.net
|
[0, 9]
|
658,697
| 658,698
|
Use C or C++ libraries as PHP extension
|
<p>Minutes back I read something like "it should be possible to link the C++ library as a php extension". </p>
<ul>
<li>Is it really possible? </li>
<li>if yes, which is better, newly written extension or a linked library (efforts and performance wise). </li>
<li>Also can you guys point me to some How-to or related doc.</li>
</ul>
|
php c++
|
[2, 6]
|
671,308
| 671,309
|
How to uniquely identify the jQuery function on checkBox change click?
|
<p>In my program i display one question at a time and on next click it is post and get the second question. But i apply some logic for check box list for each question in Jquery, and i call it like this</p>
<pre><code> $(document).ready(function () {
$("input:checkbox").change(function () {
var txt = $(this).parent().children("label").text();
if ($(this).is(':checked')) {
if ($(this).parent().children("label").text() == 'Not Sure') {
$("input:checkbox").attr('checked', false);
$("input:checkbox").attr('disabled', true);
$(this).attr('checked', true);
$(this).attr('disabled', false);
}
}
else {
if ($(this).parent().children("label").text() == 'Not Sure') {
$("input:checkbox").attr('checked', true);
$("input:checkbox").attr('disabled', false);
$(this).attr('checked', false);
}
}
});
$("input:checkbox").change(function () {
var txt = $(this).parent().children("label").text();
if ($(this).is(':checked')) {
if (txt == 'Not Sure' || txt == 'We Are Large Business' || txt == 'None of these apply') {
$("input:checkbox").attr('checked', false);
$("input:checkbox").attr('disabled', true);
$(this).attr('checked', true);
$(this).attr('disabled', false);
}
}
else {
if (txt == 'Not Sure' || txt == 'We Are Large Business' || txt == 'None of these apply') {
$("input:checkbox").attr('checked', false);
$("input:checkbox").attr('disabled', false);
$(this).attr('checked', false);
}
}
});
});
</code></pre>
<p>So the problem is that, for 1 question the logic is different from the other check box list question and i need to call appropriate function as you above see in document.ready has got two function. So how for some particular question i should fix the call to function?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
5,738,569
| 5,738,570
|
Make onFling() work on a text view with scrollingMovemetMethod
|
<p>I have an app on which I have implemented <code>textView.setMovementMethod(new ScrollingMovementMethod());</code> But the <code>onFling()</code> is not working. Before implementing this scrolling, it was working. Can someone point me in the right direction?</p>
|
java android
|
[1, 4]
|
1,487,438
| 1,487,439
|
Remove all the 'tr' if the any of the 'td' does not have given text
|
<p>I have a table with many rows . first row is the header.</p>
<p>i want to delete all the rows if any of its td does not have given text.</p>
<pre><code><tr>
<td id="1" class="links">Madia</td>
<td id="" class="edit_client" >Press</td>
</tr>
<tr>
<td id="2" class="td_link" >Nagara </td>
<td class="td_link" id="11" class="edit_client">KR Pura</td>
</tr>
</code></pre>
<p>I want to delete all the tr , if any of its td does not have given text say "me hussy".</p>
<pre><code> $('tr').each(function () {
});
</code></pre>
<p>i do not want delete first row because its header. so function should check from second row onwards. </p>
|
javascript jquery
|
[3, 5]
|
2,668,128
| 2,668,129
|
date picker which displays date like thursday, Febraury 9, 2012
|
<p>Can any one please suggest me a datepicker which displays date like thursday, Febraury 9, 2012 after user selects date from date picker.And is it possible to place the next and previous functionalities.</p>
<p>I am using Javascript on client side. PHP on server side.
<img src="http://i.stack.imgur.com/pJcEb.png" alt="enter image description here"></p>
<p>Thanks in advance.</p>
|
php javascript
|
[2, 3]
|
935,157
| 935,158
|
Load javascript via jQuery ajax
|
<p>is it possible to use jQuery %Json function to load a javascriptfile.js asynchronously?</p>
|
javascript jquery
|
[3, 5]
|
828,280
| 828,281
|
Easy way to use FindControl("")
|
<p>C#</p>
<p>Hi,</p>
<p>I've been developing c# web applications for a couple of years and there is one issue I keep coming upagainst that I can't find a logical way to solve.</p>
<p>I have a control I wish to access in code behind, this control is deep within the markup; burried within ContentPlaceHolders, UpdatePanels, Panels, GridViews, EmptyDataTemplates, TableCells (or whatever structure you like.. the point is it has more parents than farthers for justice).</p>
<p>How can I use <code>FindControl("")</code> to access this control without doing this:</p>
<pre><code>Page.Form.Controls[1].Controls[1].Controls[4].Controls[1].Controls[13].Controls[1].Controls[0].Controls[0].Controls[4].FindControl("");
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,093,601
| 1,093,602
|
force load from server instead of cache on session start
|
<p>How do I ensure that the user has the latest .js file cached in his browser? I'd like to have the app force the browser to a complete reload of all files on every session start.</p>
<p>Let me know how this can be done.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
2,824,068
| 2,824,069
|
jQuery: children count = 0 and ajax
|
<p>I'm working on a jQuery that gets a list of elements from a server, appends it to an element, and then loops in the newly appended elements to transform them (make them jEditable).</p>
<p>I'm having trouble with the loop. The appending works alright, so I have a list of elements like :</p>
<pre><code><div id="innerModal">
<label id="exampleTitle">Title :</label>
<label id="exampleField" class="ftext">Value</label>
</div>
</code></pre>
<p>Then I try to loop in: </p>
<pre><code>function makeListEditable(element, type){
//I checked here that the element sent is well '#innerModal'
alert($(element).children().length);
$(element).children().each(function() {
if( $( this ).is( 'ftext' ) ){
makeEditable( $( this ), type, '', '' );
}
});
}
</code></pre>
<p>The alert prints "0".</p>
<p>Where does that issue come from? How can I fix it?</p>
<p>Edit : Here's the call of makeListEditable : </p>
<pre><code>getFormOnElement(//Gets the form and appends it
"getorganisationeditable/"+curOId,
"#innerModal"
);
makeListEditable('#innerModal');
</code></pre>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
5,620,384
| 5,620,385
|
Toggle going wrong?
|
<p>I have made some menu with a slide down submenu. It should work fine but for some reason it doesn't work. I mean if you look at this fiddle: <a href="http://jsfiddle.net/yJdFu/2/" rel="nofollow">http://jsfiddle.net/yJdFu/2/</a> , you'll see that the big menus don't slide down when the submenu toogles.</p>
<p>Can you tell me why isn't it working ?</p>
|
javascript jquery
|
[3, 5]
|
710,334
| 710,335
|
JQuery and ASP.NET: preventDefault() called on click but normal operation does not return when returning true
|
<p>I am having a JQuery/ASP issue that I hope someone can help me with.</p>
<p>Scenario: ASP.net application already built and deployed, but in the interest of keeping all clients on the same version (easier to update), I've injected a lot of JQuery to customize the ASP application for this client to avoid recompiling the code and having them on a "one off" version. </p>
<p>Here's what I'm trying to do:</p>
<p>Add validation on a form. Currently I'm grabbing the click event of a "submit" button and doing if statements and checking fields for empty values. IE:</p>
<pre><code>$("input[id*=btnVisualSubmit]").click(function(event) {
if ($("#field").val() == "")
event.preventDefault();
alert("field is empty. ");
});
</code></pre>
<p>It's a bunch of if/else statements that checks each field for empty strings. Now.. what I want to happen is.. if none of those if statements occur, then the normal ASP button to function as is and do all of the code behind. This works fine and dandy so long as the user inputs all of the required fields on the first try. But as soon as I hit the event.preventDefault(), it NEVER submits the form after the user inputs all required fields. </p>
<p>I've tried everything from changing event.preventDefault() to "return false" to adding a last "else" statement that just returns a "true" but nothing invokes the submit button unless the user enters all valid data correctly on their first try. </p>
<p>Any help would greatly be appreciated. Thanks</p>
|
jquery asp.net
|
[5, 9]
|
648,198
| 648,199
|
Escape quotes in a variable with PHP
|
<p>I use this code to genefate html</p>
<pre><code>echo "<input type='button' onclick=\"myFunc('$param');\" />";
</code></pre>
<p>Everything would be OK unless $param contains <code>'</code> or <code>"</code> character. How should it be implemented to handle these situations?</p>
<p>ps. mysql_real_escape_string($param) won't work correctly, when a user entered <code>"</code>.</p>
|
php javascript
|
[2, 3]
|
2,070,920
| 2,070,921
|
Syntax error. Help with one small JS snippet :(
|
<p>Hey guys. I don't know much JS, but I wanted to do some quick work with jQuery.</p>
<p>But I've been staring at this for about an hour and I don't understand what I missed:</p>
<pre><code><script type="text/javascript">
$('#qty_6035').change(function () {
var substractedQty, stockQty, remQty;
substractedQty = (int) $('#qty_6035').val(); // missing ; before statement
stockQty = (int) $('#orig_qty_6035').val();
$('#rem_qty_6035').html(stockQty-substractedQty);
});
</script>
</code></pre>
<p>jQuery library is included at the beggining of the document.</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
114,998
| 114,999
|
how to register user clicked on link ads
|
<p>I want to register user clicked on ads and save users info to database without change ads operation.</p>
<pre><code><div>
<a>ads link</a> // without modify ads
<a>ads link</a>
<a>ads link</a>
<a>ads link</a>
</div>
</code></pre>
<p>how to update user info to database before load link ads.</p>
<p>Please help.</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,865,360
| 2,865,361
|
Any specific order for Java script and jquery
|
<p>I am using one java script and one jquery in my html file in head tag,
but my problem both the scripts are not working, i have used one slide show script and one nav menu script, in this both only one is working , is there any specific order to write these scripts ,
please find the below script order i have used , i am getting only slideshow. please help me out .</p>
<pre><code><script type="text/javascript"> google.load("mootools", "1.2.1");</script>
<script type="text/javascript" src="Js/MenuMatic_0.68.3.js" type="text/javascript"
charset="utf-8"> </script>
<script type="text/javascript">
window.addEvent('domready', function () {
var myMenu = new MenuMatic();
});</script>
<script type="text/javascript" src="Js/jquery.min.js"></script>
<script type="text/javascript" src="Js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="Js/slides.min.jquery.js"></script>
<script type="text/javascript">
$(function () {
$('#slides').slides({
preload: true,
preloadImage: 'img/loading.gif',
play: 5000,
pause: 2500,
hoverPause: true
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,086,997
| 1,086,998
|
checkbox value assigns some value to hidden text field
|
<p>I have a hidden checkbox whose value (either 1 or 0) is gotten from the url via GET:</p>
<p><code>if (isset($_GET['somecheckboxid'])) {
$valuehere = urldecode($_GET['somecheckboxid']);
}</code></p>
<p>in the form, the hidden checkbox value is inserted via echo:</p>
<p>input name="somecheckboxid" id="somecheckboxid" type="hidden" value=""</p>
<p>This is where I hit a brick wall.
I have a hidden text field that needs it's value assigned based on the value of the hidden checkbox. checkbox value "1" assigns textbox value "blue" or check box value "0" assigns "null"</p>
<p>if
input name="someid" id="someid" type="hidden" value="1"
then
input type="text" id="hiddentext" name="hiddentext" type="hidden" value="blue"</p>
<p>If
input name="someid" id="someid" type="hidden" value="0"
then
input type="text" id="hiddentext" name="hiddentext" type="hidden" value="null"</p>
|
php javascript
|
[2, 3]
|
129,773
| 129,774
|
How to get the android APK installation progress?
|
<p>I am using Android Tool "adb.exe" to install apk files to android phone.
The code is: <code>abd.exe install xxx.apk</code></p>
<p>I want to use a C# progressBar to show the progress of installation. How can I get the progress?</p>
|
c# android
|
[0, 4]
|
3,727,880
| 3,727,881
|
How do i manipulate select box using jquery?
|
<p>I have some select boxes like the following:</p>
<pre><code><select id="my_box1" rel="cal_10">
<option value="A"></option>
</select>
<select id="my_box2" rel="cal_10.50">
<option value="A"></option>
</select>
....
<select id="my_boxn">
<option value="B"></option>
</select>
</code></pre>
<p>On changing, I want to add the related value (that is 10 and 10.50) only when the select boxes has the same option value.</p>
<p>For Example: if the first and second select box has option value as A, then I want to add it.</p>
<p>How can I do this using jQuery?</p>
|
javascript jquery
|
[3, 5]
|
1,241,783
| 1,241,784
|
How to redirect to dynamic URL with serbarmeli mobile redirection js script?
|
<p>my local URL on dev PC is localhost:8080/hs</p>
<p>when I access it on my iPhone its 10.xxx.xxx.xx:8080/hs</p>
<p>Using</p>
<pre><code> <script>
SA.redirection_mobile ({
tablet_redirection : "true",
mobile_url : "localhost:8080/hs/m/home.jsp",
mobile_prefix : "http"
});
</script>
</code></pre>
<p>Trying to get user to be directed to /m/home.jsp from the root URL, but because I have to explicitly set mobile_url my iphone tries to hit localhost:8080 whch doesnt work, need it to work dynamically.</p>
<p>Does anyone know how to do this?</p>
<p><a href="https://github.com/sebarmeli/JS-Redirection-Mobile-Site/blob/master/README.md" rel="nofollow">library link</a></p>
|
javascript jquery
|
[3, 5]
|
5,979,870
| 5,979,871
|
Convert C# method to Java
|
<p>I am looking to convert the following bit of C# code to Java. I having a hard time coming up with a equivalent.</p>
<h2>Working C# Code:</h2>
<pre><code>private ushort ConvertBytes(byte a, byte b, bool flip)
{
byte[] buffer = new byte[] { a, b };
if (!flip)
{
return BitConverter.ToUInt16(buffer, 0);
}
ushort num = BitConverter.ToUInt16(buffer, 0);
//this.Weight = num;
int xy = 0x3720;
int num2 = 0x3720 - num;
if (num2 > -1)
{
return Convert.ToUInt16(num2);
}
return 1;
}
</code></pre>
<p>Here is the Java Code that does not work. The Big challenge is the "BitConverter.ToInt16(buffer,0). How do i get the Java equal of the working C# method.</p>
<h2>Java Code that is Wrong:</h2>
<pre><code>private short ConvertBytes(byte a, byte b, boolean flip){
byte[] buffer = new byte[] { a, b };
if (!flip){
return (short) ((a << 8) | (b & 0xFF));
}
short num = (short) ((a << 8) | (b & 0xFF));
//this.Weight = num;
int num2 = 0x3720 - num;
if (num2 > -1){
return (short)num2;
}
return 1;
}
</code></pre>
|
c# java
|
[0, 1]
|
5,062,697
| 5,062,698
|
Why is it not possible to tell the compiler to override onClick
|
<p>I am making an Android application, and I have some buttons.
I want to add some listeners to them, so I have implemented <code>android.view.View.OnClickListener</code>, and added listeners to the buttons.</p>
<p>However, at the <code>onClick</code> method, I can't add the <code>Override</code> annotation like this:</p>
<pre><code>@Override
public void onClick(View view) { /* With Override */ }
</code></pre>
<p>But this works:</p>
<pre><code>public void onClick(View view) { /* Without Override */ }
</code></pre>
<p>And if I try to log something in the latter onClick method, it works as intended.</p>
<p>I am using Eclipse, and it keeps telling me that I must override a superclass method.</p>
<p>Why can't I add the <code>Override</code> annotation to it if I'm overriding it?</p>
<p>I am using Ubuntu 11.4, if that matters. <code>java -version</code> returns:</p>
<p><code>java version "1.6.0_24"</code><br/>
<code>Java(TM) SE Runtime Environment (build 1.6.0_24-b07)</code><br/>
<code>Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)</code></p>
<p>Here is the code:</p>
<pre><code>import android.view.View.OnClickListener;
public class Main extends Activity implements OnClickListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btnFoo = (Button) findViewById(R.id.btnFoo);
btnFoo.setOnClickListener(this);
}
// @Override
public void onClick(View v) {
Log.e("foo", "bar");
}
}
</code></pre>
<p>PS. I'm using Sun JDK 1.6</p>
<p><strong>EDIT:</strong></p>
<p>I've found this applies to most of the methods I'm trying to use, e.g <code>public void run()</code> (from <code>Runnable</code>).</p>
|
java android
|
[1, 4]
|
1,041,011
| 1,041,012
|
Replacing a part of text inside a td
|
<p>I have a <code>td</code> with this format:</p>
<pre><code><td>
Business Owner - Delivery Director <br>
<a href="mailto:me@business.com">me@business.com</a>
</td>
</code></pre>
<p>How can I only replace the text <code>"Business Owner - Delivery Director"</code> with something else? </p>
<p>Using this.text() fetches <code>Business Owner - Delivery Director</code> and <code>me@business.com</code>, but I want only
<code>Business Owner - Delivery Director.</code></p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.