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,674,613 | 3,674,614 | Focus on div element | <p>I have a web page. It has too much height; in that page I have a div in the bottom of the page. I want to display the div in the center portion of the page. It’s appearing in the center of the page at the bottom position as in a way i like , but scrolling is needed. Is it possible to set focus on that div without scrolling? Does any one help me urgently?</p>
| php javascript | [2, 3] |
602,297 | 602,298 | ASP.Net, Copy image from clipboard using javascript for IE | <p>How to copy clipboard image to web browser.
Consider below sample. On button click , I would like to copy the clipboard image to div id , but this does not work. If I paste text from clipboard it works, Pls suggest.</p>
function PasteFromClipBoard() {
var _selection = document.getElementById('pasteTothis').contentWindow.document.selection.createRange();
_selection.execCommand("Paste");
}
<p>html content is -<br>
{
(input type="button" value="Paste From ClipBoard" onclick="PasteFromClipBoard()"/><br>
(div id="pasteTothis" /)
}</p>
| javascript asp.net | [3, 9] |
835,383 | 835,384 | FileUploder get file full path using jquery | <p>I use below code for getting full file path </p>
<p>My problem is using file.value in firefox only get my file name but in ie it get file full path </p>
<pre><code> function setImage(file) {
document.getElementById('prevImage').src = file.value;
}
<asp:FileUpload ID="fup" runat="server" onchange="setImage(this);" />
<img id="prevImage" height="200" width="200"></img>
</code></pre>
| javascript jquery asp.net | [3, 5, 9] |
1,544,672 | 1,544,673 | passing parameter from aspx to javascript issue | <p>I write code in asp.net backend to pass parameter, however, I found that it does not work if the parameter is so long.
In the backend:</p>
<pre><code>folderList.InnerHtml += "<span onclick='AttachId(" + folder.Id + ")'>" + folder.DisplayName + "</span>";
</code></pre>
<p>In the frontend:</p>
<pre><code>function AttachId(id) {
$("[id$='hf_FolderId']").val(id);
$("[id$='btn_Move']").click();
}
</code></pre>
<p>The parameter <code>folder.Id="AQMkAGQ2YzBkYjkxLWZjNTYtNDAwAS1hZWY2LWQ3OWI2MDkxZTE2ZAAuAAAD82EfyZcOUkeLGnLBkE1iOgEA04D3/FOc8ES6LdlZ5/AXHgAAAQRaEQAAAA=="</code></p>
<p>If I change it to "123" it works. Any idea?</p>
<p>Or maybe you could let me know a better way to pass parameter from back to front. Many thanks.</p>
| c# javascript asp.net | [0, 3, 9] |
3,635,745 | 3,635,746 | Javascript take script server side | <p>How can I take this code</p>
<pre><code><script>
var arr = [<%= myArray %>+<%= my2Array %>];
var sorted_arr = arr.sort();
var results = [];
for (var i = 0; i < arr.length - 1; i += 1) {
if (sorted_arr[i + 1] == sorted_arr[i]) {
results.push(sorted_arr[i]);
}
}
document.write(results +"<br />");
</script>
</code></pre>
<p>and convert it to <% the above script %> and keep the functionality?</p>
<p>Why does the script work in the script tag but not when I place it in <% %></p>
<pre><code> <%
var arr = [myArray+my2Array];
var sorted_arr = arr.sort();
var results = [];
for (var i = 0; i < arr.length - 1; i += 1) {
if (sorted_arr[i + 1] == sorted_arr[i]) {
results.push(sorted_arr[i]);
}
}
%>
<%= results %>
</code></pre>
<p>If I use it like this the results are returned as empty</p>
<p>I suspect the reason why it is not working is because the results value is not getting populates... In the script version it gets the time to populate and loop</p>
| asp.net javascript | [9, 3] |
1,642,361 | 1,642,362 | What is the purpose of $.fn.foo.Constructor = Foo in Twitter Bootstrap JS | <p>All of the jQuery plugins for Twitter Bootstrap follow the same basic pattern of defining a class that controls the behavior of the plugin. Near the end, they do this:</p>
<pre><code>$.fn.alert.Constructor = Alert
</code></pre>
<p>What is this doing?</p>
<p>I assume that this is defining a prototype constructor, but they use an uppercase C. Does case not matter here? Beyond that, I don't really understand what this is doing and how it's getting used by the plugin.</p>
<p>As an example, here is the Alert plugin:
<a href="https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js" rel="nofollow">https://github.com/twitter/bootstrap/blob/master/js/bootstrap-alert.js</a></p>
| javascript jquery | [3, 5] |
3,569,677 | 3,569,678 | Question marks in string due to character encoding in Request.Form | <p>I have a textarea where I type some unicode characters which become question marks by the time the string reaches the server.
On the input I typed the following:</p>
<blockquote>
<p>Don’t “quote” me on that.</p>
</blockquote>
<p>On the server I checked <code>Request.Form["fieldID"]</code> in <code>Page_Load()</code> and I saw:</p>
<blockquote>
<p>"Don�t �quote� me on that."</p>
</blockquote>
<p>I checked my web.config file and it says <code><globalization requestEncoding="utf-8" responseEncoding="utf-8" /></code>. Anything else I should check to ensure UTF-8 is enabled?</p>
| c# asp.net | [0, 9] |
1,717,795 | 1,717,796 | How to call an event handler dynamically and get its return value in javascript? | <p>I asked a question yesterday, I accepted the answer, but sometime later, I came to know that the solution was not complete. The question is :-</p>
<p><a href="http://stackoverflow.com/questions/6996830/insert-a-jquery-click-handler-that-executes-before-the-ones-already-registered">Insert a JQuery click handler that executes before the ones already registered</a></p>
<p>using <code>setTimeout(handler,0);</code> returns immediately and I can not use <code>return setTimeout(handler,0);</code>. How can I run this <code>handler</code> synchronously and not allow the parent function to complete until this handler is completely executed and I get the return value out of it ?</p>
<p>I am in hurry, so I am asking it again, rather than editing that question again.</p>
| javascript jquery | [3, 5] |
2,785,120 | 2,785,121 | display div according to scrolbar location | <p>I want to display a pop up window (div) using jquery animate ('top' and 'left' according to the user loaction )</p>
<p>I want this popup (top position) to be display according to the user location in the page(if the user scroll down the page ,the poup will be display in the user's location on this page)</p>
<p>I tried to take the mouse coordinates,in firefox it works fine, since the location of the mouse is absolote to the top of the screen,but in IE the coordinate of the mouse is relative to the top of the screen where the user's location is.</p>
<p>this is the code for taking the mouse coordinate </p>
<pre><code>function getMouseXY(e) {
if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
} else { // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}
// catch possible negative values in NS4
if (tempX < 0) { tempX = 0 }
if (tempY < 0) { tempY = 0 }
</code></pre>
<p>}</p>
<p>How can I use the animate top and left, relative to the user location in IE?</p>
<p>Thanks for any help</p>
| javascript jquery | [3, 5] |
5,163,409 | 5,163,410 | How to run a .py (Python) file in ASP.NET? | <p>I have a GetList.py file which consumes Web Service and saves the output in XML on the server.</p>
<p>How do I invoke GetList.py so it saves the output in XML on the server before displaying the XML output in .ASPX page?</p>
| asp.net python | [9, 7] |
5,935,873 | 5,935,874 | how to open screen on full screen | <p>how i can open my asp.net program on full screen (like i press F11)</p>
<p>Through C# code ?</p>
<p>thanks</p>
| c# asp.net | [0, 9] |
5,436,850 | 5,436,851 | Multi-line string insert using jQuery | <pre><code>$("#addSelect").click(function() {
$("#optionsForm").after("Hello world.");
} );
</code></pre>
<p>This works.</p>
<pre><code>$("#addSelect").click(function() {
$("#optionsForm").after("<tr>
<td><input type="text" class="optionField" value="Options" /></td>
<td>
<ul class="option">
<li><select><option>Value..</option></select></li>
</ul>
</td>
</tr>");
} );
</code></pre>
<p>Something like this doesn't. </p>
<p>In Chrome, I get the error "<strong>Unexpected token ILLEGAL</strong>". After Googling I've discovered my teeny brain doesn't know much about javascript and multi-lines. So I added '\' to then end of each line. Yet, I now get the error "<strong>Unexpected identifier</strong>".</p>
<p>I'd like this to not be as difficult as I'm making it :)</p>
| javascript jquery | [3, 5] |
2,463,090 | 2,463,091 | using jquery for Calculate total images in <id> | <p>I have one div and inside it I have some images for example <code><img src= etc</code></p>
<p>I want to calculate total number of images in that div. Also I want to save these images ID into mysql using PHP...</p>
<p>Thanks</p>
| php jquery | [2, 5] |
2,496,959 | 2,496,960 | Getting total for a column in ListView | <p>I need to get a sum for all items in a column within a listview. I put in the following code in the itemdatabound event, but realized after testing it that it will only be getting what is bound, oops.</p>
<p>So I was looking for a little help converting this to show a total for my column from all items bound to the ListView.</p>
<p>Thanks.</p>
<pre><code> if (e.Item.ItemType == ListViewItemType.DataItem)
{
ListViewDataItem item = (ListViewDataItem)e.Item;
Label lblQty = (Label)e.Item.FindControl("lblQuantity");
if (lblQty == null)
{
return;
}
if (lblQty.Text.Length == 0 || lblQty.Text == "")
{
return;
}
else
{
ListViewTotal += int.Parse(lblQty.Text);
}
}
</code></pre>
| c# asp.net | [0, 9] |
3,701,375 | 3,701,376 | multiple jquery html() assignment not working | <p>I want to show the user a "loader" before and during the ajax call. Here's the code (simplified version...)</p>
<pre><code>$(document).ready(function() {
$("#btn").click(function(){
$("#log").html("loading ajax call...");
anotherFunc();
});
});
function anotherFunc(){
$.ajax({
type: "GET",
url: correct_url,
data: data_to_send,
dataType: "jsonp",
success: function(data){
$("#log").html("new html");
}
})
}
</code></pre>
<p>the problem is that "loading ajax call..." never appears. I only see "new html" displayed. the singles ajax #log modification call work perfectly alone (without the other)</p>
<p>is there another way to do?
what am I doing wrong?</p>
<p>ps. I also tryed to write in another id (#log2) with the same result.</p>
| javascript jquery | [3, 5] |
2,015,313 | 2,015,314 | How to use the addChild method of javascript to add a node to my div? | <p>Hello I have a div as follows</p>
<pre><code><div id="test" class="test2">
<p> <a href=""> <a> </p>
<p> <a href=""> <a> </p>
<p> <a href=""> <a> </p>
<p> <a href=""> <a> </p>
</div>
</code></pre>
<p>(I have stripped out the data but that is the structure)</p>
<p>How does one use the addChild function of javascript to add a new node </p>
<pre><code><p> <a href=""> <a> </p>
</code></pre>
<p>I know how to use the removeChild function but I haven't been able to find documentation and examples using the addChild function.</p>
<p>If I have the node string in a php array, and can execute the php script containing the array with a GET call via a button click how can I use the addChild function to put the node string into the div?</p>
| php javascript | [2, 3] |
2,202,350 | 2,202,351 | Files accessed by aspx webforms and socket server. Lock file management issues | <p>I got a primitive website, where the aspx webform and socket server access flat files, which stores the data. The socket server writes the data to the file with File.Write calls and the aspx webform uses File.Readln calls to read the data from the file. Both the web form and socketserver will be accessing the same exact files to read and write. I think there may be an issue with locking the files. I think it is the higher priority for the server to quick write to the file and release any lock on the file. The webform should be able to read without interrupting the writing process of the server. What is the best way to do this? Is it with the using streamwriter?</p>
<p>Any help is appreciated.</p>
| c# asp.net | [0, 9] |
5,483,388 | 5,483,389 | Need image validation in php | <p>i'm trying to put validations on image upload code. but not properly working. so please give easy validation code for image upload in following.. image extension validation & image size limit validation. i'm putting on my upload code as..</p>
<pre><code><form action="<?php $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data" name="addroom">
Category Name:<input type="text" class="textfield" id="category_name" name="category_name" value=""/><br>
Description:<input type="text" class="textfield" id="description" name="description" value=""/><br>
Category Image:<input type="file" class="textfield" id="image" name="image" value=""/><br>
<input type="submit" id="Submit" name="Submit" value="Add" />
</form>
<?php
include('config.php');
if (!isset($_FILES['image']['tmp_name']))
{
echo "";
}
else
{
$file=$_FILES['image']['tmp_name'];
$image= addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name= addslashes($_FILES['image']['name']);
move_uploaded_file($_FILES["image"]["tmp_name"],"photos/" . $_FILES["image"]["name"]);
$location="photos/" . $_FILES["image"]["name"];
$category_name=$_POST['category_name'];
$description=$_POST['description'];
$save=mysql_query("INSERT INTO category (category_name, description, category_image) VALUES ('$category_name', '$description', '$location')");
header("location: category_insert.php");
exit();
}
?>
</code></pre>
| php javascript | [2, 3] |
1,404,523 | 1,404,524 | Sorting in drop down list in jquery | <p>I am little bit confuse on how to apply sorting on dropdownlist in jquery</p>
<p>e.g apple,cat,truck,APPLE,CAT,TRUCK</p>
<p>it should be like in drop down list....
apple
APPLE
cat
CAT
truck
TRUCK</p>
<p>how to achieve this in jquery so that it could see the uppercase and lowercase as well.</p>
| javascript jquery | [3, 5] |
1,909,718 | 1,909,719 | How to lock focus in a specific div using javascript/jquery | <p>I am developping some kind of modal popup using jQuery and I have some problems with the focus.</p>
<p>What happens right now, is that when I press the tab key, the focus goes to the controls hidden behind the popup.</p>
<p>Is there a way to force the focus to remain only on the controls in the popup window ?</p>
| javascript jquery | [3, 5] |
3,772,266 | 3,772,267 | recursively collect paths of a given root dir, when tens of millions files expected | <p>I need to create a list/lists of file paths under a given root directory,
when I expect the number of files under this directory to be tens of millions.</p>
<p>What would be a good and efficient way to do this?</p>
<p>I currently run a python script which runs os.walk multithreaded.</p>
<p>Any better way to achieve what I need?</p>
<p>should be noted that the direcotry is a nfs mounted drive.</p>
| java python | [1, 7] |
1,071,948 | 1,071,949 | Adding onclick Attribute to <a> tag using JQuery | <p>I have a link button that I want to change it <code>onclick</code> callback function when clicked:</p>
<p>I am using <code>.attr()</code> to change the <code>onclick</code> event but it simply doesn't work.</p>
<pre><code>$('#' + test).text('Unlike');
$('#' + test).attr("onclick", "return deleteLikeComment('"
+ CommentsWrapper + "','" + activityID + "', '" + test + "');");
</code></pre>
<p>But it simply doesn't work.</p>
<p>I just want to switch the callback method when the link is clicked.</p>
| javascript jquery | [3, 5] |
714,266 | 714,267 | Javascript/Jquery- "$ is not defined- $function()" Error | <p>I am trying to run a javascript/jquery function that is triggered by clicking an option in the select box. While debugging for some reason firebug finds the error: "$ is not defined $(function()". The javascript is placed inside a file called core.js and referenced on index.php. Why is the script is not running at all? </p>
<p><strong>Javascript</strong></p>
<pre><code><script type="text/javascript">
var formObject = {
run : function(obj) {
if (obj.val() === '') {
obj.nextAll('.update').html('<option value="">----</option>').attr('disabled', true);
} else {
var id = obj.attr('id');
var v = obj.val();
jQuery.getJSON('/mod/update.php', { id : id, value : v }, function(data) {
if (!data.error) {
obj.next('.update').html(data.list).removeAttr('disabled');
} else {
obj.nextAll('.update').html('<option value="">----</option>').attr('disabled', true);
}
});
}
}
};
$(function() {
$('.update').live('change', function() {
formObject.run($(this));
});
});
</script>
</code></pre>
<p><strong>PHP/html</strong></p>
<pre><code><html>
<select name="main" id="category" class="update">
<option value="">Select one</option>
<? if (!empty($list)) { ?>
<? foreach($list as $row) { ?>
<option value="<?php echo $row['id']; ?>">
<? echo $row['name']; ?>
</option>
<? } ?>
<? } ?>
</select>
</html>
</code></pre>
| javascript jquery | [3, 5] |
2,998,763 | 2,998,764 | Model not showing when creating a controller class | <p>For some reason the add controller class dialog isn't picking up on the Movies, and MovieDBContext classing. I'm new to ASP.NET and Visual Studio 2010, is there something which I should do for the classes to show here?</p>
<p><img src="http://imgur.com/Ylnmn.png" alt="Screenshot"></p>
| c# asp.net | [0, 9] |
3,940,635 | 3,940,636 | jQuery help: How can i hide divisions? | <pre><code><div id="rightside">
<div id="rightsideone" >
<div class="class_color_title" ></div>
<div id="id_color_archive" ></div>
</div>
<div id="rightsidetwo">
<div class="class_color_title" ></div>
<div id="id_color_mostcomments" ></div>
</div>
<div id="rightsidethree">
<div class="class_color_title" ></div>
<div id="id_color_mostviewed" ></div>
</div>
<div id="rightsidefour">
<div class="class_color_title" ></div>
<div id="id_color_categories" ></div>
</div>
<div id="rightsidefive" >
<div class="class_color_title" ></div>
<div id="id_color_tags" ></div>
</div>
<div id="rightsidesix" >
<div class="class_color_title" ></div>
<div id="id_color_polls" ></div>
</div>
</div>
</code></pre>
<p>I want to hide divisions with id_color_* .</p>
<p>How can i do this ?</p>
| javascript jquery | [3, 5] |
2,016,509 | 2,016,510 | conflict mulitple .load() events of jquery | <p>i have load the data with the <code>$('#result').load('test.php')</code> file, that is completely working properly. </p>
<p>here is the <code>test.php</code> screenshoot
<img src="http://i.stack.imgur.com/adgb7.jpg" alt="enter image description here"></p>
<p>now here is my loaded file in lightbox:
<img src="http://i.stack.imgur.com/8SHof.jpg" alt="enter image description here"></p>
<p>In my <code>test.php</code> file i also load another file in a lightbox with on click event. The lightbox appear correctly with the new loaded file. here is the code to call the lighbox:</p>
<pre><code>jQuery('#wt_opp_coll .coun').click(function(){
jQuery(this).jpLightBox({
width: 500,
height: 250,
url: 'components/content/test_file.php'
//message: 'Just Testing the file'
});
});
</code></pre>
<p>with this my new loaded file that is <code>test_file.php</code> appearing well in the lightbox but my last loaded file <code>test.php</code> disappearing on lightbox, as you see on the second screenshoot only lightbox appear not the details in the background like first screenshoot. </p>
<p>Please help me to stop disappearing my last loaded file(<code>test.php</code>) also.</p>
<p><strong>NOTE:</strong> i have also use <code>.load()</code> function in lighbox to load the url.</p>
| javascript jquery | [3, 5] |
1,728,298 | 1,728,299 | Does an alternative to .closest() exist? | <p>this is a snippet from my code:</p>
<pre><code>$("#myid").append($("p:contains('text')").closest("div").clone());
</code></pre>
<p>I tried to get the first closest ancestor div-element of p containing 'text'.</p>
<p>I'm looking for an alternative to .closest() because I have to use jquery version 1.2.6.
Do you have got an idea what I'm looking for?</p>
<p>I hope you can help me. I appreciate every hint, piece of code, etc.. </p>
| javascript jquery | [3, 5] |
277,933 | 277,934 | Maintain return URL in live id integration | <p>I am creating an application in which I am using Live Id authentication. When the user tries to access an authenticated page, I am redirecting the user to Live Id sign in page. Is it possible to return the user to the previously asked page (from which he was redirected). Some thing like return URL.</p>
<p>Actually I want to pass some data in query string to webauth-handler.aspx page when the user successfully logs in. Can any body tell me how to pass query string to webauth-handler.aspx?</p>
<p>Thanks
Ashwani</p>
| c# asp.net | [0, 9] |
2,607,768 | 2,607,769 | Control where typing starts in input field | <p>Is it possible to control where in an input typing starts on focus?</p>
<p>e.g. </p>
<pre><code><input type="text" value="(+44)" id="phone_number" />
</code></pre>
<p>I need the user's typing to begin after the existing value, but leave the option to backspace and delete.</p>
<p>Something like:</p>
<pre><code>$(document).ready(function(){
$('#phone_number').focus(function(){
//place type start after whatever value already exists
});
});
</code></pre>
| javascript jquery | [3, 5] |
684,269 | 684,270 | Use URL on Android throws IOException: Malformed ipv6 address | <p>I want to send the data on the android emulator to the local host web, and get some results.</p>
<pre><code>String temp = "http://10.0.2.2:8888/json/rec?user_data=" + user_data + "&friends=" + friends;
URL url = new URL(temp);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setReadTimeout(5000);
InputStreamReader is = new InputStreamReader(urlConnection.getInputStream(), "UTF-8");
String output = "";
while(is.ready()) {
output += is.read();
}
</code></pre>
<p>Here is the exception.</p>
<pre><code>java.io.IOException: Malformed ipv6 address: [10.0.2.2:8888]
</code></pre>
<p>Why it said that?
Could someone help me?
Thanks in advance.</p>
| java android | [1, 4] |
4,769,054 | 4,769,055 | How can I grab an element inside of an <li> in jQuery? | <p>I have the following <code><li></code> - there are many of these, but this is just one example:</p>
<pre><code><li class="ui-li ui-li-static ui-body-d ui-li-has-icon io-sidebar-link io-sidebar-link-standard" data-theme="d" io-sidebar-section="0aa210f2-e811-4bae-aac0-649bf87fb240" io-object-view="/cms?url=ui/object&amp;object=db13a9ad-2494-34bb-8a59-cb99fd308051" io-record-view="/cms?url=ui/record&amp;object=db13a9ad-2494-34bb-8a59-cb99fd308051" style="display: block">
<img src="/document/423fc17f-08b2-46bb-a1db-a5395cd63b83/latest" class="ui-li-icon ui-li-thumb" height="16" width="16">
<div class="io-sidebar-link-text">Tasks</div>
</li>
</code></pre>
<p>I have a click event bound, and would like to print out the value of <code>io-sidebar-link-text</code>. How can I do this?</p>
<p><code>$(this).('.io-sidebar-link-text')</code> is incorrect I believe.</p>
| javascript jquery | [3, 5] |
4,423,241 | 4,423,242 | Bind formview to datatable programmatically in C# | <p>I'm new to C# and I want to know how to bind a FormView from the code behind with a datatable. Thanks. </p>
| c# asp.net | [0, 9] |
134,544 | 134,545 | Is there any opensource “MSWord doc to PDF” convert library available | <p>I am trying to convert word(.doc/.docx format) into PDF on android device. Is there an opensource solution where I can use as a java library or something?.
Thanks..</p>
| java android | [1, 4] |
2,372,765 | 2,372,766 | jQuery element.remove undo | <p>I have code(thanks to roosteronacid) which removes web page elements when user click on them. I need to add additional functionality to undo action - revert removed elements. Any idea how to do element.remove undo with jQuery?</p>
<p>Regards,
Tomas</p>
| javascript jquery | [3, 5] |
2,637,971 | 2,637,972 | IF File Exists Javascript | <p>Can anyone see anything wrong with this? It stops the image changing when the image is not here as I want but it does not change the image all the time when it does!</p>
<p>Cheers,
Shaun </p>
<pre><code>var myFile = "/_images/multi/" + productCode + "/" + imgCodeAlt + "_l.jpg";
if (myFile.exists()) {
$("#imgMain img").attr({
rel: 'lightbox',
src: "/_images/multi/" + productCode + "/" + imgCodeAlt + "_l.jpg"
});
}
</code></pre>
| php javascript | [2, 3] |
3,564,802 | 3,564,803 | Check presence of an element with jquery | <p>I have a page in which i need to check the presence of a HTML element dynamically.Therefore I need to know the correct way of doing this</p>
| javascript jquery | [3, 5] |
5,130,746 | 5,130,747 | Set the value of an input tag with type="password" using C# and ASP.Net | <p>So I have this input tag:</p>
<pre><code><input type="password" id="password" name="password" runat="server" />
</code></pre>
<p>I'm trying to set its value using C# and ASP.Net before the page loads, but I can't get it to work.</p>
| c# asp.net | [0, 9] |
4,954,233 | 4,954,234 | unable to get tooltip to work when usingjQuery load() content | <p>I am having problem getting my tooltip to work when using the jQuery load() function. The tooltip works fine if i don't use load() to load external dynamic data. </p>
<p>I googled and found the i may need to use live(), but I can't figure how to get it to work. Any suggestion?</p>
<p>thank you!!</p>
<p>Here is my scripts:</p>
<pre><code>function loadEMERContent(uid) {
$("#ActionEWPNBook").load("ajaxLoadDATA.cfm?uid="+uid, null, showLoading);
$("#EWPNBookloading").html('<img src="/masterIncludes/images/ajaxLoading.gif" alt="loading" align="center" />');
}
function showLoading() {
$("#EWPNBookloading").html('');
}
function simple_tooltip(target_items, name){
$(target_items).each(function(i){
$("body").append("<div class='"+name+"' id='"+name+i+"'><p style='padding:5px;'>"+$(this).attr('title')+"</p></div>");
var my_tooltip = $("#"+name+i);
$(this).removeAttr("title").mouseover(function(){
my_tooltip.css({opacity:0.8, display:"none"}).stop().fadeIn(400);
}).mousemove(function(kmouse){
my_tooltip.css({left:kmouse.pageX+15, top:kmouse.pageY+15});
}).mouseout(function(){
my_tooltip.stop().fadeOut(400);
});
});
}
</code></pre>
<p>Here is my ajaxLoadDATA.cfm: it returns an unorder list</p>
<pre><code><li><span title="dynamic title here" class="tipthis">date</span></li>
</code></pre>
| javascript jquery | [3, 5] |
2,998,378 | 2,998,379 | Cannot allow duplicate enty in textboxes using jquery | <p>i have a text boxes in every row with same name like this</p>
<pre><code> <tr>
<g:textField name ="point" value = "" class = "destination_points" id ="point_0" />
<input type ="hidden" value ="" name ="pointDistanceMapping.point.id" id ="point_id_0" class="point_id"/>
</tr>
<tr>
<g:textField name ="point" value = "" class = "destination_points" id ="point_1" />
<input type ="hidden" value ="" name ="pointDistanceMapping.point.id" id ="point_id_1" class="point_id"/>
</tr>
<tr>
</code></pre>
<p>i have to validate that these text boxes should not have same value so how can i do it using jquery...</p>
| javascript jquery | [3, 5] |
2,439,392 | 2,439,393 | wordpress wp_enqueue_script() not working | <p>I'm trying to add this social-network button:</p>
<pre><code><a href="http://svejo.net/submit/?url=[your url]"
data-url="[your url]"
data-type="compact"
id="svejo-button">Add in Svejo</a>
<script type="text/javascript" src="http://svejo.net/javascripts/svejo-button.js"></script>
</code></pre>
<p>to my blog posts.
But loading this in every post would really slow my page so I've try to implement it with <strong>wp_enqueue_script()</strong> inside my <strong>functions.php</strong></p>
<pre><code>function socialNetworks(){
$opentag = '<ul class="socials">';
$closetag = '</ul>';
$socials['svejonet'] =
'<a href="http://svejo.net/submit/?url=['.get_permalink().']" data-url="['.get_permalink().']" data-type="compact" id="svejo-button">Add in Svejo</a>'.
wp_enqueue_script( 'none', 'http://svejo.net/javascripts/svejo-button.js', array(), false, true);
echo $opentag;
foreach ( $socials as $key=>$val ){
echo '<li class="'.$key.'">'.$val.'</li>';
}
echo $closetag;
}
</code></pre>
<p>However the script does not load.<br>
Appreciate any help.</p>
| php javascript | [2, 3] |
4,801,179 | 4,801,180 | Getting system Mydocument path using C#.net(Web based Application) | <p>Am using C#.net(Web based) and Am trying to get Mydocument file path using following code </p>
<pre><code> Label1.Text = System.Environment.GetEnvironmentVariable("USERPROFILE") +"\\My Documents\\";
or
Label1.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
</code></pre>
<p>while running using IDE .i got correct mydocument path . if i host my application i got different path rather getting mydocument path .</p>
<p>Please help me to find solution </p>
<p>Regrads,
ash</p>
| c# asp.net | [0, 9] |
286,097 | 286,098 | Difference between $('selecttor')[0] ,$('selector').eq(index) in jquery | <p>What is the difference between <code>$('#div1 a')[0]</code> and <code>$('#div1 a').eq(0)</code> for the following markup</p>
<pre><code><div id="div1">
<a href="#">click</a>
</div>.
</code></pre>
<p>Please Help.</p>
| javascript jquery | [3, 5] |
4,778,060 | 4,778,061 | Jquery image scroller not switching to next image | <p>I have an image scroller that I am trying to implement. The image scrolling works, but it is moving vertically instead of horizontally. Here is what I got so far:</p>
<pre><code><a href = "#" id = "btnNext">Next Image</a>
$('#btnNext').click(function () {
//Calls new image with value true, meaning next image
newImage(true);
return false;
});
function newImage(direction) {
//Get the current selected item (with selected class), if none was found, get the first item
current_image = $('#imageGallery li.selected').length ? $('#imageGallery li.selected') : $('#imageGallery li:first');
//If determines slideshow direction
if (direction) { //Next image
//Get next sibling
next_image = (current_image.next().length) ? current_image.next() : $('#imageGallery li:first');
} else { //Previous image
//Get previous sibling
next_image = (current_image.prev().length) ? current_image.prev() : $('#imageGallery li:last');
}
//Clear selected class
$('#imageGallery li').removeClass('selected');
//Reassign selected class to current image
next_image.addClass('selected');
//Scroll images
$('#images').scrollTo(next_image, 800);
}
</code></pre>
<p><strong>Update:</strong> Here are my quesions:
1) How do I edit this to make it move horizontally?
2) Is there a way to make an image scroller like this without using .scrollTo()? </p>
| javascript jquery | [3, 5] |
5,940,638 | 5,940,639 | Conditional image path using Eval | <p>I have two images progress.png and completed.png. Depending on the status in the db table (In Progress of Complete), I want to display the appropriate image. What is the correct syntax for the IIF() statement within asp.net? Thanks for your help.</p>
<pre><code>pseudocode:
<asp:image ImageUrl='<%# IIF(Eval("Status").Equals("In Progress")
display - 'images/progress.png')
else if status equals "Complete"
display - 'images/complete.png' %>' />
</code></pre>
| c# asp.net | [0, 9] |
2,355,213 | 2,355,214 | C# - how to retrieve items you ave added using Attributes.Add? | <p>I have a textbox which I have added an attribute to using the following code:</p>
<pre><code>TextBox1.Attributes.Add("type", "textbox");
</code></pre>
<p>I have searched on the net but couldn't find any examples. How can I retrieve the value stored for the "type" key?</p>
| c# asp.net | [0, 9] |
1,291,260 | 1,291,261 | Highlight zone to be completed | <p>In my drag and drop game there is a grid that is populated with words that are hidden from the user. The aim of the game is to spell these words with the aid of a sound and a picture. The user spells a word by dragging and dropping the relevant letters onto the grid. </p>
<p>At the moment the user can drag and drop the letter anywhere in the highlighted zone (the word), and the script will slide it into position. This is all well and good but I want to highlight the actual spot within the word where the user should drop the letter.</p>
<p>At the moment the the highlighted word is called ".spellword" and it glows purple. I have created a class called ".spellLetter" that glows white which I want to indicate the space to drop in. Can anyone help?</p>
<p>Here is the script that applies the class to the grid...</p>
<pre><code> $('.drag').draggable({
helper: 'clone',
snap: '.drop',
grid: [62, 62],
revert: 'invalid',
snapMode: 'center',
start: function() {
var validDrop = $('.drop-box.spellword');
validDrop.addClass('drop');
makeDroppables();
$(right).val('');
$(wrong).val('');
}
});
</code></pre>
<p>Fiddle to help - <a href="http://jsfiddle.net/smilburn/Dxxmh/57/" rel="nofollow">http://jsfiddle.net/smilburn/Dxxmh/57/</a></p>
| javascript jquery | [3, 5] |
4,409,973 | 4,409,974 | selectors via jquery | <p>Is there any way to write the following code working with innerHTML in the compact platform-independent way (probably using jquery)?</p>
<p>The point is that IE names tags in different case in innerHTML, so I need two if clauses to handle that. toLowerCase does not help when it comes to quotes.</p>
<pre><code>var flagpos = html.indexOf('</a>')
if (flagpos == -1) flagpos = html.indexOf('</A>')
html = (flagpos >= 0) ?
'<span class="' + html.substr(flagpos + 4).
replace(/^\s*|\s*$/, '').
replace(/ /g, '"></span><span class="') +
'"></span>' + res + ' ' + html.substr(0, flagpos + 4) : res + ' ' + html
</code></pre>
<p>-- or --</p>
<pre><code>if (!toggleFlags[j] ||
child.innerHTML.indexOf('<span class="' + j + '">') >= 0 ||
child.innerHTML.indexOf('<SPAN class=' + j + '>') >= 0) continue
</code></pre>
| javascript jquery | [3, 5] |
3,571,216 | 3,571,217 | Passing Looped Array Values From PHP to JavaScript & JQuery | <p>I am trying to make a search box in my web application, and I used ajax post to make a request to my server. My question is:</p>
<p>Is it possible to send looped array values from PHP to my JavaScript?
I want to get all of the results from my server.</p>
<p>CLIENT SIDE: Ajax POST request</p>
<pre><code><script type="text/javascript">
$(document).ready( function() {
$.ajax({
type: "POST",
url: "searchPlaces.php",
data: { searchInput: form.searchTxtId.value },
success: function (result)
{
// Get the search result
}
});
});
</script>
</code></pre>
<p>SERVER SIDE (after retrieving the post from ajax, and making queries):</p>
<pre><code>while ($result = mysql_fetch_assoc ($query))
{
$resultName = $result['name'];
$resultAddress = $result['address'];
}
</code></pre>
| php jquery | [2, 5] |
838,967 | 838,968 | Creating DOM 'option' elements with 'selected' attribute | <p>Why does this code would work fine in jQuery 1.5 and not in jQuery 1.6? Was there a known change to how jquery creates DOM nodes between these two versions?</p>
<pre><code>var birth = new Date(),
current = new Date().getFullYear() - 13,
year = $('select#year'),
i = 0;
birth.setFullYear(1992, 10, 3);
while (i < 48) {
var option = $('<option>', {
value: current - i,
text: current - i,
selected: (current - i === birth.getFullYear()) ? 'selected' : ''
});
year.append(option);
i++;
}
</code></pre>
<p>See <a href="http://jsfiddle.net/tauren/Z7umc/2/" rel="nofollow">this working jsfiddle using 1.5</a> and <a href="http://jsfiddle.net/tauren/Z7umc/1/" rel="nofollow">this non-working jsfiddle using 1.6</a>. The first only selects one option, but the second adds <code>selected="selected"</code> to every option. </p>
<p>Note I've only tested this in Chrome at this point.</p>
| javascript jquery | [3, 5] |
3,364,110 | 3,364,111 | Converting image to text using ocr in c# asp.net | <p>I am trying to convert a image to text using OCR library with the source code provided on below link</p>
<p><a href="http://www.codeproject.com/Articles/41709/How-To-Use-Office-2007-OCR-Using-C" rel="nofollow">Converting image to text using ocr</a></p>
<p>But i get the below annoying exception every time i do</p>
<pre><code>md.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH,true,true);
</code></pre>
<p>but i am getting error </p>
<pre><code>Object hasn't been initialized and can't be used yet.
</code></pre>
<p>Please give me solution to solve the problem.<br>
Thank You.</p>
| c# asp.net | [0, 9] |
2,619,141 | 2,619,142 | How To Send Data From One Page To Another Such That Page Do Not Navigate C# Web Application | <p>i want to navigate only data from one page to another i am using this code to navigate data to another page that is,</p>
<pre><code>FROM FIRST PAGE
Response.Redirect("testing.aspx?Parameter=" + txtCommission.Text);
To SECOND PAGE
txtCommission.Text = Request.QueryString["Parameter"].ToString();
</code></pre>
<p>but by using this code i am also navite to another page while i want to just send data to the Second page when i check check box??</p>
<p>hopes for your suggestions..</p>
| c# asp.net | [0, 9] |
929,150 | 929,151 | How can get length on checked checkbox array javascript | <pre><code><form name='form1' >
<input type=checkbox name='cbox[]' />
</form>
<script>
var checkbox = document.getElementsByName('ckbox[]')
var ln = checkbox.length
alert(ln)
</script>
</code></pre>
<p>How can I count only the checked checkboxes with javascript or jQuery?</p>
| javascript jquery | [3, 5] |
3,062,419 | 3,062,420 | Sending variable to PHP through jQuery and back | <p>I am trying to create a kind of request where registered members see posts of other registered members. They might choose to connect with them before they can be able to comment on the post. What I want is to use jQuery to send the request to PHP which in turn inserts into the database with a status <code>connection requested</code>. When the member sees the request he can then choose to accept or reject that request. If he accepts it, the status will change to <code>you are connected with this member</code>.</p>
<p>Please I know that there are similar questions like this but not exactly as mine, somebody should please help.</p>
<pre><code>'cont_email' is email of member sending request
'email_cont' is email receiving the request
'status' is the status of the connection
'counter' is request increment
</code></pre>
<p>This is my HTML part:</p>
<pre><code><input name="connect" type="button" value="Connect with&nbsp;<?php echo"$mem_com[name]";?>" class="intag2" onclick="connt()"/>
</code></pre>
<p>The PHP part is working ok. My only problem is sending the request through jQuery to PHP and back to jQuery which now displays the status of the connection based on members activity.</p>
| php jquery | [2, 5] |
3,607,481 | 3,607,482 | add class to the children if parent has a "translate" class and remove "translate" class of the parent after | <p>have any idea for this?</p>
<p>example code:</p>
<pre><code><td>
<div class="translate">
<p><span>Hello world</span></p>
<p><strong>hellow <span>there</span></strong</p>
</div>
</td>
</code></pre>
<p>the output should be</p>
<pre><code><td>
<div class="">
<pclass="translate"><span class="translate">Hello world</span></p>
<p class="translate"><strong class="translate">hellow <span class="translate">there</span></strong</p>
</div>
</td>
</code></pre>
| javascript jquery | [3, 5] |
2,885,541 | 2,885,542 | Setting minimum date to date picked in previous datepicker | <p>I have two date pickers. A <code>startdate</code> and an <code>enddate</code>.</p>
<p>The way I have the code set up is that the second datepicker won't be initiated until the first one has been changed. The <code>enddate</code> datepicker is initialized with the current date on <code>startdate</code>. The only problem is that if you change the time on the first datepicker it doesn't refresh the <code>mindate</code> on <code>enddate</code>.</p>
<pre><code> $(function(){
$( "#startdate" ).datepicker({ minDate: currentTime });
//When the startdate changes change the mindate for the enddate picker
$( "#startdate" ).change(function (){
startTime = ($("#startdate").val());
$("#enddate").datepicker({ minDate: startTime });
});
//$( "#enddate" ).datepicker({ minDate: currentTime });
});
</code></pre>
| javascript jquery | [3, 5] |
1,435,010 | 1,435,011 | How do I limit the number of selected option tags within a select tag in jQuery and javascript? | <p>I am trying to use jQuery to limit the number of selected option tags in jQuery to 100. What am I doing wrong? The select tag looks like this:</p>
<pre>
<select name="order">
<option value="1" selected>Order Name</option> ...
</pre>
<p>after a user selects one or more option tags... Still not sure how to get the event handler to work.</p>
<pre>
var countSelectedOptionTags
$("select[name='order']").change(function() {
$("select[name='order']").children('attr="selected"').each(function() {
countSelectedOptionTags++;
});
if countSelectedOptionTags > 100
{
alert("You can not select more than 100 option tag.");
return;
} //I need the option tags that have the selected attribute
</pre>
| javascript jquery | [3, 5] |
195,976 | 195,977 | What is the equivalent of Java's SimpleDateFormat class in C#? | <p>Anyone knows an equivalent class of Java's SimpleDateFormat in C#? I wonder if i can convert the following java code using Custom Date and Time Format Strings in C#</p>
<pre><code> SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
TimeZone tz = TimeZone.getDefault();
format.setTimeZone(TimeZone.getTimeZone("GMT"));
str = format.format(new Date());
</code></pre>
| c# java | [0, 1] |
1,583,745 | 1,583,746 | if statement within jQuery timepicker | <p>I'm pretty new to javascript and jQuery, but I managed to get Trent Richardson's jQuery Timepicker, <a href="http://trentrichardson.com/examples/timepicker/" rel="nofollow">http://trentrichardson.com/examples/timepicker/</a>.</p>
<p>I added constraints for limiting dates the user can select, but I now need to change those limits based on the current time. Adding a day if the current time is before 3pm, and adding 2 days if it's after 3pm.</p>
<p>I have it working, but I feel that the code is a little bulky and poorly thought out. Does anyone know if there's a more elegant way of achieving this?
Thank in advance :)</p>
<pre><code>var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if(hours > 15){
//document.write("too late buster!")
$('#datepicker').datetimepicker({
minDate: +2,
maxDate: +30,
dateFormat: "d/M",
timeFormat: 'hh:mm',
hourMin: 11,
hourMax: 19,
hourGrid: 4,
minuteGrid: 10,
stepMinute: 5,
separator: ' @ '});
} else {
$('#datepicker').datetimepicker({
minDate: +1,
maxDate: +30,
dateFormat: "d/M",
timeFormat: 'hh:mm',
hourMin: 11,
hourMax: 19,
hourGrid: 4,
minuteGrid: 10,
stepMinute: 5,
separator: ' @ '});
}
</code></pre>
| javascript jquery | [3, 5] |
4,071,334 | 4,071,335 | Links and on click in ListView? | <p>i used <code>android:autoLink="web"</code> in textview inside a listView, the problem when the listview have a link, it looks like the <code>android:autoLink="web</code>" override the on click function for that listview .
What i need is to be able to click the link and able to click on the listview that contains the link .</p>
| java android | [1, 4] |
4,657,259 | 4,657,260 | ASP.Net error responses are empty | <p>After transferring from a web site to a web application project we've run into some issues regarding exceptions.</p>
<p>When an exception occurs first of all the debugger doesn't pick it up. Doesn't break, just continues. Breakpoints are triggered!</p>
<p>The result to the browser is literally blank, no result at all (not even an empty html page, just nothing).</p>
<p>The Application_Error in Gobal.asax.cs is triggered and the exceptions are processed to our webservice that tracks them, but not reported to the browser or caught by VS.</p>
<p>Does anyone have an idea what might cause this?</p>
<p><strong>EDIT: Some extra information</strong></p>
<ul>
<li>Visual Studio 2010</li>
<li>.Net Framework 4.0</li>
<li>ASP.Net Development Server</li>
<li>Windows 7 64-bits</li>
</ul>
<p><strong>More info:</strong></p>
<p>The problem occurs with my co-workers too, as well as on the live version.</p>
| c# asp.net | [0, 9] |
2,615,484 | 2,615,485 | JQuery Progress Circle + fade page? | <p>Using JQuery how would I make the page dim / fade and display a progress circle in the center which is animated? I'd like to do this when the user fills out a form and clicks submit and is awaiting a response.</p>
| javascript jquery | [3, 5] |
3,157,663 | 3,157,664 | Slide divs like a slideshow, only one at a time should be visible | <p>I want to create a div slider that would have "n" number of images in it which would keep sliding in every few seconds, lets say 3 seconds, automatically. I am not very fluent with javascript. So please a detailed explanation would be very helpful. The below code also to be honest I have copied from google. I am very bad at Javascript I am trying to learn still. I know this is a platform for programmers but I am a newbie.</p>
<pre><code><html>
<head><title></title>
<script type="text/javascript" language="javascript">
//<![CDATA[
window.onload=function()
{
document.getElementById("d2").onclick = slideIt;
document.getElementById("d3").onclick = slideIt;
};
function slideIt()
{
var slidingDiv = document.getElementById("d1");
var stopPosition = 50;
if (parseInt(slidingDiv.style.left) < stopPosition )
{
slidingDiv.style.left = parseInt(slidingDiv.style.left) + 2 + "px";
setTimeout(slideIt, 1);
}else{
if(parseInt(slidingDiv.style.left) < -150 ){
var slidingDiv3 = document.getElementById("d3");
slidingDiv3.style.left = parseInt(slidingDiv3.style.left) + 300 + "px";
}
}
}
//]]>
</script>
</head>
<body>
<div id="d2">click here to slide the div</div>
<div id="d1" style="position:absolute; left:-150px; top:30px">horizontally sliding div</div>
<div id="d3" style="position:absolute; left:-300px; top:30px">horizontally sliding div2</div>
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
4,253,650 | 4,253,651 | Facebox plugin fill the box with data and run also code behind | <p>I want to write something in my facebox tag while do something when clicked. It is not possible to do it with href because I am using onClick(==href="__doPostBack()") event.</p>
<p>I tried other ways too like changing the code of facebox plugin, usung faceboxHtml(as below) but nothing! </p>
<pre><code> $('a[rel*=facebox]').facebox({
opacity: 0,
overlay: true,
topPosition: pos_top,
leftPosition: pos_left,
width: 270,
loadingImage: '../images/loading.gif',
closeImage: '../images/close_x.png',
faceboxHtml: '\
<div id="facebox" style="display:block;"> \
<div class="popup"> \
<div class="content"> \
<div id="dialog-form" style="display:block"> \
<p style="text-align:center">Item has been saved successfully</p> \
<p style="text-align:center;text-decoration:underline;"><a href="#">View saved list</a></p> \
</div> \
</div> \
<a href="#" class="close"><img src="../images/close_x.png" title="close" class="close_image" /></a> \
</div> \
</div>'
});
</code></pre>
<p>My link button is:</p>
<pre><code><asp:LinkButton class='google-button' id="btnSaveForLater" rel="facebox" runat="server" onclick="addSaveList">Save for later</asp:LinkButton>
</code></pre>
<p>Does anyone knows a solution?</p>
| javascript jquery asp.net | [3, 5, 9] |
5,207,298 | 5,207,299 | jquery append not working in IE/Firefox | <p>I have the following HTML and subsequent jQuery which appends the related HTML elements after the JSON request has been retrieved. </p>
<p>This implementation works in Google Chrome + Android browser + Safari, but is not populating the data in Firefox or Internet Explorer 9. </p>
<p>*<em>*</em> Works in Chrome, Android browser, Firefox 4 ... does not work in Firefox 3.x and IE.</p>
<p>Static HTML: </p>
<pre><code> <header class=line>
<div class="unit size3of4">
<h2 class="fullname"></h2>
<h4 class="nickname"></h4>
</div>
</header>
</code></pre>
<p>The jQuery code: </p>
<pre><code><script>
function load_user_info() {
var content_url = 'rest.api.url.com';
$.getJSON(content_url, {id:'11xx1122xx11'}, function(data){
console.log(data);
$.each(data, function(key, value) {
if (key == "fullname") {$('.fullname').append(value);}
else if (key == "nickname") {$('.nickname').append(value);}
});
});
}
load_user_info();
</script>
</code></pre>
<p>Slightly confused about the behavior between browsers. I can guarantee the JSON request is returning two variables: fullname & nickname and have confirmed this </p>
<p>In Firefox using the FireBug plugin I see the results of <code>console.log(data)</code>.<br>
In Chrome I see the results of the <code>console.log(data)</code> and the successful display of the fullname & nickname in the HTML after the JSON request. </p>
<p>Using jQuery 1.6.1 if it helps ... </p>
<p>JSON Output:</p>
<pre><code> {"fullname":"johnny fartburger", "nickname":"jf"}
</code></pre>
| javascript jquery | [3, 5] |
4,457,707 | 4,457,708 | Inserting content into iframe javascript | <p>How can we insert the content of 1 iframe into another. Is this possible?</p>
| javascript jquery | [3, 5] |
405,728 | 405,729 | login page in sql server 2005 | <p>Am running asp.net applications with c#.I have developed a login page and gave database connection with sql server 2005.Now I want to check the usename and password in my databse.Only if that both matches my page have to redirects to the next page.Can some suggests the code?</p>
| c# asp.net | [0, 9] |
1,703,577 | 1,703,578 | Using JQuery, what is the best way to set onclick event listeners for radio buttons? | <p>For the following HTML:</p>
<pre><code><form name="myForm">
<label>One<input name="area" type="radio" value="S" /></label>
<label>Two<input name="area" type="radio" value="R" /></label>
<label>Three<input name="area" type="radio" value="O" /></label>
<label>Four<input name="area" type="radio" value="U" /></label>
</form>
</code></pre>
<p>Changing from the following javascript code:</p>
<pre><code>$(function() {
var myForm = document.myForm ;
var radios = myForm.area ;
// Loop through radio buttons
for (var i=0; i<radios.length; i++) {
if (radios[i].value == "S") {
radios[i].checked = true ; // Selected when form displays
radioClicks() ; // Execute the function, initial setup
}
radios[i].onclick = radioClicks ; // Assign to run when clicked
}
});
</code></pre>
<p>Thanks</p>
<p>EDIT: The response I selected answers the question I asked, however I like the answer that uses bind() because it also shows how to distinguish the group of radio buttons</p>
| javascript jquery | [3, 5] |
59,310 | 59,311 | how to pass form name dynamically into jquery for validation | <p>i'm using jquery for form validation, where when i click save button, the code is as below</p>
<pre><code><input type="submit" value="Save" id="button" name="Save" onClick="save(this,'/Web/controller',this.form);">
</code></pre>
<p>and the javascript is as below</p>
<pre><code>function save(ele,servlet,formName){
$(document).ready(function() {
$("#fmyFormName").validationEngine({ //how to pass form name dynamically here from js
submitHandler: function(form) {
$(form).ajaxSubmit();
}
})
});
}
</code></pre>
<p>so i want to create generic javascript so its can handle any form, so how can i pass the form name into jquery dynamically, i try few combination such as form[id=strcmd.name],...
but not work, can anyone help</p>
| javascript jquery | [3, 5] |
467,355 | 467,356 | Javascript (jQuery) flasher effect: how to do that? | <p>I want to make a flasher effect: when hover on some specified field there shows anything (yellow icon in my case) and when mouseout it disappeares.</p>
<p>The problem that there are a lot of such similar fields (they will be the comments in future) so I've tried to do all this in one for cycle. But it's not working... I do not know why.</p>
<p><em><strong>Some notes: I have to do that all without html, only in javascript, so I've used document.write method.</em></strong></p>
<p><a href="http://jsfiddle.net/Vitali_Ponomar/TSSn6/" rel="nofollow">Demo on jsfiddle</a></p>
<p>Here the code:</p>
<pre><code>var data = ['one', 'two', 'three'];
for(var i in data){
(function(){
$('#id'+i).mouseover(function(){ $("#hdn"+i).show(); });
$('#id'+i).mouseout(function(){ $("#hdn"+i).hide(); });
});
document.write('<div id="id'+i+'" style="border:1px solid;margin:10px 0;float:left;width:100%;">');
document.write('<div style="float:left;width:20px;height:20px;">'+data[i]+'</div>');
document.write('<div id="hdn'+i+'" style="display:none;float:right;width:20px;height:20px;"><img src="http://t0.gstatic.com/images?q=tbn:ANd9GcSa7ebCG4VGWcTTXH8j7ebfpFWhYuV9ojisNmsrnZaQHk8wRMTNqGfaNA" /></div>')
document.write('</div>');
}
</code></pre>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
807,744 | 807,745 | Process a file when user exits page? | <p>this is my code so far, what I'm trying to do is process the io_up.php file when the user leaves the page. It was also be great if i could pause the page load for 3sec after file is processed.</p>
<pre><code><script type="text/javascript">
function setConfirmUnload(on) {
Window.onbeforeunload = (on) ? unloadMessage : null;
}
function unloadMessage() {
$.ajax({
async: true,
url: "/proc_files/io_up.php",
success: function(msg){
alert( "Data Saved.");
}
});
}
</script>
</code></pre>
| javascript jquery | [3, 5] |
4,863,350 | 4,863,351 | How to insert first image if no others selected | <p>I am trying to figure out a way to insert the first image of a jquery gallery once it's loaded basically. </p>
<p>I've searched everywhere and can't seem to find anything. I have pasted the code that works so far below. I think I have to put something like: </p>
<pre><code>$(function() {
$(".image").click(function() {
var image = $(this).attr("rel");
var title = $(this).attr("alt");
var description = $(this).attr("content");
$('#gallery').hide();
$('#gallery').fadeIn('slow');
$('#image').html('<img src="' + image + '"/>');
return false;
});
});
</code></pre>
| javascript jquery | [3, 5] |
2,696,289 | 2,696,290 | OnKeyUp event with timer? | <p>JQuery is kind of new to me and I set up a search suggestions system using ajax that works great but works pretty slow due to the onKeyUp limitation. After some reading I found that I can set a timer on the event. So what I am trying to do is set a timer on the 'prod-name-input' input field onKeyUp event, so that it is called every 2 seconds. I found a few examples for this online, but I wasn't able to apply any of them to my code successfully, I was wondering if someone can walk me through how this works? many thanks in advance.</p>
<p>My input field</p>
<pre><code><input onKeyUp="search(this.value)" type="text" class="prod-name-input"/>
</code></pre>
<p>JS</p>
<pre><code>function search(searchword) {
$('.smart-suggestions').load('invoice-get-data.php?searchword=' + searchword);
}
</code></pre>
| javascript jquery | [3, 5] |
2,012,990 | 2,012,991 | How can I force a web user to read and check an NDA before proceeding? | <p>Every time a user registers to our site we need to show a NDA (non-disclosure agreement). In order to continue the user has to accept it. My issue is that I have the NDA in all one page and the user does not really read it and accept (like we all do). </p>
<p>What I want is to make sure the user reads the NDA and accepts it one he "read" it?</p>
<p>What I have now is a simple jQuery validation if the user checks a box and click on accept. then it goes to the next page.</p>
<p>Here's what i have</p>
<pre><code><script>
$(document).ready(function() {
$('#go').click(function() {
// check if checkbox is check and go to next page
// i have this code
});
});
</script>
<div>
full nda
<hr>
<input type=checkbox> <input type=button value=go id=go>
</div>
</code></pre>
<p>I already have the code for the checkbox and button</p>
<p>i simply dont want the user to blindly accept the nda</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
1,250,877 | 1,250,878 | Create an Event Handler whenever a new Node is added in treeview | <p>I want to write a custom class in which whenevr I add a node to treeview it should call an event. so that I can run it recursively.</p>
| c# asp.net | [0, 9] |
829,990 | 829,991 | access post vars JS or PHP? | <p>I am using jquery to post vars to a php script.</p>
<p>Is it possible to access these vars once the script has posted? If I post the data to the php script, is the only way to access it in the html/js that i posted it from, to send it back from the php script as json?</p>
<p>I cant seem to do it in JS, but even php will not work?, Sorry correction i can access the post vars in the php page, but not in the html/js page i posted from </p>
<p>Any ideas how to access posted vars from the page thats doing the posting?</p>
<p>update: yep to be a bit clearer, i am using a html page with javascript to post to a php page, i would like to access the posted vars in the html javascript page. I tried outputting $.post and $.ajax and these just show a long function. </p>
<p>Cheers </p>
<p>Ke</p>
| php jquery | [2, 5] |
2,760,962 | 2,760,963 | Autocomplete text input in reference to the value of another text input | <p>I have two fields, one of which has the <a href="http://www.mix26.com/demo/ajax-autocomplete/test.php" rel="nofollow">jQuery autoComplete plugin</a>.</p>
<pre><code><input type='text' name='primary_diagnosis' id='icd1-diagnosis'/>
<input type='text' name='ICD_No1' id='icd1-num' />
$(document).ready(function(){
$("#icd1-diagnosis").autocomplete("autocomplete-icd.php",
{
selectFirst: true
});
});
</code></pre>
<p>Is there a way to automatically fill up the second text input once a value has been selected for the first? For example, selecting "Dengue fever [classical dengue]" for the first text input, then query the database for certain value to yeild "A90" as the value for the second text input.</p>
<p>Here's autocomplete-icd.php</p>
<pre><code><?php
include('config.php');
$q=$_GET['q'];
$my_data=$q;
$sql=mysql_query("SELECT col9 FROM tb_data_icd WHERE col9 LIKE '%$my_data%' ORDER BY col9",$con);
if($sql)
{
while($row=mysql_fetch_array($sql))
{
$col9=$row['col9'];
echo "$col9"."\n";
}
}
?>
</code></pre>
| php javascript jquery | [2, 3, 5] |
5,362,464 | 5,362,465 | open a file before uploding through file uploder in asp.net | <p>I want to upload an exe to web server from client system through file up-loader and want to run/open that exe before uploading .how can i run/open that exe before uploading it.</p>
| c# asp.net | [0, 9] |
534,246 | 534,247 | How does supersized jQuery plugin generate Image mark up | <p>The other day i was trying to understand how the supersized plugin works, and I was looking forward to using it.</p>
<p>I have downloaded the plugin from the following URL:</p>
<p><a href="http://buildinternet.com/project/supersized/" rel="nofollow">http://buildinternet.com/project/supersized/</a></p>
<p>I was debugging it using Firebug, but I don't understand how the image mark up is generated. I couldn't find its markup in any of the js, css, or html files... </p>
<p>Can someone please take a look at it, and offer me some direction?</p>
| javascript jquery | [3, 5] |
5,156,618 | 5,156,619 | Clicking a Dynamically Generated div that opens another dynamically generated Div | <p>ok, Im going to pass on submitting how I would do this...because I dont want a patch to an otherwise crappy piece of code. Heres what Im trying to do: I use php to output some divs. A corresponding set of divs is generated with the first divs. The whole idea is that when the first div is clicked, the corresponding div slides down. My attempts at this so far have been unsuccessful. Im guessing the id is going to have to correspond with the class of the other div or something to that affect. I've been baking on this one for awhile. Any help is really appreciated!</p>
| php jquery | [2, 5] |
4,998,372 | 4,998,373 | How to check if a user is holding a key down while he pushes another key? | <p>I have a function that directs a user to another page if the user pushes the right or left key on the keyboard. I need it to check if the user is holding down the CTRL key at the same time, while he pushes left or right, to redirect him. How can i do this?</p>
<p>My code:</p>
<pre><code>$(document).keydown(function (e) {
var code = (e.keyCode ? e.keyCode : e.which);
var currentPage = $("#CurrentPage").val();
var numberOfPges = $("#NumberOfPages").val();
if (code == 39) {
if (currentPage < numberOfPges) {
// Næste side
changePage(parseInt(currentPage) + 1);
$(document).focus();
}
else {
// Send user to the next category
// $("#nextCategory")
}
}
else if (code == 37) {
// Tilbage
if ((parseInt(currentPage) - 1) != 0) {
changePage(parseInt(currentPage) - 1);
$(document).focus();
}
else {
// Send user to the previous category
// $("#previousCategory")
}
}
});
</code></pre>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
285,270 | 285,271 | want to match only whole words in javascript for error | <p>So I am trying to create a little form validation on entering a Name
I want to not allow certain characters, already created names, and internally reserved words. The problem is say when I want to put "posts" in a name it says that it is matching "pos" and fails.</p>
<pre><code>var badchar = new Array('"', "," , "'" , "#", "&", "!", "@", "$", "+", ";", ":", "*", "(",")", "[","]","{","}", "/", "=" );
var resword = new Array("positive","pos","negative","neg","neutral", "neu","twitter","itunes","facebook","android","forums","RSS Feeds");
var existingNames = @anames;
var valueLen = $("#aname").val().length;
var fail=false;
var filterElem = $('#aname');
var filterName = $('#aname').val();
$.each(badchar, function(char){
if ( filterName.indexOf(badchar[char]) != -1 ) {
console.log("bad character")
filterElem.css('border','2px solid red');
window.alert("You can not include '" + badchar[char] + "' in your Filter Name");
fail = true;
}
});
$.each(resword,function(){
if ( filterName.match(this)) {
console.log("bad word");
filterElem.css('border','2px solid red');
window.alert("You can not include '" + this + "' in your Filter Name");
fail = true;
}
});
</code></pre>
| javascript jquery | [3, 5] |
3,629,921 | 3,629,922 | How can I tweet in twitter account from an android imulator? | <p>Here, I have an edit text and a button, I want to tweet what i write something in edit text after clicking the button.</p>
| java android | [1, 4] |
4,657,466 | 4,657,467 | count the number of element of same class in a div? | <p>I have a main div in my page with a specific id. Now some input elements of same class are present in this div. so how can I count the number of these elements of same class in this div using jquery?</p>
| javascript jquery | [3, 5] |
5,437,243 | 5,437,244 | SQLiteConstraintException cause stopping Activity. How can I avoid it? | <p>I have an application which can insert records into a table. The table has a primary key. (licensePlace). I get a SQLiteConstraintException when I try to insert a record whose licensePlace is already exist in the database.</p>
<p>I want to handle this exception in the following way:
In this case the user should get an alertDialog and inform him that the licensePlace is not correct.</p>
<p>My problem is that SQLiteConstraintException cause stopping the Activity and I don't know how can I avoid this.</p>
| java android | [1, 4] |
5,754,516 | 5,754,517 | How to get window "right"? | <p>I'm trying to position a floating tooltip on my webpage, and I want it so that if the tooltip is going to hang over the right edge of the window, it should flip it around the other way. Here's what I've got:</p>
<pre><code>$('[data-tooltip]').mousemove(function(e) {
var left = e.pageX + 1;
if(left + $kewtip.outerWidth() > ?????) {
left = e.pageX - $kewtip.outerWidth() - 1;
}
var top = e.pageY - $kewtip.outerHeight() - 1;
$kewtip.css({
left: left,
top: top
});
});
</code></pre>
<p>I don't know what to fill in for the question-marks. <code>left + $kewtip.outerWidth()</code> should give me the right edge of the tooltip, and I want to check if that's greater than the right edge of the window.</p>
<p><code>$(window).width()</code> won't work, particularly when you've scrolled horizontally a bit.</p>
| javascript jquery | [3, 5] |
4,809,857 | 4,809,858 | How to hide a DIV that is produced by an AJAX call? | <p>I have a simple script that closes a DIV. An example is here: <a href="http://jsfiddle.net/22fTm/3/" rel="nofollow">http://jsfiddle.net/22fTm/3/</a></p>
<p>My problem however, is that the DIV "box" is only produced after an ajax call, which is part of a search php script. </p>
<p>Any idea what I need to make this work? Similar question: <a href="http://stackoverflow.com/questions/5116200/how-to-hide-an-element-on-an-ajax-call">How to hide an element on an AJAX call?</a></p>
| javascript jquery | [3, 5] |
5,230,781 | 5,230,782 | Embedded HTML contains JavaScript function not getting called | <p>In my scenario i am making an ajax request to get some data and then passing its result to some function you can see the code.</p>
<pre><code> $.ajaxSetup({ cache: false });
$.ajax({
url: chartUrl,
type: 'GET',
dataType: 'text',
success: function(result){
UpdateChartArea(result, chartType);
if(isTextMining){
eval('ShowBreadCrmb_'identifier.substring(1) + '();');
}
},
error: function(req, status, error) {
}
});
</code></pre>
<p>After embedding the HTML i want to call a JS function that is in that HTML. the HTML that i am embedding is present in a user control so to have a unique instance this is how my show bread crumb method look like</p>
<pre><code> function ShowBreadCrmb_<%= reportScale.ScaleID %>()
{
alert('LHJLH');
var isTextMining = <%= TextMiningChart %>;
if(isTextMining)
{
CreateTmBreadCrumb('<%= reportScale.NodeLevel %>','<%= reportScale.NodeName %>',topicList)
}
}
</code></pre>
<p>for more info what my updatechartarea does is </p>
<pre><code>if (parent) {
clearChildren(parent);
var div = document.createElement("div");
div.innerHTML = html;
parent.appendChild(div);
}
</code></pre>
<p>I want to call the bread crumb function after update chart area function is called.</p>
| javascript jquery asp.net | [3, 5, 9] |
955,244 | 955,245 | Is there a way to call Java from JavaScript in Webview? | <p>Is there any way to call Java from JavaScript in Webview like this </p>
<blockquote>
<p><a href="https://github.com/ochameau/NativeBridge" rel="nofollow">https://github.com/ochameau/NativeBridge</a></p>
</blockquote>
<p>in Android?</p>
| javascript android | [3, 4] |
5,449,729 | 5,449,730 | How to kill session in jQuery function when I redirect to the logout page through jQuery? | <p>Hi all,
I have gone through this example to end session when user was inactive for some amount of time which works fine</p>
<p><a href="http://www.philpalmieri.com/js_sandbox/timedLogout/" rel="nofollow">http://www.philpalmieri.com/js_sandbox/timedLogout/</a></p>
<p>But when it redirects back to <code>logout</code> page and if I access the page with sessions I am able to see the page access with the data. I don't want this to be done. When user logged out on inactive session through the <code>jQuery</code> function I would like to kill the session which I am having too? How can I achieve this?</p>
| jquery asp.net | [5, 9] |
521,282 | 521,283 | How to pass js code to string gracefully? | <p>There is my code </p>
<pre><code><input type="radio" name="category" id="elementary" value="elementary" /> 1
<input type="radio" name="category" id="junior" value="junior" /> 2
<input type="radio" name="category" id="senior" value="senior" /> 3
<input type="radio" name="category" id="university" value="university" /> 4
<input type="radio" name="category" id="profession"/> 5
<div id='grade_select' class="clearfix">
<div id='elementary_grade' class="clearfix"></div>
<div id='junior_grade' class="clearfix"></div>
<div id='senior_grade' class="clearfix"></div>
<div id='university_grade' class="clearfix"></div>
<div id='profession_grade' class="clearfix"></div>
</div>
</code></pre>
<p>I want:</p>
<p>When check one radio, need to hide all the div in grade_select, and then show the div which id include the current radio value</p>
<p>There is my js code , I do not know how to going on </p>
<pre><code> <script type="text/javascript">
$(document).ready(function($){
$( "input[name='category']" ).bind( "click", category_select)
});
function category_select(){
$("div:[id=this.attr[id]]).show()
}
</script>
</code></pre>
<p><strong>FYI:</strong> This question is a spinoff of <a href="http://stackoverflow.com/questions/10671865/how-to-change-muitl-divs-the-display-which-have-some-special-id">this other question</a>.</p>
| javascript jquery | [3, 5] |
5,584,023 | 5,584,024 | PHP variable to Javascript variable | <p>I am currently working on making a simple php script to edit certain aspects of a game in JavaScript. When attempting to pass variables from the script to the game using forms, the variable data does not seem to transfer. As of now, the script is meant to edit the RDG value of one player in the game. The code is as follows:</p>
<p>script.php:</p>
<pre><code><html>
<head>
<title>Form</title>
</head>
<body>
<form method="get" action="tron2.html">
<p>What are your player 1's RGB values:
<input type="text" name="color1r" /> Red
<input type="text" name="color1g" /> Green
<input type="text" name="color1b" /> Blue </p>
<input type="submit" value="Submit" />
</form>
</body>
</html>
</code></pre>
<p>And the portion of the code in javascript where variables are assigned</p>
<pre><code><?php
$color1r = $_POST["color1r"];
$color1g = $_POST["color1g"];
$color1b = $_POST["color1b"];
?>
<HTML>
<HEAD>
<TITLE>
Tron2
</TITLE>
<script>
var x = "<?= $color1r; ?>";
var y = "<?= $color1g; ?>";
var z = "<?= $color1b; ?>";
//more code for the game
</code></pre>
<p>When the game runs, the color of the player stays black, so the values of x,y,z must all be 0. Is there any reason why the values aren't being passed?</p>
| php javascript | [2, 3] |
2,381,688 | 2,381,689 | Get minus (-)double value upto 6 point | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6554569/using-double-up-to-two-decimal-places">Using double up to two decimal places</a> </p>
</blockquote>
<p>Hi i want to convert double value upto 6 point something like if value is </p>
<pre><code> -1.00005522000
</code></pre>
<p>it should be converted and resulted into</p>
<pre><code> -1.000055
</code></pre>
<p>i know there are lots of solution but still i could not getting the value</p>
<p>if i use value like </p>
<pre><code> : -1.79769313486231E308
</code></pre>
<p>the resulted value become </p>
<pre><code> -9.22337203668547
</code></pre>
<p>i have used reference like</p>
<p><a href="http://www.roseindia.net/java/beginners/RoundTwoDecimalPlaces.shtml" rel="nofollow">http://www.roseindia.net/java/beginners/RoundTwoDecimalPlaces.shtml</a></p>
<p><a href="http://stackoverflow.com/questions/9528904/how-to-print-upto-two-decimal-places-in-java-using-string-builder">How to print upto two decimal places in java using string builder?</a></p>
<p><a href="http://stackoverflow.com/questions/6554569/using-double-up-to-two-decimal-places">Using double up to two decimal places</a></p>
<p>but do not get solution so please any body can help me?</p>
| java android | [1, 4] |
2,241,169 | 2,241,170 | How to fix this single quotes? | <p>Hi i want this code to be implemented...</p>
<pre><code>var clone = $('<div><p>Email:'+email+'</p><div class="clear"></div>'+s+'<div class="clear"></div>Name: '+username+'</div>');
</code></pre>
<p>and my second string is this </p>
<pre><code><a href="javascript:;" id="usr_followbtn_3" onclick="user_follow('Tiger',this,'usr_unfollowbtn_3','You now follow Tiger.');" class="followusr" onfocus="this.blur();"><b>Follow</b></a>
</code></pre>
<p>and i want to be attach the second code to the first one something like this</p>
<pre><code>var clone = $('<div><p>Email:'+email+'</p><div class="clear"></div>'+s+'<div class="clear"></div>Name: '+username+'<a href="javascript:;" id="usr_followbtn_2" onclick="user_follow(\'pranabksingh\\\'',this,'\usr_unfollowbtn_2\\\',\'You now follow pranabksingh\\\');" class="followusr" onfocus="this.blur();"><b>Follow</b></a></div>');
</code></pre>
<p>But it doesn't work... i think there's a problem with the single quotes...</p>
| javascript jquery | [3, 5] |
3,342,091 | 3,342,092 | Enter keyword in search box of any website using php script | <p>I am a beginner and i was wondering can we write a code in PHP by which we can enter keyword in search box of any website and submit.</p>
<p>so there will be 2 inputs to this php function:</p>
<pre><code>function enter_keyword($website_url, $keyword)
{
}
function enter_keyword($website_url, $keyword) { }
</code></pre>
<p>It will be a great help
thanks in advance </p>
| php javascript | [2, 3] |
440,590 | 440,591 | jquery tabs query | <p>how do the tabs on <a href="http://biblia.com/" rel="nofollow">http://biblia.com/</a> work? each click alters the page without any need for page navigation. does anyone know of any jquery plugin that can accomplish the same thing?</p>
<p>many thanks and God bless!</p>
| php jquery | [2, 5] |
3,929,367 | 3,929,368 | How to get Screw Default Buttons plugin working with dynamically added checkboxes? | <p>Here is a cool plugin that let's one easily change the appereance of a radio/checkbox:</p>
<p><a href="http://www.screwdefaultbuttons.com/" rel="nofollow">http://www.screwdefaultbuttons.com/</a></p>
<p>My problem is, that it doesnt work on checkboxes that are dynamically added.</p>
<p>Here is my code:</p>
<pre><code>function createCheckBoxes() {
$('input:checkbox').screwDefaultButtons({
image: "url(/content/img/checkbox_png.png)",
width: 19,
height: 19
});
}
</code></pre>
<p>Is it possible to make it work with dynamically added checkboxes aswell ?</p>
<p>There checkboxes are dynamically added when using paging in a GridView (ASP.NET) so i can't just call the function again</p>
| javascript jquery | [3, 5] |
1,572,748 | 1,572,749 | SelectedIndexChanged | <p>Problem:</p>
<p>SelectedIndexchanged does not fire. I tried investigating with a breakpoint but it does not even get to the event.
I made the event by double clicking on the combobox. But it did not help.
Please advice.</p>
<p>Here is the code:</p>
<pre><code> protected void nav_dd_parent_edit_SelectedIndexChanged(object sender, EventArgs e)
{
}
<td width="55%" class="style1" height="20px">
<asp:DropDownList ID="nav_dd_parent_edit" runat="server"
DataSourceID="sp_GetNavParents_Edit" DataTextField="Name"
DataValueField="NavItemId" Height="24px" ReadOnly="FALSE" Width="375px"
onselectedindexchanged="nav_dd_parent_edit_SelectedIndexChanged">
</asp:DropDownList>
</td>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//Page.MaintainScrollPositionOnPostBack = true;
//SiteMaster.g_solution = "Couche-Tard - QV";
//SiteMaster.g_solution_id = 27;
nav_dd_parent.DataBind();
if (SiteMaster.g_solution != null && SiteMaster.g_solution != "")
{
nav_literal.Text = "Solution: " + SiteMaster.g_solution;
nav_hidden_SoltnId.Value = SiteMaster.g_solution_id.ToString();
}
else
{
nav_literal.Text = "Please select a solution first from the 'Solution Template' Tab.";
panel_top.Visible = false;
}
}
</code></pre>
| c# javascript asp.net | [0, 3, 9] |
3,716,446 | 3,716,447 | Session and Thread in ASP.NET | <p>I have a ASP.NET website where a thread is responible for doing some code retrived from a database queue.</p>
<p>Is it possible to get access to the Session or pass that as a parameter ?</p>
<p>My current code looks a follows:</p>
<pre><code>MediaJob nextJob = GetNextJobFromDB();
CreateMedia media = new CreateMedia();
Thread t = new Thread(new parameterizedThreadStart(media.DOSTUFF);
t.Start(nextJob);
</code></pre>
<p>The HttpContext.Current.Session is null when running in a thread, so cant do that </p>
| c# asp.net | [0, 9] |
2,906,524 | 2,906,525 | auto page scroll when page reached 70% of page height using jquery | <p>I have a page that displays users feeds. I've setup 20 feeds per page and after that users can click on "see more" and it will again display 10 more feeds.</p>
<p>But I want to make it like facebook and twitter where pages are automatically scrolled when we go to the bottom. I have modified my javascript to do the same but it's not working. Any help will be highly appreciated</p>
<p>My javascript code for see more with modified autoscroll is:</p>
<pre><code>$(document).ready(function(){
$(document).scroll(function(e){
if (processing)
return false;
if ($(window).scrollTop() >= ($(document).height() - $(window).height())*0.7){
processing = true;
$("#morestream_button").click(function() {
$(this).hide();
$("#morestream_box").html("<img src=\"'.uhome().'/files/loading.gif\" /> Loading");
$.post("'.uhome().'/index.php?p=jquery/moreactivities",
{offset:$("#stream_offset").val(),uid:"'.$uid.'",target_id:'.$target_id.'},
processing = false;
function(data){
var currentVal = parseInt( $("#stream_offset").val() );
$("#stream_offset").val(currentVal + 30);
$("#morestream_box").before(data);
if (data) {
$("#morestream_button").show();
}
$("#morestream_box").html("");
},"html"
);
return false;
});
}}}});
</code></pre>
<p>My website is way2enjoy.com and you can see the link see more at bottom but I dont want to click on that link, I want that as users go down it should automatically scroll.</p>
<p>Use 'demo' as username and password.</p>
| javascript jquery | [3, 5] |
323,889 | 323,890 | setTimeout delay not functioning - what have I done wrong? | <p>I've put together a piece of code for a drop-down menu, bound to <code>.hover()</code>, however unfortunately the delay on <code>setTimeout()</code> doesn't seem to work and as soon as the mouse is moved from <code>.button</code>, it sets the display property of <code>#sub-nav</code> to <code>none</code>.</p>
<p>Dreamweaver CS 5.5 evaluates the syntax as correct :(.</p>
<p><strong>Here's my code:</strong></p>
<pre><code>function retract(){ $('#sub-nav').css('display', 'none'); }
$('#header-restrict > .button').hover( function() {
if($(this).html() == "Offers") {
$('#sub-nav').css('display', 'block');
$('#sub-nav').html('<a href="#">Add a New Offer</a> &nbsp;&nbsp;&nbsp; <a href="#">Edit an Offer</a> &nbsp;&nbsp;&nbsp; <a href="#">Get Offer Links</a>');
}
if($(this).html() == "Rotations") {
$('#sub-nav').css('display', 'block');
$('#sub-nav').html('<a href="#">Add a New Rotation</a> &nbsp;&nbsp;&nbsp; <a href="#">Edit a Rotation</a> &nbsp;&nbsp;&nbsp; <a href="#">Get Rotation Links</a>');
}
}, function() { setTimeout(retract(), 4000); });
</code></pre>
<p>If anyone could comment on/answer as to why the delay doesn't seem to be working, it would be greatly appreciated!</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.