Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
2,536,416 | 2,536,417 | Make my intro page appear only one time by user or computer | <p>i have a question, i have a index.php page that is the intro of my website, when the intro starts and finishes it redirects to my home.php page, but i want to make this intro page appear only one time by user or by computer, if the user already been to the intro page he will be redirectally sent to the home page whitout going to the index.php (intro) page.
How can i achieve it in php?</p>
| php javascript | [2, 3] |
1,875,246 | 1,875,247 | javascript/jquery how to make ticker of images? | <p>I need something like a stock ticker but instead of AAPL, MSFT, ORCL i want to show small images floating by of a fixed size. I want to be able to stop them as they pass by. how can this be done. I would like to use jquery if possible. Need a way to dynamically add/remove the images from the ticker. thanks</p>
| javascript jquery | [3, 5] |
3,960,519 | 3,960,520 | how to call DLL from java? | <p>how to call DLL from java ? I want to integrate a java application to Windows. Let me take Outlook as an example, I have the Outlook dll, then how to call it ? do we have similar tutorial ?</p>
| c# java | [0, 1] |
373,291 | 373,292 | Insert Page title into hidden form value with javascript/jquery? | <p>I've got a form on every page of my site via a template but I'd like to have the page title included into the emails sent via the forms so we know exactly which page the form was submitted from. Is there a simple way to do this with jquery? </p>
<p>Thanks for any tips/ideas. </p>
| javascript jquery | [3, 5] |
2,099,213 | 2,099,214 | how to test a string in both emulator 1.6 and 2.2 in android as same | <p>Hi guys I have a problem in testing a string while running on emulator1.6 and emulator2.2 in android . My problem is as follows.</p>
<pre><code>String phone="";
if(phone!=""&&!phone.equals(" ")){
}
</code></pre>
<p>In the android emulator1.6 it is working fine (i.e.,not entering into the if). But in the emulator2.2 it is entering into the if statement and executing the code. Please help me immediate response is needed.</p>
| java android | [1, 4] |
1,153,102 | 1,153,103 | How should i get some value from javascript object and check for null | <p>I am getting the element as</p>
<pre><code> var minPricePerInputField = $("input#A"+indexNr);
</code></pre>
<p>The element can be present also or not also. I am getting some [object Object] thing. I have no idea what is this. I am receiving this [object Object] when the element is not there.</p>
| javascript jquery | [3, 5] |
5,980,377 | 5,980,378 | How to read the contents of an entire disk bit by bit | <p>I've got a flash card that I need to compute a checksum on the entire contents of the drive.</p>
<p>If I could acquire a stream to the entire drive I could just read it in bit by bit.</p>
<p>Does anyone know if there is an API for doing this?</p>
<p>Everything I see so far requires me to open a file.</p>
<p>Is there any way to just read an entire drive's contents bit by bit?</p>
| c# c++ | [0, 6] |
1,324,637 | 1,324,638 | sync and async request java android | <p>I'm using geocoder which makes a sync request. I'm also making an async request to another service on another thread. I need both results inorder to procede to the next step in my android app. What is the proper way to make sure both results are returned before moving on?</p>
| java android | [1, 4] |
2,200,539 | 2,200,540 | JS page scroll didn't work | <p>I wrote code something like</p>
<pre><code>$.ajax({
type: 'POST',
url: form.attr('action'),
data: data,
dataType: 'html',
success: function(html){
$(html).hide().appendTo(parent.find("[data-interactions]")).show().stop().animate({
scrollTop: $(".vote_feedback_snippet:last-child").offset().top
}, 1500,'easeInOutExpo');
</code></pre>
<p>I above code when I click on post button it generates new HTML snippet at the bottom of the list
<strong>What I want:-</strong>
When new Html Snippet come it will scroll upto that snippet only</p>
<p>Can somebody help me</p>
| javascript jquery | [3, 5] |
2,289,888 | 2,289,889 | Activate action onClick in PHP | <p>I have the following chunk of code:</p>
<pre><code>while ($row = mysql_fetch_array($result)) {
echo "<li/>".$row['trendName']."<input type='submit' name='Dispay' value='Display All Items' onclick='action='http://blah.co.uk/DisplayData.php';'/>";
echo"<br />";
}
</code></pre>
<p>So, this I want to do is for each element on the list to create a button. When I will click at this button I want to hit a URL. </p>
<p>Let's say that we have only one element on the list (<code>Movies</code>). By clicking on the button next to the movies, I want to move to another URL: <code>http://blah.co.uk/DisplayData.php</code>
and furthermore to pass to the other URL the name of the element (i.e. <code>Movies</code>)</p>
<p>Is this possible, and if so, how?</p>
| php javascript | [2, 3] |
2,171,352 | 2,171,353 | image button event not fired in c# | <p>Am using the below code to validate and process some other action. In the script, i check the balance amount and pay amount.Pay amount not exceed the balance amount means it return the error message. Then the else part doesn't redirect to my code behind button click event. i can't find it. Please help me to solve this.</p>
<pre><code> if (ddl_selected == "ebal") {
var cust_balance = document.getElementById('<%= lbl_balance.ClientID %>');
var cust_ramount = document.getElementById('<%= lbl_amount.ClientID %>');
if (cust_balance.innerHTML <= cust_ramount .innerHTML) {
alert('Error Alert : You don\'t have enough balance.!.');
return false;
}
else {
return true;
}
}
<asp:ImageButton ID="btn_activate" runat="server" OnClick="btn_pay_Click"
OnClientClick="return valid_details();"
ImageUrl="~/Images/pay.png" />
protected void btn_pay_Click(object sender, ImageClickEventArgs e)
{
//Event not fire
}
</code></pre>
| c# asp.net | [0, 9] |
670,719 | 670,720 | JS height adjustment should work | <p>I'm using some JS code to automatically adjust the height of the buttons when the slideshow is smaller due to screen size. It works when used in the Chrome console, but fails when inserted into the site. </p>
<p>Site: <a href="http://www.incensu.co.uk/" rel="nofollow">http://www.incensu.co.uk/</a></p>
<p>You can see where I'm placing the code as it's commented out at the bottom of /js/main.js and here it is for reference:</p>
<pre><code>var homeTopMain = $('#homeTopMain');
if (homeTopMain) {
var btnHeight = (homeTopMain.height()+20)/3-20; // 20px at bottom, 3 buttons, 20px between.
$('.btnFlapsBodyWrapper').height(btnHeight);
$('.btnFlapsRed').height(btnHeight);
$('.btnFlapsGrey').height(btnHeight);
}
</code></pre>
<p>I'm thinking that perhaps it's the the timing of the code or a scoping issue, but I'm just not seeing it for some reason. Perhaps someone with a clear mind could spot the problem?</p>
| javascript jquery | [3, 5] |
5,815,006 | 5,815,007 | Server.UrlEncode & Server.UrlDecode | <p>i dont know, why do we use Server.UrlEncode() & Server.UrlDecode()?!
in QueryString we see anything in URL, so why do we want encode or decode them?</p>
| c# asp.net | [0, 9] |
3,602,403 | 3,602,404 | Upgrade jQuery plugins to latest version | <p><br>
I have quick question about jQuery plugins, hope somebody out there has some advice.
I'm working with a jQuery plugin that has been working as expected, but in the last couple of days we upgraded from jQuery 1.1.4 to 1.4.2.<br>
After a lot of debugging, I was able to realize that in the old plugin, selectors are written as follows:</p>
<pre><code> $('img[@id&=myImage]').each ...
</code></pre>
<p>Once we upgraded to the latest version of jQuery, I started getting JavaScript errors as follows:</p>
<pre><code>uncaught exception: Syntax error, unrecognized expression: [@id&=myImage]
</code></pre>
<p>As you can see, the selector includes an "@" symbol (which I believe is the one causing the error) and after consulting the jQuery documentation about all the different type of selectors, I was not able to find whether this was correct or not, given that it worked before and now it doesn't. </p>
<p>At this point I have to figure out if I can use the old plugin with the new version of jQuery or if I have to come up with an alternative solution. </p>
<p>I'd appreciate any advice.<br>
Thanks</p>
| javascript jquery | [3, 5] |
1,007,948 | 1,007,949 | How does the default browser on Android send "SEND" intents? | <p>I'd like to enable a "silent send" from my application-- that is, I'd like to catch the SEND intent in a Service, not an Activity. How does the default Android web browser send that intent? Is it possible to handle it in a Service, or in an Activity that never sets a View?</p>
| java android | [1, 4] |
3,800,704 | 3,800,705 | Uncaught SyntaxError: Unexpected token ILLEGAL search.json:1 | <p>I noticed recently that the jquery twitter plugin I am using stopped working (plugin info: <a href="http://www.moretechtips.net/2009/09/realtime-related-tweets-bar-another.html" rel="nofollow">http://www.moretechtips.net/2009/09/realtime-related-tweets-bar-another.html</a>). I checked the consol in chrome and it gives me the following error: "Uncaught SyntaxError: Unexpected token ILLEGAL search.json:1". Not sure what file the error resides in as when I click on the location it gives me some mess of ugly characters as shown below.</p>
<p>Any help is appreciated. Thanks.</p>
<p>jQuery191011999929416924715_1367691953565(�d�[
�0E�2<code>���-�(�:DBh�5��m҂"�ݠV�~^��Ý;T��5�Te��1c</code>�U�x�`�E�1��"ƼH����K��%��D���uf��/ʶgi��Q�ȟ��tv^ي��\
����GZڶ$���I����
�''�#bd0��w��ُ�x��ZeQ;);</p>
| javascript jquery | [3, 5] |
5,745,847 | 5,745,848 | Android SQLite sync updates from server | <p>I just wanted some advice. I have an app with a database that will be updated once a week. In my opinion there is no point having users download the app again each week. Nor is there a reason for the entire database to be downloaded once a week.</p>
<p>My idea is to send a request to a server every time the app is opened with the version of the database. The server compares this version to the current and if it is out of sync the rows will be returned via something like a json reply.</p>
<p>If there are better methods for this or if there are valid reasons why the options I have discounted are much better, please do tell me.</p>
| java android | [1, 4] |
5,701,463 | 5,701,464 | HR tag is it possible to create one in javascript | <p>This is just a question</p>
<p>is it possible to create a hr tag in <code>javascript</code> or <code>Jquery</code> without coding any <code>HTML</code>?</p>
| javascript jquery | [3, 5] |
1,672,528 | 1,672,529 | What does following a function with (jQuery, window, document); mean? | <p>I have the following plugin:</p>
<pre><code>;(function($, window, document)
{
...
...
})(jQuery, window, document);
</code></pre>
<p>I can understand what the ; is for and also realize that $ is the jQuery but can someone explain why is the function followed by (jQuery, window, document);</p>
| javascript jquery | [3, 5] |
3,802,882 | 3,802,883 | GridView not showing new inserted row | <p>I'm using a gridview and sqldatasource.
When I'm adding a new row in the gridview I need to refresh the page in order to see the new row.
The View state is enabled.</p>
<p>Is there anything I can do ?</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
4,033,892 | 4,033,893 | How can I hide some ID elements using Javascript if the browser window is less than a given size? | <p>I have been looking for an answer to this problem for hours and can't find anything that works.</p>
<p>I need to make some elements if a web page not visible if the browser window width is less than a given size. This is because there are some fixed position "buttons" on the left side of the window which expand when rolled-over, BUT if the window is less than about 1056 pixels in width, the buttons overlap the main page contents.</p>
<p>I have a script for returning the window size and putting that value into a variable.
I have got it to show a message if the variable value is less than 1056. (for testing)</p>
<p>I have seen ways how to make things visible or not with jQuery and and with Javascript but none of them work for me.</p>
<p>The id of the image I'm trying to hide is #go2.</p>
<p>here is a part of the script I have been trying to get to work:</p>
<pre><code>if (viewportwidth <1056)document.write('<p>Your viewport width is LESS than 1056</p>');
if (viewportwidth <1056)document.getElementById('go2').style.display = 'none';
</code></pre>
<p>I have had to use {literal} tags as the pages are using SMARTY templates!</p>
<p>I am very new to javascript and jQuery and wouold appreciate any help.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
2,270,151 | 2,270,152 | Do any of these javascript minifiers remove debug statements? | <p>It would be nice if I could put debug/console log statements in my javascript, then have a js minifier/compacter remove these when it compiles.</p>
<p>Does this exist?</p>
| javascript jquery | [3, 5] |
2,223,062 | 2,223,063 | How do I pass the correct data type to Javascript from PHP | <p>I am using the jQuery post method to create a record in MySQL. When I evaluate the output of the PHP with <code>==</code>, all three conditionals work properly. However, when I use <code>===</code>, the first two conditionals return <code>false</code>. How do I pass the correct data type to Javascript from PHP?</p>
<p>jQuery:</p>
<pre><code>$("#form").validate({
submitHandler: function(form) {
// do other stuff for a valid form
$.post('inc/process_form.php', $("#form").serialize(), function(data) {
//alert(data);
if (data == 1) {
$('#results').html("Success");
} else if (data == 2) {
$('#results').html("No Success");
} else {
$('#results').html(data);
}
});
}
});
</code></pre>
<p>This is the PHP (which I've truncated to only show the execute conditional):</p>
<pre><code>$value = $stmt->execute();
if ($value === TRUE) {
echo 1; //success
} else {
echo 2; //failure
}
</code></pre>
| php javascript jquery | [2, 3, 5] |
3,277,250 | 3,277,251 | jQuery - Detecting specific length words in a string? | <p>In jQuery, is there a simpler method to detect if a string has words with X amount if characters or less? I'm about to write some Javascript that loops through each word in the string, checking each individual length, but want to know if there is a function, or a simpler method, possibly in jQuery, before I waste time and lines.</p>
<p>This is what I was going to do, there must be an easier method, possibly a one-liner?</p>
<pre><code>var bad_words = 0;
var search_str = $('#search_str').split(' ');
$.each(search_str, function(index, chunk) {
if (chunk.length < 4) {
bad_words++;
}
}
if (badwords > 0) {
alert("Words with 3 or less characters found.");
}
</code></pre>
<p>I'm not looking for somebody to do my work, I just want to know if it's possible, and if so, what should I be looking at.</p>
| javascript jquery | [3, 5] |
2,587,068 | 2,587,069 | Changing an array of tags' attributes | <p>I have an array of objects (data)</p>
<pre><code>data[0].image = image1.jpg;
data[0].name = "some name";
data[1].image = image2.jpg;
data[1].name = "some name";
data[2].image = image3.jpg;
data[2].name = "some name";
data[3].image = image4.jpg;
data[3].name = "some name";
</code></pre>
<p>I also have a group of tags nested in a ul. </p>
<pre><code><ul class='swapme'>
<li><img class="swapme" src="a.jpg" /></li>
<li><img class="swapme" src="b.jpg" /></li>
<li><img class="swapme" src="c.jpg" /></li>
<li><img class="swapme" src="d.jpg" /></li>
</ul>
</code></pre>
<p>I know I can grab the img tags with </p>
<pre><code>$('ul.swapme').children('img.swapme')
</code></pre>
<p>I know I can swap out each images src attribute with</p>
<pre><code>$('img.swapme').attr('src', data[0].image)
</code></pre>
<p>My question is, what is the right way to swap out the src attribute with the corresponding data object. ie, a.jpg becomes image1.jpg. . . ect. . . </p>
<p>If I use loops it looks ugly and clumsy, can anyone provide a better way / the right way to do this ?</p>
| javascript jquery | [3, 5] |
5,746,831 | 5,746,832 | ASP.NET C# pass object to method | <p>How do I pass an object from one method to another?
From the code below, I would like to pass <code>newEvent</code> from <code>xmlReader()</code> to <code>outputData()</code></p>
<pre><code>public class Event
{
public int ID {get; set;}
}
public void xmlReader()
{
Event newEvent = new Event;
newEvent.ID = 56;
outputData(newEvent);
}
public void outputData(object theEvent)
{
MainContainerDiv.InnerHtml = theEvent.ID;
}
</code></pre>
<hr>
<p>Thank you,
Jordan</p>
| c# asp.net | [0, 9] |
1,245,869 | 1,245,870 | Change Tab Link on Click (and Already Active Anchor) | <p>Trying to piece together js knowledge as I go here. But I have a website that will be relying on a tabbed (just 2) concept to flip between the companies two services.</p>
<p>So when navigating to the page, they user will be directed to Company1 and I would like to have a tab of Company 2 on the right. It will be the same domain, just domain.com#company2.</p>
<p>When they navigate to Company 2 directly (via domain.com#company2) I would like the tab on the right to link to Company 1.</p>
<p>So basically, it looks like js is the only way to do this. Something that could read the active id and style the tab accordingly.</p>
<p>The main function would be based on click. So if you click the tab, it switches to the non-active companies tab.</p>
<p>The tab itself will remain the same, all I need to change is the href.</p>
<p>Thanks in advance guys!</p>
| javascript jquery | [3, 5] |
772,455 | 772,456 | How do I place a control created in the code behind on a page? | <pre><code>protected void Page_Load(object sender, EventArgs e)
{
Label myLabel = new Label();
myLabel.Text = "Testing 1 2 3";
}
</code></pre>
<p>If I create this Label object in the code behind, and it has no < asp:Label > tag on the main page, how can I put this Label somewhere on the page?</p>
<p>I want to dynamically create controls based on information out of a database. From there, I want to place the controls onto the webpage. I can't predefine places for them because the number and types of controls will change.</p>
<p>What's the best way to do this?</p>
<p>What if I already have something on my page, such as a table, and I wanted to place the control after the end of the table.</p>
| c# asp.net | [0, 9] |
5,823,275 | 5,823,276 | Adding functions with jquery replace() markup | <p>I have a jquery replace() putting in list items that I want to attach a function to. I don't know exactly how to do this though.</p>
<pre><code>function replaceListItems(){ $('ul.options').replaceWith('<ul class="options"><li class="btn"><img src="btn.png" /></li></ul>');}
</code></pre>
<p>Here's the function I'd like to attach:</p>
<pre><code>$("ul.options li").click(function(){myFunction()});
</code></pre>
<p>Seems like it gets removed if I assign it before the list items gets replaced/created.</p>
<p>Thanks in advance for the help!
-m</p>
| javascript jquery | [3, 5] |
3,222,996 | 3,222,997 | Using SWITCH to call different intents depending on what button was pressed | <p>I cant seem to find any info on this anywhere.</p>
<p>Is it possible first?</p>
<p>Classic page with 5 buttons each open new page.</p>
<p>I guess the question is how do i create a listener for an unknown button?</p>
<p>Thanks</p>
| java android | [1, 4] |
1,629,276 | 1,629,277 | C# String.IsNullOrEmpty Javascript equivilant | <p>I want to try to do string call equivalent to the C# <code>String.IsNullOrEmpty(string)</code> in javascript. I looked online assuming that there was a simple call to make, but I could not find one. </p>
<p>For now I am using a <code>if(string === "" || string === null)</code> statement to cover it, but I would rather use a predefined method (I keep getting some instances that slip by for some reason)</p>
<p>What is the closest javascript (or jquery if then have one) call that would be equal?</p>
| javascript jquery | [3, 5] |
5,010,791 | 5,010,792 | What is a suitable replacement for android ActionBar? | <p>I've developed an application that utilizes an actionBar, but apparently actionBar is only available for SDK 3.0 or later. I would like my application to be able to run on earlier SDKs, what would be a suitable replacement for an actionBar?</p>
<ul>
<li>Pop up menu</li>
<li>Context Menu etc..</li>
</ul>
<p>Please suggest anything that you think would be a suitable replacement or similar to an actionbar.</p>
| java android | [1, 4] |
457,407 | 457,408 | find sequence of numbers in array and alert highest number | <p>I have an array that looks like this:</p>
<pre><code>[1,2,3,4,5,6,8,10,12,13,14,15,20,21,22,23,24,25,26,27,28,29,30]
</code></pre>
<p>the highest count on one of the found sequences would be: 10</p>
<p>My goal is to loop through the array and identify the sequences of numbers, then find the length of the highest sequence that exists.</p>
<p>So, based on the array above, the length of the longest sequence would be "10"</p>
<p>Does anyone know of quick and easy script to find this?</p>
<p>I've got jquery available</p>
| javascript jquery | [3, 5] |
3,229,215 | 3,229,216 | how do i write a javascript alert box to give a yes or no question and integrate with php calls? | <p>i am trying to figure out how to create a javascript alert box asking the user if they would like to delete a record (that their viewing) and when the user presses yes a query is called through php to delete a database row. and if the user presses no nothing will happend.</p>
<p>wondering how this can be done</p>
<p>thanks</p>
<p>ps:</p>
<p>this is what i did and it didnt work.</p>
<pre><code><script type="text/javascript">
if(window.confirm("Are you sure you want to delete that record?")) {
<?php
mysql_query("delete from tbl_payments where id = '$id'") or die(mysql_error());
header("Location: dashboard.php");
?>
}
</script>
</code></pre>
| php javascript | [2, 3] |
2,046,961 | 2,046,962 | jQuery preventDefault function not working on jsfiddle | <p>I cannot get the following simple jQuery to work. I know I am overlooking something, so please help me out. Here is the code at <a href="http://jsfiddle.net/Z5waA/" rel="nofollow">http://jsfiddle.net/Z5waA/</a>. It's a simple click the button, then alert with jQuery.</p>
| javascript jquery | [3, 5] |
3,126,350 | 3,126,351 | How to add a numeric order to the GridView using RowDataBound? | <p>I am a new ASP.NET developer and I am trying to change the value of the first cell in each row in the GridVie by giving it a number starting from 1. It means that I want to add order to the list of things that will be displayed in the GridView.</p>
<p>I am using GridView RowDataBound method but now I don't know to set the limit of the for loop in it. Could anyone help me with this?</p>
<p>My code-behind:</p>
<pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow) {
for(int i=1, i<; i++)
e.Row.Cells[0].Text = i;
}
}
</code></pre>
| c# asp.net | [0, 9] |
2,216,995 | 2,216,996 | Populate the URL params in title | <p>I need help in populating the parameter in the url in the title of the page. What's the best way to do this?</p>
<p>www.mydns.com/sometext1/sometext2</p>
<p>sometext1 | sometext2 </p>
<p>Thank you</p>
| php javascript | [2, 3] |
1,221,015 | 1,221,016 | Unknown Sources Check over Web Site? | <p>The Android SDK has a way to check for "Unknown Sources using the following API: <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#INSTALL_NON_MARKET_APPS" rel="nofollow">http://developer.android.com/reference/android/provider/Settings.Secure.html#INSTALL_NON_MARKET_APPS</a>"</p>
<p>However, I was wondering if there is anyway to use this through a browser or have Javascript do this?</p>
<p>There's a chicken and egg problem that I'm trying to understand of knowing if a user can install and unsigned app before they try to install an unsigned app.</p>
<p>Thanks!</p>
| javascript android | [3, 4] |
387,815 | 387,816 | switching from VB.net, ASP.net to Java is it a good idea? | <p>I am programmer analyst working mainly in Asp.net for more than 3 yrs. I always wondered why employers are ready to pay more dollars for the same skill a person have in dotnet. I also see more BPM technologies are based on Java. Like Pega, Tibco etc. I have learned java in my college 4-5 years back. but didnt do much.Please advise.</p>
<p>Thanks</p>
| java asp.net | [1, 9] |
1,804,756 | 1,804,757 | Smooth natural motion when page scroll | <p>I am newbie in JS. Right now i am working on an effect in which i want when page scroll first time then the natural motion animation starts but it's creating a problem because when i scroll the element animation became fast.</p>
<p>Check this more you got the idea.</p>
<p><a href="http://jsfiddle.net/byvLy/" rel="nofollow">http://jsfiddle.net/byvLy/</a></p>
| javascript jquery | [3, 5] |
1,026,495 | 1,026,496 | Dynamically generated buttons, on click not being executed | <p>I need to generate a dynamic list of buttons, I already did, with an event handler attached to it.</p>
<p>However the event handler is not being executed.</p>
<pre><code>private void GetOptions(EcoBonusRequest request)
{
var ecobonuswworkflow = WorkflowFactory.CreateEcobonusWorkflow();
ecobonuswworkflow.SetCurrentStep(request.CurrentStatus);
var currentoptions = ecobonuswworkflow.GetCurrentOptions();
foreach(var option in currentoptions)
{
var btn = new Button() {Text = option.OptionName};
btn.Click +=new EventHandler(btn_Click);
Buttons.Controls.Add(btn);
}
}
void btn_Click(object sender, EventArgs e)
{
var btn = (Button) sender;
string command = btn.Text;
EcoBonusRequest request = this.GetDBRequest(RequestBaseId.Value);
EcoBonusRequestBL.AddWorkflowHistoryItem(request, command,CurrentUser, command);
}
</code></pre>
| c# asp.net | [0, 9] |
1,185,574 | 1,185,575 | javascript calling a function on window object | <p>I have the following code and am wondering how to make the last line work. I addopted a set of api's that current use _view appended as it's namespacing convention and would rather use something like arc.view.$function_name. thx</p>
<pre><code>var arc={};
arc.view={
say_hello: function(){
alert("I want to say hello");
}
}
function say_goodbye(){
alert("goodbye to you");
}
arc.view.say_hello(); // works
window['say_goodbye'](); // works
// possible to make this work?
window['arc.view.say_hello']();
</code></pre>
| javascript jquery | [3, 5] |
2,742,436 | 2,742,437 | how can i understand jquery source code | <p>i'm new to object oriented javascript. i want to be a javascript guru. so i leant oo-related concepts in javascript, such as scoping, scope chain, execute context, colsure, anonymous function... but when i try to practice my javascript knowledge to read jquery source code. i still can't understand a lot of it. anyone can give me some suggestions? great thanks!</p>
| javascript jquery | [3, 5] |
4,594,184 | 4,594,185 | How to use c++ header file in c#.net? | <p>I want to use my existing header file on c#.net. Please help me, what is the best way to use and how to do it </p>
| c# c++ | [0, 6] |
1,036,414 | 1,036,415 | checkspell textbox words onkeyup event | <p>I have a textbox. What I want is when user enters a word in that textbox, it should call <code>onkeyup</code> function and in the function we should check if spelling is correct or not. </p>
<p>If it is correct we don't do anything if its not we should display an alert message and remove all text from the textbox. Please tell what is the best way to do this? </p>
| php javascript | [2, 3] |
5,970,532 | 5,970,533 | Submit username and password javascript (not a form) | <p>I have a popup which asks the user for login information, which means two input text fields for password and username. </p>
<p>Now as I will be verifying the information using ajax I didn't wrap the elements on a because form always needs a php action, correct? or am I missing something?</p>
<p>So I'd like to know if there is a fancier way to check if the user pressed enter, in order to submit the login information, than checking each time a key is pressed, with keydown, if it's the enter key. </p>
<p>Thanks in advance</p>
| javascript jquery | [3, 5] |
4,625,457 | 4,625,458 | How to import and use another package | <p>I have my main project and I have created another on the side. The new one simply listens for a button click and then runs methods to update a users twitter status.</p>
<p>What I am unable to do at the moment is use this in my original project. I could copy the code into every .java file but that would be excessive.</p>
<p>What would be a better way to accomplish this and activate the onclick listener.</p>
| java android | [1, 4] |
3,620,692 | 3,620,693 | Running Javascript inside ASP.NET code instantly. | <p>I hope you can help me with my problem. I am executing a SQL query inside ASP.NET code and I am using bing's javascript API. Problem is that I need to do a javascript function before running a query. This function provides geocoordinates based on the address in a string format. I already know for <strong>RegisterStartupScript</strong> and <strong>RegisterClientScriptBlock</strong>, but these two don't work for me because javascript is not executing for some reason. Here is the code. And, I almost forgot, the script is declared properly at the head of the page. Is there any other way to run javascript in C# ASP.Net?</p>
<pre><code> public void calculateCoordinates()
{
ClientScriptManager cs = Page.ClientScript;
Type cstype = this.GetType();
String csName = "Calculate";
if (!cs.IsStartupScriptRegistered(cstype, csName))
{
String jsFunction = "calculateGeoCoordinates();";
cs.RegisterStartupScript(cstype, csName, jsFunction, true);
}
}
</code></pre>
| c# javascript asp.net | [0, 3, 9] |
2,559,128 | 2,559,129 | How to encapsulate jQuery? | <p>Particularly I want to define local jQuery (var jQuery) where<br>
jQuery should be stored (and also local $).</p>
<p>The problem is that jQuery operates directly with window object:</p>
<pre><code>// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
})(window);
</code></pre>
<p>this is a citation from jQuery 1.6.4<br>
How can I workaround this? </p>
<p>P.S.: my particular problem is to write some snippet for 3-rd party website use<br>
and if I include jQuery there may appear some incompatibilities with
that 3-rd party js code. Currently I'm doing the following:</p>
<pre><code>// here some license notes about jQuery included
(function() {
if (typeof jQuery === "undefined") {
// jQuery code as it is goes here
}
// my code
})();
</code></pre>
| javascript jquery | [3, 5] |
1,460,025 | 1,460,026 | Show a message when entering text in the textbox | <p>I have a requirement that is when user entering text in the textbox i want to show a message (not alert box, this is asp: lable) i.e if user enter "x" in the textbox then i want show a message not after completion of text and not like ontextchanged event. If user cleans textbox then i don't want to show message.</p>
| javascript asp.net | [3, 9] |
4,115,889 | 4,115,890 | how to read file, split record line by line and save them to database | <p>A.O.A</p>
<p>I want to split the following code and save it into database:</p>
<pre><code>31201011281853000100000000710003
</code></pre>
<p>The format of splitting is</p>
<pre><code>31
(2010-11-28,18 53) yyyy-mm-dd,hr-min
0001
0000000071
0003
</code></pre>
<p>first I have to upload a file containing these codes and then read each record line by line, split each line in the format I mentioned above, and then save it to database.</p>
| c# asp.net | [0, 9] |
1,536,050 | 1,536,051 | javascript function is calling more than once | <p>In my javascript code ( which is too long , so i can`t put it here ), functions are calling more than once , like suppose :</p>
<pre><code> $("#button").bind({ click : Call }); // bind the Call with button click event
function Call()
{
alert("This message shows me more than once when i clicked the button");
}
</code></pre>
<p>if this alert message shows me more than once it means function <code>Call()</code> is calling more than once. Can anybody guess or tell me what's going on in my code? (Please don't ask me for code)</p>
| javascript jquery | [3, 5] |
2,100,235 | 2,100,236 | Using php information in jQuery | <p>I am trying to get a variable from the php code and put it in jquery i have tryed this and it does not work can anyone help me?</p>
<pre><code>< script type="text/javascript" src="js/jquery.query-2.1.6.js"></script>
<?
$next_exp = 123;
?>
$(document).ready(function() {
var next_exp = $.query.get('next_exp');
$("#pb5").progressBar({ max: next_exp, textFormat: 'fraction',barImage: 'images/progressbg_orange.gif' });
</code></pre>
<p>});</p>
| php jquery | [2, 5] |
2,977,555 | 2,977,556 | Replacing commas in resultset with new line in jQuery | <p>I have not had to do something like this in the past and am wondering if it is indeed possible. I am allowing multiple code numbers to be added in an so long as they are delimited by commas. What I am wanting to do is upon the user clicking on the "okay" button that a showing the numbers entered will show them one on top of each other with a "delete" button next to them. That part is easy...the hard part is getting the comma stripped out and the new line placed in its stead.</p>
<p>Are there any examples or samples that anyone can point me too?</p>
| javascript jquery | [3, 5] |
1,346,348 | 1,346,349 | Unable to copy file "C:\Data.dll" to "bin\Data.dll". The process cannot access the file 'bin\Data.dll' because it is being used by another process | <p>I am getting below mention error in VS 2010. After getting this, Just restarting my machine and its working fine. But while hosting my application in windows server 2008 + IIS 7.0 its not working. Could you please suggest.</p>
<blockquote>
<p>Error 107 Unable to copy file "C:\Inetpub\wwwroot\solution\Data.dll" to "bin\Debug\Data.dll". The process cannot access the file 'bin\Debug\Data.dll' because it is being used by another process.Services</p>
<p>Error 106 Unable to copy file "C:\Inetpub\wwwroot\source\Business.dll" to "bin\Debug\Business.dll". The process cannot access the file 'bin\Debug\Business.dll' because it is being used by another process.Services</p>
</blockquote>
| c# asp.net | [0, 9] |
3,488,175 | 3,488,176 | Add variables to a .js file | <p>I'm looking for a way to post variables in an external .js file.</p>
<p>Something like:</p>
<pre><code><script type="text/javascript" src="/js/script-starter.js?var=value"></script>
</code></pre>
<p>And then I'd like to call var (and thus, value). Is this possible in any way?</p>
<p>Thank you!</p>
| javascript jquery | [3, 5] |
2,007,509 | 2,007,510 | main_screen cannot be resolved or is not a field error showing even i setup the resources correctly | <p>In the following code main_screen can not be resolved or not a field and button IDs also showing same error here I validated the res folder still i am getting these errors for IDs only.</p>
<pre><code>public class MainScreenActivity extends Activity {
Button btnViewProducts;
Button btnNewProduct;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_screen);
// Buttons
btnViewProducts = (Button) findViewById(R.id.btnViewProducts);
btnNewProduct = (Button) findViewById(R.id.btnCreateProduct);
// view products click event
btnViewProducts.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
// Launching All products Activity
Intent i = new Intent(getApplicationContext(),
AllProductsActivity.class);
startActivity(i);
}
});
</code></pre>
| java android | [1, 4] |
5,917,123 | 5,917,124 | having trouble making a menu slide down on click and then reverse this animation using jquery | <p>I am trying to create a sliding menu effect when a link is clicked, basically on click I want to prepend a background that fades in with 0.6 opacity and then slide my menu into place and then on a further click I want to reverse this animation. I have create a click event with a callback function but I think this callback is cancelling out my first click so nothing seems to be happening, can anyone advise me on how I can create this effect?</p>
<p>I have created a fiddle here: <a href="http://jsfiddle.net/AHj4Y/3/" rel="nofollow">http://jsfiddle.net/AHj4Y/3/</a></p>
<p>Thanks
Kyle</p>
| javascript jquery | [3, 5] |
5,093,538 | 5,093,539 | Asp.net 2.0 and c# 3.0? | <p>We use asp.net where I work and we are using c# as the language. Will c# 3.0 work with asp.net 2.0? Ive been trying to pick up some books on c#, but not sure which I should be buying, any help would be greatly appreciated!</p>
| c# asp.net | [0, 9] |
1,372,518 | 1,372,519 | Error HTTP 422 GET in Android | <p>I'm trying to perform a GET request to the server that returns me a JSON file. But I am getting an error in the HTTP statusLine / 422. Anyone know why. Below I show how I'm doing</p>
<pre><code>public void testConverteArquivoJsonEmObjetoJava() {
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet get = new HttpGet(
"http://safe-sea-4024.ppooiheroku4554566adffasdfasdfalaqwerpcp.com/crimes/mobilelist");
get.setHeader("Accept", "application/json");
get.setHeader("Content-type", "application/json");
get.getParams()
.setParameter("token",
"0V1AYFK12SeCZHYgXbNMew==$tRqPNplipDwtbD0vxWv6GPJIT6Yk5abwca3IJ88888a6JhMs=");
HttpResponse httpResponse;
try {
httpResponse = httpClient.execute(get);
String jsonDeResposta = EntityUtils.toString(httpResponse
.getEntity());
System.out.println();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
</code></pre>
| java android | [1, 4] |
1,433,930 | 1,433,931 | In jquery: Use attr(“class”) value as a selector? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4096834/in-jquery-use-attrclass-value-as-a-selector">In jquery: Use attr(“class”) value as a selector? </a> </p>
</blockquote>
<p>I have fields with multiple classes. I want to use one of those classes as a selector, how do I do this?</p>
<p>generic example:</p>
<pre><code><input id="from"/><div class="error from">errormessage</div>
<input id="to"/>
<div><input id="when" /></div><div class="error when">errormessage</div>
</code></pre>
<p>Because ther is a div.error with the class from, I want to add a certain class to input#from and the same goes for the input called when.
Note that "when" is wrapped in a div. Several variations like this are necessary for the page. Therefore, tree-traversal is not a suitable solution. </p>
| javascript jquery | [3, 5] |
4,916,381 | 4,916,382 | can anyone see anything wrong with this js / jQuery? | <p>I have the following script to ask the user to confirm clicking a button depending on a system setting.</p>
<p>The system setting is stored in a hidden field set from code behind.</p>
<p>Markup:</p>
<pre><code><asp:HiddenField ID="hfConfirmOnApproval" runat="server" Value="False" />
</code></pre>
<p>cs:</p>
<pre><code>//Read the confirm on approval setting
hfConfirmOnApproval.Value = Objects.Engine.Settings.Instance.ConfirmOnApproval.ToString();
</code></pre>
<p>js:</p>
<pre><code>//Get whether to confirm on approval
var _confirmOnApproval = new Boolean($('#hfConfirmOnApproval').val());
if ( _confirmOnApproval ? confirm('Are you sure you want to approve this item?') : true )
{
// do work
}
</code></pre>
<p>The problem is that the confirm message box is being displayed even though _confirmOnApproval is set to false?</p>
<p>I only want the message box to appear if its set to true.</p>
<p>The _ConfirmOnApproval is false at the moment</p>
<p>SOLUTION:</p>
<p>js:</p>
<pre><code>var _confirmOnApproval = $('#<%=hfConfirmOnApproval.ClientID %>').val() == "True" ? true : false;
if ( _confirmOnApproval ? confirm('Are you sure you want to approve this item?') : true ) {
//Do work
}
</code></pre>
| javascript jquery asp.net | [3, 5, 9] |
5,989,703 | 5,989,704 | jQuery image swap on hover | <p>When you hover over the Dharma arrow image in my sample link, it's meant to replace the bunny picture with the same you're hovering.</p>
<p>I was doing it <a href="http://jsfiddle.net/Kyle_Sevenoaks/3ehnB/" rel="nofollow">here at jsFiddle.net</a></p>
| javascript jquery | [3, 5] |
4,421,759 | 4,421,760 | Most elegant way to return value from within JQuery $.each? | <p>I was wondering if there a more elegant way of returning a value from the function I've pasted below : "getImageURLforPOICategory". </p>
<p>As you can see I've used JQuery's "each" function to iterate through an array of objects, when I find the matching value I want to return a result out of the "each" loop and then right out of the function that contains the each loop. </p>
<p>I've used a local variable to "cache" it and then I'm returning that. I'm not entirely sure if this is the best approach? Is there a way of returning the value directly from within the each loop?</p>
<pre><code>Tracker.getImageURLforPOICategory = function (POICategoryID) {
var url;
$.each(Tracker.pointofinterestcategories, function () {
if (this.id === POICategoryID) {
url = this.imageurl;
return;
}
}
);
return url;
};
</code></pre>
<p>Thanks for reading,</p>
<p>Cheers,</p>
<p>Duncan</p>
| javascript jquery | [3, 5] |
511,125 | 511,126 | How to get element content by id from HTML object by JavaScript ( JQuery ) | <p>i write the following code to access page "JQueryPage.aspx" and get data from it using jQuery</p>
<pre><code><script type="text/javascript">
$.get
(
"JQueryPage.aspx",
function(data) {
alert("Data Loaded: " + data);
}
);
</script>
</code></pre>
<p>"JQueryPage.aspx" is just a page that contain DIV called 'resultsDIV' that contain the data that i want to return
<br><br>
the above code return data variable that contain "JQueryPage.aspx" html and i want to get DIV content from it .. <BR>
i have 2 questions: <br/>
1- how can i extract DIV content from data object <br/>
2- is this way is th best to get that data ?</p>
| asp.net javascript jquery | [9, 3, 5] |
1,937,819 | 1,937,820 | How do I write 'if not clicked' or 'if clicked outside element', using Jquery? | <p>I'm kind of stuck on a problem of how to stop my menu from executing the fadeOut() function. When I click the main links on my menu to open the submenu it just fades out. Here is how the code looks at the moment:</p>
<pre><code> $('a.main-menu-item').click(function(){
if($('.rtmenu:visible')){
$('.rtmenu').click(function(e) { e.stopPropagation(); });
$(document).click(function() {
$('.rtmenu').fadeOut(200);
});
}
})
</code></pre>
<p>Can anyone tell me how I can write 'if not clicked a.main-menu-item' where it says 'document'?</p>
<p>Much Appreciated</p>
<hr>
<p><strong>SOLUTION FOUND!</strong></p>
<pre><code>$('.rtmenu').click(function(e) { e.stopPropagation(); });
$('.rtmenu').mouseout(function(){
$(document).one('click',function() { $('.rtmenu').fadeOut(200); });
})
</code></pre>
| javascript jquery | [3, 5] |
384,567 | 384,568 | ValidationExpression Number positive and negative Decimal | <p>I apologize for my bad writing, English is not my first lenguage.</p>
<p>i need to regex for this</p>
<p>Good</p>
<pre><code>-1000000.00 = 7 digits and 2 decimals with negative
-100
1000000.00
100
</code></pre>
<p>Bad</p>
<pre><code>-10000000 = 8 digits
100.000 = 3 decimals
-100.000 = 3 decimals
</code></pre>
<p>tnx for the help.</p>
| c# asp.net | [0, 9] |
343,240 | 343,241 | How to disable all the controls on the page after the countdown timer stops in asp.net? | <p>I have tried to disable the next button in the following code but its not working....pls help... </p>
<pre><code> protected void timer1_Tick(object sender, EventArgs e)
{
CurrentTime = CurrentTime.AddSeconds(-1);
LblTime.Text = "Time Left: " + CurrentTime.TimeOfDay;
if (CurrentTime.TimeOfDay == DateTime.MinValue.TimeOfDay)
{
LblTime.Text = "Oops!! Time Up";
timer1.Enabled = false;
btnnext.Enabled = false;
}
</code></pre>
| c# asp.net | [0, 9] |
3,566,618 | 3,566,619 | How could I access the ring and vibration as an alert from java script or html | <p>How could I access the ring and vibration as an alert from java script or html.</p>
<p>I am trying to activate the ring tone, when AJAX returns the valid data.</p>
<p>I couldn't find anything so far.</p>
<p>Thanks,
Zafer Boz</p>
| javascript iphone | [3, 8] |
3,996,735 | 3,996,736 | Form submit on keyCode == "enter" (13) | <p>I need to submit the content of a form when I press the Enter key, but only if the form has no error message. I build up the following function:</p>
<pre><code>$(targetFormID).submit(function (e) {
var mess = error_m(targetDiv);
if (e.keyCode == 13 && mess.length > 0) {
e.preventDefault();
e.stopPropagation();
}
if (mess.length == 0 && e.keyCode == 13) $(targetFormID).submit();
});
</code></pre>
<p>In this function the mess variable is getting the error message returned by function error_m
the rest is simple code condtion but it doesn't work?</p>
<p>Need some help with this!!</p>
| javascript jquery | [3, 5] |
4,514,702 | 4,514,703 | $('input[type=checkbox]').change(function() | <p>Currently Im have the following script which checks to see if a checkbox value has changed but its not working when I try to use it!</p>
<pre><code><script>
$('input[type=checkbox]').change(function () {
if ($(this).is(':checked')) {
if ($(this).prev().attr('checked') && $(this).val() != $(this).prev().val()) {
alert("previous checkbox has same value");
}
}
});
</script>
<input name="" type="checkbox" value="here"/>(if this was checked)
<input name="" type="checkbox" value="here"/>(then this)
<input name="" type="checkbox" value="there"/>(would not allow prompt alert)
<input name="" type="checkbox" value="here"/>(would allow)
</code></pre>
<p>you can see it working here yet it does not work when i try to use it
<a href="http://jsfiddle.net/rajaadil/LgxPn/7" rel="nofollow">http://jsfiddle.net/rajaadil/LgxPn/7</a></p>
<p>The idea is to alert when a checked checkbox value is different from the previously checked checkbox value! </p>
<p>Currently my checkbox look like</p>
<pre><code><input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="`key`=<?php echo $rspatient['key']?>" class="chk" id="chk<?php echo $a++?>"/>
</code></pre>
<p>I thought the function <code>('input[type=checkbox]').change(function()</code> would get these but im wrong somewhere? </p>
| javascript jquery | [3, 5] |
587,695 | 587,696 | Progress dialog during tab switch | <p>When the user switches from tab A to tab B it takes a long time (6 seconds), so I put in a progress dialog to let the user know that the app is working on it. The timeline is as follows:</p>
<ol>
<li>Activity B onCreate - creates ProgressDialog and puts long tasks in a background Thread.</li>
<li>Activity B onStart</li>
<li>Activity B onResume</li>
<li>Activity B appears on the screen</li>
</ol>
<p>This all works great with one "minor" snafu- the app intermittently crashes because the onResume function references something that is created by the background Thread. It is, in other words, a classic race condition.</p>
<p>To fix the race condition I did a "join" on the thread right before the reference in onResume, but that makes the progress dialog not show up until the background thread is done (i.e. it shows up for a split second and then goes away) and the app acts like it is hung while the background thread is working. Apparently the progress dialog cannot show up until onResume completes.</p>
<p>My question is this: how can I get the ProgressDialog to show up without crashing the program? Or do I need to either get the offending reference out of onResume or live with the app acting hung?</p>
| java android | [1, 4] |
1,487,753 | 1,487,754 | Android hide soft keyboard IME | <p>Below is a bit of code that I managed to get to work to hide the soft keyboard on android. It works by the user clicking anywhere on the screen (outside of a <code>EditText</code> input/s) to hide the IME soft keyboard. It registers a <code>OnTouchListener</code> to the <code>ScrollView (id="@+id/sv_background)</code> which when the screen is touched it hides the IME soft keyboard via the <code>InputMethodManager</code> code. I have set the scroll view as the parent layout in this case but it also works with any other layout view. </p>
<p>I hope this is useful to someone out there in Android land.</p>
<p>XML</p>
<pre><code><ScrollView
android:id="@+id/sv_background"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<other views and EditTexts/>
</ScrollView>
</code></pre>
<p>Java</p>
<pre><code>private ScrollView svBackground;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.newentry);
svBackground = (ScrollView)findViewById(R.id.sv_background);
svBackground.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(svBackground.getWindowToken(), 0);
return false;
}
});
}
</code></pre>
| java android | [1, 4] |
5,143,168 | 5,143,169 | Are there any widget sets (and application frameworks) that build on jquery? | <p>It seems clear that jquery has become the standard “low level” JavaScript library. </p>
<p>We also have extjs and dojo that provide application frame works and widgets etc. </p>
<p>I was expecting an application framework and widget set that builds on the jquery foundation to have become <em>fashionable</em> by now.</p>
<p>Is there such a widget set and application framework?</p>
| javascript jquery | [3, 5] |
3,641,196 | 3,641,197 | Assign Div data attribute as Data Source to JQuery AutoComplete | <p>I am using a <strong>JS</strong> method to assign the names of computer languages to data attribute of <code>div</code>
e.g</p>
<pre><code><div id="Languages" data-Languages=''></div>
</code></pre>
<p>and <code>js</code> code</p>
<pre><code>var langs='["Perl", "PHP", "Python", "Ruby", "Scala", "C#"]';
$('#Languages').data('Languages', langs);
</code></pre>
<p>but when i type text in the textbox it gives me an error
Object Expected
i am using this line for autocomplete</p>
<pre><code>$(function () {
$("#tags").autocomplete({ source: $('#Languages').data('Languages') });
});
</code></pre>
<p>it works totally fine when i make another variable and pass it as a source as implemented in jquery <a href="http://jqueryui.com/autocomplete/" rel="nofollow">website</a></p>
<p>i want to handle it with div's data attribute because in future i want to use <code>JSON</code> that fetches autocomplete data on page load and assign it to div data attribute.</p>
<p>sorry if that question sounds stupid, its my 2nd day with <code>jquery</code> and all that stuff.</p>
| c# jquery asp.net | [0, 5, 9] |
1,895,372 | 1,895,373 | How to make a link in aspx reference from app setting value? | <p>need a classic html link reference from app setting value in web.config</p>
<pre><code><a href="<%$appSettings:link%>"+"search.asp" id="more01" title="More" target="_top" >
</code></pre>
<p>it can not compile</p>
<blockquote>
<p>Parser Error Message: Literal expressions like
'<%$appSettings:iframedomain%>' are not allowed. Use " /> instead.</p>
</blockquote>
| c# asp.net | [0, 9] |
243,898 | 243,899 | Usage of setInterval method and asking for jQuery alternate | <p><code>window.setInterval("moveUp(fire,2)","100"); </code></p>
<p>in the code above fire is a object represting a div. I want to pass this object to moveUp method and call this method continuosly.</p>
<p>My problem is window.setInterval does not accepts fire object like this and gives error as fire is not defined. Although i am using fire object at other places as well. Besides this i also want to know if i can do the same using jQuery.</p>
| javascript jquery | [3, 5] |
1,269,615 | 1,269,616 | Merge repeated variables in javascript | <pre><code>var some1 = false;
var some2 = false;
var some3 = false;
var some4 = null;
var some5 = null;
var some6 = null;
</code></pre>
<p>Is it possible to merge variables by comma?</p>
<p>What is a true way to do this in javascript? </p>
| javascript jquery | [3, 5] |
568,229 | 568,230 | Why right click is not triggered with .click()? | <p><a href="http://jsfiddle.net/fPhDg/2/" rel="nofollow">This</a> is a simple code :</p>
<h1>HTML</h1>
<pre><code><a id="link" href="#">Ciao</a>
</code></pre>
<h1>jQuery</h1>
<pre><code>$('#link').click(function () {
alert("ciao");
});
</code></pre>
<p>in fact, left/middle button is triggered (the alert is printed) but with Right Click? Why not? And how can I trigger it?</p>
| javascript jquery | [3, 5] |
669,442 | 669,443 | how can I intercept a click for all img's ? I have a bunch of images, each needs to reply to a click. | <p>I would like to present images to my users, where they can select them. I need them to select a limited number, say 5, so:
The images are shown in a matrix, and the user can click them.
I thought:</p>
<pre><code>function boom()
{
this.css('background-color','#fff');
this.data('clicked','yes');
// I should also make checks here to see how many were clicked already
}
$('img').click(boom);
</code></pre>
<p>// I thought this would connect all img's that were clicked upon to this function, where I can call the 'this' with the css function... </p>
<p>But it doesn't work as I thought it would...</p>
<p>Any help would do, thanks !</p>
| javascript jquery | [3, 5] |
891,513 | 891,514 | slide feature in image and pdf document | <p>I am planning to implement the slide feature in my current project where I want to have the ability to side the image back and forth with bottom rigth and bottom left slider. I also have the PDF and wanted to implement same silde logic.
Please let me know if any best javasctipt plugin available to use which support all browsers. </p>
| javascript jquery | [3, 5] |
5,190,354 | 5,190,355 | JQuery Add Value of 2 input boxes to a third | <p>I have 3 input boxes in my page.</p>
<p>What I need to do is Onchange add the values of Input box A and Input Box B with a comma separating the two values.</p>
<p>For example:</p>
<pre><code>Input A = 'MyValueA'
Input B = 'MyValueB'
Result = 'MyValueA , MyValueB'
</code></pre>
| javascript jquery | [3, 5] |
1,583,114 | 1,583,115 | Get some particular CSS elements | <p>Let me explain.
I have a css page that is stored in a table, it presents itself in this form:</p>
<pre><code>. styleFloatCenter, form.styleFloatCenter,. focus {
margin: auto;
width: 70%;
}
</code></pre>
<p>All css is built like that, it is a norm.
I need to recover for all my css "rules" the 2nd element like styleFloatCenter for my example.</p>
<p>An idea? Ty !</p>
<p>Edit :
2nd example :</p>
<pre><code>. red, form.redColor,. focus {
margin: auto;
width: 70%;
}
</code></pre>
<p>Here i need redColor...</p>
| php javascript jquery | [2, 3, 5] |
211,488 | 211,489 | Problem when setting a value to a dropdown in jQuery | <p>I have this strange problem in JQuery. I try to set a value to a dropdown dinamically, so I have this code:</p>
<pre><code>$('#activity').val(idValue);
//or this way:
$('#activity').val("'"+idValue+"'");
</code></pre>
<p>but it does not work. However, if I'm setting the value "statically" then it works:</p>
<pre><code>$('#activity').val('23');
</code></pre>
<p>So, why does not accept the value from the variable? Or what am I doing wrong? Thanks!</p>
<p><strong>UPDATE</strong></p>
<p>I have tried the code in jsfiddle and it does work. It seems that the problem was related to the JSON data i was parsing. Thanks for the help!</p>
| javascript jquery | [3, 5] |
4,763,047 | 4,763,048 | Is it necessary to double define data type? | <p>In the code....</p>
<pre><code>NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
</code></pre>
<p>is it actually necessary to define the data type twice?</p>
| java android | [1, 4] |
1,471,230 | 1,471,231 | Locate HTML Element when it does not have the runat="server" attribute | <p>I have an ASP.NET C# website and I am attempting to retrieve the inner html from a HTML in my page when a button is clicked.</p>
<p><strong>My Problem:</strong> I use the function FindControl() but it returns null when it should find the element. Why is this happening, what am I doing wrong?</p>
<p>My HTML page:</p>
<pre><code><%@ Page Title="test" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="test.aspx.cs" Inherits="test" %>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ActualContent">
<div class="regMainContainer mainContainer container">
<!-- Attempting to get the below div -->
<!-- Knowtice it does not have runat="server",
I would prefer not to do that if I dont need to -->
<div id="courseDiv" class="courseContainer">
</div>
</div>
</asp:content>
</code></pre>
<p>My Code that executes when a button is clicked(inside test.aspx.cs file:</p>
<pre><code>HtmlGenericControl d = (HtmlGenericControl)FindControl("courseDiv");
</code></pre>
| c# asp.net | [0, 9] |
85,095 | 85,096 | asp.Net <control> does not exist in current context | <p>I am facing a small big problem. I have taken a dropdownList control and ID is
<code>"drpDownCountries</code>" in ASP.Net project. The problem is that "The dropdownlist control
is placed on page, in the code behind file of c#, while typing the control name <code>"drpDownCountries"</code>, this control ID is listed in object member list.
But, in compiling the project I am getting following error.</p>
<p><em><strong>Error : - The name 'drpDownCountries' does not exist in the current context</strong></em>.</p>
<p>I have checked this thing on different machines too. But same error is occurring. I do not understand what is the reason behind that.</p>
| c# asp.net | [0, 9] |
2,233,490 | 2,233,491 | CSS dimming overlay | <p>I have a fullscreen (100% width and height) div that has a 60% opacity for the android browser (on a z index). On top of it, i have a form. However, everytime i try to open up the keyboard to enter any text, it seems like the keyboard is trying to push the div upwards, and it eventually just fails with the keyboard not opening up, or push the page to the very bottom. (Cyanogen mod behaviour)</p>
<p>On android 2.2 with HTC sense, the behaviour is similar, on top of that, the input textbox will have another instance of itself directly above the textbox. </p>
<p>Any idea how to avoid this type of behaviour?</p>
| javascript android | [3, 4] |
2,342,825 | 2,342,826 | How to merge mutiple tables into one, with same schema and column names | <p>I have 3 collection datatable that shows in this below</p>
<pre><code>Month: January
ID NAME Absent
001 John 3
002 Travis 0
Month: February
ID NAME Absent
001 John 18
002 Travis 14
Month: March
ID NAME Absent
001 John 10
002 Travis 5
</code></pre>
<p><strong>Before</strong>, I have used to <code>merge</code> DataTable</p>
<pre><code>dataTable.merge(dataTable2);
</code></pre>
<p>The result is like this:</p>
<pre><code>ID NAME Absent
001 John 3
002 Travis 0
001 John 18
002 Travis 14
001 John 10
002 Travis 5
dataTable.Merge(dataTableTemp);
GridView.DataSource = dataTable;
GridView.DataBind();
</code></pre>
<p><strong>But, I want to create like this</strong> (we say: custom GridView):</p>
<pre><code> Jan Feb Mar Apr
ID NAME Absent Absent Absent Absent
001 John 3 18 10
002 Travis 0 14 5
</code></pre>
<p>How to add/merge every month in the right side of table before, so if I add next month it will appear in the right side of table before..</p>
<p>How to create this:??? Is there any method of function or tools that I can use??</p>
<p>Thanks for any help..</p>
| c# asp.net | [0, 9] |
497,338 | 497,339 | Found this in the jquery source, how does it work? | <p>All this is one expression. What exactly gets put inside div in the end? What's it called when you have a bunch of comma delimited expressions?</p>
<pre><code>var div = document.createElement( "div" ),
documentElement = document.documentElement,
all,
a,
select,
opt,
input,
tds,
events,
eventName,
i,
isSupported;
</code></pre>
| javascript jquery | [3, 5] |
5,716,097 | 5,716,098 | DOM ready twice | <p>I use jQuery on my website and I have a bug on one page. </p>
<p>I submit a form when the DOM is ready like this:</p>
<pre><code>jQuery.(document).ready(function() {
alert("test"); jQuery("#form").submit();
});
</code></pre>
<p>My form is like this:</p>
<pre><code><form id="form" onsubmit="return false;" action="test.php"></form>
</code></pre>
<p>But when I load my page, the alert appeared twice.
So the big problem is the form which submit twice. </p>
<p>Why the dom is loaded twice?
This bug is only on IE (all version)</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
1,161,920 | 1,161,921 | jQuery submit() not firing when triggered from live() | <p>I'm trying to get the form <code>#url_form</code> to be submitted when a URL is pasted into <code>#video_url</code>. The <code>.loading</code> class is added correctly, but the form still isn't being submitted.
Here's the code:</p>
<pre><code> $(document).ready(function(){
$("#url_form").live("paste", "#video_url", function(){
$("#video_url").addClass("loading");
$("#url_form").submit();
});
});
</code></pre>
<p>and the HTML:</p>
<pre><code><form accept-charset="UTF-8" action="/posts/get_video" data-remote="true" id="url_form" method="post">
<input autofocus="autofocus" class="post-modal-url loading" id="video_url" name="video_url" placeholder="Paste a URL here" required="required" type="url">
</form>
</code></pre>
<p>the Rails form_tag:</p>
<pre><code> <%= form_tag get_video_posts_path, :remote => true, :id => "url_form" do -%>
<%= url_field_tag 'video_url', params[:video_url], :placeholder => "Paste a URL here", :required => true, :autofocus => true, :class => "post-modal-url" -%>
<% end -%>
</code></pre>
| javascript jquery | [3, 5] |
1,230,230 | 1,230,231 | Executing javascript code stored in an element attribute using jQuery | <p>say there is an element #button with the attribute onmousedown containing some random javascript how could I trigger the js in that element attribute using jQuery? </p>
<pre><code>j("#otherbutton").click(function(){
var script = j("#button").attr("onmousedown"); //what now?
});
</code></pre>
| jquery javascript | [5, 3] |
2,713,478 | 2,713,479 | Why is my two javascript codes not running? | <p>I am using two different scripts on one page and when I call them both, one of them doesn't work. If I delete one then the one left works. Why aren't they both working? Here is what I have in the head of my page:</p>
<pre><code><script type="text/javascript" src="jscript/jquery.js"></script>
<script type="text/javascript" src="jscript/script.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="../plugins/nicescroll/jquery.nicescroll.min.js"></script>
<script>
$(document).ready(function () {
var nice = $("html").niceScroll();
$("#outer").html($("#outer").html());
$(".overflow").niceScroll({
cursorborder: "",
cursorcolor: "#333333",
boxzoom: false,
cursorwidth: "5px"
});
});
</script>
<script type="text/javascript" src="tabslider/javascripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="tabslider/javascripts/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="tabslider/javascripts/jquery.coda-slider-2.0.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#coda-slider-1').codaSlider();
});
</script>
</code></pre>
<p><a href="http://pastebin.com/MwNTNhXV" rel="nofollow">Posted code on PasteBin: http://pastebin.com/MwNTNhXV</a></p>
| javascript jquery | [3, 5] |
4,398,627 | 4,398,628 | Jquery general tagName | <p>Is this possible to acces selector with a general tag name.
Like in sql if you want to find a varchar that contains "ert" you write it "%ert%"</p>
<p>can I go like <code>("#%_tagname%").hide();</code>?</p>
| javascript jquery | [3, 5] |
267,788 | 267,789 | On change radio button state show submit button... how? | <p>I want to show a submit button only when the radio button value change. I will have several radio groups and the button should appear if any radio button change! Also, if radio button group value gets to default value submit button will hide again.</p>
<pre><code>$("form :radio").live('change',function(){
});
</code></pre>
<p>My new code:</p>
<pre><code>//hide the submit button on load
$('form :submit').hide();
//Data structure where the initial value from radio button(s) will be stored
var dbRadios = [];
//Getting the initial values from the radio button(s) and load them to the data structure
$("form :radio:checked").each(function() {
dbRadios.push($(this).attr('value'));
});
//Attach onclick event to radio button(s)
$('form :radio').click(function() {
//The event fired, therefore the "New value(s)" (radio button value(s)) will be stored in the data sctructure
var submitedRadios = [];
//Geting the values from checked radio buttons
$("form :radio:checked").each(function() {
submitedRadios.push($(this).attr('value'));
});
//Now comparing both data structures
if(dbRadios.compare(submitedRadios)){
$('form :submit').fadeOut('slow');
}else{
$('form :submit').fadeIn('slow', function(){ ACTION! WILL BE EXECUTED MANY TIMES AS BUTTONS CLICKED});
}
});
$("form").submit(function () {
//AJAX GOES HERE!
alert("a submeter dados");
})
</code></pre>
<p>The compare function:</p>
<pre><code>//Compare two different arrays
Array.prototype.compare = function(testArr) {
if (this.length != testArr.length) return false;
for (var i = 0; i < testArr.length; i++) {
if (this[i].compare) {
if (!this[i].compare(testArr[i])) return false;
}
if (this[i] !== testArr[i]) return false;
}
return true;
}
</code></pre>
| javascript jquery | [3, 5] |
4,585,203 | 4,585,204 | calling a code behind member from javascript | <p>I have an ASPX.CS code:</p>
<pre><code>Protected int myprop
</code></pre>
<p>I would like to call it on a JS assignment :</p>
<pre><code><script type='text/javascript'>
...
data.add(['SomeJSProperty', "<%..myprop from code behind%>"]);
</code></pre>
<p>I remember doing it with <% %> inline code and it used to view the code behind protected and public members. but it won't work now.</p>
<p>Thanks</p>
| c# javascript asp.net | [0, 3, 9] |
2,965,408 | 2,965,409 | load form elements values dinamically jquery | <p>I can get dinamically input /textarea /select values in form with jquery?</p>
<p>For example i have this:</p>
<pre><code><form id="contact" method="post" action"contact.php" class="ajaxForm">
<label>Name:</label>
<input type="text" name="name" />
<label>Email:</label>
<input type="text" name="email"/>
<label>Message:</label>
<textarea name="message"></textarea>
<input type="submit" value="send!"/>
</form>
</code></pre>
<p>In js:</p>
<pre><code>$(".ajaxForm").send(function(){
var page = $(this).attr("action");
// i want to get here var name=value with some loop like .each but
// reading only inputs/textarea/select data
});
</code></pre>
<p>Thanks for help!</p>
| javascript jquery | [3, 5] |
674,376 | 674,377 | Local jQuery.js file not working | <p>I had downloaded jQuery.js file from jQuery.com .I have saved this file in 3 places, including JRE/Lib and desktop (where my HTML file which calls it is), to be sure that the jQuery.js file is found. I reference this js file as :</p>
<pre><code><head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
$("#clas").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p id="clas"> Hello</p>
<p>Hi</p>
</body>
</code></pre>
<p>When I ran this HTML file on Mozilla browser, I expected 'Hello' to vanish when I clicked on it, but it did not. It remained as solid as ever.
But when I used a jQuery CDN:</p>
<pre><code><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
</code></pre>
<p></p>
<p>And when I used an online HTML editor called Tryit Editor v1.5, it worked correctly!
It seems only the local jQuery.js is not doing its part. The JavaScript works fine, only the $() part doesn't. I'm using jdk1.6. I wonder why this snag has occurred. How to resolve it? Help.</p>
| javascript jquery | [3, 5] |
4,403,324 | 4,403,325 | jQuery: Backstretch plugin - show image loading? | <p>I'm using the <a href="http://srobbin.com/blog/jquery-plugins/jquery-backstretch/" rel="nofollow">Backstretch Plugin</a> to load some full screen images. Everything works fine, but I'd like it to show the image loading (as it would by default) rather than wait with a blank screen until it completely loads. Is this possible? I'm not a JS expert by the way.</p>
<p>Thanks.</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.