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 |
|---|---|---|---|---|---|
3,786,256
| 3,786,257
|
jquery word limiter?
|
<p>Hello I am looking for a jquery (or javascript) based word limiter ? searched on web but only char. limiters</p>
<p>please help</p>
<p>Thanks a lot</p>
|
javascript jquery
|
[3, 5]
|
5,003,913
| 5,003,914
|
problem in wordpress like delete rows in jquery
|
<p>im trying to impelement a technique to delete stories with jquery animation exactly like wordpress </p>
<p>this is my script part :</p>
<pre><code>$(function(){
$('#jqdelete').click(function() {
$(this).parents('tr.box').animate( { backgroundColor: '#cb5555' }, 500).animate( { height: 0, paddingTop: 0, paddingBottom: 0 }, 500, function() {
$(this).css( { 'display' : 'none' } );
});
});
});
</code></pre>
<p>but not working
am i wrong in any part of my code ?</p>
|
php jquery
|
[2, 5]
|
921,716
| 921,717
|
jquery validation issues
|
<p>I am a newbie for jquery and currently have a problem on jquery validation. Here is my codes:</p>
<pre><code>jQuery(function(){
jQuery("#qty").validate({
expression: "if (VAL) return true; else return false;",
message: "please enter buying amount"
});
jQuery("#qty").validate({
expression: "if (!isNaN(VAL)) return true; else return false;",
message: "Only integer is valid for amount"
});
jQuery("#qty").validate({
expression: "if (VAL > 0) return true; else return false;",
message: "At least buy 1 share"
});
jQuery("#qty").validate({
expression: "if (VAL <= jQuery('#division').val()) return true; else return false;",
message: "You have insufficient amount to purchase"
});
</code></pre>
<p>and another relevant part:</p>
<pre><code><td><input type="text" name="quantity" size="10" id="qty" value=""/>
<?php
$division = $available/$rate;
?>
</code></pre>
<p>Now the problem is I cannot detect whether the quantity input is decimal. If it is decimal, I want to show error message: only integer is valid for amount. And also, when I compare the quantity input to $division, no matter what positive integer I enter, it will always show the error message "you have insufficient amount to purchase". Can anyone give me some advice? Say thank you in advance!</p>
|
php jquery
|
[2, 5]
|
587,829
| 587,830
|
Jquery Model Popup
|
<p>Dear Expert i have a aspx apge in which i want to open a Jquery modelpop up having some information like Username and pasword and model pop up also having two button like login and cancle when i click login then i want to redirect to user to his dashbord i want to use this in aspx page and cs page how i will achive this i am new in jquery i don`t know anything about jquery will you please tell me howto do that step wise.</p>
<p>Thanks
Naval Kishor Pandey</p>
|
asp.net jquery
|
[9, 5]
|
4,207,527
| 4,207,528
|
System.Exception: Incorrect syntax I can't find the problem
|
<p>So I have a grid view with checkboxes in it.
This is the code behind the page.</p>
<pre><code>protected void BtnApproveUsers_Click(object sender, EventArgs e)
{
var num = new List<int>();
try
{
for (var i = 0; i< GvApproveUser.Rows.Count; i++)
{
var row = GvApproveUser.Rows[i];
var isChecked = ((CheckBox) row.FindControl("ChbSelect")).Checked;
if (isChecked)
{
num.Add(System.Convert.ToInt32(GvApproveUser.Rows[i].Cells[1].Text));
Authentication.ApproveUser(num, GvApproveUser.Rows.Count);
}
}
throw new Exception("The registration forms were approved.");
}
catch (Exception exception)
{
throw new Exception(exception.Message);
}
}
</code></pre>
<p>And this is the method.</p>
<pre><code>public static void ApproveUser(List<int> userIds, int rowCount)
{
using (var connection = Utils.Database.GetConnection())
try
{
for (var i = 0; i < rowCount; i++)
{
using (var command = new SqlCommand("UPGRADE [Users] SET [Role] = @role WHERE [UserID] = @userId", connection))
{
command.Parameters.AddWithValue("@role", "User");
command.Parameters.AddWithValue("@userId", userIds[i]);
command.ExecuteNonQuery();
}
}
}
catch (Exception exception)
{
throw new Exception(exception.Message);
}
}
</code></pre>
<p>And this is the exception:</p>
<p>Incorrect syntax near 'Role'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
<p>Exception Details: System.Exception: Incorrect syntax near 'Role'.</p>
<p>Source Error: </p>
<p>Line 52: {
Line 53:<br>
Line 54: throw new Exception(exception.Message);
Line 55: }
Line 56: </p>
<p>I can't find the problem. Pls help.</p>
|
c# asp.net
|
[0, 9]
|
2,162,816
| 2,162,817
|
Toggle between two forms with one edit button
|
<pre><code> $('div#showme').css('display', 'none');
$('#edit').click(function() {
event.preventDefault();
console.log("detected click")
$('div#showme').toggle();
});;
</code></pre>
<p>I have two #showme forms, and two #edit buttons, I want to show just one form at a time using Jquery, as it is currently coded, this will show both forms #showme, when one #edit is clicked. How can I fix this</p>
|
javascript jquery
|
[3, 5]
|
2,459,060
| 2,459,061
|
How to use Image conrtrol in asp.net (C# web)
|
<p>I have an image stored in my MS Access database with the data type OLE Object. I want it to display in an <code>Image</code> control. How can I do this? I tried this, but only in a <code>PictureBox</code> control in windows forms. Please help. Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
5,239,917
| 5,239,918
|
How to compare items between two disordered ListBox
|
<p>I have 2 <code>ListBoxs</code> which has a set of items. The count between each <code>ListBoxs</code> can be same or different, if the count is same, I want to check if items between the <code>ListBoxs</code> are same. The items can be disordered or ordered as shown below:</p>
<pre><code>ListBox1 = { "C++", "C#", "Visual Basic" };
ListBox2 = { "C#", "Visual Basic", "C++" };
</code></pre>
<p>Kindly help.</p>
|
c# asp.net
|
[0, 9]
|
381,187
| 381,188
|
Javascript - Change button onclick to an existing function
|
<p>I have a button:</p>
<pre><code><button onclick = "doDisactivate(5);" id = "status_button_5" value = "Disactivate" />
</code></pre>
<p>where 5 is a dynamically added ID. I have two javascript functions, doDisactivate(ID) and doActivate(5). </p>
<pre><code>function doDisactivate(serviceID) {
// logic that changes the button onclick to doActivate(serviceID)
}
function doActivate(serviceID) {
// logic that changes the button onclick to doActivate(serviceID)
}
</code></pre>
<p>I'm guessing I can do the following with jquery:</p>
<pre><code>${"#status_button_" + serviceID}.click(function() {
doActivate(serviceID);
});
</code></pre>
<p>But is there a way to directly assign the function while passing the ID as a parameter?</p>
|
javascript jquery
|
[3, 5]
|
3,580,583
| 3,580,584
|
Trying to set fileinput val from drag and drop Jquery file
|
<p>Im trying to make a simple uploader where users drag and drop files from the desktop into the website element. I believe I figured out how but I cant seem to get any information on the file. How can I set a file inputs value from a drag and drop? Here is the drag and drop code im not sure if its correct. The box does change color when draged over thats about it.</p>
<pre><code>$(".droparea").bind({
dragleave: function (e) {
e.preventDefault();
$(".droparea").css("backgroundColor","white");
},
drop: function (e) {
e.preventDefault();
//something here to set the FileInput element val()
},
dragenter: function (e) {
e.preventDefault();
$(".droparea").css("backgroundColor","Green");
},
dragover: function (e) {
e.preventDefault();
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,422,882
| 2,422,883
|
jQuery watermark "Object doesn't support this property or Method"
|
<p>I am using <code>WaterMark.min.js</code> for password boxes so that by default text 'Password' and 'Re-Enter' should appear in text. After the user clicks on that textbox these texts should be removed and typing password should convert the user's text to password dots.</p>
<p>Here is my Javascript</p>
<pre><code><script src="../Scripts/WaterMark.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("[id*=TxtBx_Password], [id*=TxtBx_Reenter]").WaterMark();
});
</script>
</code></pre>
<p>Here is my aspx page markup for controls:</p>
<pre><code><asp:TextBox ID="TxtBx_Password" TextMode="Password" runat="server" Width="200px" ForeColor="Gray"
ToolTip="Enter Password"></asp:TextBox>&nbsp;&nbsp;
<asp:TextBox ID="TxtBx_Reenter" TextMode="Password" runat="server" Width="200px" ForeColor="Gray"
ToolTip="Re-Enter Password"></asp:TextBox>
</code></pre>
<p>But the default text is not appearing on page load and on IE it says script error.</p>
<p>The following is the detail of the error:</p>
<blockquote>
<p>Message: Object doesn't support this property or method</p>
</blockquote>
<p>on line </p>
<pre><code>$("[id*=TxtBx_Password], [id*=TxtBx_Reenter]").WaterMark();
</code></pre>
<p>Please let me know what I am doing wrong.</p>
<p>Thanks in advance.</p>
<p>Regards
<strong>Note</strong>
i am running this page in asp.net wizard control. is this the problem
??</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
5,680,472
| 5,680,473
|
Anyone know how to use the jQuery Gallery View Plugin?
|
<p>I found the <a href="http://spaceforaname.com/galleryview" rel="nofollow">jQuery Gallery View plugin</a> because I was looking for a good way to cycle through pictures including text and one that was well designed. This plugin does not seem to be updated anymore and does not have much documentation so I am having difficulties implementing it. Does anyone have an idea as to how it works?</p>
<p>Thanks in advance for any help you can give.</p>
<p>Heres the code I have now (of course with the pictures at the right locations just not possible to attach in jsfiddle): <a href="http://jsfiddle.net/chromedude/GgusY/" rel="nofollow">http://jsfiddle.net/chromedude/GgusY/</a></p>
|
javascript jquery
|
[3, 5]
|
2,812,322
| 2,812,323
|
Passing Object data to jQuery.post successor function
|
<p>I want this.item of an instance of the class to be filled by the data received through jQuery.post successor function. I am able to do this using some another user-defined function to set this.item with the data received.</p>
<p>Question : Is there any way to set this.item inside the successor function of jQuer.post() without using any other user-defined functions ? </p>
<p>Following is the code snippet </p>
<p>Inside Class Prototype function :-</p>
<pre><code> this.item = new Array();
jQuery.post("index.php?p=getdataitem", fileobj,function(item_str_data)
{
...
this.item = ....;
...
}
);
</code></pre>
<p>Thank You</p>
|
javascript jquery
|
[3, 5]
|
3,260,417
| 3,260,418
|
jQuery.replaceAll multiple elements?
|
<p>This isn't working for me:</p>
<pre><code>$('<span>Something</span><span>Something else</span>').replaceAll('<span>Something New</span><span>Something New Too</span>');
</code></pre>
<p>How do I replace more than 1 element? Help please.</p>
<p>The elements are on the DOM, so I cannot append them.</p>
|
javascript jquery
|
[3, 5]
|
3,933,551
| 3,933,552
|
C# - Get JavaScript variable value using HTMLAgilityPack
|
<p>I currently have 2 JavaScript variables in which I need to retrieve values from. The HTML consists of a series of nested DIVs with no id/name attributes. Is it possible to retrieve the data from these variables using HTMLAgilityPack? If so how would I go about doing so, if not what would be required, regular expressions? If the latter, please help me in creating a regular expression that would allow me to do this. Thank you.</p>
<pre><code><div style="margin: 12px 0px;" align="left">
<script type="text/javascript">
variable1 = "var1";
variable2 = "var2";
</script>
</div>
</code></pre>
|
c# javascript
|
[0, 3]
|
5,705,354
| 5,705,355
|
Editing a jQuery plugin for matching different jQuery version
|
<p>I have assigned <code>jQuery.noConflict()</code> to <code>$jq</code>:</p>
<pre><code>var $jq = jQuery.noConflict();
</code></pre>
<p>Now I want to edit a jquery plugin to use $jq. There are a lot of codes in the following style:</p>
<pre><code>(function($) { /* some code that uses $ */ })(jQuery)
</code></pre>
<p>Changing <code>$</code> to <code>$jq</code> doesn't solve the problem. What should I do?</p>
|
javascript jquery
|
[3, 5]
|
453,430
| 453,431
|
jQuery - setting an element's text only without removing other element (anchor)
|
<p>I have an element like this:</p>
<pre><code><td>
<a>anchor</a>
[ some text ]
</td>
</code></pre>
<p>And i need to set it's text in jQuery, without removing the anchor.</p>
<p>The element's contents could vary in order (text before or after), and the actual text is unknown.</p>
<p>Thanks</p>
<p><strong>New Update</strong></p>
<p>This is what i came up using, assumes only a single text node:</p>
<pre><code> function setTextContents($elem, text) {
$elem.contents().filter(function() {
if (this.nodeType == Node.TEXT_NODE) {
this.nodeValue = text;
}
});
}
setTextContents( $('td'), "new text");
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,263,642
| 3,263,643
|
What are the uses of jquery ui ? and why not use jquery instead?
|
<p>What are the uses of jquery ui ? and why not use jquery instead ?</p>
<p>I've read about Jquery ui in their official site , however , I'm still confused as to what it can do for me and whether I should study it or not ? I'm an aspiring Website Designer.</p>
|
javascript jquery
|
[3, 5]
|
2,466,211
| 2,466,212
|
Not able to add 15 minute to 00:00
|
<p>I have written a function for adding time in a 24 hour format as given below</p>
<pre><code>for (int i = 0; i < cursor.getCount(); i++) {
String RevisedTime="00:00";
// get hour and minute from time string
StringTokenizer st1 = new StringTokenizer(RevisedTime, ":");
int j = 0;
int[] val = new int[st1.countTokens()];
// iterate through tokens
while (st1.hasMoreTokens()) {
val[j] = Integer.parseInt(st1.nextToken());
j++;
}
// call time add method with current hour, minute and minutesToAdd,
// return added time as a string
String date = addTime(val[0], val[1], 15);
}
public String addTime(int hour, int minute, int minutesToAdd) {
Calendar calendar = new GregorianCalendar(1990, 1, 1, hour, minute);
calendar.add(Calendar.MINUTE, minutesToAdd);
SimpleDateFormat sdf = new SimpleDateFormat("kk:mm");
String date = sdf.format(calendar.getTime());
return date;
}
</code></pre>
<p>The problem is that while adding 15 minutes to 00:00 I am getting the output as 12.15....</p>
<p>I need to get it as 00:15......Pleas help me.....</p>
|
java android
|
[1, 4]
|
4,805,959
| 4,805,960
|
How to pass DataTable values in a loop in aspx?
|
<p>I have a DataTable called dt5 which has 4 rows. I am trying to pass the src of image in aspx from dt5, but its not working. Here is my code...</p>
<pre><code><%
for (int i = 0; i < dt5.Rows.Count; i++)
{
string a = dt5.Rows[0]["imageurl"].ToString();
string b = dt5.Rows[1]["imageurl"].ToString();
string c = dt5.Rows[2]["imageurl"].ToString();
%>
<div id="Div1" class="image_stack" style="margin-left:600px" runat="server" >
<img id="Img1" class="stackphotos photo1" src="<%a%>" />
<img id="Img2" class="stackphotos photo2" src="<%b%>" />
<img id="Img3" class="stackphotos photo3" src="<%c%>" />
</div>
<br /><br /><br /><br /><br /><br /><br />
<% } %>
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
72,035
| 72,036
|
Java scripts conflict on my home page
|
<pre><code><script type="text/javascript" src="jquery-1.js"></script>
<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript" src="slideshow.js"></script>
<script type="text/javascript">
//<![CDATA[
window.addEvent('domready', function(){
var data = {
'1.jpg': { caption: 'Volcano Asención in Ometepe, Nicaragua.' },
'2.jpg': { caption: 'A Ceibu tree.' },
'3.jpg': { caption: 'The view from Volcano Maderas.' },
'4.jpg': { caption: 'Beer and ice cream.' }
};
var myShow = new Slideshow('show', data, {controller: true, height: 400, hu: 'images/', thumbnails: true, width: 500});
});
//]]>
</script>
<script type="text/javascript">
$(document).ready(function()
{
//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked
$("#firstpane p.menu_head").click(function()
{
$(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
$(this).siblings().css({backgroundImage:"url(left.png)"});
});
//slides the element with class "menu_body" when mouse is over the paragraph
$("#secondpane p.menu_head").mouseover(function()
{
$(this).css({backgroundImage:"url(down.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
$(this).siblings().css({backgroundImage:"url(left.png)"});
});
});
</script>
<!--[if lt IE 7]>
<script type="text/javascript" src="unitpngfix.js"></script>
<![endif]-->
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,490,129
| 2,490,130
|
Name of a Page Validator using JQuery?
|
<p>I m using Page_Validator function in jquery to get all the Page Validators in my asp.net page..Is there some way so that i can fetch the name of Validator using Page Validator?? For e.g Can i know that whether the particular Page Validator is RequiredField or RegularExpression or CustomValidator? I have tried this.. </p>
<pre><code> $(Page_Validators).each(function(i)
{
if(typeof(Page_Validators[i]) == 'RequiredFieldValidator')//Is it right??
{
//Do ur stuff
}
}
</code></pre>
|
jquery asp.net
|
[5, 9]
|
2,308,992
| 2,308,993
|
ASP.NET control with jquery in seperate .js file
|
<p>i have just wrote a jquery voting script which is working fine if i leave the code within the header of the page. however im looking to move it to a seperate .js file and then just include this .js at the top of the page. for some reason when i do this i get an exception error occurs on the control!!! can anyone advise how to get round this? my code is below</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$(".voteup").live("click", function () {
<asp:LoginView runat="server">
<LoggedInTemplate>
// if user is logged in, allow them to vote
</LoggedInTemplate>
});
});
</script>
</code></pre>
<p>Thanks in advance,
David</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,301,134
| 3,301,135
|
Write .csv file(Excel type File) data to .csv file(Excel type File) in c#
|
<p>I have an excel <code>.csv</code> file that has some data in the below formats in cells:</p>
<pre><code>NAME Address Contact
Shoeb Lko 675567
Rajesh Banaras 7687678
</code></pre>
<p>.csv file is not a text file having only .csv extension. It is a csv file that is made using Microsoft Excel file...For testing you can also make .csv file... For this (1) create an excel file (2) open this excel file (3) go to file menu and click on "save as" (4) select CSV(Comma Seperated) option in Save as type: ---- Now this is .csv file from which I will read content and write content also in a .csv file</p>
<p>I am trying to use C# to write another Excel <code>.csv</code> file in the same format.</p>
<p><em><strong>Code that I am using is written below:<br /></em></strong></p>
<pre><code>//Below line is reading file from system drive
StreamReader rd = new StreamReader("D:\FilesUploadedToTablet\drivers.csv", true);
//Below line is writing data to file existing in our site folder
StreamWriter wr = new StreamWriter(Server.MapPath(".") + "\filename\CSVFile.csv");
wr.Write(rd.ReadToEnd());
rd.Close();
wr.Close();
</code></pre>
<p>Here <code>StreamReader</code> is reading <code>drivers.csv</code> file but <code>StreamWriter</code> is not writing that content to the <code>CSVFile.csv</code> file. If I use any text file in place of .csv file then the content writes successfully. What am I doing wrong?</p>
|
c# asp.net
|
[0, 9]
|
4,614,241
| 4,614,242
|
'System.Web.UI.WebControls.ListItem' in Assembly is not marked as serializable
|
<p>I have made a property, which looks like below.</p>
<pre><code>public ListItem[] DropDownListItems
{
get { return (ListItem[])ViewState["DropDownListItems"]; }
set { ViewState["DropDownListItems"] = value; }
}
</code></pre>
<p>And this is how i assign it values</p>
<pre><code>ListItem[] litem = new ListItem[7];
litem[0] = new ListItem("View", "RowView");
litem[1] = new ListItem("ReadView", "RowReadView");
litem[2] = new ListItem("WriteView", "RowWriteView");
litem[3] = new ListItem("DeleteView", "RowDeleteView");
this.DropDownListItems=litem;
</code></pre>
<p>But I get the following error</p>
<p><strong>'System.Web.UI.WebControls.ListItem' in Assembly is not marked as serializable.</strong></p>
<p>How to resolve it</p>
|
c# asp.net
|
[0, 9]
|
3,885,596
| 3,885,597
|
Can I create an inline function/method inside of a user control?
|
<p>I want to create an inline function/method inside of my user control, so that I can do this:</p>
<p>Inside my test.ascx:</p>
<pre><code><asp:Repeater ...>
<itemTemplate>
<p><%# MyInlineMethod(Eval("hello").ToString())%> </p>
<itemTemplate>
</asp:Repeater>
</code></pre>
<p>is this possible?</p>
|
c# asp.net
|
[0, 9]
|
3,228,304
| 3,228,305
|
How to send message through net to mobile?
|
<p>currently we are developing website which send sms alert to user for perticular service
but i am not able to set script which will do the same</p>
<p>Please somebody tell me what will be solution....
Please tell any script or site for this problem</p>
<p>thanks...</p>
|
php javascript
|
[2, 3]
|
5,564,707
| 5,564,708
|
Jquery targeting when multiple items of a class exist
|
<p>I have the following code:</p>
<pre><code>$(function () {
var target = $('span.slider') //can I make the variable apply to the target span?
target.mousedown(function() {
sliding = true
})
$(document).mouseup(function() {
sliding = false
})
$(document).mousemove(function(e) {
if(sliding){
target.css('left', e.pageX) //do I isolate here?
}
})
})
</code></pre>
<p>There are four 'span.slider' in my html. How do I modify this jquery so that the functionality only applies to the target span.slider? The code above moves all four spans, and I completely understand why it does. I am having trouble targeting it to just the span the user wishes to move.</p>
|
javascript jquery
|
[3, 5]
|
3,736,242
| 3,736,243
|
ASP.Net assign event handler to asp button click
|
<p>this is my code </p>
<pre><code><asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<div>
<asp:Table id="tb" runat="server" Height="239px" Width="417px" >
</asp:Table>
</div>
<table>
<tr>
<td></td><td><asp:Button ID="Votes" runat="server" Text="Vote" OnClick="Votes_Click" /></td>
</tr>
</table>
</asp:Content>
</code></pre>
<p>But when I click the button in debugging it execute page_load event not Votes_Click event</p>
<p>why it does that???
and how to solve this problem???</p>
<p>and the handle on code behind page is</p>
<pre><code>protected void Votes_Click(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "btn",
"<script type = 'text/javascript'>alert('Button Clicked');</script>");
int i = 0;
Response.Redirect("Default.aspx");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,141,568
| 5,141,569
|
Retrieve primary key of the row that clicked on it (edit and delete button)
|
<p>I have a gridview that shows information from a <code>SqlDatasource</code>. Now the gridview shows some information with an edit button and a delete button at the end of the row.</p>
<p>I want to retrieve the primary key of that row from a table in C#, when I click on the edit or the delete button.</p>
<p>For this I overriden two functions:</p>
<pre><code>protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
Response.Write(e.NewEditIndex);
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
Response.Write(SqlDataSource1.DeleteCommand);
}
</code></pre>
<p>But I cannot retrieve the primary key value. How can I do that?</p>
|
c# asp.net
|
[0, 9]
|
1,654,307
| 1,654,308
|
Check for data in database before delete
|
<p>I have these 2 forms (Add.aspx) "CalculationParameters" and "CalculationParametersValues". I also have 2 forms (Delete.aspx). These two forms are related. If there is no CalculationParameter, then you cannot add CalculationParametersValues. Now my problem is... when I delete a CalculationParameter, I want to check first if the CalculationParammeter has any CalculationParametersValues. I need to do this using this "<code>=></code>" which is new to me, but I can't get the hang of it.
I get the values from database from here : <code>"Factory.Definitions.CalculationParameters.List()"</code> and <code>"Factory.Definitions.CalculationParametersValues.List()"</code>.</p>
<p>It should be something like this (I think):</p>
<pre><code>Factory.Definitions.CalculationParameters.List(item => (item.Id == <NOW here is where I should equal that Id with "CalculationParameterId">)
</code></pre>
<p>Help please ?</p>
|
c# asp.net
|
[0, 9]
|
3,290,631
| 3,290,632
|
jQuery fancy box question
|
<p>I have a jQuery fancybox with an iframe. It loads the code from a .php.
Inside that .php file, I have a button which does a post when clicked. </p>
<pre><code>$(".next").click(function() {
$.post("update.php", {page: $(this).attr('data-page')}, function(success){
$("#dialog").html(success);
}
);
});
</code></pre>
<p>The issue is that when I click this for the first time it loads up the html, however it does not work the second time. It seems that jQuery is not loaded for the second time as I am using the star-rating and the star-rating is not rendered there as well.</p>
<p>Initially my dialog has some html code in it.</p>
<p>To illustrate, here's how the structure of my page. I have a main.php. I have a button inside main.php that when I click launches an iframe fancy box. The content of this fancy box is loaded from a .php file, called content.php. Inside the content.php I have another button that when clicked does a post to loader.php. loader.php echoes a bunch of html. The jQuery code to post is located at content.php When I click on the button inside the iframe for the second time, it doesn't do anything</p>
|
php jquery
|
[2, 5]
|
2,019,742
| 2,019,743
|
form send button is already pre clicked when the jquery function is loaded
|
<p>Suppose, a,b,c results are dynamically generated from database via echoing <code>$scname</code> variable and <code>showtablesc</code> is trigered on <code>onclick</code>. But except first time clicked, send button on the form is always seems pre clicked when I click on any <code>a,b ,c</code> results. </p>
<p>My Php code is here:</p>
<pre><code> echo "<a href='#$name' style='margin-left: 30px' onclick=showtablesc();>$scname</a><br>";
</code></pre>
<p>html goes here..</p>
<pre><code> <table id="jobs" style="display:none" bgcolor="#0099FF" align="center"
<tr ><td> j tittle</td><td><input type="text" name="tittle" /></td></tr>
<tr ><td><input type='button' value='send' id="send" /></td> </tr>
</table>
</code></pre>
<p>jquery function goes here</p>
<pre><code>function showtablesc(){
$('#jobs').show('fast');
$('#send').click(function(){
$('#send').replaceWith("<em>sending...</em>");
});
</code></pre>
<p>} </p>
|
php jquery
|
[2, 5]
|
1,311,931
| 1,311,932
|
Add no. of days in a date to get next date(excluding weekends)
|
<p>I have an date, i need to add no. of days to get future date but weekends should be excluded.
i.e </p>
<pre><code>input date = "9-DEC-2011";
No. of days to add = '13';
next date should be "27-Dec-2011"
</code></pre>
<p>Here weekends(sat/sun) are not counted. </p>
|
javascript jquery
|
[3, 5]
|
1,702,175
| 1,702,176
|
Repeating a method every 60 seconds in Java on Android
|
<p>I am busy with a application for my phone for a project. I am not a programmer, so have learnt a bit of java for android so far.</p>
<p>I am stuck on running a method every 60 Seconds while the application is running on the phone.</p>
<p>The application uses the GPS and then sends a User Id & Gps co-ords to a server.</p>
<p>So I have a Method (getLoc) that gets the Location & then calls the send to server method and save to SD card method.</p>
<p>This is for proof of concept & I only need to run the application over the next few days in my car while the phone is connected to the car charger & not allowing it to sleep. I need to log some "test" data (GPS Coords) while I drive around over the next few days.</p>
<p>I am just looking for the easiest way to repeat the method every 60 seconds that sends the data to the server while the Location manager runs & gets the location constantly..</p>
<p>How would I keep the method getLoc to run every 60 Seconds?</p>
|
java android
|
[1, 4]
|
1,496,296
| 1,496,297
|
Access to restricted URI denied" code: "1012
|
<p>I am using jsGantt chart. To fill chart I am using xml file.<br><br>
<strong>Problem is that xml file is outside project(root directory). so when jsgantt.js try to load xml file to fill chart it gives error like <br></strong>
<img src="http://i.stack.imgur.com/yJ8kZ.png" alt="enter image description here"></p>
<p>jsGantt.js' code is below which throws error.</p>
<pre><code>JSGantt.parseXML = function(ThisFile,pGanttVar){
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; // Is this Chrome
try { //Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e) {
try { //Firefox, Mozilla, Opera, Chrome etc.
if (is_chrome==false) { xmlDoc=document.implementation.createDocument("","",null); }
}
catch(e) {
alert(e.message);
return;
}
}
if (is_chrome==false) { // can't use xmlDoc.load in chrome at the moment
xmlDoc.async=false;
xmlDoc.load(ThisFile); // we can use loadxml
JSGantt.AddXMLTask(pGanttVar);
xmlDoc=null; // a little tidying
Task = null;
}
else {
JSGantt.ChromeLoadXML(ThisFile,pGanttVar);
ta=null; // a little tidying
}
};
</code></pre>
<p>error in <strong><em>xmlDoc.load(ThisFile);</em></strong> line where argument ThisFile is file path.</p>
|
javascript asp.net
|
[3, 9]
|
2,195,239
| 2,195,240
|
jQuery resize() using browser maximise button
|
<p>This is my code that fires whenever the window is resized:</p>
<pre><code>$(window).resize(function()
{
setDisplayBoardSize();
});
</code></pre>
<p>Fires fine when I resize the window and runs my function just fine, as expected. </p>
<p>If I hit the maximise button though it doesn't work correctly.</p>
<p>This is the setDisplayBoardSize() function:</p>
<pre><code>function setDisplayBoardSize()
{
var width = $(".display_container").width();
for (i=min_columns; i<=max_columns; i++)
{
if ((width > (i*(item_width + gap))) && (width < ((i+1) * (item_width + gap))) )
{
$("#display_board").css("width",(i*(item_width + gap))+ "px");
}
}
}
</code></pre>
<p>I think the problem is that when the browser maximise button is clicked it fires the function which reads gets the .display_container width <em>before</em> the resize and then resizes the window to maximum which means that my display_board is incorrectly sized.</p>
<p>If I'm right how can I get the size of the .display_container element <em>after</em> the window has resized to maximum?</p>
<p>Should note I've tested this in Chrome and Firefox</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,076,637
| 4,076,638
|
What do you call it when you pass a parameter to the next parameter
|
<p>I notice a lot of code where people do something like:</p>
<pre><code>myClass.someMethod(something here, $1);
</code></pre>
<p>The $1 is picking up a value from "something here"?</p>
<p>What is this known as? I can't seem to find it anywhere? But this step, process is used in cases with regex quite a bit..</p>
|
c# javascript
|
[0, 3]
|
5,603,256
| 5,603,257
|
Jquery timer Stop when Mouse hover
|
<pre><code> $(function() {
setInterval(transition, 9000);
});
function transition() {
var current = $('.shown');
var next = null;
if (current.next('.box').size() == 0) {
next = $('.container .box:first');
} else {
next = current.next('.box');
if($(next).children().attr("id")=="BestSellers"){
ShowBestSellers();
}
else if($(next).children().attr("id")=="NewRelease"){
ShowNewRelase();
}
else if($(next).children().attr("id")=="HotAccessories"){
ShowHotAccessories();
}
else if($(next).children().attr("id")=="OnSale"){
ShowOnSale();
current.removeClass('shown');
next.fadeIn().addClass('shown');
setTimeout(timedCount,9000)
}
function timedCount (){
$("#LandingProductImages > div > div").hide();
$("div#BestSellers").fadeIn();
$("div#os").css("background-position", "0px -43px");
$("div#bs").css("background-position", "0px -40px");
$("div#bs").css("background-position", "0px 0.8px");
}
}
current.removeClass('shown');
next.fadeIn().addClass('shown');
}
</code></pre>
<p>This is my code i need when mouse hover in div name LandingProductImages so my functionaly stop .and when mouse out functionaly again on.im very week in jquery</p>
|
javascript jquery
|
[3, 5]
|
4,756,588
| 4,756,589
|
Issue with callback functions
|
<p>I have three dropdowns I am trying to dynamically populate when an HTML form loads. They all use API callback functions provided by a third-party cloud database provider to retrieve the data and populate the dropdowns. The problem I am encountering is that only the last one populates. Here is how I'm calling the functions:</p>
<pre><code>$(function ()
{
PopulateDropdown('OwnerList');
});
$(function()
{
PopulateDropdown('ClientList');
});
$(function ()
{
PopulateDropdown('AssignedToList');
});
</code></pre>
<p>The text inside the parentheses are the IDs of the dropdowns (select elements) in the HTML.</p>
<p>The only dropdown that ever gets populated is whichever the last one in the list is. The code as shown above populates only the AssignedToList dropdown. If I move the call to populate the AssignedToList to the top, moving the ClientList to the bottom, only the ClientList dropdown populates. I am fairly new to JavaScript and jQuery, so I'm sure there's a way to ensure all three calls work properly. I have Googled everything I can think of but haven't been able to find anything to help. I'm not even real sure what it is I need to Google! Any help would be greatly appreciated!</p>
|
javascript jquery
|
[3, 5]
|
5,553,121
| 5,553,122
|
Stop page scroll after the page reaches certain point
|
<p>How can scroll be prevented after scrollTop reaches certain value say 150.</p>
<pre><code>$(window).scroll(function() {
if($(window).scrollTop() >=50)) {
return false; // basically don't scroll
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,913,504
| 3,913,505
|
Trying to delay/pause/slow a while loop in jQuery
|
<p>I have looked around a lot, and not found the answer yet. Maybe it is simply something that cannot be done.</p>
<p>I am new to jQuery and JavaScript. Just to test the limitations I am trying to create a script that will continuously append a list item to an un-ordered list while a check box is not checked. I know I may not have my while statement correct in searching if the checkbox is checked or not, but the main issue I am having at the moment is the while loop starts running faster than the browser can keep up, locks up the page, and eventually I have to kill the browser. I have read many examples on setTimeout and setInterval, but what I continuously see is those only work with a for/next style loop, where the loop goes for a predetermined amount of cycles dependent upon a variable. I do not want this. I want the loop to continue until I check the box and then it should stop. So I am looking for a way to pause the loop or slow it down so 1) I can see each list item appended to the page, and 2) the script will give me a chance to end it by checking the box before it runs the browser to freeze/suicide.</p>
<p>Thanks in advance, code is below.</p>
<pre><code>$(function(){
$(document).ready(function() {loopLi();});
var i = $('#jlist li').size();
console.log(i);
function loopLi() {
while($('#Chckbox').not(":checked") ) {
setInterval(function(){
i++;
$('<li>' + i + '</li>').appendTo('#jlist');
}, 5000);
}
}
});
</code></pre>
<p>EDIT: Thank you all. Got it working. Did not realize that a while loop would run the code multiple times at the same time. This is all being learned for work, and the book we currently have does not go this in depth with stuff. Currently using jQuery: Novice to Ninja. Anything else we should look at to answer these kinds of questions, or is this just something that comes with working with it?</p>
|
javascript jquery
|
[3, 5]
|
2,551,178
| 2,551,179
|
It scrolls to the top of the page after clicking
|
<p>I have this code to switch a switching button image:</p>
<pre><code>$("#invio_scatola_on, #invio_scatola_off").click(function(){
$("#invio_scatola_off").toggle();
$("#invio_scatola_on").toggle();
});
</code></pre>
<p>when it is executed, the browser goes to the top of the page. why?</p>
|
javascript jquery
|
[3, 5]
|
104,985
| 104,986
|
Loop through textNodes within selection with unknown number of descendants
|
<p>I'm required to basically <em>Find and replace</em> a list of words retrieved as an array of objects (which have comma separated terms) from a webservice. The <em>find and replace</em> only occurs on particular elements in the DOM, but they can have an unknown and varying number of children (of which can be nested an unknown amount of times).</p>
<p>The main part I'm struggling with is figuring out how to select all nodes down to textNode level, with an unknown amount of nested elements.</p>
<p>Here is a very stripped-down example:</p>
<p>Retrieved from the webservice:</p>
<pre><code>[{
terms: 'first term, second term',
youtubeid: '123qwerty789'
},{
terms: 'match, all, of these',
youtubeid: '123qwerty789'
},{
terms: 'only one term',
youtubeid: '123qwerty789'
},
etc]
</code></pre>
<p>HTML could be something like:</p>
<pre><code><div id="my-wrapper">
<ol>
<li>This is some text here without a term</li>
<li>This is some text here with only one term</li>
<li>This is some text here that has <strong>the first term</strong> nested!</li>
</ol>
</div>
</code></pre>
<p>Javascript:</p>
<pre><code>$('#my-wrapper').contents().each(function(){
// Unfortunately only provides the <ol> -
// How would I modify this to give me all nested elements in a loopable format?
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,225,876
| 2,225,877
|
How to make resolution free app
|
<p>I have set 320x480 size for canvas/widget of app. How can I make it resolution free.I have to draw some tips on particular location using AbsoluteLayout.If I change size of canvas/widget then the tips are displaying at wrong coordinates.</p>
|
java android
|
[1, 4]
|
176,829
| 176,830
|
Javascript - override or prevent execution
|
<p>I'm working on a client project and I have to include their header and footer, which includes some core javascript files. I have a couple of PNGs on the page, but their core JS file is poorly coded and doesn't check for IE 7 before attempting to replace IMG tags that contain .png files with DIVS that use the AlphaImageLoader filter. The result is that in IE 7, all my .png images are replaced with DIV tags that have a default display: block, causing a linebreak after every single png image in my pages.</p>
<p>What I'd like to do is override their function with a better one or somehow prevent theirs from executing, but I cannot modify the js file itself, which both defines the function and attaches it to the window onload event. I've tried redefining the function under the same name in several places (header, just before the /body tag, in $(document).ready, etc...) but the original function always seems to execute, presumably because the original function code is what is stored with the event handler, and not merely a pointer to the function.</p>
<p>Any way I can fix? Is there a way to selectively remove onload event handlers?</p>
|
javascript jquery
|
[3, 5]
|
4,510,628
| 4,510,629
|
Get selected value from select list
|
<p>I have this part here, which i use in order to print some values in a list:</p>
<pre><code><select id = "paisja" name="paisja" >
<?php
while( $row = odbc_fetch_array($resultpaisja) ) {
?>
<option value="<?php echo $row['id_paisje']; ?>"><?php echo $row['paisje']; ?></option>
<?php
}
?>
</code></pre>
<p>Now, what i need is if i print the list of this order, the list should appear again but with the selected value...
Some Help Please?
Thanks</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,975,160
| 5,975,161
|
jQuery each() with a delay
|
<p>So, I would like an element to fade in and wait half a second, then fade the next in etc...</p>
<p>My code:</p>
<pre><code>$('.comment').each(function() {
$(this).css({'opacity':0.0}).animate({
'opacity':1.0
}, 450).delay(500);
});
</code></pre>
<p>I'm obviously doing something really silly.... (I hope)... My question is: Is this even possible? if not - can anyone point me in the right direction? </p>
<p>Thanking you!</p>
|
javascript jquery
|
[3, 5]
|
4,697,691
| 4,697,692
|
asp.net and permissions on a share
|
<p>I have an app that needs to update a txt file on another server. The asp.net app runs under iis6.0. Ive tried setting the permissions on the share for the server that runs the app. e.g DOMAIN\ServerA$ however it still says access to path blah blah is denied.</p>
<p>Any ideas?</p>
|
c# asp.net
|
[0, 9]
|
1,229,663
| 1,229,664
|
Using JavaScript With C# For non browser based operations
|
<p>I recently had to take a quick look at Adobe InDesign server. In this enviroment you write your interactions with the servers libs via JavaSscript. </p>
<p>This got me thinking, how could I use the Javascript language within a C# application so that I could expose set bits of functionality of my API/framework and allow others to write small plugins with JavaScript. </p>
<p>As JS is a pretty popular language so I would have thought that I wouldnt have to go writing my own impterpretor or anything, but I could be wrong. Any ideas where I would start with something like this?</p>
<p>Cheers, Chris. </p>
|
c# javascript
|
[0, 3]
|
2,291,500
| 2,291,501
|
JAVA's System.currentTimeMillis() or C#'s Environment.TickCount?
|
<p>Hey, as of lately, I've been trying to find good ways to smoothen out thread sleeps (incase it gets disturbed or if your computer laggs etc).</p>
<p>So which is an overall "better performance" method?</p>
<p>JAVA's System.currentTimeMillis() method for C#:</p>
<pre><code>public static double GetCurrentMilliseconds()
{
DateTime staticDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
TimeSpan timeSpan = DateTime.UtcNow - staticDate;
return timeSpan.TotalMilliseconds;
}
</code></pre>
<p>System.currentTimeMillis() in use:</p>
<pre><code> public void Run()
{
this.lastUpdate = TimeUtilities.GetCurrentMilliseconds();
while (isRunning)
{
if (TimeUtilities.GetCurrentMilliseconds() - lastUpdate >= 600)
{
lastUpdate = TimeUtilities.GetCurrentMilliseconds();
// bla bla bla...
}
try
{
Thread.Sleep(100);
}
catch (Exception ex)
{
Jolt.GetLog().WriteException(ex);
}
}
}
</code></pre>
<p>and C#'s Environment.TickCount:</p>
<pre><code> private void Run()
{
double lastUpdate = Environment.TickCount;
while (isRunning)
{
if (lastUpdate + 600 < Environment.TickCount)
{
lastUpdate = Environment.TickCount;
// bla bla bla...
}
try
{
Thread.Sleep(100);
}
catch (Exception ex)
{
Jolt.GetLog().WriteException(ex);
}
}
}
</code></pre>
<p>Any help would be appreciated. Otherwise if this is a bad idea, could you please provide a better way to do this.</p>
|
c# java
|
[0, 1]
|
4,106,487
| 4,106,488
|
Multiple instances of a view object within an android activity
|
<p>I have two custom view objects that are created within an activity like so.</p>
<pre><code>public class Statistics extends Activity {
GraphWindow graph1;
GraphWindow graph2;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.statistics);
graph1 = (GraphWindow) findViewById(R.id.graph1);
graph2 = (GraphWindow) findViewById(R.id.graph2);
...
}
</code></pre>
<p>However they seem to be acting as one instance, so a public method to graph1 will also be executed on graph 2. Do I need to initiate each graph view as a new instance somehow? Where would I do this? </p>
<p><strong>EDIT</strong></p>
<p>Here is the (condensed) GraphWindow Class:</p>
<pre><code>public class GraphWindow extends View {
//draw data
public ArrayList<DataPoint> data = new ArrayList<DataPoint>();
//set height
public int graphHeight = 0;
public int indexStart = 0;
public int indexFinish = 0;
public boolean isTouched = false;
public boolean isDraggable = false;
public GraphWindow(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public GraphWindow(Context context, AttributeSet attrs) {
super(context, attrs);
}
public GraphWindow(Context context) {
super(context);
}
public void setGraphHeight(int graphHeight) {
this.graphHeight = graphHeight;
}
public void isDraggable(boolean isDraggable) {
this.isDraggable = isDraggable;
}
public void panBox(MotionEvent event) {
rectX = (int)event.getX();
rectW = this.getWidth()/5 + rectX;
this.postInvalidate();
}
public void clearData() {
this.data.clear();
}
@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);
...
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
...
}
}
</code></pre>
<p>In particular the clear data method will operate on both graph1 and graph2.</p>
|
java android
|
[1, 4]
|
4,633,797
| 4,633,798
|
How to change the value of textbox when form is submitted?
|
<p>I have a form which has fields pre-filled with a default value, like this:</p>
<pre><code><input type=text name=first value="First Name" class="unfilled" />
</code></pre>
<p>When the textbox is clicked, the class <code>unfilled</code> is removed from the textbox, and the textbox is made blank so the user can type in his/her own info.</p>
<p>The problem is that when the form is submitted, its getting submitted with these default values, which is messing up the server side validation. How can I do it so that when the form is submitted, all the fields which have a default value are made blank, so the server side validation would throw the error: 'Please fill in this field'?</p>
<p>I'm trying the following code which isn't working:</p>
<pre><code>$("#myForm").submit(function()
{
$(".unfilled").val('');
}
);
</code></pre>
<p>This does make the fields blank, but the server still receives them with their previous default values.</p>
|
javascript jquery
|
[3, 5]
|
3,934,136
| 3,934,137
|
issue in disabling submit button using jquery
|
<p>i am iterating a list , and displaying its values in textboxes.
there is two textboxes with name <code>checkquantity</code> & <code>quantity</code> whose values i am iterating from a list.</p>
<p>Now users have to enter the quantity values, if they enter the quantity values more then the allocated quantity. Then i have to disable the submit button.</p>
<p><em>This is my problem:</em>
From my below code , submit button is diasabling for first time only. i.e. if i enter invalid values for first time then my code is working fine but if again i enter valid values in another text-box then my button is enabling. But it should not enable since in first textbox invalid values are entered. </p>
<p><strong>Note:</strong> Users can only enter values in textbox name <code>quantity</code> and this textbox will be validated from the textbox <code>checkquantity</code>.</p>
<p>Please check my below code and suggest me a solution for this.</p>
<pre><code>$('input[name="quantity"]').keyup(function() {
var $tr = $(this).closest("tr");
var q = +$tr.find('input[name^="quantity"]').val();
var cq = +$tr.find('input[name^="checkquantity"]').val();
if (q > cq) {
$('#submtbtnId').attr('disabled', 'disabled');
}
else {
$('#submtbtnId').removeAttr('disabled');
}
});
----------------------------------- in
while loop my list is iterating
{
<tr>
<td width = "10%">
<input type = "text" name = "quantity"values = "" id = "quantity" / >
<input type = "text" name = "checkquantity" disable = "disable"
values = "random values coming from my list
eg. 5 or 9 ..." / > < /td>
</tr >
}
-------------------------
< input type = "submit" id = "submtbtnId" / >
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,985,969
| 3,985,970
|
Set active tab without page view changing
|
<p>Using the following code to initialize tabs, then activate the tab selected in the url (mypage#this_tab, for example). The problem is on page load it shifts the view to the tab. Subsequent clicks on tabs do not shift the view. How can I fix the view to the top of the page on page load?</p>
<pre><code><!-- *********** Config tabs -->
<script type="text/javascript">
$(document).ready(function() {
// When page loads...
$(".tab_content").hide(); //Hide all content
if (location.hash != "") {
$(location.hash).show(); //Show selected tab content
$("ul.apptabs li:has(a[href="+location.hash+"])").addClass("active").show();
} else {
$("ul.apptabs li:first").addClass("active").show(); //Activate first tab
$(".tab_content:first").show(); //Show first tab content
}
// On Click Event
$("ul.apptabs li").click(function() {
$("ul.apptabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
return false;
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,572,839
| 2,572,840
|
unicode to utf-8 in JavaScript
|
<p>i have output from a server like</p>
<pre><code>["alex", "\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd"]
</code></pre>
<p>i want to convert it like
["alex", "to its right language"]
using js or jquery</p>
<p>i tried </p>
<pre><code>function encode_utf8( s )
{
return unescape( encodeURIComponent( s ) )
}
</code></pre>
<p>but not working correctly</p>
<p>any help?<br>
thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
3,380,469
| 3,380,470
|
Difference between code beside and code behind
|
<p>Can anyone tell me what are the differences between code beside and code behind in Asp.NET?</p>
|
c# asp.net
|
[0, 9]
|
5,370,972
| 5,370,973
|
Android Dev: AlertDialog with SurfaceView
|
<p>I am developing an Android game and I have my SurfaceView rendering the game and I want to make it so when the player loses or wins an AlertDialog pops up and either restarts the level or whatever.</p>
<p>Basically I have two questions:</p>
<ol>
<li><p>How do I use AlertDialogs with SurfaceViews? Do I have to put it into the layout.xml or does it get coded into the UI part or the game thread part?</p></li>
<li><p>Is there a way to "restart" an activity so it doesn't make a new one just starts the current one over with the same "intent" it was given originally?</p></li>
</ol>
<p>Thank You!</p>
|
java android
|
[1, 4]
|
658,572
| 658,573
|
Freeze body scroll when hover a div
|
<p>I am using a slim scroll jQuery plugin in my DIV.</p>
<p>but there is a problem:</p>
<p>when i scroll inside that <code>DIV</code>, then Body also scroll. </p>
<p>So, I want to freeze the <code>BODY</code> scroll when i hover inside that <code>div</code>.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
5,320,363
| 5,320,364
|
jQuery mouse out and not hiding a particular element
|
<p>Let's say I've got two elements: an anchor which causes an occurence of a particular div.
In that single case I'm not able to wrap these two into a parent container, thus the whole markup has to be as following:</p>
<pre><code><a href="#" class="trigger">click me</a>
<div class="info">info displayed on trigger hover</a>
</code></pre>
<p>The very basic question is: <strong>when the mouse leaves the trigger I want to hide the info window but only if the cursor is not over it.</strong>
How can I do that?</p>
<p>Help appreciated,
regards</p>
|
javascript jquery
|
[3, 5]
|
4,569,404
| 4,569,405
|
Link detect and replace the other,in js
|
<p>Hello
I wonder how Replace automatically links on my site
that start with:</p>
<p><a href="http://site.com/00000/" rel="nofollow">http://site.com/00000/</a></p>
<p>to:</p>
<p><a href="http://site.com/11111/" rel="nofollow">http://site.com/11111/</a></p>
<p>detects> replaces</p>
|
javascript jquery
|
[3, 5]
|
3,174,165
| 3,174,166
|
Creating multiple transitional buttons from 1 image
|
<p>I have a very simple looking image of different coloured bars which 'fan' left to right, a bit like the choc bars here:</p>
<p><a href="http://www.lifeafterbagels.com/blog/wp-content/uploads/2012/05/Fanned-Bars.jpg" rel="nofollow">http://www.lifeafterbagels.com/blog/wp-content/uploads/2012/05/Fanned-Bars.jpg</a></p>
<p>I want to turn into each bar into individual buttons with tooltip 'pop-ups' and colour changes when the cursor hovers over them. Very much like this image map:</p>
<p><a href="http://winstonwolf.pl/clickable-maps/europe.html" rel="nofollow">http://winstonwolf.pl/clickable-maps/europe.html</a></p>
<p>I have looked at the map source code and it doesn't really help me, but from searching on this forum it looks like I need to use x and y coordinates to determine the area that would be 'clickable'. Is this correct? </p>
<p>I found some code which allowed me to create a transition between 2 images, which is great, but when the image is not a simple square inside a square div I run into trouble. This is the code for the simple transition:</p>
<pre><code>jQuery(document).ready(function(){
jQuery("img.a").hover(
function() {
jQuery(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
jQuery(this).stop().animate({"opacity": "1"}, "slow");
});
});
</code></pre>
<p>and the CSS:</p>
<pre><code>![div.fadehover {
position:relative;
}
img.a {
position: absolute;
left: 0;
top: 0;
z-index: 10;
}
img.b {
position: absolute;
left: 0;
top: 0;
}][2]
</code></pre>
<p>Any help to point me in the right direction would be much appreciated!</p>
<p>Thanks</p>
<p>J</p>
|
javascript jquery
|
[3, 5]
|
2,213,519
| 2,213,520
|
Which iPhone first supported JavaScript?
|
<p>What version of the iPhone first supported JavaScript?</p>
|
javascript iphone
|
[3, 8]
|
3,427,867
| 3,427,868
|
jquery return false in form
|
<pre><code><script LANGUAGE="JavaScript">
function confirmSubmit() {
jConfirm('Is the Appointment Confirmed?', 'Confirmation Dialog', function(r) {
if(r) {
return true;
} else {
return false;
}
});
}
</script>
<form name='cancel_form'id='cancel_form' method='POST' action="">
<center>
<input type='submit' name='confirm_appointment' value='Cancel Appointment' onclick='return confirmSubmit();'>
</center>
</form>
<script type='text/javascript'>
var ajax_load = "<img class='loading' src='img/load.gif' alt='loading...' />";
var saveUrl = "<?php echo $this->url(array('controller' => 'appointment', 'action' =>'cancelsave'));?>";
$('#cancel_form').ajaxForm({ success: saveCallbk , url : saveUrl });
function saveCallbk(responseText) {
jAlert(responseText,'Alert Dialog');
if(responseText.indexOf("ERROR")<0) {
$(location).attr('href',redirectUrl);
}
}
</script>
</code></pre>
<p>When I submit the form I call this function and use <code>jConfirm</code> from jQuery. I print <code>r</code>. It's printing properly (e.g. <code>true</code> and <code>false</code>), but <code>return false</code> or <code>return true</code> has no effect -- it just shows the pop up and submits the form, and does not wait for confirmation. How to solve this?</p>
<p>The ajaxForm plugin takes care of the submission by itself and it needs a submit button. If I use:</p>
<pre><code>function confirmSubmit() {
var agree=confirm("Is the Appointment Cancelled?");
if (agree) {
return true;
} else {
return false;
}
}
</code></pre>
<p>like default javascript it works well</p>
|
javascript jquery
|
[3, 5]
|
5,513,674
| 5,513,675
|
Getting values of all controls
|
<p>i am trying to get the values of my controls like this:</p>
<pre><code> function ConfirmWithUser()
{
var nodeText = '';
$('.mytreeview input[@type=checkbox]:checked').each(function() {
nodeText += $(this).next('a').text() + '\r';
});
var confirmationMessage;
confirmationMessage = "Please review the data before submitting:" + "\r"
+ "Sample Received Date: " + document.getElementById(received_dateTextbox).Value + "\r"
+ "Site of Ocurrence: " + document.getElementById(site_of_occurrenceTextBox).Value + "\r"
+ "Occurrence Date: " + document.getElementById(occurrence_dateTextBox).Value + "\r"
+ "Report Date: " + document.getElementById(report_byTextBox).Value + "\r"
+ "Specimen ID: " + document.getElementById(spec_idTextBox).Value + "\r"
+ "Batch ID: " + document.getElementById(batch_idTextBox).Value + "\r\n"
+ "Report Initiated By: " + document.getElementById(report_byTextBox).Value + "\r\n"
+ "Problem Identified By: " + $("input[@name=RadioButtonList1]:checked").val() + "\r\n"
+ "Problem List: " + nodeText;
HiddenFieldConfirmation.Value = confirmationMessage;
if (confirm(document.getElementById('HiddenFieldConfirmation').value) == true)
{ return true; }
else
{ return false; }
}
</code></pre>
<p>and the CONFIRM box is not firing at all! i do not get any pop up. </p>
<p>i tried to debug using firefox, and as soon as it go to this line:</p>
<pre><code>confirmationMessage = "Please review the data before submitting:" + "\r"
+ "Sample Received Date: " + document.getElementById(re.......
</code></pre>
<p>it escapes out of the function</p>
<p>what am i doing wrong? how can i get the values of all the controls?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,820,229
| 1,820,230
|
Is it realistic for an android newbie to successfully complete a project in 30 days and submit it to ADC2?
|
<p>Just for the disclaimer, I'm not trying to win the prize in Android Developer Challenge, but just want to participate.</p>
<p>I heard about the Android buzz lately and got interested in it. And today I stumbled upon a site talking about Android Developer Challenge 2. Luckily, the submission hasn't ended but unfortunately it starts tomorrow, August 1. Since this is a new opportunity I want to give it a try but I think I'm a little bit late.</p>
<p>I have configured the development platform and got some tutorials. I wanted to know if I could successfully develop a project within 30 days and submit it. Or is it really a big task which needs months of preparation. I just want to know if it is worth a try.</p>
<p>And for the record I know nothing about Androids except that it is an open source platform for application development on mobiles. I know Java but not competent, so may be need to touch up on that too.</p>
<p>It would be nice, if I get some real pointers on what I'm about to embark on. If it isn't possible I may need to pace down and enjoy other things in life too.</p>
<p>So is is possible to complete a small and decent app within 30 days or is it already late and if so are there any suggestions?</p>
|
java android
|
[1, 4]
|
5,843,372
| 5,843,373
|
Resize HTML elements on Android orientation change
|
<p>I am trying to bind an event in Javascript to either the orientationchange or resize events in Android in order to change the width/height of some elements for my web app. In the event, I use window.innerHeight and window.innerWidth to get the current height and width of the window.</p>
<p>This works great on iOS and desktop devices, but on Android it seems that it calls this event before changing the values in the window variable. Therefore, when someone switches from portrait to landscape, I still get the values for portrait and therefore cannot resize correctly. Does anyone know what the problem is, and how I can fix it?</p>
|
javascript android
|
[3, 4]
|
2,175,774
| 2,175,775
|
Decompose URLs into multiple keyword arrays
|
<p>I need a script in jQuery with the following features:</p>
<ol>
<li>Gets actual URL of the page</li>
<li>Depending on that URL search for words in that URL (utf-8 and ISO)</li>
<li>Display or execute a given code (jQuery code) depending on words found in URL</li>
</ol>
<p>I need to use multiple words in multiple arrays and add arrays easily.</p>
<p>For example:</p>
<pre><code>array 1 --> apple, pear, strawberry, etc --> display a given html
array 2 --> chicken, meat, lamb, etc --> display a given html
array X --> xxxx, xxxx, xxxx,
last array --> every word that doesnt match with array 1 or 2 or X ----> display a given html
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,174,396
| 5,174,397
|
Should I Learn C# or C++?
|
<p>When I first became interested in programming, I took a class that introduced me briefly to C++ for a semester (this class mostly focused on topics like "what is a variable", so I know very little about what C++ is capable of). Up next was a year of AP Computer Science, where I learned Java. Don't get me wrong, I love Java, but I feel like I have become so dependent on it. I am pretty good at programming in Java, and I like the extensive packages like Swing and io that give a great degree of power to even a new learner. </p>
<p>I have exhausted my school's (extremely) limited supply of Computer Science classes and am looking at Internet tutorials or books to learn on my own. However, I don't want to start learning a language only to realize that it isn't "right" for me.</p>
<p>I guess what I am looking for is a widely used, well-known, powerful language that will not only be good for controlling a computer but also for opening doors later in my life.</p>
<p>I am specifically looking at C# or C++, although I don't know why. If you think some other language would be better, please suggest it and why. Hopefully this is enough information for someone to answer. If not, please ask me to clarify because I really would like a specific good answer.</p>
|
c# java c++
|
[0, 1, 6]
|
5,168,319
| 5,168,320
|
Use jQuery to check for link extension
|
<p>I'm trying to read all links on the page and check if link extension is ending with '.png'. If it does, then when that link is clicked, I want to grab that image and append into div with the class 'test'. If link doesn't end with '.png' just ignore it and open normally. </p>
<p>This is markup, you can grab it on <a href="http://jsfiddle.net/Klikerko/KnvuD/1/" rel="nofollow">jsFiddle</a> too:</p>
<pre><code><a href="image01.png">Image 01</a>
<a href="image02.png">Image 02</a>
<a href="http://www.google.com/">Page</a>
<a href="image03.png">Image 03</a>
<div class="test"></div>
</code></pre>
<p>... and this is how markup should look like when first link is clicked:</p>
<pre><code><a href="image01.png">Image 01</a>
<a href="image02.png">Image 02</a>
<a href="http://www.google.com/">Page</a>
<a href="image03.png">Image 03</a>
<div class="test">
<img src="image01.png" />
</div>
</code></pre>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
2,714,750
| 2,714,751
|
how can i do jquery's $.get in pure javascript? (without wanting to return anything)
|
<p>I want the mobile version of my site to be as snappy as possible, however i still want some basic analytics.</p>
<p>I want to ping a php file (hit counter) after the mobile page has loaded to count the amount of hits from javascript enabled browsers.</p>
<p>Jquery's a bit overkill for 1 ajax function so i'm keen to learn how to do the following in pure javascript:</p>
<pre><code><script type="text/javascript">
Window.onload(function(){
$.get('mvc/assets/ajax/analytics/event_increment.php?id='+id');
})
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,661,632
| 4,661,633
|
How to run a loop on a bunch of Android buttons that need to control their neighbors?
|
<p>I have a list of text inputs that each contain numbers. To the left of each is a button that says " - " to the right one that says " + ".</p>
<p>So, it looks like this:</p>
<pre><code>[ - ] [ 1111 ] [ + ]
[ - ] [ 1112 ] [ + ]
[ - ] [ 1113 ] [ + ]
etc...
</code></pre>
<p>I want each [-] to alter the value of the field next to it, reducing it by 1, and each [+] to increment the value of the field left of it.</p>
<p>Is there a way that I can write a generic listener that would, upon instantiation, take as a param the id of the text field to be edited?
setOnClickListener only takes a View.OnClickListener as a param, and that can't be given any extra params to hang onto either. Do I have to extend View.OnClickListener with my own custom listener to do this? Or is there some obvious way to accomplish this task that I'm overlooking?</p>
<p>TIA.</p>
|
java android
|
[1, 4]
|
2,251,290
| 2,251,291
|
Removing title bar of android application
|
<p>I'm making a small android application, and I want to remove the android title bar. </p>
<p>I've tried using the </p>
<pre><code>this.requestWindowFeature(Window.FEATURE_NO_TITLE);
</code></pre>
<p>But it still makes the title bar show for 0,1 second when the application starts. I would love to make it not even show it when the app is loading. </p>
<p>I've searched a bit around, and somebody mentions that you can change the style of the app, but I have no idea how to do that. I've only just started making apps, so I don't have a lot of experience. </p>
|
java android
|
[1, 4]
|
998,278
| 998,279
|
How to create new packages in an Android project
|
<p>I have too many activities in my Android app project and I'd like to manage them using packages.</p>
<p>How can I do it? </p>
|
java android
|
[1, 4]
|
3,738,926
| 3,738,927
|
Detecting ASP form submit no longer works
|
<p>I have the following code on my ASP.Net pages.</p>
<pre><code>$(window).submit(function () {
prompt = false;
});
</code></pre>
<p>The point of this code is that if the user clicks a button on the page and does a postback for example then I set the prompt flag to false and do not prompt the user with "Are you sure you want to leave this page?"</p>
<p>This worked fine up untill today now all of a sudden anytime the user clicks a button on the page he gets the prompt. I can't figure it out. This function is no longer getting called on any of the pages. Even if i revert the page back to when it worked still nothing.</p>
<p>So the problem is not on the page itself but somewhere else. Any ideas guys?</p>
<p>Thanks,
Michael</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
786,421
| 786,422
|
Why we can't use Response.Write on Page_Unload Event?
|
<p>I am using <code>Respose.Write</code> on <code>Page_Unload</code> event, then I get the error </p>
<blockquote>
<p>Response is not available in this context.</p>
</blockquote>
<p>May I know why we can't use? </p>
<pre><code>protected void Page_Unload(object sender, System.EventArgs e)
{
Response.Write(" hi ");
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,284,740
| 3,284,741
|
Can I hide SMS on Android?
|
<p>I would like to develop an application for Android 3.0 with only one button...
When I click on this button I should HIDE all the SMS sent from a specific phone number.</p>
<p>Is it possible?</p>
|
java android
|
[1, 4]
|
5,776,873
| 5,776,874
|
JS detect the width of the screen, running a different JS files
|
<p>I write two js code. I want first detect the width of the screen, then run a different JS files. How to write correctly?</p>
<pre><code>$(document).ready(function() {
if ((screen.width>=1024) && (screen.height>=768))
{
$("link[text/javascript]:not(:first)").attr({src : "1024.js"});
}
else
{
$("link[text/javascript]:not(:first)").attr({src : "768.js"});
}
});
<script src="1024.js"></script>
<script src="768.js"></script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,446,590
| 4,446,591
|
Textbox using password mode
|
<p>Hi I am using a text box with Password mode. And inserting the value using encryption. After that while updating the information I have to display the text again using password mode. But While assigning the data It is not displaying it in the textbox. How can I overcome this?</p>
|
c# asp.net
|
[0, 9]
|
6,032,505
| 6,032,506
|
jquery select remove undefined?
|
<p>I using jquery how do i remove the one of the elements of the select dropdown where the value</p>
<pre><code><option value=" ">undefined</option>
</code></pre>
<p>i tried </p>
<pre><code>$("#subType option[value=' ']").remove();
$("#subType option[value='']").remove();
</code></pre>
<p>None of them worked.</p>
<p>Please advise.</p>
|
javascript jquery
|
[3, 5]
|
5,204,789
| 5,204,790
|
jQuery equivalent of PHP's strtr
|
<p>What is the jQuery equivalent of PHP's strtr.</p>
<p><a href="http://php.net/manual/en/function.strtr.php" rel="nofollow">http://php.net/manual/en/function.strtr.php</a></p>
<p>I would prefer the simplest possible, pure jQuery solution.</p>
<p>JS would also be a great alternative.</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,689,030
| 4,689,031
|
How to access the elements in <script> inside the body tag
|
<p>I am using <code><script></code> inside the body tag.</p>
<pre><code><script type="text/javascript" language="javascript">
$('#audioVolume').text($('#audioVolume').text(Math.round((document.mediaPlayer.Volume + 2000) / 10) + "%"));
</script>
</code></pre>
<p>Error: Microsoft JScript runtime error: 'undefined' is null or not an object.</p>
<p>Need: I want to access the html elements in <code><script</code> inside the body tag.</p>
|
javascript jquery
|
[3, 5]
|
929,245
| 929,246
|
Loop through a php page until session reaches a certain value
|
<p>I am currently developing a web based examination. all the question and answers are save on mysql database. I started the system by retrieving and displaying one question together with the answers which is on radio type. i used a session $_SESSION['questionno']=1; to indicate on what question number will be retrieved and displayed. what i want to do next is that whenever the user clicks the next button it will forward informations to result.php and then the said page will add into the session the answer that was retrieved from the previous page at the same time result.php will increment the $_SESSION['questionno']; and then use</p>
<pre><code>echo ("<SCRIPT LANGUAGE='JavaScript'> window.location='/OE/index.php'; </SCRIPT>");
</code></pre>
<p>to go back to the questions page (index.php) but this time question number two will be displayed because of the incrementation that happened in result.php.</p>
<p>after a series of loops and the user reaches the last question a tally page will then appear.</p>
|
php javascript
|
[2, 3]
|
1,323,838
| 1,323,839
|
Pass client side value to server side
|
<p>I need to use a javascript variable value in server side.</p>
<p>Example:</p>
<p><strong>JavaScript</strong></p>
<pre><code>var result = false;
</code></pre>
<p><strong>CS Code</strong> </p>
<pre><code>if(result)
{
Console.Write("Welcome..")
}
else
{
Console.Write("plz try again..")
}
</code></pre>
<p><strong>Note</strong></p>
<p>I don't want to post a hidden field.</p>
|
javascript asp.net
|
[3, 9]
|
6,000,360
| 6,000,361
|
JavaScript form validation not working
|
<p>I have a very simple form with a very simple JavaScript validator. </p>
<p>I want an alert to popup if the first nae isnt filled out only it doesnt seem to be alerting and still submits. </p>
<p>I've uploaded a fiddle here <a href="http://jsfiddle.net/nvgMq/" rel="nofollow">http://jsfiddle.net/nvgMq/</a> </p>
|
javascript asp.net
|
[3, 9]
|
5,161,127
| 5,161,128
|
Registering Coords for two fingers
|
<p>I want to build an android application that would register the x,y for two fingers on the screen at the same time. Is this possible or does android not allow that?</p>
|
java android
|
[1, 4]
|
2,950,202
| 2,950,203
|
Access asp:lable value which set using jquery?
|
<p>I am making web application in asp.net, I have one label control in my .aspx page. I have to set label text value using jquery. want to access this value in my .cs file.</p>
<pre><code><asp:Label ID="lbltext" runat="server" Text=""></asp:Label>
</code></pre>
<p>By using this am able to change label text :</p>
<pre><code>$('#<%= lbltext.ClientID %>').text("Test");
</code></pre>
<p>I want to access label text value in code behind page</p>
<p>Thanks in advance..</p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
566,322
| 566,323
|
A better way to detect the index in the parent's children array by using JQuery?
|
<p>for example, how to detect the index of the li elem in it's parent ul?</p>
|
javascript jquery
|
[3, 5]
|
4,306,487
| 4,306,488
|
Recall a function
|
<p>I have made a simple image slideshow using jQuery. I need the "next" button to execute exactly the same function I use on each image click above. Since I am noobie, I can't get the issue.</p>
<p><a href="http://jsbin.com/etajuv/6/edit" rel="nofollow">Demo</a></p>
<pre><code>$('.show').each(function(){
var $this = $(this);
$this.children('li').hide().eq(0).show();
var activeli = $this.find('li');
activeli.click(function() {
var $this = $(this);
var $next = $this.next();
if ($next.length === 0) {
$next = $this.parent().children(':first');
}
$this.hide();
$next.show();
});
// My issue is there
$('.next').click(function() {
activeli.click();
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,087,854
| 3,087,855
|
jquery firstChild.data equivalent
|
<p>Is there an equivalient of the firstChild.data in JQuery?</p>
<p>Given the following HTML :</p>
<pre><code><p id='test'>Hello<span>world</span>/<p>
</code></pre>
<p>the below javascipt will return : "Hello"</p>
<pre><code>document.getElementById('test').firstChild.data
</code></pre>
<p>the given JQuery will return : <code>Hello< span>world</span></code></p>
<pre><code>$('#test').text()
</code></pre>
<p>how can I achieve this?</p>
|
javascript jquery
|
[3, 5]
|
4,772,813
| 4,772,814
|
hyperlink to jquery tabs
|
<p>We have our accordion tabs ( horizontal as follows )</p>
<pre><code><ul class="tabs">
<li><a href="#tab1"><span class="upArrow">Inbox (2)</span></a></li>
<li><a href="#tab2"><span class="downArrow">Sent (8)</span></a></li>
<li><a href="#tab3"><span class="composeMssg">Compose</span></a></li>
</ul>
</code></pre>
<p>We have the tab titles as such </p>
<pre><code><div class="tab_content_container">
<div id="tab1" class="tab_content" style="font-size: 12px;">
</code></pre>
<p>Content and then closing divs, and remainder of tabs linking to the href's as you do.</p>
<p>Issue is , </p>
<p>How can I link to #tab2 from external link and open that tab on page load.</p>
|
javascript jquery
|
[3, 5]
|
3,352,675
| 3,352,676
|
Creating a loop that fades out each article in succession. jQuery
|
<p>So the idea is to fade each image out from the bottom.. obviously it's going to have to backwardly traverse the array. However, i can't seem to figure it out at the moment. The idea is that it would pause after running the fadeOut() function, I thought set time out would work, but firebug gives me this error:
useless setTimeout call (missing quotes around argument?)</p>
<p>Line 262.
I even went as far as to not use a $.each loop and use a for (i=0 loop</p>
<pre><code><script type="text/javascript">
//Bottom Nav functions
$(document).ready(function(){
$('#bottomNav a:eq(0)').click(function(){
var arti = $('#aHolder article');
var amt = arti.length;
var i = 0;
for (i=0;i<amt;i++){
$('#aHolder article:eq('+i+')').fadeOut();
setTimeout(300);
}
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,351,785
| 2,351,786
|
how to use asp.net list view control of framework 3.5 into framework 2.0?
|
<p>Can I use the list view control of framework 3.5 in a framework 2.0 app? If so, how?</p>
|
c# asp.net
|
[0, 9]
|
4,822,107
| 4,822,108
|
Convert String to Integer/Float/Double
|
<p>I am trying to convert a string to <code>Integer/Float/Double</code> but I got a <code>NumberFormatException</code>.</p>
<p>My String is <code>37,78584</code>, Now I am converting this to any of them I got <code>NumberFormatException</code>.</p>
<p>How can I convert this <code>string</code> to any of them.</p>
<p>Please help me to get out of this problem.</p>
|
java android
|
[1, 4]
|
3,485,290
| 3,485,291
|
variable initialized in class loses its previous value with the page loading
|
<p>I've declared a String variable test with "hi". every time I click on Button1, I expect that test will be appended with its previous value. But I have noticed that it loses its previous value when the button is clicked and the page is reloaded. That is every time I click it, it has its text as "hihi". I expect "hihihihi" on the next click and so on. What's the problem here with the code below?</p>
<p>public partial class _Default : System.Web.UI.Page
{</p>
<pre><code>String test = "hi";
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
test += test;
Button1.Text = test;
}
</code></pre>
<p>}</p>
|
c# asp.net
|
[0, 9]
|
5,094,190
| 5,094,191
|
Long running operation on website
|
<p>What if I have website with a button. User clicks on the button and starts a long running process. After a few hours (or minutes) user update webpage and see results. What is the best (and any other) way to implement long running operation on website?</p>
|
c# asp.net
|
[0, 9]
|
4,611,901
| 4,611,902
|
LINQ - return random value does not work
|
<p>I have this class in my infrastructure that suppose to return random image. It always returns same image. I have exactly same code used in different place on my website and it works. Any ideas?</p>
<p><a href="http://stackoverflow.com/questions/648196/random-row-from-linq-to-sql">This</a> question is where I got the info for getting random value. I don't understand why it works on one place and not another though...</p>
<p>Background.cs</p>
<pre><code>public static class Background
{
public static string Get()
{
photoBlogModelDataContext _db = new photoBlogModelDataContext();
var image = _db.Images.OrderBy(x => Guid.NewGuid()).FirstOrDefault();
return image.Small; // Always same value?
}
}
</code></pre>
<p>Same code on another page that works where I loop through my gallery and choose random image from it</p>
<pre><code><img src="@Url.Content("~/content/uploads/" + item.Images.OrderBy(x => Guid.NewGuid()).FirstOrDefault().Small)" alt="" />
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,957,488
| 2,957,489
|
Change URL on first and second clicks
|
<p>I've searched the internet and stackoverflow for how to trigger a second click function and this is what I found:</p>
<pre><code>$('.elementclass').toggle(
function(){
//on odd
},
function(){
//on even
});
</code></pre>
<p>It's perfect. Now according to this I try to change the URL of my document but something doesn't work. Here is my code:</p>
<pre><code>$('.orderby').toggle(
function(){
document.location.href+='?orderby='+$(this).val()+'ASC';
},
function(){
document.location.href+='?orderby='+$(this).val()+'DESC';
});
</code></pre>
<p>where <code>$(this).val()</code> will be something like name or date...</p>
<p>What I want to accomplish is: on first click of a button, the URL changes to <a href="http://blablabla/page.php?orderby=nameASC" rel="nofollow">http://blablabla/page.php?orderby=nameASC</a> and then on the second click, the URL changes to <a href="http://blablabla/page.php?orderby=nameDESC" rel="nofollow">http://blablabla/page.php?orderby=nameDESC</a>.</p>
<p>So what's wrong with my code?</p>
<p><strong>I don't want to refresh the page when user click on button, I just want to add some (one in this case) parameters that can take whit $_GET later but on same page.document.URL can be update whit +=?orderby=nameASC on first click and on second click +=?orderby=nameASC need to be remove and document.URL update whit +=?orderby=nameDESC.</strong></p>
|
javascript jquery
|
[3, 5]
|
596,840
| 596,841
|
how to copy checkboxlist item's value to listbox using jquery
|
<p>I have a checkboxlist in my page having item text as some languages (ex: c, c++, java, c#sharp.net etc.). I have an empty listbox called desired skills. HR recruiter will select some of the languages (items of checkboxlist) and click a button called desire to copy the selected ckeckboxes and that need to be populated in list box. I wanted to know that how can i achieve this using jquery. here are my controls :</p>
<pre><code><asp:CheckBoxList ID="cbxlang" runat="server">
<asp:ListItem Text="C" Value="C"></asp:ListItem>
<asp:ListItem Text="C++" Value="C++"></asp:ListItem>
<asp:ListItem Text="Java" Value="Java"></asp:ListItem>
<asp:ListItem Text="csharp" Value="csharp"></asp:ListItem>
</asp:CheckBoxList>
</code></pre>
<p>here the button : </p>
<blockquote>
<pre><code><asp:Button ID="btnCheck" runat="server" Text="DesiredSkills" />
</code></pre>
</blockquote>
<p>and the listbox is like this</p>
<pre><code> <asp:ListBox ID="lstDesired" runat="server"></asp:ListBox>
</code></pre>
<p>I want to populate the selected checkbox items as my listbox items. I have done this in code behind page, but that need page to be sent back and then load it again. Please help. I am very new to jquery.</p>
|
jquery asp.net
|
[5, 9]
|
2,949,751
| 2,949,752
|
Replace Picture Source (Adding)
|
<p>What i wish to do is have a div containing a image, when a button/mini picture is pressed the image's source will change from 1-2 2-3, etc adding 1 each time. This needs to go both ways:
i.e Right Arrow: 1.jpg 2.jpg Left Arrow 3.jpg 2.jpg Now the script also needs to include a IF statement so if the picture doesn't exist the button will be visibility: hidden; in css. Something like IF picture source 5.jpg + 1 doesn't exist #mini img visibility: hidden;
Currently i had an idea i could use something not the same but similar to this (jQuery). I used this script previously to change a image on hover, i figure i could change it onclick and use something similar.</p>
<pre><code>$(function() { $('#buttons #right img').each(function() {
var originalSrc = this.src,
hoverSrc = originalSrc.replace(/\.(gif|png|jpe?g)$/, '_over.$1');
image = new Image();
image.src = hoverSrc;
$(this).hover(function() {
image.onload = function() {
}
this.src = hoverSrc;
}, function() {
this.src = originalSrc;
});
});
})
</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.