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 |
---|---|---|---|---|---|
4,825,062 | 4,825,063 |
How to add contacts directly to a group without creating an account?
|
<p>I have this contacts that needs to be imported directly to a particular group that i created in which AFAIK that adding of contacts in an Account ,in the api seems to be broken(can't add other fields) so i implemented my own Activity to add accounts.</p>
<p>how do i add them directly to a group? </p>
|
java android
|
[1, 4]
|
5,331,950 | 5,331,951 |
How to load data while scrolling horizontally and on a DIV overflow?
|
<p>I’m working on this horizontal scrollbar that grabs content from the database when you scroll to the farthest right. Here's an example of what we want to do:
<a href="http://designarchives.aiga.org/#/entries/+collections%3a%2250%20Books/50%20Covers%20of%202009%22/_/grid/relevance/asc/0/48/120" rel="nofollow">http://designarchives.aiga.org/#/entries/%2Bcollections%3A%2250%20Books%2F50%20Covers%20of%202009%22/_/grid/relevance/asc/0/48/120</a></p>
<p>I found useful tutorial here but its vertical scroll:
<a href="http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html" rel="nofollow">http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html</a></p>
<p>So far it is working vertically, but how do you load data while scrolling horizontally and on a DIV overflow, not the window?</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,572,264 | 3,572,265 |
Get link value in html document with jQuery?
|
<p>Let's say I have a link in a table like:</p>
<pre><code> <td class="ms-vb" width="100%">
<a onfocus="OnLink(this)" href="/Lists/Business%20Divisions/DispForm.aspx?ID=2" onclick="GoToLink(this);return false;" target="_self">Train<img src="/_layouts/images/blank.gif" class="ms-hidden" alt="" width="1" border="0" height="1">
</a></td>
</code></pre>
<p>How can I get the value Train with jQuery?</p>
<p>Thanks in advance.</p>
<p>edit:
I currently get the querystring value from every link and push them into an array with the following code:</p>
<pre><code>$("table").each(function(index, value) {
$(this).addClass("table" + index);
});
var hrefs = new Array();
$('.table449').children().children().each(function(){
var link = ($(this).find('a').attr('href'));
var startIndex = link.indexOf(",'");
var endIndex = link.indexOf("');");
if ( startIndex >= 0 && endIndex >= 0 ) {
var linkID = link.substring( startIndex+2, endIndex );
hrefs.push(linkID);
}
alert(hrefs);
});
</code></pre>
<p>What I want to do is to store the values like Train in another array.</p>
|
javascript jquery
|
[3, 5]
|
748,021 | 748,022 |
how to pick value in jquery
|
<p>i have build a small function whose work to get value in alert box but i want to pick only 5 character from starting. here is my function</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function (){
$(".hhh").click(function(){
$(this).html()
})
})
</script>
</head>
<body>
<div class="hhh">dd:ff:aa</div>
</body>
</html>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,872,643 | 2,872,644 |
In Javascript, queuing the execution of function if the function is already executing, but cancel any previously queued
|
<p>I've faced the following scenario quite often so I'm wondering if there is a built-in jQuery way of solving the issue.</p>
<p>Imagine the following code:</p>
<pre><code>$(document).click(function() {
paintCanvas();
});
</code></pre>
<p>The problem with this code is that if the user clicks on the screen 50 times in rapid succession you are going to overload the browser with 50 calls to paintCanvas.</p>
<p>If paintCanvas is currently executing and a new request is created, we want to queue the new request so that it waits until paintCanvas is finished executing. However, at the same time, we can drop any previously queued calls to paintCanvas as we only care about the final state of the mouse, not all the intermediate states.</p>
<p>Here is some code that solves the problem:</p>
<pre><code>var _isExecuting, _isQueued;
function paintCanvas() {
if (_isExecuting) {
if (!_isQueued) {
_isQueued = true;
setTimeout(function() {
_isQueued = false;
paintCanvas();
}, 150);
}
return;
}
_isExecuting = true;
// ... code goes here
_isExecuting = false;
};
</code></pre>
<p><a href="http://www.protofunc.com/scripts/jquery/ajaxManager/" rel="nofollow">This AJAX queue plugin</a> essentially implements this functionality, but does so only in terms of AJAX. Surely this is a very common problem that can be solved in more generic way?</p>
|
javascript jquery
|
[3, 5]
|
253,649 | 253,650 |
GridView is not shown in the content page
|
<p>I have a gridview in my Master page.I have taken an item template inside it. I have given some text to the controls initially.
In the design view of the content page gridview is visible but while running the page it's not showing gridview.
when i deleted gridview and put some simple text in place of it ,it's working .</p>
<p>i tried setting z- index and some peculiar things but nothing seems to work.Please help me out </p>
|
c# asp.net
|
[0, 9]
|
3,919,889 | 3,919,890 |
How to use ORM in android
|
<p>I have to use ORM in android. I have read about the ORM from that I have understood that It is layer between Front end and Back End Database. Can any one please tell what is mean by ORM and how to use in android program. What is the advantage to use the ORM. </p>
|
java android
|
[1, 4]
|
1,442,789 | 1,442,790 |
sleep in JavaScript?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/758688/sleep-in-javascript">Sleep in Javascript</a> </p>
</blockquote>
<p>I want to make a <strong>sleep</strong> function in JavaScript, I have to stop any code execution before the user performs an action (like the alert() behaviour)</p>
<p>What I need is exactly: what should I insert here to make it work?</p>
<pre><code>window.alert = function(message){
var dialog = $('<div>'+message+'</div>').dialog({
title:'Alert',
buttons:{
'Ok': function(){
$(this).dialog('close').data('open', false);
$(this).remove();
}
}
}).data('open', true);
//What to insert here?
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,008,952 | 2,008,953 |
How can i get data from a dataset into a list?
|
<p>I am a newbie in Web Developing. I am using C# in ASP.net</p>
<p>I created a Dataset that includes TableAdapters.</p>
<p>I.e. for my Table Product_family i created the ProductFamilyTableAdapter that includes the following columns prfm_description1, prfm_description2, prfm_description3, etc...</p>
<p>I have a method GetAllProductFamilies.</p>
<p>After that i created a Business Logic Layer class ProductFamiliesBLL.cs which includes the same functions.</p>
<p>In the Page_Load event of my master page i create </p>
<pre><code>ProductFamiliesBLL prfLogic = new ProductFamiliesBLL()
</code></pre>
<p>and i can bind to a Datagrid</p>
<pre><code>datagrid1.Datasource = prfLogic.GetAllProductFamilies();
datagrid1.Databind();
</code></pre>
<p>My question is if I can add this data into an array or a List and how?
How can i read one by one the retrieved rows and get data from first, second,..., n row from a specific column.</p>
|
c# asp.net
|
[0, 9]
|
2,110,396 | 2,110,397 |
How to merge 2 files
|
<p>I want to merge two files together, i want the java code for this to work<br>
I am merging hosts files for Android, also after merging I want to save and replace the file in the original location</p>
|
java android
|
[1, 4]
|
1,553,839 | 1,553,840 |
Decode MS Office double quote character?
|
<p>I need to decode and encode the MS Office double quote character. I used escape and unescape function in JS to escape the MS Office double quote character. But i couldn't use it in Java.</p>
<p>Is there any library to use it in Java.</p>
<p>MS Office double quote(“ ). Double quote got from keyboard ( " ). </p>
|
java javascript
|
[1, 3]
|
3,658,547 | 3,658,548 |
jQuery Class Selectors: With or Without tagname?
|
<p>I'm trying to find a definitive answer to the old question "should i use a tag name when selecting with a class?"</p>
<p>Everywhere i look on the web for jQuery best practices, there is nearly always a point of using jQuery("tag.className"); because this uses getElementByTagName first.</p>
<p>So I've set up a benchmark on jsPerf to check. I've used the source markup from my website so its more of a real world test and run the benchmark on all modern browsers and apart from Chrome and Opera, all the other modern browsers say that jQuery(".className"); is an order of magnitude faster even though this goes against nearly everything i've read in books and tutorials online. I assume its faster because those browsers support getElementByClassName natively.</p>
<p>Here's the benchmark:</p>
<p><a href="http://jsperf.com/length-detection" rel="nofollow">http://jsperf.com/length-detection</a></p>
<p>What do you think is best?</p>
<p>Many thanks</p>
<p>Chris</p>
|
javascript jquery
|
[3, 5]
|
1,036,347 | 1,036,348 |
What's the difference between Binding Data to the repeater in the mark-up or binding it programatically
|
<p>What's the difference between binding for example a column called ("Name") in both cases ? and is there's any performance difference ?</p>
<p>1- Assigning the data in the mark-up</p>
<p><code><asp:Label ID="Name_Lbl" runat="server" Text='<%# Eval("Name") %>' ></asp:Label></code></p>
<p>2- defining a control object for every control inside the repeater ItemTemplate and find it and then assign the data in the column "Name" to it</p>
<p><code>e.Item.FindControl("Name_Lbl")</code> </p>
|
c# asp.net
|
[0, 9]
|
1,577,794 | 1,577,795 |
Jquery and object href confusion
|
<p>I've tried adding console.log, but I can't figure it out.</p>
<pre><code>$(this).href
</code></pre>
<p>Doesn't this refer to the end link location?</p>
<p>As in if </p>
<pre><code><a href="test.php">here</a>
</code></pre>
<p>And the page we are on is test.com
Does $(this).href give us "test.php" or test.com/test.php? I need to access the latter of the two.</p>
<p>Any tips?</p>
|
javascript jquery
|
[3, 5]
|
3,611,132 | 3,611,133 |
Track a user that is not logged in
|
<p>Is it possible to track not logged in user without using session or a cookie? Is there a more reliable way?<br>
Just like www.filefactory.com or other similar download space website, they can track if you are free user and send download request, before starting next download you must wait x time, I was thinking it used session or cookies, but after clearing session and cookie or change IP address, it's still the same. </p>
<p>I'm a newbie trying to create a website, I have to track user before logged in like this example site, I'm using php and javascript set session and timeout to keep catch user status (to write file in dir or ...
I've been searching a long time, if anyone knows any tutorial or just a little clue how to do it like this site it would be appreciated.. </p>
<p>Thanks!</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,636,255 | 4,636,256 |
How can I dynamically change text based on input field?
|
<p>How can I dynamically change a link based upon an input field in a form. For example, if I input <code>1.00</code> into the input field, I want to change the link to this:</p>
<p><code>donate.php?amount=1.00</code></p>
<p>Where the amount changes to the amount specified in the input field.</p>
<p>I'm guessing its JavaScript which isn't my strongest point but any help would be awesome. :)</p>
<p>Thanks</p>
|
php jquery
|
[2, 5]
|
5,908,463 | 5,908,464 |
Replace numbers without change number in style or everything else by jQuery
|
<p>How can replace arabic number with latin number as that doesn't change number into div:style and doesn't change tag and ... ? How can done it?</p>
<p><strong>DEMO:</strong> <a href="http://jsfiddle.net/mCUvT/" rel="nofollow">http://jsfiddle.net/mCUvT/</a></p>
<pre><code><div class="myGrid">
<b style="top: 50px;">123456789-10-11-12</b>
<br />
<span style="margin: 20px 0 10px 5px">05-10-1390</span>
<a href="http://blog.jsfiddle.net/" style="left: 20px">our blog</a>
</div>
var grid= $(".myGrid");
grid.html(grid.html().replace(/0/g,"&#1776;"));
grid.html(grid.html().replace(/1/g,"&#1777;"));
grid.html(grid.html().replace(/2/g,"&#1778;"));
grid.html(grid.html().replace(/3/g,"&#1779;"));
grid.html(grid.html().replace(/4/g,"&#1780;"));
grid.html(grid.html().replace(/5/g,"&#1781;"));
grid.html(grid.html().replace(/6/g,"&#1782;"));
grid.html(grid.html().replace(/7/g,"&#1783;"));
grid.html(grid.html().replace(/8/g,"&#1784;"));
grid.html(grid.html().replace(/9/g,"&#1785;"));
</code></pre>
<p></p>
|
javascript jquery
|
[3, 5]
|
4,308,033 | 4,308,034 |
LineNumberReader setLineNumber not working
|
<p>i use LineNumberReader to read text file , when call setLineNumber and getLinenumber it print == 0 But when call readLine again ์Nit thing happen how can i fix it
Here is my code</p>
<pre><code> BufferedWriter writer = new BufferedWriter(new FileWriter("text.txt"));
writer.write("This is a line1\n" +
"This is a line2\n" +
"This is a line3");
writer.newLine();
writer.close();
File myFile = new File("text.txt");
FileReader fileReader = new FileReader(myFile);
LineNumberReader reader = new LineNumberReader(fileReader);
// Read from the FileReader.
String lineRead = "";
while ((lineRead = reader.readLine()) != null) {
System.out.println(lineRead);
}
// Determine the number of lines that were read.
System.out.println("Total lines read: " +
reader.getLineNumber());
// Reset the number of lines read.
reader.setLineNumber(0);
System.out.println("Total lines read after reset: " +
reader.getLineNumber());
String lineRead2 = "";
while ((lineRead2 = reader.readLine()) != null) {
System.out.println(lineRead2);
}
System.out.println("End");
// Close the LineNumberReader and FileReader.
fileReader.close();
reader.close();
</code></pre>
<p>Thank</p>
|
java android
|
[1, 4]
|
754,234 | 754,235 |
video event listener within iframe
|
<p>i'm using daily motion cloud (www.dmcloud.net) to host a video which is embedded within my site as an iframe. the standard code they gave for embedding looks like this:</p>
<pre><code><iframe width="640" height="360" frameborder="0" scrolling="no" src="http://api.dmcloud.net/player/embed/50071a76947399130e000cf1/5007219606361d1595000d2d?auth=1658005007-0-zddb6jin-a18fde4cb11266dad1c817b9c8bc1aca&autoplay=1&force_asset_name=mp4_h264_aac_hq"></iframe>
</code></pre>
<p>i need to add an event listener (or something similar) where i can determine when a user has finished watching the video, and then i display some content. How can this be done? </p>
|
javascript jquery
|
[3, 5]
|
4,030,709 | 4,030,710 |
DropDownList postback never finishes on iPad
|
<p>I've seen several posts about DropDownLists getting cleared, or events not getting fired, but they don't seem to match this situation.</p>
<p>I've got (well I've reduced the problem to) a very simple asp.net website, a master page with a content page. The content page has a single DropDownList with AutoPostback set to True. The code behind updates a Label with the list's selected value. Not using UpdatePanel or AJAX (though I tried using them and I get exactly the same results). It's an intranet site using Windows authentication.</p>
<p>It works fine on IE and Chrome, but every time I try it on my iPad it just sits and spins. The postback appears to be happening, but either nothing's coming back (or being accepted) from the server, or the client just doesn't know how to finish things up, or I don't know what.</p>
<p>Sorry if this seems vague but I've spent two hours on Google and haven't come up with anything other than the fact that a simple page like this should work fine on an iPad, so I'm a little punchy.</p>
<p>Anybody got any pointers or ideas?</p>
<p><strong>EDIT</strong>: Running this page through the remote web access portal my company uses, it works fine. So this may be an authentication problem between the iPad and IIS.</p>
|
iphone asp.net
|
[8, 9]
|
1,037,215 | 1,037,216 |
Is there any way to get the size in bytes of a string in Java?
|
<p>I need the size in bytes of each line in a file, so I can get a percentage of the file read. I already got the size of the file with <code>file.length()</code>, but how do I get each line's size?</p>
|
java android
|
[1, 4]
|
5,641,087 | 5,641,088 |
Make div appear on dynamic option select
|
<p>I have a SELECT input that gets all of its options via the database. Below the select input, there are divs created for each option in the select. I want the user to select an option from the drop down and make the div below display. So basically the drop down are sports, and if they make a selection the sport div hidden below will load, and that div will contain all the sport positions</p>
<pre><code> <select name="sport" id="select">
<?
foreach ($getSports as $row) {
echo '<option onClick="toggle'.$row['1'].'()" onLoad="toggle'.$row['1'].'()" value="' . $row['0'] . '">' . $row['1'] . '</option>';
}
?>
</select>
</label>
<?
foreach ($getSports as $row) {
echo '<div id="position' . $row['1'].'" style="margin-top: 5px;display:none;">Positions:' . $row['1'].'';
$sport = $row['0'];
$getPositions = $model->getPositions($sport);
foreach ($getPositions as $row2) {
echo '<label style="float:right">'.$row2['1'].'</label>';
echo '<input type="checkbox" name="'.$row2['1'].'" value="'.$row2['0'].'">';
}
echo '</div>';
}
?>
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
2,066,825 | 2,066,826 |
Javascript file - change source at runtime from web.config
|
<p>I have this in my code:</p>
<pre><code><script type="text/javascript"
src="path?key=1234567890">
</script>
</code></pre>
<p>I added this in web.config:</p>
<pre><code><appSettings>
<add key="key" value="1234567890"/>
</code></pre>
<p></p>
<p>How to implement it in the above code?</p>
|
javascript asp.net
|
[3, 9]
|
5,409,864 | 5,409,865 |
Detect multiple keys on single keypress event on jQuery
|
<p>Is it at all possible to combine a mixture of keypress' to fire a single event?</p>
<pre><code>$(document).keyup(function(e){
if (e.keyCode==68 && e.keyCode==69 && e.keyCode==86) {
alert('oh hai');
}
});
</code></pre>
<p>I've tried it in Chrome but the event doesn't fire.</p>
<p>Call me crazy but I am writing a chrome extension and want to push D+E+V keys together to force it into a hidden developer mode.</p>
<p>I'm using this <a href="http://www.aspdotnetfaq.com/Faq/What-is-the-list-of-KeyCodes-for-JavaScript-KeyDown-KeyPress-and-KeyUp-events.aspx">reference</a> for the keycodes</p>
|
javascript jquery
|
[3, 5]
|
3,707,610 | 3,707,611 |
Calculate total value of textboxes
|
<p>I have 8 textboxes that only accept integers. How to calculate the total of value entered by users in each textbox and the result will be showed as a label. After user click on submit button, the the value of the label(result of numbers) will be stored in db. Anyone knows? Thank you. Looking forward to hear from u guys.
I got this error : <strong>Input string was not in a correct format.</strong>
At this line: </p>
<pre><code>int total = 0;
total = int.Parse(TextBox2.Text) + int.Parse(TextBox4.Text) + int.Parse(TextBox6.Text) + int.Parse(TextBox8.Text) + int.Parse(TextBox10.Text) + int.Parse(TextBox12.Text) + int.Parse(TextBox14.Text) + int.Parse(TextBox16.Text);
Label1.Text = total.ToString();
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,549,955 | 1,549,956 |
facebook add link feature in asp.net
|
<p>I want to implement the functionality in which if user add the url/link of the website, should show corresponded contents and image, something very similar to facebook's add link feature. I tried using iframe but it's not the solution, I guess.</p>
|
c# asp.net
|
[0, 9]
|
601,758 | 601,759 |
Variable's value not retained in the method of a class
|
<p>In ASP>Net using C#, I declared a variable as member of the class as follows:</p>
<pre><code>public class sales: System.Web.UI.Page
{
string type=null;
}
</code></pre>
<p>And i have an Image Button in my UI for which I've defined the event called</p>
<pre><code>protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
</code></pre>
<p>in this method, any value assigned to variable 'type'(by any other method of the class) is not retained and only value null is being retrieved though I've assigned some value to 'type' somewhere inside the class...</p>
<p>What could be the problem that I cant access the assigned value????</p>
|
c# asp.net
|
[0, 9]
|
3,945,107 | 3,945,108 |
create an object
|
<p>how can i create an object so i can get the item.
i found an example that said </p>
<pre><code> Object item2 = getListView().getAdapter().getItem(holder.position);
</code></pre>
<p>to create the object but thing is different in my class
can you help me to find how
cause i need the object</p>
<p>here is my class. how can i do it here:</p>
<p>i need the object to do some functions.</p>
|
java android
|
[1, 4]
|
458,447 | 458,448 |
Tables updated on SMS Receive in Android
|
<p>When a contentObserver is registered for <strong>content://sms/</strong> then it is called multiple times. I found an accepted answer <a href="http://stackoverflow.com/questions/7493139/why-is-the-contentobserver-called-multiple-times">Why is the ContentObserver called multiple times?</a>. According to this answer multiple tables are updated. I want to know that which tables are actually updated when an SMS IS RECEIVED and what is their sequence.</p>
<p>Also i found out that when Go SMS Pro is activate for private mode and a text message for private number is received then content observer is called only one time but their is no new sms is found in <strong>sms</strong> table ??</p>
|
java android
|
[1, 4]
|
2,463,093 | 2,463,094 |
Converting between image file types in c#
|
<p>On my website, I'm receiving image files for upload. I accept files of type jpg, png, bmp or gif. If the user uploads a jpg, png or gif I want to save the file keeping the file type, but if the user uploads a bmp I want to convert it to a png.</p>
<p>I have a method stub like this:</p>
<pre><code>private void profileImgUpload(HttpPostedFile profileImg)
</code></pre>
<p><code>HttpPostedFile</code> has a method <code>saveAs</code>, to save the file, or else a property <code>InputStream</code> to get a stream to work with.</p>
<p>In the previous implementation, someone had written this:</p>
<pre><code>String[] allowedExtensions = { ".png", ".jpeg", ".jpg", ".gif" };
for (int i = 0; i < allowedExtensions.Length; i++)
{
if (FileExtension == allowedExtensions[i])
FileOK = true;
}
}
if (FileOK)
profileImg.SaveAs(physicalPath + "newAvatarTemp.png");
</code></pre>
<p>I have assumed that this just results in the file being saved with the name <code>newAvatarTemp.png</code>, but the actual encoding type is not changed.</p>
|
c# asp.net
|
[0, 9]
|
1,643,485 | 1,643,486 |
Going from C# to Java
|
<p>I've been working with C# and more generally the .Net framework for a couple of years now. I often heard about the similarity between C# & the Java language and would like to learn more about the second one.</p>
<ul>
<li>Have you got any specific advice to learn Java when coming from C# ?</li>
<li>Any common errors a C# programmer would do when starting Java ?</li>
<li>Any documentation showing the habits you can keep and the ones you must change (still in a C# to Java optic, so something a bit more specific then a C# vs Java comparison) ?</li>
</ul>
|
c# java
|
[0, 1]
|
4,786,418 | 4,786,419 |
how to upload post directly to developer timeline using facebook integration in android
|
<p>Is it possible, that when user clicks on post on facebook button then content is directly shown on developer's timeline.
without user's login on facebook.</p>
<p>Anybody have any idea about it? Please help me.</p>
<p>Thanks in advance..</p>
|
java android
|
[1, 4]
|
5,759,232 | 5,759,233 |
JQuery | Find all "," (comma) in an <ul> and erase them / replace with ' '
|
<p>HTML</p>
<pre><code> <ul class="tabbox">
<li></li>
,
<li></li>
,
<li></li>
</ul>
</code></pre>
<p>JQuery (My Idea - does NOT work)</p>
<pre><code>$(".tabbox").replace(',' , ''); // This was my idea, and it does not work ..
</code></pre>
<p>How can I remove the , from the < ul > ?</p>
|
javascript jquery
|
[3, 5]
|
3,289,208 | 3,289,209 |
How can I detect with JavaScript/jQuery if the user is currently active on the page?
|
<p>I am needing to detect when a user is inactive (not clicking or typing) on the current page for more than 30 minutes.</p>
<p>I thinking it might be best to use event blubbling attached to the body tag and then just keep resetting a timer for 30 minutes, but I'm not exactly sure how to create this.</p>
<p>I have jQuery available, although I'm not sure how much of this will actually use jQuery.</p>
<p><strong>Edit:</strong> I'm more needing to know if they are actively using the site, therefore clicking (changing fields or position within a field or selecting checkboxes/radios) or typing (in an input, textarea, etc). If they are in another tab or using another program, then my assumption is they are not using the site and therefore should be logged out (for security reasons).</p>
<p><strong>Edit #2:</strong> So everyone is clear, this is not at all for determining if the user is logged in, authenticated or anything. Right now the server will log the user out if they don't make a page request within 30 minutes. This functionality to prevent the times when someone spends >30 minutes filling in a form and then submitting the form only to find out that they haven't been logged out. Therefore, this will be used in combination with the server site to determine if the user is inactive (not clicking or typing). Basically, the deal is that after 25 minutes of idle, they will be presented with a dialog to enter their password. If they don't within 5 minutes, the system automatically logs them out as well as the server's session is logged out (next time a page is accessed, as with most sites).</p>
<p>The Javascript is only used as a warning to user. If JavaScript is disabled, then they won't get the warning and (along with most of the site not working) they will be logged out next time they request a new page.</p>
|
javascript jquery
|
[3, 5]
|
5,900,602 | 5,900,603 |
ASP.NET - Display Message While Page Is Loading
|
<p>I have a page that performs a long-running task (10 to 15 seconds) in the page_load method.</p>
<p>I have client-side javascript code that will display a decent "page loading" animated gif to the user.</p>
<p>I am able to invoke the JavaScript method from the code-behind, to display the "page loading" animated gif, however, the long-running task is hanging up the UI such that the animated gif doesn't actually display until after the long-running task is complete, which is the exact opposite of what I want.</p>
<p>To test this out, in my page_load method I make a call to the JavaScript method to display the animated gif. Then, I use Thread.Sleep(10000). What happens is that the animated gif doesn't display until after Thread.Sleep is complete.</p>
<p>Obviously I am doing something incorrect.</p>
<p>Any advice would be appreciated.</p>
<p>Thanks.</p>
<p>Chris</p>
<p>Below is an example of the code-behind:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript
(GetType(), "Javascript", "javascript: ShowWaitIndicator(); ", true);
Response.Flush();
Thread.Sleep(10000);
}
</code></pre>
|
c# asp.net javascript
|
[0, 9, 3]
|
2,915,178 | 2,915,179 |
What is the Problem with this kind of Data for Javascript and PHP
|
<p>I have a Html table which consists of the Data Generated through serverside php .It consists of many rows.Each Row Contains One Button Called "Approve" . when clicked on "Approve" it goes to one php file and does its DB transcations</p>
<p>Here is what i have Code for "Approve button " in php</p>
<pre><code>$cntrl = "<input name=btn1 type=button id=btn1 value=Approve onClick=\"callApprove('".$row['val1']."','".$row['val2']."');\"";
</code></pre>
<p>Here is the JS Function called when clicked on "Approve".</p>
<pre><code>function callApprove(val1,val2){
var url = 'approve.php?id=<?php echo $_REQUEST['var3'];?>&param1='+val1+'&param2='+val2;
window.open(url)
}
</code></pre>
<p>Now Here my Problem is when i have the data as "ABC6252756/ A#1829533" .when i have this kind of data val2 i not being passed to approve.php
where as when we have this kind of data "ABC07- USVDL2" it value is being passed succesfully.
Do we have any kind of problem with the (/,#) characters . For Safe Side i have put the alert for the val2 for ("ABC6252756/ A#1829533") this data
It came up succesfully . What might be the problem?</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,128,044 | 3,128,045 |
using for loop value from javascript with php variable
|
<p>I have this code that executes a for loop in javascript with a php array inside of it. Is there anyway I can use the variable for the loop inside of the php variable for example. This is all inside of php.</p>
<pre><code>echo '<script>
for (var i =0; i<4;i++){
alert("hey"'.$phparr[i].');
}</script>';
</code></pre>
<p>I know this will not work because the $phparr is a php variable while the i is a javascript variable is there anyway I can do this?</p>
|
php javascript
|
[2, 3]
|
4,319,021 | 4,319,022 |
not all code paths return a value Error
|
<p>I'm getting an Compilation Error with my CS file. I have a method that creates a JSON object of the user credentials.</p>
<pre><code>public string CreateLoginjson(string strErrorType, bool blIsAuthenticated)
{
StringBuilder sbLoginJson = new StringBuilder();
if (blIsAuthenticated)
{
sbLoginJson.Append("{LoginSuccess:1");
}
else
{
sbLoginJson.Append("{LoginSuccess:0");
}
if (strErrorType != string.Empty)
{
if (strErrorType.TrimEnd(new char[] { ',' }) == "Token" || strErrorType.TrimEnd(new char[] { ',' }) == "BlankToken")
{
sbLoginJson.Append(",txtTestTokenNumber1:\"Error\"");
sbLoginJson.Append(",txtTestTokenNumber2:\"Error\"");
sbLoginJson.Append(",txtTestTokenNumber3:\"Error\"");
sbLoginJson.Append(",txtTestTokenNumber4:\"Error\"");
}
if (strErrorType.TrimEnd(new char[] { ',' }) == "Password" || strErrorType.TrimEnd(new char[] { ',' }) == "BlankPassword")
{
sbLoginJson.Append(",txtPassword:\"Error\"");
}
if (strErrorType.TrimEnd(new char[] { ',' }) == "UserName" || strErrorType.TrimEnd(new char[] { ',' }) == "BlankUserName")
{
{
sbLoginJson.Append(",UserName:\"Error\"");
}
string strLoadErrorControlMessage = LoadErrorControl(strErrorType, string.Empty);
if (strLoadErrorControlMessage != string.Empty)
{
PageTestApplicationLogin objPageTestApplicationLogin = new PageTestApplicationLogin(objClientConfiguration);
sbLoginJson.Append(",ErrorMessage:'" + objPageTestApplicationLogin.GetTestApplicationLoginErrorHtml("", strLoadErrorControlMessage).Replace("'", "\"") + "'");
}
}
sbLoginJson.Append("}");
var LoginJson = sbLoginJson.ToString();
return LoginJson;
}
}
</code></pre>
<p>Should I place the return statement elsewhere, cos I feel that's what's causing this error?
Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
1,218,393 | 1,218,394 |
nodeName for selected text in Javascript
|
<p>I am making a HTML text editor.
For this,i have a div with contenteditable set to true.
For making a selected text "bold",i am trying to find node of the selected text.
How should i do this or is there is any other way to implement this(particular in ie).</p>
|
javascript jquery
|
[3, 5]
|
3,185,079 | 3,185,080 |
Java Equality not Behaving as Expected
|
<p>I'm currently working on an android application that uses a subclass of SimpleListAdapter to bind a ListActivity. The list that the Adapter binds to is of type <code>List<HashMap<String, Object>></code>.</p>
<p>I have to following If statement in the list Adapter...</p>
<pre><code>if (dataRow.get("HasLineup1").toString()) == "0")
</code></pre>
<p>This never evaluates to <code>true</code> for me, even when the Eclipse debugger says that <code>dataRow.get("HasLineup1").toString()</code> is equal to <code>"0"</code> in the inspection window.</p>
<p>The list of data is populated from an XML source with the line </p>
<pre><code>Game.put("HasLineup1", attributes.getNamedItem("home_lineup").getNodeValue());
</code></pre>
<p>I managed to work around the issue by changing the If statement to</p>
<pre><code>if (Integer.parseInt(dataRow.get("HasLineup1").toString()) == 0)
</code></pre>
<p>Can someone explain to me why the first If statement I used wasn't working? Java isn't my native language, but I can't for the life of me figure out what I'm doing wrong based on my .Net background.</p>
|
java android
|
[1, 4]
|
5,783,574 | 5,783,575 |
how to check if input type button is pressed in php?
|
<p>the isset function can be used to check if input type submit is pressed but is there any way to check if the input type button is pressed?in my code the button does nothing but call a function on onclick event which then refreshes the page and makes a database entry inside php...and i want it to make the entry only after the button is pressed...and i cant use the sumbit type for other reasons...following is some code</p>
<pre><code> function send(){
var events=document.getElementById("event").value;
location.href="calm.php?day=" + xx + "&month=" + yy + "&year=" + zz + "&events=" + events;
}
<input name="Button" type="button" id="submit" onclick="send(this.form)" value="Button" />
<?php
session_start();
include_once "connect_to_mysql.php";
$day = $_GET['day'];
$month = $_GET['month'];
$year = $_GET['year'];
$events = $_GET['events'];
$userid = $_SESSION['id'];
if (isset($_POST['button']))
{ $sql = mysql_query("INSERT INTO events (userid,month,day,year,events)
VALUES('$userid','$month','$day', '$year','$events')")
or die (mysql_error());}
</code></pre>
<p>?></p>
|
php javascript
|
[2, 3]
|
881,173 | 881,174 |
Passing Variables from JavaScript to PHP?
|
<p>I have just integrated Evercookie into my site, problem is it is written in JavaScript</p>
<p>I currently use a redirect to pass the variable to php </p>
<pre><code><script type="text/javascript">
// retrieve a cookie called "id" (simply)
ec.get("uinwish", function(value) { window.location = "http://www.mysite.com?cookie=" + value });
</script>
</code></pre>
<p>is there a better way than a redirect to pass JavaScript Values to PHP?</p>
|
php javascript
|
[2, 3]
|
1,149,300 | 1,149,301 |
create a set get class and pass parameter in constructor
|
<p>I am new to asp.net & trying create a object, but there is a syntax error</p>
<pre><code>public class pair
{
private string key;
private string value;
public pair(string key, string value)
{
this.key = this.setKey(key);
this.value = this.setValue(value);
}
private void setKey (string key) {
this.key = key;
}
public string getKey()
{
return this.key;
}
private void setValue(string value)
{
this.value = value;
}
public string getValue()
{
return this.value;
}
}
</code></pre>
<p>these two lines</p>
<pre><code>this.key = this.setKey(key);
this.value = this.setValue(value);
</code></pre>
<p>have something wrong, anyone know the problems?</p>
|
c# asp.net
|
[0, 9]
|
2,459,924 | 2,459,925 |
Alarm when battery get full charged
|
<p>How to get information of battery status means whether its fully charged.</p>
<p>Is it possible if possible how which api should i use</p>
|
java android
|
[1, 4]
|
3,480,126 | 3,480,127 |
Get simple name for the running application
|
<p>How can i make my code to show only the name of running application which i can kill, because in my code it show the package name and that is very confusing for the user. And also, i want it to have an icon beside the application so that the user will identify it easily. i got this code from the internet and i used it for my project. Here is my code:</p>
<pre><code> private List<TaskObject> getTasksToKill() {
List<TaskObject> tol = new ArrayList<TaskObject>();
for (int i = 0; i < adapter.getCount(); i++) {
TaskObject to = adapter.getItem(i);
if (to.isToKill()) {
tol.add(to);
}
}
return tol;
}
public void loadRunningProcesses() {
ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> appinfolist = activityManager
.getRunningAppProcesses();
Log.d(TAG, "AppInfoList Size: " + appinfolist.size());
for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : appinfolist) {
TaskObject runningtask = new TaskObject();
runningtask.setPid(runningAppProcessInfo.pid);
runningtask.setProcessName(runningAppProcessInfo.processName);
adapter.addTask(runningtask);
}
}
class TaskObject {
int pid;
String processName;
private boolean toKill;
public int getPid() {
return pid;
}
public void setPid(int pid) {
this.pid = pid;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
public boolean isToKill() {
return toKill;
}
public void setToKill(boolean toKill) {
this.toKill = toKill;
}
}
}
}
</code></pre>
<p>Hoping for all of your answers and recommendation. Thank you for all of your help :) </p>
|
java android
|
[1, 4]
|
4,242,820 | 4,242,821 |
$(document).on('click', selector, function() ) combined with :not
|
<p>I've got several list items, when I click on the item I want the browser to redirect to ".title > a" link (href). But I don't want any event on the "notThis" selector.</p>
<p>see the example
<a href="http://jsfiddle.net/VTGwV/29/" rel="nofollow">http://jsfiddle.net/VTGwV/29/</a></p>
<pre><code><div class="item">
<div class="title">
<a href="www.jsfiddle.net">jsfiddle.net</a>
</div>
<div> djføljdsaføljdsf a</div>
<div> djføljdsaføljdsf a</div>
<div> djføljdsaføljdsf a</div>
<div class="notThis">
<a href="/test.html">link1 </a>
<a href="/test2.html">link2</a>
</div>
</code></pre>
<p></p>
<p>script</p>
<pre><code>$(document).on('click', '.item', function(event) {
window.location.href = $(event.currentTarget).find('.title > a').attr('href');
});
</code></pre>
<p>I've tried :not('.notThis') without any luck. </p>
<p><strong>Changes</strong>
Thanks for all the answers, but I found another problem. If I have a event handler on the whole item , I can't manage to click on the link in "notThis" selector, because it returns only "false". Isn't there a way to use .not / :not combined with $(document).on('click', -------)</p>
|
javascript jquery
|
[3, 5]
|
3,530,423 | 3,530,424 |
jQuery UI Slider - Disable click on slider track
|
<p>I'm trying to find a way to disable the click on my jQuery UI Slider's track. Clicking on the handle is ok but I do not want the handle to respond if the user clicks on the track.</p>
<p>slider set up in document.ready() as follows:</p>
<pre><code>$('#navScroller').slider({
value: 0,
start: onNavScrollStart,
slide: onNavScrollSlide,
animate: slideSpeed,
max: slideWidth
});
</code></pre>
<p>I tried both:</p>
<pre><code>$('#navScroller').unbind('click');
</code></pre>
<p>and</p>
<pre><code>$('#navScroller .ui-slider').unbind('click');
</code></pre>
<p>neither of which worked to stop the slider from responding to track clicks.</p>
<p>Any ideas on how to accomplish this? Thanks!</p>
<p>EDIT:
I just discovered that using:</p>
<pre><code>$('#navScroller').unbind('mousedown');
</code></pre>
<p>removes clicks from the whole slider, handle and all, which is closer to what i need but I still need to be able to drag the handle.</p>
|
javascript jquery
|
[3, 5]
|
3,420,132 | 3,420,133 |
How do I properly fade in and out using jQuery?
|
<p>Can anyone help me with this simple bit of jQuery? I am building a carousel that features many sliding <code><li></code>s. Each one has a short description accompanying it, which I want to fade out when the carousel slides, and fade in when the carousel stops at another <code><li></code>. The problem is that when the carousel controls are clicked rapidly, the fades take a while to catch up. Also the current simple fadeIn/Out option doesn't work well when clicking to an <code><li></code> much further through the carousel (from the small grey discs underneath infographic). I've tried a few options but I'm not really getting anywhere.</p>
<p>The page is here: <a href="http://weaver-wp.weavertest.com/radiation-infographic/" rel="nofollow">http://weaver-wp.weavertest.com/radiation-infographic/</a></p>
<p>Thanks for any help :)</p>
<p>David</p>
|
javascript jquery
|
[3, 5]
|
5,687,014 | 5,687,015 |
Is it possible to have php load and run javscript?
|
<p>I have a php script that runs glob on a directory, and it returns all the images it finds in the directory, with an ad from google before all the images.
I would like it if I could use glob to load 10 of the images, then insert the javascript from googles ad services, and continue loading the images. So an ad every 10 images. Every attempt by me so far has failed spectacularly, and any help would be greatly appreciated!</p>
<p>Below is my PHP code</p>
<pre><code><?php
$manualwidth = $_GET['manwidth'];
$manualdir = $_GET['mandir'];
$manualmodel = $_GET['manurl'];
$manualurl = $manualdir . '/' . $manualmodel . '/';
$files = glob($manualurl .'{*.jpg,*.gif}', GLOB_BRACE);
for ($i=0; $i<count($files); $i++)
{
$num = $files[$i];
echo '<img src="'.$num.'" width="'.$manualwidth.'"><br>'."&nbsp;&nbsp;";
}
?>
</code></pre>
|
php javascript
|
[2, 3]
|
3,203,184 | 3,203,185 |
Can I add to a javascript object once its defined?
|
<p>I have the following javascript code:</p>
<pre><code>var oLink = {
title: $link.attr('title') || '',
row: $link.attr('data-row') || ''
}
</code></pre>
<p>Is it possible to add another field <strong>once these fields have already been defined</strong> so as to achieve:</p>
<pre><code>var oLink = {
viewUrl: $link.attr('data-href') || '',
title: $link.attr('title') || '',
row: $link.attr('data-row') || ''
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,822,139 | 4,822,140 |
ASP.NET Javascript Hide/Show Read More for Long Text
|
<p>So at the moment I have a literal to which I assign a value to from database. I.e an Introduction to a programme.</p>
<p>What I am looking to do is i.e if the text is larger than 100 Characters, to only display the first 100 Characters and then display a javascript link "Read More" which when clicked displays the rest of the content.</p>
<p>Any Ideas ?</p>
|
javascript asp.net
|
[3, 9]
|
396,120 | 396,121 |
Resume timer with jQuery
|
<p>I am using the plugin from <a href="http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/" rel="nofollow">http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/</a></p>
<p>I want to Resume the timer. I wrote this, as I also want to get the data from server. But <strong>onResume</strong> is not working (Means the timer is not resetting).</p>
<pre><code>$.get("test1.php?data="+message, function(result){
// $("div").html(result);
$('#idletimeout').html(result)._onResume();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,710,969 | 1,710,970 |
remove object from object array
|
<p>Hello I was trying to remove objects from object array that I have and then create another new object (I'm using $.map() to create the new object ) </p>
<p>to remove this object from object(x) it's object.number has to match one of the number the number in array(y)</p>
<p>this following code works but i only remove the object that has the object.number = 40
<a href="http://jsfiddle.net/minagabriel/C3d9T/4/" rel="nofollow">DEMO</a></p>
<p>Code : </p>
<pre><code> var x =[ //this is the object
{name : 'mark' , number : '10' , color:'green'},
{name : 'jeff' , number : '15' , color:'blue'} ,
{name : 'joy' , number : '30' , color:'yellow'},
{name : 'mick' , number : '15' , color:'red'},
{name : 'mick' , number : '40' , color:'black'}] ;
var y =['40','15']; // i need to remove all object.number that match the
// number in this array
var newObject = $.map(x ,function(index, value){
for(i in y){
if(index.number == y[i])
{return null ; }
else{
return index;
}
}
});
console.log(newObject);
</code></pre>
<p>the code above only remove the object that has 40 in it's object.number, how can i make this work?</p>
|
javascript jquery
|
[3, 5]
|
2,963,111 | 2,963,112 |
Errors when EditText left blank
|
<p>Can anyone take a look at the below code and point out the obvious on what's wrong? The program gives an error when <code>editText</code> is left blank and only does the calculation once all the information is present. Currently the program crashes when there is text missing, why is this?</p>
<pre><code>EditText editText1, editText2;
double numA, numB, numC;
TextView answer;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.calc);
editText1 = (EditText) findViewById(R.id.editText1);
editText2 = (EditText) findViewById(R.id.editText2);
}
public void btnClick(View v)
{
if(editText1.getText().length()==0)
{
editText1.setError("please input text");
}{
if (editText2.getText().length()==0)
{
editText2.setError("please input text");
}
numA = new Double(editText1.getText().toString());
numB = new Double(editText2.getText().toString());
numC=(numA + numB); answer.setText(Double.toString(numC));
}
}}
</code></pre>
|
java android
|
[1, 4]
|
2,805,164 | 2,805,165 |
Checkbox outside of form
|
<p>Because of a design requirement, I need to place several checkboxes outside of a form. Is it still possible to include these values in the form's submit action? Maybe with javascript or some other way I'm not thinking of?</p>
|
php javascript
|
[2, 3]
|
3,776,307 | 3,776,308 |
After clicking the nth item, how do I manipulate another nth element?
|
<p>I'm using jQuery and wanting to target the nth <li> in a list after clicking the nth link.</p>
<pre><code><ul id="targetedArea">
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<div id="clickedItems">
<a></a>
<a></a>
<a></a>
<a></a>
</div>
</code></pre>
<p>I can target them individually, but I know there must be a faster way by passing which <a> element I clicked on.</p>
<pre><code>$("#clickedItem a:eq(2)").click(function() {
$("#targetedArea:eq(2)").addClass('active');
return false;
});
</code></pre>
<p>Cheers,<br />
Steve </p>
|
javascript jquery
|
[3, 5]
|
41,527 | 41,528 |
Repeater and Custom Control - Dynamically adding to the collection and retaining values
|
<p>It has been so long since I've used Web Forms I find myself not remembering most of the perks.</p>
<p>I have a user control that has a button, a repeater and the ItemTemplate property of the repeater is another user control.</p>
<pre><code><asp:Button runat="server" ID="btnAdd" CssClass="btn" Text="Add" OnClick="btnAdd_Click"/>
<br/>
<asp:Repeater runat="server" ID="rptrRequests">
<ItemTemplate>
<uc1:ucRequest ID="ucNewRequest" runat="server" />
</ItemTemplate>
</asp:Repeater>
</code></pre>
<p>The idea is that when the user clicks on the Add button a new instance of the ucRequest is added to the collection. The code behind is as follows:</p>
<pre><code>public partial class ucRequests : UserControl
{
public List<ucRequest> requests
{
get
{
return (from RepeaterItem item in rptrRequests.Items
select (ucRequest) (item.Controls[1])
).ToList();
}
set
{
rptrRequests.DataSource = value;
rptrRequests.DataBind();
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
requests = new List<ucRequest>();
}
protected void btnAdd_Click(object sender, EventArgs e)
{
var reqs = requests;
reqs.Add(new ucRequest());
requests = reqs;
}
}
</code></pre>
<p>After much googling I now remember that I should be binding the Repeater in the OnInit method in order for the ViewState to put the captured data of the controls within the ucRequest control on them between post backs but when I try to do that I will always have a single instance of the control on the Repeater since its Items collection is always empty.</p>
<p>How could I manage to do this?</p>
<p>Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
3,964,983 | 3,964,984 |
jQuery countdown timer
|
<p>I am using:</p>
<pre><code> $(function () {
endAuction = new Date(
data.year,
data.month,
data.day,
data.hour,
data.minute,
data.second
);
$('#defaultCountdown').countdown('destroy')
$('#defaultCountdown').countdown({
until: endAuction,
format: 'DHMS',
onExpiry: endAuctionReload
//,onTick: highlightLast5
});
});
</code></pre>
<p>to create a countdown timer from a time sent by an ajax call (PHP file) however this wont work if a user changes their local clock. Is there a way to force the server time as opposed to the local time?</p>
|
php jquery
|
[2, 5]
|
4,697,079 | 4,697,080 |
How can i catch number or chars using javascript or jquery
|
<p>I need to catch or filter a number from string example:</p>
<pre><code>var Mystring = "4.0" // or sometime 4.5
// so i need to catch .5 or .0 to replace it or eliminated
</code></pre>
<p>sorry about my English. </p>
|
javascript jquery
|
[3, 5]
|
4,380,898 | 4,380,899 |
PHP/JS clock not showing user's timezone and not displaying seconds as they change
|
<p>I have a clock that I am tring to use on my site and it works really well as in it shows the time but there are still two things that I need it to do:</p>
<ol>
<li>I need it to display the time in my timezone, the server's timezone.</li>
<li>I need the clock to keep real time. (i.e., display the seconds as they change)</li>
</ol>
<p>Code:</p>
<pre><code><script>
function displayTime() {
document.getElementById( "servertime" ).innerHTML = '<?=date("h:i:s A");?>';
}
var serverTime = window.setInterval( "displayTime()", 1200 );
</script>
</code></pre>
|
php javascript
|
[2, 3]
|
2,779,332 | 2,779,333 |
how to check for input validation java
|
<p>this is what i have so far, how do i make it so it will check the the EditText boxes are empty. when i test it out with all empty boxes it will force close, why and/or how do I fix it?</p>
<pre><code>if ((x1field.getText().toString().equals("")));
{
forgetunits.setText("you have forgotten a number");
}
if ((x2field.getText().toString().equals("")));
{
forgetunits.setText("you have forgotten a number");
}
if ((y1field.getText().toString().equals("")));
{
forgetunits.setText("you have forgotten a number");
}
if ((y2field.getText().toString().equals("")));
{
forgetunits.setText("you have forgotten a number");
}
</code></pre>
|
java android
|
[1, 4]
|
4,716,214 | 4,716,215 |
$.getJSON data not displaying in loop with ajaxSubmit
|
<p>I've been having a few issues trying to execute a dynamically loaded form with jquery. Here is my code:</p>
<pre><code>$(this).ajaxSubmit({
url: '/postform1.php',
type: 'post',
//target: '#preview',
success: function(msg) {
var s = msg + '<form name="sr" id="sr" action="postform.php" method="post"><input type="text" /></form>';
$('#preview').html(s);
$.getJSON("/postform1.php", function(data){
var counter = 0;
if(data) {
$.each(data, function(i, val) {
var newTextBoxDiv = $(document.createElement('div')).attr("id", val);
newTextBoxDiv.after().html('<label>' + i + ' : </label>' + '<input type="text" name="' + i + '" id="' + i + '" value="' + val + '" >');
newTextBoxDiv.appendTo("#sr");
counter++;
});
}
});
}
});
</code></pre>
<p>I was initially echoing the whole form from postform1.php but found the form was not submitting. I dont know if this is the right way of going about it either but figured i'd give it a try. If anyone has any ideas it would be great ro hear from you.</p>
|
php jquery
|
[2, 5]
|
5,506,206 | 5,506,207 |
JQuery: $.get is not a function
|
<p>I'm having a problem doing something very basic in jQuery. Can someone tell me what I'm doing wrong exactly?</p>
<p>If I run the code below, the function $.get seems to be missing (getJSON and others missing too). But $ itself and other functions do exist, so I know JQuery is loading.</p>
<pre><code>google.load("jquery", "1.3.2");
function _validate(form, rules_file) {
$.get('/validation_rules.json',function(data) {
alert("hello")
})
}
</code></pre>
<p>Any ideas would be much appreciated. </p>
<p>Thanks,
Rob</p>
<p>Edit: here is some additional info:</p>
<pre><code> <script src="http://www.google.com/jsapi"></script>
<script>
google.load("prototype", "1.6");
google.load("scriptaculous", "1.8");
google.load("jquery", "1.3.2");
</script>
<script>
jQuery.noConflict(); // prevent conflicts with prototype
</script>
<script src="/livepipe/src/livepipe.js"
type="text/javascript"></script>
<script src="/livepipe/src/window.js"
type="text/javascript"></script>
<script src="/livepipe/src/tabs.js"
type="text/javascript"></script>
<script src="/jquery.maskedinput-1.2.2.js"
type="text/javascript"></script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
715,129 | 715,130 |
Script not running jquery .each
|
<p>This is a snippet from a puzzle game I'm trying to develop. The problem is it stops working after <code>each()</code> of jquery is called. Please help me figure out the problem. Thanks in advance.</p>
<pre><code> function setTotalInPositionPieces()
{
$("#board").children('div').each(function(index, element) {
if(testInPosition(element))
{
++totalInPositionPieces;
$(element).attr("data-inPositionStatus", '1');
}
});
/* The script does not from here, onward. Please tell
me what is the problem. Thanks in advance.*/
if(totalInPositionPieces == totalPieces)
{
$("#messageBox").text("Puzzle Solved!");
}
}
</code></pre>
<p><code>totalInPositionPieces</code> and <code>totalPieces</code> are global variables.</p>
|
javascript jquery
|
[3, 5]
|
4,078,910 | 4,078,911 |
Is there a workaround to trigger an option.click event in IE?
|
<p>I am using a dropdown to allow the user to sort search results. These results in a table but not all of the sortable criteria are represented by columns. The columns can be sorted by either clicking on the column header or using a 'Sort By' dropdown. The user can reverse the sort by clicking on the sorted columns header. I am trying to duplicate this functionality in the drop down but can't get it to work in IE7/IE8.</p>
<p>The following is the existing code that works in both IE and Firefox. It changes the sorted column but not the sort direction.</p>
<pre><code>$("#sortSelect").change(function() {
//change sort
});
</code></pre>
<p>This is what I am trying to change it to and it works in Firefox. It changes the sorted column and if the sorted columns is already selected it will change the sort direction.</p>
<pre><code>$("#sortSelect option").click(function() {
//change sort
});
</code></pre>
<p>I was hoping someone would know of a way to trigger the option.click event or know of a good workaround.</p>
|
javascript jquery
|
[3, 5]
|
1,809,421 | 1,809,422 |
Get a process response
|
<p>I am looking for a way to get a response in a form of a javascript alert after a form has been submitted using a php script. I guess ajax should do this but Im not an Ajax guy yet. A simple sample code would help a lot. Thanks for reading</p>
|
php javascript
|
[2, 3]
|
4,391,755 | 4,391,756 |
ListView: disabling clicking/focus
|
<p>I added a header view to my ListView and it's working quite well, the problem I'm having right now is that I need to remove the default clicking/focus effect when I click the header.</p>
<p>Apart from that, is it possible to also remove the click/focus effect to some items when they are "disabled" options?</p>
|
java android
|
[1, 4]
|
2,348,343 | 2,348,344 |
When do we use HashSet<>
|
<p>i have a small sample .</p>
<pre><code>//Class
public class GetEntity
{
public string name1 { get; set; }
public string name2 { get; set; }
public GetEntity() { }
}
</code></pre>
<p>and:</p>
<pre><code>public void GetHash()
{
HashSet objHash = new HashSet();
GetEntity obj = new GetEntity();
obj.name1 = "Ram";
obj.name2 = "Shyam";
objHash.Add(obj);
foreach (GetEntity objEntity in objHash)
{
Label2.Text = objEntity.name1.ToString() + objEntity.name2.ToString();
}
}
</code></pre>
<p>Code works fine.Same task is done through Dictionary and List.But i want to know when we use HashSet<> , Dictionary<> or List<>.Is there only performance issue or any other things which i dont understand.Thanks.</p>
|
c# asp.net
|
[0, 9]
|
3,433,238 | 3,433,239 |
How to dynamically add buttons with a command argument for the OnClick Event
|
<p>I am coming across an issue with dynamically creating buttons. I have my text I am adding to the buttons, however I also have a command argument I want to send with it. I want my dynamically created buttons to open up a new <code>Activity</code> and pass this argument via <code>Intent</code>. I am a .NET guy and this would be easily done with a <code>CommandParameter</code> off of the <code>Button</code>.</p>
<p>My question is, is this the following code best way to accomplish this task? If so, how can I pass command arguments to the click event. If not, what should be my approach?</p>
<pre><code>int counter =0;
TableLayout layout = (TableLayout) findViewById(R.id.tableLayout);
while (counter< list.size())
{
MyObj obj = list.get(counter);
Button b = new Button(this);
b.setText(obj.getName());
// CommandParameter = obj.getId().toString();
b.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{
Context ctx = getApplicationContext();
Intent intent = new Intent(ctx, TestScreen.class);
intent.putExtra("Id", "MyCommandParameter");
startActivity(intent) ;
}
});
layout.addView(b);
counter++;
}
</code></pre>
|
java android
|
[1, 4]
|
2,734,835 | 2,734,836 |
get label value in javascript through iframe
|
<p>i have an aspx page containing following code</p>
<pre><code><body>
<script language="javascript" type="text/javascript">
function Hidee()
{
alert(window.frames["frame1"].document.getElementById("Label1").text);
}
</script>
<form id="form1" runat="server">
<div>
<iframe id="frame1" name="frame1" class="frame" frameborder="0" src="Default4.aspx"></iframe>
<a onclick="javascript:Hidee()" style="cursor: pointer">close</a>
</div>
</form>
</body>
</code></pre>
<p>in Default4 page i have a label with id Label1
when i click on close button i get <strong>undefined</strong> alert message</p>
|
asp.net javascript
|
[9, 3]
|
1,443,010 | 1,443,011 |
display dropdownlist box option on jgrid
|
<p>I have a drop down list box where i display timezone with gmt hours.<br>
Now I want to display this option in Jgrid. Is it possible?</p>
<pre><code>for(..)
{
<option value=<%=tzone.getTimeZoneID() %> > <%=tzone.getTimeZoneName() %> </option>
}
</code></pre>
<p>In js file, i use </p>
<pre><code> var timeZone = $("#backDropDownTimezone").val();
</code></pre>
<p>hence only id is displayed but i want to display timezone name.</p>
|
java jquery
|
[1, 5]
|
3,416,547 | 3,416,548 |
The Button ID does not get set to the Text of the Text Box
|
<p>I am creating a text box tb and a button b, and I am trying to set the ID of the button to the text of the Text Box, however, the ID is set to empty string, and not to the string that is entered in the text box.
Need help!
Thank you.</p>
<pre><code> Button b = new Button();
b.Text = "Comment";
TextBox tb = new TextBox();
String x = pno.ToString();
b.ID = x + " " + tb.Text.ToString();
form1.Controls.Add(tb);
form1.Controls.Add(b);
b.Click += new EventHandler(Button1_Click);
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,578,291 | 2,578,292 |
How can I prevent spam while letting users email content to their friends?
|
<p>I'm working on an app (in PHP & JavaScript) that lets users generate content (short stories), and I want to add in a "email this to your friend" button.</p>
<p>I'm worried, though, that this could be used to send spam.</p>
<p>What are some things I could do to prevent that from happening? I am thinking:</p>
<p>1) The user must confirm their own personal email address before I send it
2) I have a hidden field somewhere that bots would fill in</p>
<p>What else should I do?</p>
<p>Cheers</p>
|
php javascript
|
[2, 3]
|
5,902,664 | 5,902,665 |
Autocomplete textbox
|
<p>I need to develop a autocomplete textbox customcontrol. Please any ideas or sample code. I need to fetch data from database to populate this control</p>
|
c# asp.net
|
[0, 9]
|
4,298,493 | 4,298,494 |
Javascript Instragram-style functionality
|
<p>Is there an Javascript or JQuery Instagram style api or website out there?</p>
<p>I was convinced that something called jsFilter (or similar) did exist, and that this enabled me to create 70s style photo filters. I would be interested in accessing any available APIs, should they exist</p>
<p>Edit: Fair point re expanding on the question - I would like to be able to upload a photo and apply a number of filters to the image - desaturation, viewfinder, and other properties to create a 1970s style image, and then save the image down (as byte array or base64)</p>
|
javascript jquery
|
[3, 5]
|
4,314,647 | 4,314,648 |
I want to change combobox when mouse is on it or when its not
|
<p>in my application i need ... if a user click on combobox it will work as usual like show all the list and when mouse is not on any of item or on combobox...then that combobox should take its default position .... that mean it must compress again </p>
<p>in jquery or javascript..you can post your answer ...
i just want solution :(</p>
|
javascript jquery
|
[3, 5]
|
728,347 | 728,348 |
Store the text entered by the user as it is in the database C#
|
<p>How to store the text entered by the user as it is in the database. Suppose if the user entered the text in proper case then the data should be stored in proper case in the database. If the user entered the text in upper case then the data should be stored in upper case and likewise. I am changing the textbox style property according to the user setting in the database. If the user setting is in proper case then using style i am setting the textbox property to title case and proper case likewise. But when storing the data the text is entered in lower case irrespective of the case in which the user entered.</p>
<pre><code>CompanyMasterClass cm = new CompanyMasterClass();
cm.strcompany_code = Request.Cookies["userinfo"]["companycode"];
ResultClass objress = cm.fn_GetNameNumberStyle();
if (objress.bStatus)
{
eslist<CompanyMasterClass> OBJLISTS = objress.objData as eslist<CompanyMasterClass>;
if (OBJLISTS.Count > 0)
{
ViewState["namestyle"] = OBJLISTS[0].strname_style.ToString();
if (OBJLISTS[0].strname_style.ToString() == "PC")
{
//txtGroupName.Text = "";
//txtGroupSname.Text = "";
}
if (OBJLISTS[0].strname_style.ToString() == "UC")
{
txtGroupName.Style.Add("text-transform", "uppercase");
txtGroupSname.Style.Add("text-transform", "uppercase");
lblGroupName.Style.Add("text-transform", "uppercase");
}
if (OBJLISTS[0].strname_style.ToString() == "UG")
{
// txtGroupName.Text = "";
//txtGroupName.Text = "";
}
}
}
</code></pre>
<p>Here I am setting the textbox style according to the property set in the database by the user. </p>
<p>How to store the text entered by the user with the case in the database?</p>
<p>Thanks,</p>
|
c# asp.net
|
[0, 9]
|
2,219,837 | 2,219,838 |
How in Android do I centre text that changes per second?
|
<p>I've got some Android code that works fine to make a piece of text count down...</p>
<pre><code>final TextView mTextField = new TextView(this);
mTextField.setTextColor(Color.RED);
mTextField.setTextSize(25);
mTextField.setTypeface(tf);
final Handler handler = new Handler();
final Runnable r = new Runnable() {
public void run() {
mTextField.setText("Days : " + getTimes()[0] + " Hours : "
+ getTimes()[1] + " Minutes : " + getTimes()[2]
+ " Seconds : " + getTimes()[3]);
handler.postDelayed(this, 1000);
}
};
handler.postDelayed(r, 1000);
setContentView(mTextField);
</code></pre>
<p>The problem I have is, I can't format this text in anyway, I want it to be like exact centre of the screen, but as the text is actually in Java rather than XML, how would I go about say embedding this inside a relativeLayout so I can control the location of where the text is printed to the screen?</p>
<p>Thanks,</p>
|
java android
|
[1, 4]
|
5,469,731 | 5,469,732 |
executing runOnUiThread on a seperate class.
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7860384/android-how-to-runonuithread-in-other-class">Android how to runOnUiThread in other class?</a> </p>
</blockquote>
<p>My Asyn Classes are a separate class file. </p>
<pre><code>public class AdamTask extends AsyncTask<String, Void, String>{
public void showToast(final String toast)
{
runOnUiThread(new Runnable() {
public void run()
{
Toast.makeText(context, toast, Toast.LENGTH_SHORT).show();
}
});
}
}
</code></pre>
<p>How would i execute this method in my AsyncTask Class. I am getting an error The method <code>runOnUiThread(new Runnable(){}) is undefined for the type AdamTask</code></p>
<p>new AdamTask(Eve.this, <code>How to pass the eve activity here</code>).execute();</p>
|
java android
|
[1, 4]
|
4,135,122 | 4,135,123 |
jquery POST method callback function query
|
<pre><code>$("#submit_js").click(function() {
var commentmsg = $('#comment').val();
$.post(
"user_submit.php",
{comment: $("#comment").val(), aid: imgnum, uid:$("#uid").val()},
function(data){
/*alert(data);*/
//$('#greetings').html('Your choice was submitted successfully. Thank You for voting.');
$('#confirm_msg').addClass("on");
$('#care_parent').addClass("off");
$('#fb_user_msg').html(commentmsg);
//$('#fb_user_msg').html( commentmsg );
});
});
</code></pre>
<p>the above is my jquery POST function. in the callback function i am doing some html stuff. this is the successful POST version. that means, when the POST procedure is complete or added to the DB. now in my user_Submit.php i am checking to validate whether I should add the data to the DB or not. </p>
<p>Can the callback function be modified so that if I dont add to the DB in user_Submit.php, I should display some other message to the user...</p>
<p>what I really want to ask is, how to make PHP pass a 0/1 value ot JS? can someone help?</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,992,997 | 5,992,998 |
how to select text naturally with jquery?
|
<p>Due to copyright laws and licensing agreements, I'm unable to allow copy+paste on certain parts of text we're displaying. So selecting is disabled and right click is disabled. It sucks, I know, but unfortunately its part of playing the game and remaining in business.</p>
<p>With jquery, I've been able to allow the user to select text line by line -- that is, they mouseover a line of text, it gets highlighted and if they click it, then it permamently gets selected which causes a 'copy' button to appear. </p>
<p>I want to this but allow partial lines to be selected. So if the user only wants to copy two words from the line, they can. More like the natural selection process. </p>
<p>I'm having difficulty doing this. In my whole line solution, I add divs around each line. But this doesn't seem efficient for partial lines? Would I have to have spans around each word? </p>
<p>Any other ideas?</p>
|
javascript jquery
|
[3, 5]
|
3,439,687 | 3,439,688 |
What's the purpose of creating jQuery code inside this elements like this
|
<pre><code> (function ($) {
...
} ) (jQuery);
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,169,383 | 5,169,384 |
Javascript Reference Comprehension
|
<p>I have been learning some of the more detailed loopholes of JS here and there, and have a few things I need to get help on.</p>
<pre><code>;(function($){
$.fn.makeRed1 = function() {
return $.each(this, function() {
$(this).css('background-color', '#FF0000');
});
}
})(jQuery)
;(function($){
$.fn.makeRed2 = function() {
$(this).css('background-color', '#FF0000');
}
})(jQuery)
</code></pre>
<p><b>Both</b> of these work correctly. Why?</p>
<p>Anyone who talks about writing plugins always says to use the 'return each' method. What is the reason? I need someone to tell me exactly what happens when each of these methods are used, so I can understand the flow.</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
3,347,932 | 3,347,933 |
How to get the value of usercontrol in codebehind of page
|
<p>How to get the value of usercontrol to page holding usercontrol?</p>
|
c# asp.net
|
[0, 9]
|
134,817 | 134,818 |
Jquery how to run a function only if condition is true
|
<p>I have a function that check if CSS value exists,
the problem is that I need the function to work only when the CSS class exists,
currently the function running all the time because I'm using else condition (that need to re do the if condition).</p>
<pre><code> //use for @media only screen and (max-width: 767px) detection
$(window).resize(function(){
if ($('#mobile-view').css('visibility') === 'hidden') {
$("#product-gallery").insertAfter("#product-info");
}
else {
$("#product-info").insertAfter("#product-gallery");
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
672,787 | 672,788 |
Object Reference is null when creating the object
|
<p>I've tried searching around, but most of the answers were about instantiating a list that doesn't exist or otherwise isn't exactly what I'm looking for. Most of the questions I've come across weren't using the "new" keyword.</p>
<p>Here's what I've got:</p>
<pre><code>using (SqlCmd cmd = new SqlCmd("SELECT * FROM [User] WHERE Login = @Login", false))
{
cmd.AddIString....
}
</code></pre>
<p>My problem is on that first line. Visual Studio is fine with it until I try to run it. Then it throws an error <code>Object reference not set to an instance of an object</code>. It threw the error even when it looked like:</p>
<pre><code>using (SqlCmd cmd = new SqlCmd(
"SELECT * " +
"FROM [User] " +
"WHERE Login = @Login", false))
{
// Code here...
}
</code></pre>
<p>Any ideas? I've rewritten it, looked at other methods that do the exact same thing, used Google, etc for about 2 hours now with no real result. Closing Visual Studio didn't do anything either, except cause the same problem on code that was working previously.</p>
<p>EDIT: I did say first line, but here it is a bit more clearly (Line 74):</p>
<pre><code>Line 72: {
Line 73: //using (SqlCmd cmd = new SqlCmd("SELECT * FROM [User] WHERE Login = @Login", false))
Line 74: using (SqlCmd cmd = new SqlCmd("SELECT * FROM [User] WHERE Login = @Login", true))
Line 75: {
Line 76: cmd.AddIString("@Login", 100, login);
</code></pre>
|
c# asp.net
|
[0, 9]
|
880,846 | 880,847 |
Cant make jQuery animation work
|
<p>I am trying to make the top div fade out when it is clicked, but i cant get it to work. Here is my code:</p>
<pre><code><script type = 'text/javascript' src = '../Javascript/jquery/jquery-1.6.2.js'></script>
<script type = 'text/javascript'>
$(document).ready(function() {
$('#topcontent').click (
function() {
$('#topcontent').fadeTo(300,0.0);
}
);
}
</script>
</head>
<body>
<div id = 'wrapper'>
<div id = 'topcontent'>
TOP<br />
</div>
<div id = 'bottomcontent'>
BOTTOM
</div>
<div id = 'sub'>
This site is still being created. Check back soon!
</div>
</div>
</body>
</code></pre>
<p>Any ideas on why its not working?</p>
|
javascript jquery
|
[3, 5]
|
5,365,915 | 5,365,916 |
How to access a data key?
|
<p>I have a <code>GridView</code> with textboxes in its cells. A JavaScript function is called on changing textbox's contents. I want to pass to the function a data key of the row to which the textbox belongs, but don't know how I can do that.</p>
<p>The following gives me an error message:</p>
<pre><code> <asp:TextBox ID="txtWFShipDate" runat="server"
Text='<%#Eval("StrShipDate") %>' BorderStyle="None" Width="80%"
CssClass="date"
onchange="JSSaveWorkflowChanges(this, '<%# Eval("BookStemCommon") %>');">
</asp:TextBox>
</code></pre>
<p><code>BookStemCommon</code> is the data key name.</p>
|
c# asp.net
|
[0, 9]
|
3,062,612 | 3,062,613 |
Find serial number of child
|
<p>Suppose that I've a given html code:</p>
<pre><code><ul class="fmenu123">
<li>city</li>
<li>service</li>
<li>hour</li>
</ul>
</code></pre>
<p>There are in jquery function <code>children</code> and selector <code>nth-child</code>. But how could I find a serial number of "mouseovered" child of this <code>ul</code> element - ie number <code>n</code> such that nth child of <code>ul</code> is exactly this chosen element? Which is the simplest method in jquery to find this?
Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
4,458,277 | 4,458,278 |
Asp.net loses connection to remote share
|
<p>I have two webservers that rely on a single file-share to read/write files to. All three computers are in the same domain, and ASP.NET impersonates a domain-user to get the access rights to the share. The applicatin accesses the share via UNC-path</p>
<p>But the latest nights, there has been occuring some problems when the application tries to access the shares. A typical error-message is:</p>
<blockquote>
<p>"The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you. "</p>
</blockquote>
<p>and:</p>
<blockquote>
<p>"Network path not found"</p>
</blockquote>
<p>But when I access the web-fronts via RDP, the problem disappears.</p>
|
c# asp.net
|
[0, 9]
|
1,956,114 | 1,956,115 |
jQuery / iScroll - Scrolling panel with clickable images
|
<p>I have a scrolling panel (using <a href="http://cubiq.org/iscroll-4" rel="nofollow">iScroll4</a> & jQuery) to navigate a horizontal list of thumbnails, like below.</p>
<p><img src="http://i.stack.imgur.com/qB1du.png" alt="enter image description here"></p>
<p>Using my mouse, I can grab and slide this panel nicely, works a treat. The problem is, I have now added a click event to each image in the list, so when the user grabs and slides, it clicks on an image, causing the event to fire. This is annoying as the user didn't want to select that image, they just wanted to look further.</p>
<p>How can I make this so if they definitely click on the image, without a left or right movement, it selects the image, but if the scroller moves then it doesn't?</p>
<p>An example of what I am saying can be found on the Fotorama slider plugin <a href="http://fotoramajs.com/" rel="nofollow">here</a>. If you try sliding the thumbnails across and then try clicking on a thumbnail, you will see what I mean.</p>
<p>Any help or suggestions would marvelous.</p>
<p><strong>UPDATE</strong></p>
<p>I have found that there is an onScrollMove and onScrollEnd callbacks in the iScroll4 docs. Maybe: <code>onScrollEnd: function() { $(".uploaded_images").unbind("click"); }</code></p>
<p><strong>ANOTHER UPDATE</strong></p>
<p>For now, I have got around this by making the images double-clickable, instead of single, but I would still like to know how it's possible.</p>
|
javascript jquery
|
[3, 5]
|
4,820,727 | 4,820,728 |
How to capture the onload event of a window with attachment response?
|
<p>I have the following download request in javascript:</p>
<pre><code>var exportWindow = window.open('Download.ashx?source=1', '');
exportWindow.onload = function() {
alert('finished');
};
</code></pre>
<p>My problem is that the above alert box does not appear.
The download.ashx sets up the following response (which will be saved as a csv file), which works fine.</p>
<pre><code> context.Response.ClearContent();
context.Response.ContentType = "application/text";
context.Response.AddHeader("content-disposition", "attachment; filename=\"" + fileName + "\"");
context.Response.Write(resultWriter.ToString());
context.Response.Flush();
context.Response.Close();
</code></pre>
<p>If I replace the download.ashx with a normal aspx page, then the alert appears.
So my question would be: is it possible to know programatically when the dowload.ashx returned with a response?
(using FF3)</p>
<p>Thanks in advance,
Geza</p>
|
asp.net javascript
|
[9, 3]
|
5,125,018 | 5,125,019 |
Getting the values in a dropdownbox from javascript
|
<p>Does anyone know how to get the values from an asp dropdownbox (not just the selected one) using javascript?</p>
|
asp.net javascript
|
[9, 3]
|
103,125 | 103,126 |
Auto scroll bottom unless moving scroll bar
|
<p>I have a simple function that scrolls a div to the bottom so that the user can see the most recent log messages. However people have been wanting to scroll up to look at previous messages.</p>
<p>Is there any way of making it so it will scroll to the bottom automatically, but if the user is moving the scroll bar, then it won't auto scroll?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
149,432 | 149,433 |
find missing range from array of ranges
|
<p>I am having array of my class that having Minvalue and Maxvalue property.</p>
<p>Suppose in my array i am having three elements</p>
<pre><code>First MinValue=0 and MaxValue=25
Second MinValue=26 and MaxValue=50
Third MinValue=75 and MaxValue=100
</code></pre>
<p>Minvalue and Maxvalue can be between 0 to 100.</p>
<p>Now I want to find the missing range from above array having three objects.</p>
<p>The missing range in above array is 51 to 75</p>
<p>There can be more than one missing value at that time i want to find the range having min MinValue.</p>
<p>I want to write code in javascript.</p>
<p>Please help me to solve this.</p>
|
javascript jquery
|
[3, 5]
|
1,222,542 | 1,222,543 |
Show and Hide Div for the text that comes dynamically
|
<p>I have a problem where we have to show/hide some text in the product description in the product detail page. The description has to be shortened upto desired number of lines and by clicking on "more" complete description is to be shown. I taken the following script from the link below: </p>
<blockquote>
<p><a href="http://stackoverflow.com/questions/1606336/using-javascript-substring-to-create-a-read-more-link">Using javascript substring() to create a read more link</a> </p>
</blockquote>
<p>And the code is as follows:</p>
<pre><code><script type="text/javascript">
$(function() {
var cutoff = 200;
var text = $('div.contentdetail').text();
var rest = $('div.contentdetail').text().substring(cutoff);
if (text.length > 200) {
var period = rest.indexOf('.');
var space = rest.indexOf(' ');
cutoff += Math.max(Math.min(period, space), 0);
}
rest = text.substring(cutoff);
var visibleText = $('div.contentdetail').text().substring(0, cutoff);
$('div.contentdetail')
.html(visibleText + ('<span>' + rest + '</span>'))
.append('<a title="Read More" style="font-weight:bold;display:block;cursor: pointer;">Read More&hellip;</a>')
.click(function() {
$(this).find('span').toggle();
$(this).find('a:last').hide();
});
$('div.contentdetail span').hide();
});
</script>
</code></pre>
<p>But with the above script the entire description is converting into text format. But since the description contains unordered lists,header tags etc. it is not considering those. How to modify the above script to display the content as it is.</p>
|
javascript jquery
|
[3, 5]
|
954,660 | 954,661 |
Returning false on link click jquery
|
<p>I wish to have a link which opens popup when clicked however I wish it to open a page in a new window if the user doesn't have JS enabled.</p>
<p>The following doesn't seem to work,</p>
<pre><code><a id="tac-link" target="_blank" href="tac.html">terms and conditions</a>
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=550,height=600,left = 445,top = 150');");
}
$('tac-link').click(function() {
popUp('tac.html');
return false;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,315,855 | 1,315,856 |
How do I perform an action on mousedown when a certain element is NOT clicked
|
<p>Below is the code that I want to execute a command if the click is not on the rl_menu / any of it's child elements (.comment, .rl_arrow, etc)</p>
<pre><code>TBR.mouse_down = function(e){
target = $j(this)
if (target != $j("#rl_menu") && target != $j("#rl_menu .comment") &&
target != $j("#rl_menu .change") && target != $j("#rl_menu .rl_arrow_border") &&
target != $j("#rl_menu .rl_arrow")){
TBR.Menu.hide(); // this needs to be triggered when the menu is not clicked on.
}
}
</code></pre>
<p>but when I inspect target, target is the document.</p>
<p>To recap:</p>
<p>Anywhere in the document, when the mouse is pressed, <code>TBR.Menu.hide()</code> should be executed. but if the click is within <code>#rl_menu</code>, <code>TBR.Menu.hide()</code> shouldn't be executed.</p>
<p>Am I going about this the wrong way?</p>
|
javascript jquery
|
[3, 5]
|
4,112,692 | 4,112,693 |
Passing PHP session to external ASP app
|
<p>I have been asked by a client if it was possible to build a PHP site which will pass sessions to an other app located on a different server which uses ASP. </p>
<p>I was wondering if any of you had a prior experience with this ? And if so how problematic can this task be? Is there any resources that you would recommend about that topic ?</p>
<p>Thanks a bunch for your insights. </p>
|
php asp.net
|
[2, 9]
|
3,188,279 | 3,188,280 |
Issue in conditionally preventing the default action of anchor tag
|
<p>There is an anchor tag: inventoryHome which takes the user to a different page.</p>
<p>If the size of rateMap is greater than 0, I need to show a confirmation pop-up confirming if the user wants to discard the unsaved changes.</p>
<p>The method navigateToInv() is called if the user confirms the discard.</p>
<p>In the code below, though the navigateToInv() method is called & the click event is getting triggered, the page is not navigating to the new page.</p>
<pre><code><li><a href="<%=request.getContextPath()%>/inventory" id="inventoryHome"> <spring:message code="inventoryTab" /></a></li>
$('#inventoryHome').click(function(e) {
if (Object.size(rateMap) > 0) {
e.preventDefault();
showDiscardConfirmationPopUp(navigateToInv, false);
}
});
var navigateToInv = function (){
rateMap = new Object();
$('#inventoryHome').trigger('click');
}
Object.size = function(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
</code></pre>
<p>Not able to identify the issue.</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.