Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
2,282,655 | 2,282,656 |
Is this Possible to Count a Button Click in postbacks
|
<p>What i trying to do is simply <strong>disable a button after 4 clicking</strong> but when the post backs occurs then it doesn't have a count of clicks.
i trying to do that by jquery. Any suggestions.?
<br/>
Correct me if i am wrong by asp.net we do that by putting a static variable and increment the count on button click .</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
276,430 | 276,431 |
From javascript array to mysql
|
<p>Im making a 100% javascript and canvas web application, no forms at all. I have a js array with data and I'm wondering how could be possible to pass it to a php script so it gets loaded into the database. Suggestions? </p>
|
php javascript
|
[2, 3]
|
3,186,498 | 3,186,499 |
How do I get Jquery to compare between two selectors?
|
<p>I think my JQuery knowledge is a little lacking.</p>
<p>On my page I have 0 or more hidden variables that look like this.</p>
<pre><code><input type='hidden' class='defaultTickedStatus' value='INACTIVE' />
<input type='hidden' class='defaultTickedStatus' value='ACTIVE' />
</code></pre>
<p>They can be accessed via the selector $(".defaultTickedStatus")</p>
<p>I also have a number of checkboxes in an element like this </p>
<pre><code><div id="checkboxes">
<input type="checkbox" value="INACTIVE" id="checkbox1" tabindex="30430">
<input type="checkbox" value="ACTIVE" id="checkbox1" tabindex="30430">
<input type="checkbox" value="SUBMITTED" id="checkbox1" tabindex="30430">
<input type="checkbox" value="FINALISED" id="checkbox1" tabindex="30430">
...
</div>
</code></pre>
<p>They can be accessed via the selector $("#checkboxes input")</p>
<p>What I would like to do is when the user clicks a button, I want it go through all of the checkboxes and for the ones that have a value which equals one of the values in the hidden tags, then to check it.</p>
<p>However, being a little unfamiliar with JQuery, I'm unfamiliar with how to accomplish this. This is what I have so far...</p>
<pre><code> $("#checkboxes input").each(function (index, Element)
{
$(".defaultTickedStatus").each(function (i2, status)
{
if (status.value == Element.value)
{
$(status).selected(true);
}
});
});
</code></pre>
<p>It's getting to the $(status).selected(true) part but for some reason, it does not seem to work. Also, I'm positive there is a much easier way to do this through Jquery.</p>
<p>Wonder if anyone can help me.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,381,896 | 2,381,897 |
put value in textarea using jquery
|
<p>I want to put the value in textarea using the jquery. I'm using the following code. It is not working.</p>
<pre><code> <link rel="stylesheet" href="css/jquery.wysiwyg.css" type="text/css" />
<script type="text/javascript" src="js/jquery.wysiwyg.js"></script>
<script type="text/javascript">
function wedit(topic){
$("#wysiwyg").html(topic);
alert(id+topic+instructor+date+video);
}
</script>
<form name="theform" action="" method="post">
<table border="0" cellpadding="10" cellspacing="10" width="680px">
<tr><td width="150">Topic:</td><td><span id="wtopic">
<textarea name="wysiwyg" id="wysiwyg" ></textarea></span></td></tr>
<tr><td></td><td><input type="submit" name="submit" value="Save"
title="Save" /></td> </tr>
</table>
</form>
</code></pre>
<p>It is working in case of text but in case of textarea it is showing empty value.
please let me know how can I put the text into the textarea through jquery or javascript??</p>
|
javascript jquery
|
[3, 5]
|
4,362,029 | 4,362,030 |
How to create delay before ajax call?
|
<p>I am using jQuery 1.8. </p>
<p>I have a series of checkboxes that a user can check to get information on particular product. When the box is check, a function is called and loads the product info into a div. CURRENTLY, the function fires immediately after each click. So, if the visitor checks all five boxes, the ajax call will be made five times. </p>
<p>What I want is for the function to fire after a certain period of time once the visitor stops clicking. The function should fire only once. The purpose of the delay is to limit the number of calls and create a smoother user experience.</p>
<p>Here is my HTML:</p>
<pre><code><input type='checkbox' class='SomeClass' data=prodid='1'> 1
<input type='checkbox' class='SomeClass' data=prodid='2'> 2
<input type='checkbox' class='SomeClass' data=prodid='3'> 3
<input type='checkbox' class='SomeClass' data=prodid='4'> 4
<input type='checkbox' class='SomeClass' data=prodid='5'> 5
<div id='ProductInfoDiv'></div>
</code></pre>
<p>Here is my pseudo JavaScript:</p>
<pre><code>// set vars
$Checkbox = $('input.SomeClass');
$ProductInfoDiv = $('div#ProductInfoDiv');
// listen for click
$Checkbox.click(getProductInfo);
// check which boxes are checked and load product info div
getProductInfo = function() {
// create list of product id from boxes that are checked
var QString = $Checkbox.filter(":checked");
// LOAD THE PRODUCT DIV
$ProductInfoDiv.load('SomePage.cfm?'+QString);
}
</code></pre>
<p>So, where do I put the delay? How do ensure that the function only fires ONCE?</p>
|
javascript jquery
|
[3, 5]
|
2,849,070 | 2,849,071 |
Converting string to object
|
<p>Is it possible to convert a string that was created by Object.ToString() back to the original object i.e:</p>
<pre><code> public boolean dispatchKeyEvent (KeyEvent event) {
appendLog(event.toString());
return super.dispatchKeyEvent(event);
}
</code></pre>
<p>appent log will log every keyevent as a string in a new line. After logging i would like to run the logged keyevents</p>
<p>Is it possible to convert the string logged keyevents to a KeyEvent object?</p>
|
java android
|
[1, 4]
|
3,127,453 | 3,127,454 |
calling alert from code-behind
|
<p>i have a dropdownlist and a listbox both asp.net controls</p>
<p>i am trying to prevent the user add duplciate items to listbox control</p>
<p>i able to block it but i want to display DIV or Alert box saying,"duplciate names are not allowed"</p>
<pre><code>protected void btn_AddRecipientAction_OnClick(object sender, EventArgs e)
{
if (Convert.ToInt32(this.ddlRecipient.SelectedValue) > 0)
{
if (ddlRecipient.Text.Length > 0)
{
//var items = new System.Collections.ArrayList(this.lstRecipient.Items);
for(var i = lstRecipient.Items.Count - 1; i >= 0; --i)
{
if (lstRecipient.Items[i].Text == ddlRecipient.SelectedItem.Text)
{
lstRecipient.Items.RemoveAt(i);
**//alert("duplicate entry not allowed")
//div display the message and disappears after few seconds?**
}
}
ListItem newList = new ListItem();
newList.Text = ddlRecipient.SelectedItem.Text;
newList.Value = ddlRecipient.SelectedValue;
this.lstRecipient.Items.Add(newList);
}
}
}
</code></pre>
|
asp.net jquery
|
[9, 5]
|
1,474,859 | 1,474,860 |
Eval() in ASP. How to pass values on redirect throught session
|
<p>I have this image button inside a grid view which redirects the groupname to the send message.aspx. </p>
<pre><code> <asp:ImageButton ID="img_Send" ImageUrl="Styles/Images/Message.jpg" Enabled="True" Width="" runat="server" PostBackUrl='<%# Eval("GroupName", "SendMessage.aspx?GroupName={0}") %>'></asp:ImageButton>
</code></pre>
<p><a href="http://localhost:48996/SurelyK/SendMessage.aspx?GroupName=Jobs" rel="nofollow">http://localhost:48996/SurelyK/SendMessage.aspx?GroupName=Jobs</a>
this is the url</p>
<p>Is it possible to store the value in a session in the client side so that i can use it in server side coding.</p>
<p>i dont want to pass the value in the URL. How can i do it without passing it in URL. </p>
<p>2nd q: I am also doing the same in user page where I pass the user id. </p>
<p><a href="http://localhost:48996/SurelyK/SendMessage.aspx?UserID=3" rel="nofollow">http://localhost:48996/SurelyK/SendMessage.aspx?UserID=3</a></p>
<p>In my sendmessage server side code i have to save the message in the message table and then save the username and the message id in usermessage table. </p>
<p>the code for inserting in userdetails usermessage table and code for inserting groupdetails in grouptable is different. I have to do both in send button click. How to check which page redirected to send message page, is it group or user page..</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,324,791 | 4,324,792 |
.sortable() adding 50px height, dispurts scrollbar
|
<p>I have a draggable list of elements. The only jQuery I am using is:</p>
<pre><code>$('.section_rows').sortable();
</code></pre>
<p>This works fine. However, when I am at the bottom of the page (vertical scroll all the way at the bottom), and click a row to drag and sort it, the page 'jumps' up by <code>55px</code>. While this isn't a big deal functionally, it is a terrible user experience (and the draggable rows are located at the bottom of this page, so this hiccup invariably happens).</p>
<p>I took a look at the HTML, and it looks like jQuery is adding a class called <code>'.ui-sortable-helper'</code> which contains a style with a 55px height.</p>
<p>Is there a way that I can disable this or force the page to 'not move' when the draggable item is selected?</p>
|
javascript jquery
|
[3, 5]
|
1,431,541 | 1,431,542 |
asp - Cannot find method 'IsNullOrEmpty(String)' in 'String'
|
<p>Trying to only print if a string isn't empty, and am using the code below, but it keeps coming up with that error... </p>
<pre><code><%if(!String.IsNullOrEmpty(o_handler.renderDesc())) { %>
<strong>Description:</strong><BR>
<HR SIZE="1">
<strong><%= o_handler.renderDesc()%></strong>
<HR SIZE="1">
<BR>
<%} else { %>
<%}%>
</code></pre>
<p>Also tried this:</p>
<pre><code><%if( o_handler.renderDesc() != null ) { %>
<strong>Description:</strong><BR>
<HR SIZE="1">
<strong><%= o_handler.renderDesc()%></strong>
<HR SIZE="1">
<BR>
<%} else { %>
<%}%>
</code></pre>
<p>Here's the error:</p>
<p><strong>Compiler Error Message: VJS1223: Cannot find method 'IsNullOrEmpty(String)' in 'String'</strong></p>
|
c# asp.net
|
[0, 9]
|
1,032,241 | 1,032,242 |
How to pass a derived class to a function accepting the parent type
|
<p>I have a Sport base class that has a couple variables. I also have a few different classes derived from Sport such as Volleyball, Soccer, etc. that have additional methods and variables. They look somewhat like this.</p>
<pre><code>public class Sport {
public String commonVar;
public Sport(String c) {
this.commonVar = c;
}
}
</code></pre>
<p>And then Volleyball:</p>
<pre><code>public class Volleyball extends Sport {
public String onlyVolleyball;
public Volleyball(String c, String thisVar) {
super(c);
this.onlyVolleyball = thisVar;
}
}
</code></pre>
<p>Now I want to be passing the derived classes of Sport into a function elsewhere, but making the parameters</p>
<pre><code>public otherFunction(int one, int two, Sport sport) { }
</code></pre>
<p>Only treats sport as a Sport object (it will accept the derived classes but I cannot access any of the variables and methods not common to Sport). My question is how do I create a function that I am able to send all types of Sport derivatives to without losing any data?</p>
|
java android
|
[1, 4]
|
5,905,283 | 5,905,284 |
why this not adding to array
|
<p>I am trying to create a multidimenssional array like this</p>
<pre><code>var myArray = new Array();
var test = new Array(1, 100,200,2);
$.each(test, function(index, val) {
myArray['value'].push(val);
myArray['index'].push(index);
});
</code></pre>
<p>but console.log(myArray) shows me no values;</p>
|
javascript jquery
|
[3, 5]
|
5,093,922 | 5,093,923 |
Pattern for wiring up events using jQuery
|
<p>Please look at the code at the end to see the method I've been using to wire up events in my jQuery code. I prefer using bind and as you can also see I don't like using Anonymous functions in my event handlers. </p>
<p>I'm using named functions because of the following two reasons:</p>
<ol>
<li>Readability</li>
<li>Multiple calls to my WireUpGlobalCommandClickEvents will not add multiple event handlers to the click of my link.</li>
</ol>
<p>This has a side effect - I need to pass in data to the OnAddNewSnippetClick using bind's functionality, since in OnAddNewSnippetClick, this now refers to the element that caused the event to fire.</p>
<p>I've always treated JavaScript as a second-class citizen and as you can see I'm trying to force the conventions I use in my ASP.NET MVC application onto my JavaScript here as well. Is my paranoia about multiple event handlers being added misplaced? Is there a better pattern to wire up event handlers using jQuery?</p>
<pre><code>SettingsController.prototype = {
OnAddNewSnippetClick: function(event) {
event.data.SettingsController.SettingsAjaxHelper.AddNewSnippet(event.data.Parameter, event.data.SettingsController);
},
WireUpGlobalCommandClickEvents: function(parameter) {
$('#addSnippetLink').bind("click", { SettingsController: this, Parameter: parameter }, this.OnAddNewSnippetClick);
}
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,654,535 | 4,654,536 |
Getting images and description of a webpage using its link in ASP.Net
|
<p>hi i am making a website in asp.net which is like social netwroking. users shares their updates and views. i am able to complete all modules but now stucked at a requirement.</p>
<p>i want to get images (not screenshot of page) and description from webpage link, when entered by user into the update status bar. just like facebook do. when we enter some link, it gets its thumbnail images and also some desription of that page.</p>
<p>can someone give me direction how can this be done in asp.net. is there some pluggin or code available..</p>
<p>thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
5,080,426 | 5,080,427 |
C# button click once a day
|
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.GetLeft.Value = invited.GetInviteCountByWeb().ToString();
HttpCookie oldCookie = Request.Cookies["Time"];
if (oldCookie != null)
{
if (DateTime.Now.ToString("yyyy-MM-dd") == Convert.ToDateTime(oldCookie.Values["GetTime"]).ToString("yyyy-MM-dd"))
{
this.IsGet.Value = "false";
}
else
{
HttpCookie newCookie = new HttpCookie("Time");
newCookie.Values.Add("GetTime", DateTime.Now.Date.ToString("yyyy-MM-dd"));
newCookie.Expires = DateTime.Now.AddHours(24.0);
Response.Cookies.Add(newCookie);
}
}
}
}
</code></pre>
<p>but it's not working, the oldcookie is null when browser is closed everytime..
so how can i set button click once a day??</p>
|
c# asp.net
|
[0, 9]
|
2,949,350 | 2,949,351 |
add or remove a datepicker from a tex field according to seleced dropdown value
|
<p>I have a form used to search data. On that form I have a textbox, a dropdown list, and a search button. In my dropdown, I have options: </p>
<ul>
<li>check in date</li>
<li>last name </li>
<li>reservation id </li>
</ul>
<p>I want to add a datepicker to the textbox, but only when "check in date" has been selected.</p>
<p>Once the date picker is added to the text box - I can't remove it. How can I remove the datepicker when the other options have been selected?</p>
<p>This is my jquery </p>
<pre><code>$('#list').change(function() {
var selected = $(this).val();
if(selected == 2) {
$('#text').datepicker({ dateFormat: 'yy-mm-dd' });
} else {
$('#text').prev().val(''); //here , need to remove the date picker
}
});
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
2,866,975 | 2,866,976 |
Open a new window and submit a form with a single click
|
<p>when i click on submit button then :
<li>first : open a new window to display process (by ajax call)
<li>second : submit current form (processing time consuming job)</p>
<p>on Click of submit following JQuery function is being called :</p>
<pre><code>function submitForm(){
window.open('displayGetStatus.action?id=' + p_id );
$("#frmStartSomeTask").attr("action","executeDatabaseOperation.action").submit();
}
</code></pre>
<p><b>Result</b> : second window is opened and waiting for process to start but form on first window is not submitted so process is not started.</p>
<p>Please help how can i get this ?</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
5,500,938 | 5,500,939 |
Variable Scope: cross-class function call
|
<p>I have a <code>vehicle</code> and a <code>product</code> object and I need vehicle to call a function within product.... I can't seem to figure it out, what should I do here?</p>
<pre><code>var vehicle = function () {
return {
init: function () {
var that = this;
jQuery('.vehicle-year-profile .options .delete').bind('click', function (e) {
e.preventDefault();
that.remove(jQuery(e.currentTarget).parents('.vehicle-year-profile'));
});
jQuery('.vehicle-year-profile .options .edit').bind('click', function (e) {
e.preventDefault();
that.edit(jQuery(e.currentTarget).parents('.vehicle-year-profile').attr('id'));
});
jQuery('#association-detail .save').bind('click', function (e) {
e.preventDefault();
that.save();
});
},
edit: function (id) {},
save: function () {},
remove: function (el) {},
reset: function () {}
}
}();
var product = function () {
return {
refreshHistory: function () {}
};
}();
</code></pre>
|
javascript jquery
|
[3, 5]
|
6,021,711 | 6,021,712 |
jQuery pop up window in background
|
<p>I have a div with <code>id="icontainer"</code> in my web page and when the user clicks on it a new url opens in a new tab and the user stays there in the new tab.</p>
<p>How it is possible when the user clicks on my div the new url is opening in background of the browser, or a new tab, but the user remains in my web page?</p>
<p>My code:</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
$("#icontainer").click(function() {
$("#icontainer").hide();
var link = 'http://www.youtube.com/42/16022/15176/" alt="" border="0">';
var mer_window = window.open(link, '_blank', 'toolbar=1,location=1,directories=1,scrollbars=1,resizable=1,status=1,menubar=1');
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
367,903 | 367,904 |
jQuery slideUp() content when clicked for a second time
|
<p>How would I slideUp() the content only when '.areaCodeList' is clicked a second time?</p>
<pre><code>$(".areaCodeList").on('click', function() {
$(this).next('.churchList').slideDown();
($this.die());
$('.churchList').slideUp();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,181,748 | 5,181,749 |
Binding event with mouseover on an iframe that sits on my page with a src that contains
|
<p>I have some third party iframes that sit on my page and I want to capture when a user <code>mousesover</code> them ONLY if the src of those iframes contain either twitter or facebook anywhere in the src text. Since I can't capture the clicks (I can with their custom methods, I want to keep code completely seperate). I want to capture when a user mouses into an iframe (that sits on my page, is not brought in by them). The "SRC" of the iframe is outside my site, but the actually call is in my page. Any ideas?</p>
<p>ala:</p>
<pre><code>var _self = this;
$("iframe src").filter('/facebook|twitter/')
.mouseover(function(event){
event.stopPropagation();
_self.somemethodcall();
});
</code></pre>
<p>or something like:</p>
<pre><code>var _self = this;
$('iframe').filter(function() {
return $(this).attr('src').match(/facebook|twitter/);
}).bind("mouseover", function(event) {
event.stopPropagation();
_self.somemethodcall();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,754,203 | 5,754,204 |
Preserve Active Tab after PostBack when using Simple Tab in Asp.Net
|
<p>I am using <a href="http://www.htmldrive.net/items/show/542/Simple-Tabs-w-CSS-jQuery.html" rel="nofollow">Simple Tab</a> for ASP.NET web application. You can see the <a href="http://www.htmldrive.net/items/demo/542/Simple-Tabs-w-CSS-jQuery" rel="nofollow">Demo</a> of simple tab here.</p>
<p>I want to preserve the Active tab even after postback.</p>
<p>I tried writing the following code but couldnot make the progress.</p>
<pre><code> $(document).ready(function () {
debugger;
//Default Action
var activeTab;
if (activeTab == undefined) { <-- Added by me but the variable activeTab is refreshing every time and is undefined for every post back.
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
}
//On Click Event
$("ul.tabs li").click(function () {
debugger;
$("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
return false;
});
});
</code></pre>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
3,249,133 | 3,249,134 |
How to draw a dotted circle in android sdk?
|
<p>I am very new to Android sdk. I need to display a dotted circle with in the view. But My requirement is to display a dotted circle. But I don't have an idea how to do it?. Can you guys please let me know if any one know this ?</p>
<p>Thank you,
-Sek.</p>
|
java android
|
[1, 4]
|
3,609,011 | 3,609,012 |
is it possiable to call our server side(like gridview events) event from javascript
|
<pre><code><img src='<%# "ThumbNailImage.ashx?ImID="+ Eval("ImageID") %>' id="ImgShow" runat="server"
align="top" style="border: solid 1px Gray;" height="150"
width="170" onclick="javascript:myFunction();" >
protected void gvImages_SelectedIndexChanged(object sender, EventArgs e)
{
string s = gvImages.SelectedValue.ToString();
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString);
SqlCommand command = new SqlCommand("SELECT imagename,ImageID from [Image2] where ImageID='"+s+"' ", connection);
SqlDataAdapter ada = new SqlDataAdapter(command);
ada.Fill(dt);
this.dvCustomerDetail.Visible = true;
dvCustomerDetail.DataSource = dt;
dvCustomerDetail.DataBind();
this.updPnlCustomerDetail.Update();
this.mdlPopup.Show();
}
<script type ="text/javascript" >
function myFunction()
{
debugger ;
document.getElementById('<%=gvImages.ClientID%>').SelectedIndexChanged();
//__doPostBack('Button1','OnClick');
}
</script>
</code></pre>
<p>now in control i a calling my javscript function from there i need to call my gvImages_selected index change event.</p>
<p>which is not happening is there any issue in my javscript
any help would be great thank you</p>
|
asp.net javascript
|
[9, 3]
|
3,212,090 | 3,212,091 |
Going from Java desktop programming to Android Application Developement
|
<p>I know similar questions have been asked before but i think this is slightly different. for about a year Ive been learning Java. I have been building a few applications on the desktop using my-eclipse and swing GUI. Now i want to start programming for the android. I understand how to do what i want in Java but it all seems very different on android. Does anyone know of any good tutorials or videos out there with step by step instructions showing examples of android applications so that i can learn and build off of them? Most of my programs are simple and for the most part i just need to understand how to interact with the interface (IE the buttons, label or text views i think they call them and so on). I've searched all day and I cant find anything good.</p>
|
java android
|
[1, 4]
|
1,470,737 | 1,470,738 |
Looking for a good name for interface with inUse() method
|
<p>How would you name an interface which provides 1 method inUse()?</p>
|
c# java
|
[0, 1]
|
3,715,361 | 3,715,362 |
Android ListItem Not Working
|
<p>When I click on a List Item, it doesn't start a new activity. What is the reason? Other people have implemented the same code and there program is working. What should I do with this problem?
Here is the code:</p>
<pre><code>public class Menu extends ListActivity {
String classes[]={"StartingPoint","Splash", "You", "Dumb"};
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, classes));
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
String cheese = classes[position];
try {
Class ourclass = Class.forName("com.umer.splashscreenwithsound." + cheese);
//Class ourclass = Class.forName("com.umer.splashscreenwithsound.StartingPoint");
Intent myintent = new Intent(Menu.this,ourclass);
startActivity(myintent);
} catch(ClassNotFoundException e) {
e.printStackTrace();
}
}
}
</code></pre>
<p>Please help.</p>
|
java android
|
[1, 4]
|
877,257 | 877,258 |
AES-256 compatible for both c# and android
|
<p>I am developing an android application in which i need to encrypt files from my c# application and decrypt it from android application and vice versa through AES-256. any guide or help would be so much appreciated.</p>
<p>Thanks.</p>
|
c# java android
|
[0, 1, 4]
|
849,391 | 849,392 |
how to toggle addClass and removeClass?
|
<p>my code:</p>
<pre><code><a href=# onclick="obj.addClass('fliph'); return false;">toggle</a>
</code></pre>
<p>i want click <strong>toggle</strong> to <code>obj.addClass('fliph')</code>,then click again run <code>obj.removeClass('fliph')</code>.</p>
<p>how to fix my code?</p>
<p>thanks all! :)</p>
|
javascript jquery
|
[3, 5]
|
2,317,464 | 2,317,465 |
Alternative in PHP for java DefaultMutableTreeNode
|
<p>Can anyone please tell me about the java "DefaultMutableTreeNode" and how can i use this PHP.</p>
<p>Thanks in advance.</p>
|
java php
|
[1, 2]
|
1,446,135 | 1,446,136 |
Checkbox is checked, but :checked doesn't work
|
<p>I have a few checkboxes. I'm setting and resetting the default values of the checkboxes with the .prop() function, based on a JSON response (loading the data via ajax-requests). The problem is, that they apparently don't change this behaviour, if I change them manually. I can't pass the value of the checkboxes via $('#checkbox :checked').val(), a console log says 'undefined'. Is this because of the .prop() function? How can I get the value of the checked checkboxes?</p>
<p>If you need more information, i'll gladly provide them.
Here some code:</p>
<pre><code>if (json.event.public_visible == 1) {
$('#event_public_visible').prop('checked', true);
} else {
$('#event_public_visible').prop('checked', false);
}
if (json.event.package_event == 1) {
$('#event_package_only').prop('checked', true);
} else {
$('#event_package_only').prop('checked', false);
}
</code></pre>
<p>Update: more code</p>
<pre><code>var editEvent = function () {
if ($('#event_public_visible').is(':checked')) {
console.log('test');
}
formData = {
// ... other fields
event_package_only: $('#event_package_only :checked').val(),
event_public_visible: $('#event_public_visible :checked').val(),
// ... more fields
};
$.ajax({
url: base_url + "admin/events/editAsync",
type: "POST",
data: formData,
dataType: "json",
success: function (json) {
// success handling
}
});
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,057,518 | 5,057,519 |
jquery ajax not catching error when posting to an aspx page
|
<pre><code>$.ajax({
type: "POST",
url: "/zzz/bbb/abcd.aspx?deleteIDs=" + request_ids,
contentType: "application/x-www-form-urlencoded",
data: '',
dataType: "html",
complete: function(xhr, status) {
if (status == "success")
{
}
else {
}
}
</code></pre>
<p>The jquery code above has its status ="success" regardless of the outcome of the background operation. What am I doing wrong?</p>
|
jquery asp.net
|
[5, 9]
|
1,352,745 | 1,352,746 |
Character limit for asp label upto 1000 characters
|
<p>I want to restrict my label upto 1000 characters only.
how to achieve this?
please help...</p>
|
c# asp.net
|
[0, 9]
|
2,744,809 | 2,744,810 |
how to change button image by javascript
|
<p>I have 2 button and i want to change background image of that button which is clicked.</p>
<pre><code><input style="float:right; padding-right:10px;" name="comp_sephora" id="comp_sephora" type="submit" value="Sephora" onClick="change(this.style);">
<input style="float:right;" type="submit" name="comp_bloom" id="comp_bloom" value="Bloom" onClick="change(this.style);">
</code></pre>
<p>i have used javascript function for that:</p>
<pre><code>function change(style)
{
//alert(val);
style.backgroundImage = "url(<?php echo IMAGES."btn1.bmp"; ?>)";
//style.color = "#000000";
}
</code></pre>
<p>but when i was clicked then image changed for only few seconds. i want to maintain that image after page reload.</p>
|
php javascript
|
[2, 3]
|
163,416 | 163,417 |
Using Javascript/JQuery and getting undefined var when the page loads
|
<p>I have this Javascript/JQuery code:</p>
<pre><code><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
name = $("#name").val();
alert("Name: " + name);
</script>
</code></pre>
<p>And this HTML:</p>
<pre><code><form name="report" action="send.php" method="post">
<input type="text" name="name" id="name" value="Senna" />
<input type="submit" value="Send" />
</form>
</code></pre>
<p>When the page loads i get "Name: undefined" instead of "Name: Senna".</p>
<p>Can someone help me to get the expected result?</p>
|
javascript jquery
|
[3, 5]
|
4,286,233 | 4,286,234 |
Javascript Date Validation
|
<p>How to validate particular format date string using Javascript?
I have one date picker which has the display format like "dddd MMMM dd, yyyy"(displaying like this:"Wednesday February 03, 2010".) So i have to validate this format using javascript. Please help me for implementing this..</p>
|
asp.net javascript
|
[9, 3]
|
2,166,271 | 2,166,272 |
How do I create a superclass that extends AsyncTask?
|
<p>I have to extend the android class android.os.AsyncTask (Params, Progress, Result). I have to add new methods and class variables without setting (Params, Progress, Result) in the superclass, as types will be defined by its children.</p>
<pre><code> AsyncTask <Params, Progress, Result>
|
My superclass <Params, Progress, Result>
|
┌───┴───────────────┬───────────────────┐
| | |
Child1 <Integer, Void, Integer> | |
| |
Child2 <JSONObject, Void, Integer> |
|
Child3 <String, Void, Integer>
</code></pre>
<p>How do I implement this?</p>
|
java android
|
[1, 4]
|
5,313,544 | 5,313,545 |
DllImport method isn't receiving data
|
<pre><code>BYTE* pImageBuffer = NULL;
eResult res = PlayerLib::CreateImageSnapshot( iPlayerRef, eBMP, &pImageBuffer );
if( res > 0 )
{
.... // do something with the image
WriteFile(FileHandle, pBuffer, eRes, NULL, NULL);
ReleaseImageSnapshot( pImageBuffer ); // free the image buffer in not longer needed!
}
</code></pre>
<p>here i can receive the image data in pImageBuffer and i could do the some image process</p>
<p>the same way I have tryed in c# like</p>
<pre><code> [DllImport("PlayerLib")]
public static extern int CreateImageSnapshot(int iPlayerRef, eImageFormat imgFormat,byte[] ppImageBuffer);
byte[] bte ;
CreateImageSnapshot(iPlayerref,eImageFormat.ePNG,bte);
</code></pre>
<p>here its giving some unhandeld Exception..... hopefully the problem is in byte[] but i can't point out...
please help me to overcome it.... thanks in advance</p>
<p>here it shoud return the imagedata in ppImageBuffer... but here it's giving zero byte only</p>
|
c# c++
|
[0, 6]
|
5,717,407 | 5,717,408 |
stack activity in android
|
<p>Hi i am working with android , and i have a problem with the activity stack. As i know, when someone uses the back button, reload the back activity. But in the case i have many layouts shown from one activity, how can i go back to them.</p>
<p>Here is the deal, i am using a listview filled with categories, and when i press an item, i reuse the activity and the layout, to show its subcategories. So what i need is to came back no to the back activity, not to the back layout, but to the back "state".</p>
<p>Well, the idea is simple, first i show all the categories with no parent, then when i pressed an item, i show its subcategories.</p>
|
java android
|
[1, 4]
|
687,089 | 687,090 |
what is the difference between .last() and :last?
|
<p>Can someone explain the difference between .last() and :last ? I can't seem to find a definitive explanation.</p>
<p>Why Exactly does this <code>$('td.cellsOfSpecificClass:last', '.table tr')</code> return the last td in each tr instead of the last td in the whole table?</p>
|
javascript jquery
|
[3, 5]
|
260,599 | 260,600 |
Multiple JQuery actions based on timer
|
<p>I have a testimonial box that has the testimonial within it, and then I have icons indicating whom provided the testimonial underneath. Connected to the box and right above the icon is a little arrow that can be generated via CSS or an image.</p>
<p>Every 5 seconds, it should change the testimonial content via a fade-in/fade-out, the little image should slide to the right, and the icon should fade to a colored version of the icon. At the end of the loop (when it reaches the 5th one), the arrow should slide all the way to the left and the loop should begin again.</p>
<p>I'm not too familiar with how I can do this with a loop efficiently, or how to time it. I know the basics of how I can fade it in and whatnot, but I'm lost on the rest. </p>
<p><img src="http://i.stack.imgur.com/6lUQD.jpg" alt="enter image description here">
Thank you very much!</p>
|
javascript jquery
|
[3, 5]
|
4,048,085 | 4,048,086 |
Get Windows Service Description ASP .NET
|
<p>I'm writing a service monitoring ASP .NET app and I'm having issues particularly with getting the service descriptions. My current method (reading from registry) is not going to work due to registry read permissions on the production server.</p>
<p>For example:</p>
<pre><code>Microsoft.Win32.RegistryKey system, currentControlSet, services, service;
system = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System");
currentControlSet = system.OpenSubKey("CurrentControlSet");
services = currentControlSet.OpenSubKey("Services");
service = services.OpenSubKey(scTemp.ServiceName, true);
row["service_description"] = service.GetValue("Description");
</code></pre>
<p>Produces:</p>
<blockquote>
<p>System.Security.SecurityException: Requested registry access is not allowed.</p>
</blockquote>
<p>My question is:</p>
<p>Is there a work-around with another .NET class (maybe under System.ServiceProcess namespace?) or will it always end with a security exception error?</p>
<p>I have no issues getting Service names and states with the System.ServiceProcess namespace but I can't find any classes contained to get descriptions which is why I resorted to reading from registry.</p>
|
c# asp.net
|
[0, 9]
|
5,427,540 | 5,427,541 |
How to hide any row in a table whose third cell value does not match a given string in JQuery
|
<p>If i have a table:</p>
<pre><code><table id="myTable">
<tr>
<td>1</td><td>2</td><td>NoMatch</td><td>4</td>
</tr>
<tr>
<td>1</td><td>2</td><td>Match</td><td>4</td>
</tr>
</table>
</code></pre>
<p>I have been trying:</p>
<pre><code>$(document).ready(function () {
$('input#myInput').keyup(function (val) {
// for each third td of each row, if this value does not contain: this.val() then hide it
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,440,376 | 5,440,377 |
jquery cycle to vertically scroll through table
|
<p>Okay I have a table that I am populating with 25 rows of information. I want to use Jquery cycle or something similar to create a vertical scrolling effect, so the rows constantly scroll vertically upwards through a container that can display roughly five rows at a time. </p>
<p>I have used jquery cycle for numerous things, but for some reason I am at a dead end on trying to get it to work for a table.</p>
<p>I think my confusion is probably on how I need to set up my table/container structurally so cycle knows what children or elements to apply to:</p>
<pre><code>$(document).ready(function() {
$('#table_container').cycle({ //Will this even work for a table???
fx:'scrollVert',
continuous: 1
});
});
</code></pre>
<p>So how do I structure the table elements so cycle influences them? </p>
<p>More on <a href="http://jquery.malsup.com/cycle/" rel="nofollow">Jquery Cycle</a>, from their website:</p>
<p>The plugin provides a method called cycle which is invoked on a container element. Each child element of the container becomes a "slide". Options control how and when the slides are transitioned.</p>
|
javascript jquery
|
[3, 5]
|
3,296,830 | 3,296,831 |
web-development: how to display an increasing number of messages?
|
<p>I want to build a website that display changing text-messages.</p>
<p>The server gets the text-messages from a DB.
I wanted to grab a chunck of msgs, shufle them and send them to the client to present each of them. When the client is done with the current chunck he asks the server for the next chunck.</p>
<p>can some one help me with client side psudou-code?
I though to use asp.net ans JS but I'm newbie to JS.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,113,955 | 2,113,956 |
Jquery Asp.net button disable
|
<p>html code:</p>
<pre><code><asp:Button runat="server" ID="btnTest" Text="Test" OnClick="btnTest_Click" />
</code></pre>
<p>Jquery Code:</p>
<pre><code>$('[id$=btnTest]').click(function(){
$('[id$=btnTest]').attr('disabled', 'true');
});
</code></pre>
<p>CodeBehind:</p>
<pre><code>protected void btnTest_Click(object sender, EventArgs e)
{
//here not come.
}
</code></pre>
<p>Code Behind btnTest event not work ?</p>
|
asp.net javascript jquery
|
[9, 3, 5]
|
5,327,287 | 5,327,288 |
Error when does not select data from DDL
|
<p>I had this message </p>
<blockquote>
<p><em>Input string was not in a correct format</em> </p>
</blockquote>
<p>when inserting values into the database. When I checked I have DDL but I did not select value from it so this message appeared, although I make this column in the database to allow NULL value.</p>
<pre><code>protected void BT_submit_Click(object sender, ImageClickEventArgs e)
{
string File = "~/CvFiles/" + FU_CV.FileName;
if (FU_CV.FileBytes.Length > 4194304)
{
modalpopup.Show();
}
else
{
app.AddApplicant(txt_Mname.Text, Convert.ToInt32(DDL_Dept.SelectedValue));
}
}
private void loadDepts()
{
DDL_Dept.DataSource = d.GetAll();
DDL_Dept.Items.Clear();
DDL_Dept.AppendDataBoundItems = true;
DDL_Dept.Items.Insert(0, new ListItem("-All-", "NULL"));
DDL_Dept.DataValueField = "id";
DDL_Dept.DataTextField = "name";
DDL_Dept.DataBind();
}
public bool AddApplicant(string MiddleName, int Dept_ID)
{
SqlCommand cmd = new SqlCommand("SP_Insert_IntoApplicantforuser");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@MiddleName", MiddleName);
cmd.Parameters.AddWithValue("@Dept_ID", Dept_ID);
System.Data.SqlClient.SqlParameter paramter1 = cmd.Parameters.Add("@AppID", SqlDbType.Int);
paramter1.Direction = ParameterDirection.Output;
bool rowaffected;
rowaffected = DBHelper.Instance().Insert(cmd);
if (rowaffected == false)
{
AppID = (int)paramter1.Value;
}
return rowaffected;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,095,748 | 4,095,749 |
Posting data to an aspx form from an android app
|
<p>I want to send data from my app to <a href="http://studentssp.wit.ie/Timetables/POSTT.aspx" rel="nofollow">http://studentssp.wit.ie/Timetables/POSTT.aspx</a> that page and I'm not sure how to do that. All that I have tried atm is adding some of the form values to the url to see if that changes anything, but it hasn't. e.g. I put cboSchool=EP (the name value of the select is cboSchool and the value of the School of Adult Education is EP) into the url to see if it would only load information regarding that school. <a href="http://studentssp.wit.ie/Timetables/POSTT.aspx?cboSchool=EP" rel="nofollow">http://studentssp.wit.ie/Timetables/POSTT.aspx?cboSchool=EP</a>
I'm knew to android and know nothing about aspx.</p>
|
android asp.net
|
[4, 9]
|
2,787,189 | 2,787,190 |
How do I pass a customer keyup handler with params?
|
<p>So say I have this ..</p>
<pre><code> keyup_handler: function(e, item){
if (e.which == 27) {
close_lightbox(item);
return false;
};
}
$(document).live('keyup', function(e){ keyup_handler(e, item) });
</code></pre>
<p>This is not returning any console.log()'s I place in here. So I assume that that it's not being touched. What am I missing? How do I pass the <code>e</code> or <code>event</code> to keyup_handler?</p>
<p>jQuery 1.4.4</p>
|
javascript jquery
|
[3, 5]
|
3,708,003 | 3,708,004 |
OnmouseOver Jquery/Javascript call external function
|
<p>I could be mistaken here but I thought that inline html can call an external javascript file's function with onmouseover.</p>
<p>For example:</p>
<pre><code><a href="#" onmouseover="updateParentImage('<?php echo $this->getGalleryUrl($_image) ?>');">
</code></pre>
<p>And my EXTERNAL jquery/javascript file function looks like:</p>
<pre><code> function updateParentImage ($image_url)
{
alert($image_url);
$('.product-img-box .product-image img').attr('src', $image_url);
}
</code></pre>
<p>The function never runs. Am I completely missing something? Shouldn't that tag call the appropriate file even thought the javascript is external?</p>
<p>Note: If I include the javascript inline, the alert box shows but the image that I am trying to change in the document does not change, even though I"m using the same referencing as another place in the code where it successfully updates the image.</p>
<p>Any help would be appreciated. Thanks!</p>
|
php javascript jquery
|
[2, 3, 5]
|
561,672 | 561,673 |
Python web client programming library
|
<p>I am working on a client-server simulation software. And I want the client to be implemented on the web, and also require that the client can do computations like matrix multiplication, random number generation etc., which framework can I use? And also I hope that the client side and server side communicate using simple socket, because the server code is implemented with c++. Any suggestions are really appreciated!! </p>
<p>Thanks </p>
<p>Simon </p>
|
c++ python
|
[6, 7]
|
1,679,346 | 1,679,347 |
how to view Pdf from url in PdfViewerActivity
|
<p>Hi i made an android app for viewing local Pdf file in PdfViewerctivity.It is working fine for local pdf.How can i read pdf fetched from URL in PdfViewerActivity?
My java code for downloading file from url and storing it in sdcard is here <a href="http://pastie.org/6191997" rel="nofollow">http://pastie.org/6191997</a></p>
<p>Can someone tell me how can i call intent for pdf reading from url??</p>
|
java android
|
[1, 4]
|
3,734,675 | 3,734,676 |
Select first word in a container
|
<p>maybe this is easy or I overlooked it</p>
<p>but if i have:</p>
<pre><code><div class='test'>Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</div>
</code></pre>
<p>how can i select the first word of it? [in this example 'Fusce']</p>
|
javascript jquery
|
[3, 5]
|
11,826 | 11,827 |
Runing a cpp binary on php could speed up my code?
|
<p>I'm a php developer as well as cpp developer. I was wondering: if I make a cpp binary and I run it on php. Will that make my process run faster?</p>
<p>For example: </p>
<p>I have to compare 1,000 array elements and execute a process for each of them and in some cases I had to run it over and over again ( recursively) . Yes is messup but it works !.</p>
|
php c++
|
[2, 6]
|
4,738,467 | 4,738,468 |
increase response rate to ip log
|
<p>I am logging visits to several of my pages to determine geographic areas of visitors. I am using the google client location api. I seems to work correctly on my development equipment. However, only a few of my visitors are actually being logged to the database. What can I do to increase the logging percentages?</p>
<pre><code><script src="http://www.google.com/jsapi" language="javascript"></script>
<script type="text/javascript" charset="utf-8">
if (google.loader.ClientLocation != null) {
var city = google.loader.ClientLocation.address.city;
var region=google.loader.ClientLocation.address.region;
var country=google.loader.ClientLocation.address.country;
var country_code=google.loader.ClientLocation.address.country_code;
var pagetitle=document.getElementById('pagetitle').innerHTML;
var ip = "<?php echo $_SERVER['REMOTE_ADDR'];?>";
var url= "<?php echo $_SERVER['REQUEST_URI'];?>";
$(document).ready(function() {
var data="city=" + city + "&region=" + region + "&country=" + country + "&country_code=" + country_code + "&ip=" + ip + "&pagetitle=" + pagetitle + "&url=" + url;
$.ajax({
url:'somefile.php',
type:'post',
cache:false,
data:data
});//end ajax
});//end doc ready
}//end if not null
</script>
</code></pre>
|
php javascript
|
[2, 3]
|
2,193,582 | 2,193,583 |
How to verify Digital Signature generated in C# for JAVA
|
<p>I have a string digitally signed in C#.
The target to which the string is needed to be send use JAVA.</p>
<p>How can i verify Digital signature in JAVA before send it to other end.</p>
|
c# java
|
[0, 1]
|
1,456,239 | 1,456,240 |
extract line from javascript
|
<p>I need to extract this line of code from a script i am retrieving via ajax..</p>
<p>this line <code>new Date(2010, 10 - 1, 31, 23, 59, 59)</code> from </p>
<pre><code>jQuery(function () { jQuery('#dealCountdown').countdown({
until: new Date(2010, 10 - 1, 31, 23, 59, 59),
serverSync: serverTime,
timezone: +11,
compact: true,
format: 'HMS',
expiryUrl: BASE,
layout: '
</code></pre>
<p>Is it possible to do this with jquery. The jquery selector won't let me manipulate script tags.</p>
<p>Any help would be greatly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
4,365,258 | 4,365,259 |
Jquery div scroll question
|
<p>I have a page that requires multiple divs with the same class name. Within each div is text that I'd like to scroll via controllers.</p>
<p>I can't figure out how to make it so that the controllers in each div only scroll the text that's in their specific div and not the text in every div that shares the same class on the page. Each of the divs look like this:</p>
<pre><code><div class="box-wrap">
<div class="box"> Text that will be scrolled </div>
<div class="controllers">
<div class="button1"> Scroll Up </div>
<div class="button2"> Scroll Down </div>
</div>
</code></pre>
<p>Using the code below everything works but the buttons in each div will cause <em>every</em> div on the page to scroll:</p>
<pre><code>$(".button1").click(function(){
$(".block").animate({"top": "-=50px"}, "slow");
});
$(".button2").click(function(){
$(".block").animate({"top": "+=50px"}, "slow");
});
</code></pre>
<p>Changing code to <code>$(".block", this).animate({"top": "+=50px"}, "slow");</code> makes it stop working altogether.</p>
<p>Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
3,294,684 | 3,294,685 |
Something is overriding some of my jigoshop widgets
|
<p>I'm creating my first eCommerce wordpress website which I have work on for weeks now, I'm nearly at finished but some of the jigoshop widgets and features are not working for example the price filter is not showing up and the fancy box feature isn't showing up too.</p>
<p>I have a demo of the site up at <a href="http://demo.remi-niscenthair.com/shop/" rel="nofollow">http://demo.remi-niscenthair.com/shop/</a> I would be very grateful for any advice on how to get these issues sorted. </p>
|
php jquery
|
[2, 5]
|
3,186,208 | 3,186,209 |
Using LoadControl without a Page
|
<p>How can I load a control without a Page?</p>
<pre><code>public void Something()
{
var ascx = /*LoadControl*/("my.ascx"); // being Page = null
var ctl1 = ascx.Controls[0];
var ctl2 = ascx.Controls[1];
}
</code></pre>
<p>my.ascx:</p>
<pre><code><%@ Control Language="C#" %>
<asp:Literal ID="ctl1" runat="server" />
<asp:Label ID="ctl2" runat="server" />
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,775,563 | 5,775,564 |
Getting JavaScript variable in embeded C# code
|
<p>I am trying to write a simple <em>for</em> in JS which uses an element from a list declared in C# code behind. Actually there is a problem here: <code>['i']</code> - compiler doesn't know what is <code>i</code>. </p>
<p>How can I write this for properly? </p>
<pre><code>for (var i = 0; i < '<%= poz.Count %>'; i++) {
var Latitude = '<%= poz['i'].Latitude %>';
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,373,193 | 2,373,194 |
Meaning of :: Operator in C# and PhP
|
<p>In my work I have come across syntax like global:: (C#) or G:Loading($value) in Php, what do they mean?</p>
|
c# php
|
[0, 2]
|
492,005 | 492,006 |
How can I use delay on textview for show text?
|
<p>When i click button first time. Program will random text. then when i press button again it will delay slow to show text</p>
<p>my code</p>
<pre><code>public void onClick(View v) {
final MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.yeehaw);
showRandom = !showRandom;
t = new Thread() {
public void run() {
try {
while(showRandom) {
sleep(5);
mp.start();
handler.sendMessage(handler.obtainMessage());
}
} catch(Exception ex) {
ex.printStackTrace();
}
}
};
t.start();
}
</code></pre>
|
java android
|
[1, 4]
|
3,250,814 | 3,250,815 |
Jquery fade-in and out loop
|
<p>I've updated an old javascript of mine to work with Jquery recently. </p>
<p>It does the following:</p>
<p>When a user hovers over a link with a class of <code>content-fade</code> it causes content with an associated <code>id</code> to fade-in and then within a set time fade-out unless the user leaves their mouse on the content.</p>
<p>I need to change the script again and have it loop through a set of <code>id</code>s aka id1, id2, id3...etc. Ideally causing the only the content with the individual associated id to show. I've just started working with JQuery and I'm not sure how best to approach this. The code is below if anyone could point me in the right direction I would appreciate it.</p>
<pre><code> $(document).ready(function() {
var hide = false;
$(".content-fade").hover(function(){
if (hide) clearTimeout(hide);
$("#id").fadeIn();
}, function() {
hide = setTimeout(function() {$("#id").fadeOut("slow");}, 250);
});
$("#id").hover(function(){
if (hide) clearTimeout(hide);
}, function() {
hide = setTimeout(function() {$("#id").fadeOut("slow");}, 250);
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
465,435 | 465,436 |
Which is more efficient - $('selector').last() or $('selector:last')?
|
<p>I have a parent element with a real lot of child elements (1000s). I am looking for the fastest possible way to get a handle to the last child element. The options I've found are:</p>
<pre><code>$('.parent .child').last()
</code></pre>
<p>and </p>
<pre><code>$('.parent .child:last')
</code></pre>
<p>Any opinions on which one is reliably faster across browsers?</p>
<p><strong>EDIT</strong></p>
<p>I wrote a test in jsfiddle to measure this out and it turns out the difference is pretty much negligible. Though .last() was performing better, the difference is negligible. So i think even with the :last selector, it is actually getting the whole list of elements and then returning the last element? Unbelievable.</p>
<p><strong>Fiddle:</strong> <a href="http://jsfiddle.net/techfoobar/GFb9f/8/" rel="nofollow">http://jsfiddle.net/techfoobar/GFb9f/8/</a></p>
|
javascript jquery
|
[3, 5]
|
3,383,303 | 3,383,304 |
Animating a div's apearance on mouseover in jquery
|
<p>I wanted to animate a div on mouseover.
I just don't know how to make it fade in/appear slowly (I think we have to use the .animate function or something like that)</p>
<pre><code>$("#logo").mouseover(function() { $("#nav").css('visibility','visible'); });
</code></pre>
<p>Will appreciate any help :)</p>
|
javascript jquery
|
[3, 5]
|
4,968,306 | 4,968,307 |
Jquery find next (specified) element not working
|
<p>I am trying to find the next div using Jquery. Here is the code:</p>
<pre><code>$('.menu-item').hover(function() {
$(this).stop(true, true).addClass("menu-item-hover", 300);
$(this).next('div').stop(true, true).fadeIn(300);
}, function() {
$(this).stop(true, true).removeClass("menu-item-hover", 300);
$(this).next('div').stop(true, true).fadeOut(300);
});
<a href="media.html"><div class="menu-item"><h1>Media</h1></div></a>
<div id="tooltip-media">Sights and sounds from Cambodia</div>
<a href="about.html"><div class="menu-item"><h1>About</h1></div></a>
<div id="tooltip-about">Who in the world is the Phillips Family?</div>
</code></pre>
<p>Simple. The <code>toolip-*</code> divs are hidden in css. I want the next one in the code to show on hover of the <code>menu-item</code>. I have checked other questions and none of them work for my case. I am using both Jquery and Jquery UI. Thanks for any help.</p>
|
javascript jquery
|
[3, 5]
|
6,015,617 | 6,015,618 |
jQuery - iterate through all elements with class and change their style
|
<p>I know this is supposed to be simple, but I'm running into multiple problems. First of all, I don't know how to get all elements of a class and change their display. I found the <code>.each</code> method with this sample code:</p>
<pre><code>$('.classname').each(function(index) {
alert(index);
});
</code></pre>
<p>What do I need instead of the alert to change the display property of an element from 'none' to block'?</p>
<p>The second problem is, the class name is gathered from a hidden field. Let's name this variable <code>service</code>. When I try to replace the '.classname' with '.'+service I get an error saying 'Syntax error, unrecognized expression: .'.</p>
<p>So the actual code would be something like:</p>
<pre><code>var service=$('#service').val();
$('.'+service).each(function(index) {
alert(index);
});
</code></pre>
<p>I'm sure this can't be complicated but I can't figure it out.</p>
<p>Any alternative solution is of course welcome.</p>
|
javascript jquery
|
[3, 5]
|
1,708,103 | 1,708,104 |
How enable existing radio to broadcast on website?
|
<p>With existing radio; for example the BBC, how to enable internet users to listen to it through the BBC website?
Any specific reference would be appreciated that is compatible with PHP or Java.</p>
|
java php javascript
|
[1, 2, 3]
|
2,292,828 | 2,292,829 |
Fade Div out and fade next div and animate child element within
|
<p>I have 3 divs i want to fade in, then out and once they have faded in, have the child element animate its way up, so it comes in from the bottom right. </p>
<p>Ive made the following but cant seem to get any further, has anybody got at ideas? </p>
<p><a href="http://jsfiddle.net/FeqkB/2/" rel="nofollow">http://jsfiddle.net/FeqkB/2/</a></p>
|
javascript jquery
|
[3, 5]
|
4,820,372 | 4,820,373 |
javascript error with label
|
<p>I have a function as follows:</p>
<pre><code>function textNext(element, num) {
document.getElementById("lblContent").innerHTML = "hello";
}
</code></pre>
<p>However, the text of the <code>lblContent</code> label won't change when the function is called. </p>
<p>What am I doing wrong?</p>
<p>btw : lblContent is of type asp:Label</p>
|
javascript asp.net
|
[3, 9]
|
4,712,539 | 4,712,540 |
Jquery Wait for animation to finish before leaving the function
|
<p>I have an animation inside a function. How can I code such that the animation should finish first before leaving the function?</p>
<p>Consider the code below:</p>
<pre><code>ShowBanner.prototype.basicRotate = function (pos, callback) {
var self = this;
self.animation = true;
this.bigbannerScroll.animate({
left: pos
}, this.settings.rotateSpeed, function () {
self.animation = false;
if (callback) callback();
console.log('animation done');
return false;
});
console.log('function done');
}
</code></pre>
<p>Based on the code, the <code>console.log('function done')</code> is called first before the <code>console.log('animation done')</code>. Is there a way for the first log to be called first, stating that the animation was finished before leaving the function?</p>
|
javascript jquery
|
[3, 5]
|
1,300,772 | 1,300,773 |
$.ajax JQuery progress bar
|
<p>I have a sql queries being executed via an ajax call, but I need to be able to check the progress of it and update a progress bar.</p>
<p>Here's my simple ajax call (using JQuery):</p>
<pre><code>var strResult = (($.ajax({url: URL,async: true}).responseText));
</code></pre>
<p>Any ideas how I listen for changes to update the bar?</p>
<p>PS. This question is nothing to do with SQL.</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,252,010 | 2,252,011 |
Hide a div on hover outside of div
|
<pre><code><div id='container'>
<div id="animate"></div>
</div>
</code></pre>
<p>I have a small div inside a big div with id container . i want to hide div with id animate if someone hovers the out side of small div . it should remain open when mouse is over the small div . </p>
|
javascript jquery
|
[3, 5]
|
1,195,091 | 1,195,092 |
control after unexpected shutdown
|
<p>I'm working on a program that sends a command to the server and creates a file on the server to let it know its connected for example, while the program is running it creates a file say "here" everytime it loops, a php site then checks the server for that file, if the file is there it knows the program is connected. However when it suddently stops say because the computer is shutdown, it might happen to shutdown when the file has been created, so say it shutsdown now in 5minutes if the server checks the file will be there, is there any way to have the program delete the file on unexpected shutdown? This is on C++.</p>
<p>thank,</p>
|
php c++
|
[2, 6]
|
913,163 | 913,164 |
How to animate an items transparecy while it is moving
|
<p>I am trying to have a dollar sign pup up and move up about 100px. The dollar sign should fade in then fade out while it is in the process of moving. I cannot figure this out. Here's what I'm using right now, which has a pause in between operations. I need no pause. Thanks!</p>
<pre><code>$("#dollar1").animate({
opacity: 1,
top: '480px'
}, 1000);
$("#dollar1").animate({
opacity: 0,
top: '440px'
}, 1000);
</code></pre>
|
javascript jquery
|
[3, 5]
|
408,198 | 408,199 |
Selecting all check boxes using header check box in grid of asp.net
|
<p>It tried many solutions but nothing worked. Please provide me jquery code to select all check boxes of current page of gridview by checking checkbox in header template. I am using asp.net 4 using c#. Any detailed guidance will be highly appreciated. </p>
|
c# jquery asp.net
|
[0, 5, 9]
|
4,759,533 | 4,759,534 |
How to change the weight size of a fragment in android?
|
<p>Here is the xml-Layout of my fragment view</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:weightSum="100"
>
<fragment
android:id="@+id/menuFragment"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="70"
class="com.pack.Menufragment" >
</fragment>
<fragment
android:id="@+id/bodyFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="30"
class="com.pack.BodyFragment" >
</fragment>
</LinearLayout>
</code></pre>
<p>Now I want to change the fragment weight size from the java not from XML, is there anyway to do this?</p>
|
java android
|
[1, 4]
|
5,517,162 | 5,517,163 |
Call jQuery defined function via string
|
<p>I'd like to call functions I've defined within the document ready function of jQuery, but am having a bit of trouble. I have the following code:</p>
<pre><code>jQuery(document).ready( function($) {
function test1() {
alert('test1');
}
function test2() {
alert('test2');
}
var test_call = '2';
var fn = 'test' + test_call;
// use fn to call test2
});
</code></pre>
<p>I don't want to use <code>eval</code>, and <code>window[fn]</code> doesn't seem to be working. The two test functions don't appear to be indices in the window variable. I appreciate the help and knowledge.</p>
|
javascript jquery
|
[3, 5]
|
732,577 | 732,578 |
How do I get the onclick variable into a dialog function
|
<p>I have a onclick event that has a value in it that I want to post to a backend php script. Just not sure how to get it in the dialog function. </p>
<pre><code>function reorder(job_index)//<--------this fella
{
$('#dialog').dialog('open');
}
$(document).ready(function(){
$(function() {
$("#dialog").dialog({
bgiframe: true,
autoOpen: false,
height: 250,
width: 600,
modal: true,
buttons: {
'Yes, use the number above': function() {
var jobID=$("#jobnumber").val();
$.post("rpc.php", {
job_index:job_index,// <-------to here
jobID:jobID,
method: "reorder"
},
function(data,textstatus)
{
alert(data.message);
}, "json");
},
'No, create a new number for me': function() {
$(this).dialog('close');
},
Cancel: function() {
$(this).dialog('close');
}
}
});
});
});
</code></pre>
<p>The value is job_index. Any tips?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,170,453 | 4,170,454 |
jQuery Datepicker - Multiple instances and disable previously selected dates?
|
<p>I have a page where the user can select three different appointment days using the jQuery UI Datepicker. When the user selects a day in the first field, I would like that date blocked out from the other two fields. I currently am also disabling Sundays, but cannot get dynamic date disabling working.</p>
<pre><code> Appointment Time 1<br />
<input id="appointment1_date" type="text" name="appointment1_date" value="Select..." />
Appointment Time 2<br />
<input id="appointment2_date" type="text" name="appointment2_date" value="Select..." />
Appointment Time 3<br />
<input id="appointment3_date" type="text" name="appointment3_date" value="Select..." />
<script type="text/javascript">
function noSunday(date){
var day = date.getDay();
return [(day > 0), ''];
};
</script>
<script type="text/javascript">
$(function() {
$("#appointment1_date").datepicker(
{
minDate: +2,
beforeShowDay: noSunday
});
});
$(function() {
$("#appointment2_date").datepicker(
{
minDate: +2,
beforeShowDay: noSunday
});
});
$(function() {
$("#appointment3_date").datepicker(
{
minDate: +2,
beforeShowDay: noSunday
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,533,387 | 2,533,388 |
Shorten C# ASP.NET URL's when submitting a form
|
<p>My URL length is capped at 2084 characters and I have forms that need to have essay's emailed. I am not using MVC, not sure if that matters. Forms are set to POST data, runat=server. I just want the code behind the main page to load and send an email, I don't need all the variables passed in the URL. Is this possible or does ASP.net just fill up the URL with VIEWSTATE data? If so, how can I send an email with this data without it going in the url?</p>
<p>Oh I also edited the web.config to allow a larger maxQueryStringLength but from what I am reading older browsers don't really support that anyway.</p>
<pre><code><form id="infoForm" runat="server" name="contactForm" method="POST" action="#">
<!--Other form stuff here-->
<asp:Button class="button" id="submitButton" Text="Submit" runat="server"
onclick="submitButton_Click" />
</form>
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,908,534 | 2,908,535 |
jQuery functions
|
<p>I'm trying to remove a class from a HTML tag along with adding a new one and also doing some other magic.</p>
<p>Right now I just have a procedure style coding going on... which I know there's another way of doing it. Like creating a function within another function? I'm not sure what it's called and sometimes when trying to do it, it never worked so I went down procedure style type but I figured I post on here and maybe someone can explain to me on how jQuery works? Right now I have like</p>
<pre><code>$(this).removeClass("theClass");
$(this).addClass("theClass");
$(this).slideDown();
</code></pre>
<p>I think I can do something like </p>
<pre><code>$(this).removeClass("theClass", function(){
// other goodness?
});
</code></pre>
<p>Thanks everyone. Sorry if i don't make sense.</p>
|
javascript jquery
|
[3, 5]
|
5,087,131 | 5,087,132 |
How can I access content of a website client side?
|
<p>I've set up my own whatsmyip type site that returns a simple string of the callers external IP.</p>
<p>But I can't figure out how to get the queried text into an asp control for use.</p>
<p>I can load it up in an iframe and see it on the page, but accessing it and using it is blocked for built in security reasons.</p>
<p>I can get it working server side with ~WebClient.DownloadString("Whatsmyip.com").
But I need the client's IP, not the web servers.</p>
<p>Thanks!</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
355,549 | 355,550 |
for loop inside scroll function
|
<p>How can i multipy functions inside the scroll loop?</p>
<p>I have:</p>
<pre><code>$(window).scroll(function() {
b1Center = $("#block-1").offset().top - ( $(window).height() - divHeight )/2;
b1Bottom = $("#block-1").offset().top - $(window).height()
b1Top = $("#block-1").offset().top + divHeight;
if(getScrollTop() > b1Bottom && getScrollTop() < b1Top){
$("#block-1 .txt").css('marginTop', ( (getScrollTop()) *(1.6)) + 'px');
}...
</code></pre>
<p>That needs to be inside scroll function redy all the time and i have the same block for all buttons so: </p>
<p><a href="http://jsfiddle.net/Dx3hr/27/" rel="nofollow">http://jsfiddle.net/Dx3hr/27/</a></p>
<p>Hope this will make more sense.</p>
|
javascript jquery
|
[3, 5]
|
2,478,674 | 2,478,675 |
Server tags cannot contain <% ... %> constructs
|
<p>I am trying to use CDN for my images on the website.
Problem is, sometimes I have server controls such as ImageButton, and I would like to use a class in order to fully extract the path of the CDN. for that purpose I tried doing:</p>
<pre><code><asp:ImageButton runat="server" OnClick="Agree" ImageUrl="<%=ResourceManager.GetImageCDN("iagree.png")%>" />
</code></pre>
<p>and I get the title as error.</p>
<p>Only if I'm using <%# it will work (and only if I an databinding).
How can I do this easily? how can I place CDN code on my markup code?</p>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
175,195 | 175,196 |
How to manage the native heap?
|
<p>I'm researching about lazy list, and i have a concern about it</p>
<p>When the native heap is too lager, how can we detect and control it (clearing or reset all count ... ) ??</p>
<p>Please, help me :(!</p>
|
java android
|
[1, 4]
|
1,154,569 | 1,154,570 |
Issue with jQuery ajax post
|
<p>This is a followup to this <a href="http://stackoverflow.com/questions/10730765/how-to-find-a-sibling-elements-value-using-jquery-upon-click">question</a>. Since the problem that I'm now facing is different from that, I thought I'll pose a new question. </p>
<p>I'm having an issue with the following code where in, the request is getting POSTed to the server, but whatever response the server has sent is not visible on the browser (in the form of an alert here).</p>
<pre><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('#login').delegate('input#submit','click',function(){
var request = $.ajax({
type: "POST",
url: "login",
data: {userid: $("#userid").val(), password:$("#password").val()},
datatype: "xml",
cache: false,
success: function(xml){alert(xml);}
});
});
});
</script>
</code></pre>
<p>I can see that this request is going to the server - can see it in the logs. But I don't see the server's response in the browser. Here's the server's response:</p>
<pre><code><result><url>landing-page</url></result>
</code></pre>
<p>Not sure what am I doing wrong, but this seems to be simple stuff that I should get it working without issue. Tried Firebug, but no luck. Any idea as to where am I going wrong here or on how to debug this issue further.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,414,595 | 4,414,596 |
Cancel hoverIntent timer
|
<p>I've used jQuery and hoverIntent plugin many times, for dropdown menus and advanced navigation that should be a bit more elegant. But I've run into a problem. </p>
<p>I have a menu with a clickable li element that also has a hover. <strong>If someone clicks it before the intent timer triggers I want to cancel the hoverintent</strong>, just because it looks nicer.</p>
<p>I can't figure out how though, designer first, coder second. This is what calls the intent:</p>
<pre><code>$('#navigationContainer ul li').hoverIntent(configDown);
</code></pre>
<p>It's got a variable configDown that defines sensitivity etc. And two functions called slideUp and slideDown. Everything works perfectly. </p>
<p>If someone clicks this same element, I want to cancel the hoverIntent. Any help would be appreciated.</p>
|
javascript jquery
|
[3, 5]
|
543,879 | 543,880 |
How do I load results using php and jquery as I scroll?
|
<p>How do I load results using php and jquery as I scroll? E.g. like twitter, facebook and Especially <a href="http://cssline.com/" rel="nofollow">http://cssline.com/</a></p>
|
php jquery
|
[2, 5]
|
303,906 | 303,907 |
how to show 20 rows on datagrid each time?
|
<p>i show data on gridview like this:</p>
<pre><code>SQL = "SELECT * FROM MEN ";
dsView = new DataSet();
adp = new SqlDataAdapter(SQL, Conn);
adp.Fill(dsView, "MEN");
adp.Dispose();
GridView1.DataSource = dsView.Tables["MEN"];
GridView1.DataBind();
</code></pre>
<p>but i see along list... </p>
<p>how to show Every time only 10 rows ?</p>
<p>i work on asp.net and C#</p>
|
c# asp.net
|
[0, 9]
|
293,541 | 293,542 |
DetailsView Preview mode?
|
<p>DetailsView1.DefaultMode = DetailsViewMode.Insert;</p>
<p>After inserting how can i Preview Data before Submitting/Inserting data in the table?</p>
<p>I know the code would be:
DetailsView1.DefaultMode = DetailsViewMode.ReadOnly;</p>
<p>Where do I put this code BEFORE submitting/inserting data in the table?</p>
|
c# asp.net
|
[0, 9]
|
5,838,954 | 5,838,955 |
using jquery with elements inside a asp:gridview
|
<p>i am trying to add some style with jquery to some elements inside a grid-view but jquery cannot identify those element. i am trying something like this</p>
<p><code>$("name").css("border", "3px solid red");</code></p>
<p>thanks</p>
|
jquery asp.net
|
[5, 9]
|
1,208,121 | 1,208,122 |
load an event on a finished redirected page after an AJAX call
|
<p>How do I load an event after a redirected page has finished loading, following an ajax call?</p>
<p>For the sake of simplicity, here is some sample code:</p>
<pre><code>$.ajax({
type: "POST",
url: "some_page.php",
success: function() {
window.location.href="new_page.php"; // redirect to this page
$(window).load(function() { alert("test"); }); // load after redirect
}
});
</code></pre>
<p>the "alert" box does not load for me, but the redirect works.</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,206,423 | 4,206,424 |
Asynchronous Callback functions: Iphone Versus Android
|
<p>On Callback</p>
<p>On Iphone </p>
<h2>File A:</h2>
<p>@protocol servicedelegate
-(void)taskCompleted:(NSDcitionary*) dict;
@end</p>
<p>-(void) performtask
callback=@"taskCompleted:";</p>
<p>[(id)delegate performSelector:NSSelectorFromString(callback) withObject:data];</p>
<h2>File B:</h2>
<p>-(void) taskcompleted:(NSDictionary*)dict
{</p>
<p>//don something when File A fisnihed the taskcompleted and have the data
// this callback on File B will be awaken from File A's delegate function
}</p>
<p><em><strong>The question How does Android implement the above, File A waiting to getting the data, and nobody knows how long, but once finished, File B would awaken by the delegate callback fucntion of taskcompleted.</em></strong></p>
|
android iphone
|
[4, 8]
|
3,955,928 | 3,955,929 |
Submit cross domain ajax POST request
|
<p>I swear I saw an article about this at one point but can not find it...</p>
<p>How can I perform a jQuery ajax request of type POST on another domain? Must be accomplished without a proxy. Is this possible?</p>
|
javascript jquery
|
[3, 5]
|
106,982 | 106,983 |
How do you share variables with other activities easily?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android">How do I pass data between activities in Android?</a> </p>
</blockquote>
<p>I am making a card game and I have an activity for discarding cards and an activity for showing the scores. The problem is I want to pass some objects (player and dealer hands) to the other activity so that I can set imageViews in the scores to the cards that are in the players hands. How can I do this? I don't care about security or anything I just want the easiest way. </p>
|
java android
|
[1, 4]
|
2,324,481 | 2,324,482 |
How do I get the value of the input field?
|
<p>this is my input field:<pre><code>$("<td class='testclass'><input id='field-search' value='' type='text'></td>")</code></pre></p>
<p>How do I get the value of the input field?</p>
<p>I tried it this way:</p>
<pre><code>var mytest =$('#field-search').val();
alert(mytest);
</code></pre>
<p>The result is that I get an alert being undefined though the input field has got a value e.g. 10.</p>
<p>Is there a way to get the value when the value of the input field changes?</p>
<p>A link or an example would be very helpful. Thank you.</p>
<p>Link to the code: <a href="http://www.file-upload.net/download-2902420/test.user.js.html" rel="nofollow">http://www.file-upload.net/download-2902420/test.user.js.html</a></p>
|
javascript jquery
|
[3, 5]
|
2,479,644 | 2,479,645 |
Convert datetime to Time and show in a label in GridView
|
<p>I have a grid view in which I have a label in which I want to show the date and time as</p>
<p><strong>Nov 19 at 07:30 am</strong></p>
<p>i have a field in the database which give the datetime value as <strong>2011-11-19 07:30:43.193</strong></p>
<p>How can I get the desired result?</p>
|
c# asp.net
|
[0, 9]
|
3,927,901 | 3,927,902 |
For loop breaks when it encounters an image that doesn't exist
|
<p>I am trying to load a series of images inside a div using for loop and when the file does not exist, the <code>for</code> loop breaks. This code doesn't seem to work.</p>
<p>I've tested many others but no success. Any tips?</p>
<p>HTML:</p>
<pre><code><div id="project_img">
</div>
</code></pre>
<p>JavaScript:</p>
<pre><code>function load_projects()
var project_array = new Array();
var project_name;
for(var i = 0; i < 7; i++) {
project_array.push(new Image());
project_name = "project_" + i;
project_array[i].src = "images/" + project_name + ".png";
project_array[i].id = project_name;
$("#project_img").append(project_array[i]);
$("#" + project_name).error(function() {
alert(i);
i = 7;
})
}
}
$(document).ready(function() {
load_projects();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.